{
  "metadata": {
    "generatedAt": "2025-09-20T19:34:27.340Z",
    "version": "3.0.0",
    "synthesizer": "KnowledgeGraphSynthesizer",
    "purpose": "Comprehensive synthesis of Xikolo platform architecture from multiple analysis runs and cluster enhancements",
    "sources": {
      "runs": [
        "run_1",
        "run_2",
        "run_3"
      ],
      "clusters": 33,
      "totalSourceFiles": 885
    },
    "statistics": {
      "components": 868,
      "workflows": 372,
      "enhancedComponents": 791,
      "multiRunComponents": 206,
      "enhancementCoverage": "91.1%",
      "multiRunCoverage": "23.7%",
      "totalSourceFiles": 885,
      "runContributions": {
        "run_1": 381,
        "run_2": 335,
        "run_3": 403
      },
      "clusterContributions": {
        "01_CORE_UserAuthentication": 34,
        "02_CORE_CourseContent": 64,
        "03_CORE_CourseService": 67,
        "04_CORE_CourseNavigation": 20,
        "05_CORE_APIGateway": 50,
        "10_LEARN_QuizAssessment": 37,
        "11_LEARN_Discussion": 25,
        "12_LEARN_VideoStreaming": 35,
        "13_LEARN_FileManagement": 12,
        "14_LEARN_Achievements": 16,
        "15_LEARN_Gamification": 16,
        "16_LEARN_PollsSurveys": 11,
        "17_LEARN_LTIIntegration": 23,
        "18_LEARN_Proctoring": 8,
        "20_COMM_Announcements": 32,
        "21_COMM_Notifications": 16,
        "22_COMM_ReferralTracking": 7,
        "30_ADMIN_GeneralPanel": 34,
        "31_ADMIN_Analytics": 20,
        "32_ADMIN_ContentManagement": 36,
        "33_ADMIN_Support": 9,
        "34_ADMIN_Vouchers": 11,
        "40_INFRA_SystemCore": 61,
        "41_INFRA_Database": 16,
        "42_INFRA_BackgroundJobs": 22,
        "43_INFRA_ServiceCommunication": 7,
        "44_INFRA_UIComponents": 162,
        "45_INFRA_TimeEffort": 12,
        "50_SEC_CookieConsent": 3,
        "51_SEC_RecaptchaIntegration": 0,
        "60_DEVOPS_Monitoring": 12,
        "61_DEVOPS_Testing": 14,
        "62_DEVOPS_Internationalization": 8
      }
    }
  },
  "components": {
    "QuizAnswersController": {
      "type": "Controller",
      "description": "Manages CRUD operations for quiz answers within the frontend application. It allows content editors to create, edit, update, move, and delete answers for various question types, distinguishing between `TextAnswer` and `FreeTextAnswer`. It ensures content editor permissions and sets no-cache headers.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Quiz::Quiz to get quiz context for questions ",
        "interaction_1": "Interacts with Xikolo::Quiz::Answer (ACFS client model) for finding, creating, updating, and moving answers [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_2": "Interacts with Xikolo::Quiz::FreeTextAnswer and Xikolo::Quiz::TextAnswer for specific answer types [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_3": "Communicates with the Quiz Service via `quiz_api` (Restify) for answer deletion [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_4": "Redirects to `edit_course_section_item_path` after operations [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_5": "Interacts with `Xikolo::Quiz::Question` to find parent questions (via ACFS).",
        "interaction_6": "Interacts with `Xikolo::Quiz::Answer`, `Xikolo::Quiz::FreeTextAnswer`, `Xikolo::Quiz::TextAnswer` for answer data management (via ACFS).",
        "interaction_7": "Communicates with the `Xikolo::QuizService` microservice via `quiz_api` for answer deletion.",
        "interaction_8": "Interacts with `Xikolo::Quiz::Question` and `Xikolo::Quiz::Answer` ACFS models to fetch and persist data from the `quiz` microservice.",
        "interaction_9": "Uses `Acfs.run` to execute asynchronous data fetching requests.",
        "interaction_10": "Performs direct `DELETE` API calls to the `quiz` microservice via `Xikolo.api(:quiz)`.",
        "interaction_11": "Redirects to course item editing paths after actions.",
        "interaction_12": "Includes `CourseContextHelper` for context-specific authorization."
      },
      "techDebt": [
        "The `answer_type` method relies on checking `params[:xikolo_quiz_text_answer].nil?` which can be brittle and less explicit than other methods for determining parameter presence."
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizQuestionsController": {
      "type": "Controller",
      "description": "Manages CRUD operations for quiz questions within the frontend application. It enables content editors to create, edit, update, move, and delete questions of different types: `MultipleChoiceQuestion`, `MultipleAnswerQuestion`, `FreeTextQuestion`, and `EssayQuestion`. It enforces content editor permissions and sets no-cache headers.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item to verify content type is 'quiz' and retrieve quiz ID [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_1": "Interacts with Xikolo::Quiz::Quiz (ACFS client model) to find the associated quiz [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_2": "Interacts with Xikolo::Quiz::Question (ACFS client model) for finding, creating, updating, and moving questions [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_3": "Communicates with the Quiz Service via `quiz_api` (Restify) for question updates and type validation [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_4": "Redirects to `edit_course_section_item_path` after operations [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_5": "Interacts with `Xikolo::Course::Item` to find the associated course item (via ACFS).",
        "interaction_6": "Interacts with `Xikolo::Quiz::Quiz` to find the associated quiz (via ACFS).",
        "interaction_7": "Interacts with `Xikolo::Quiz::Question` and its subclasses (`MultipleChoiceQuestion`, `MultipleAnswerQuestion`, `FreeTextQuestion`, `EssayQuestion`) for question data management (via ACFS).",
        "interaction_8": "Communicates with the `Xikolo::QuizService` microservice via `quiz_api` for question updates and deletion.",
        "interaction_9": "Redirects to `edit_course_section_item_path` or `new_course_section_item_quiz_question_quiz_answer_path` after operations.",
        "interaction_10": "Interacts with `Xikolo::Course::Item` and `Xikolo::Quiz::Quiz` ACFS models to retrieve course and quiz context.",
        "interaction_11": "Interacts with various `Xikolo::Quiz::Question` ACFS models to fetch and persist question data from the `quiz` microservice.",
        "interaction_12": "Uses `Acfs.run` to execute asynchronous data fetching requests.",
        "interaction_13": "Performs direct `PATCH` and `GET` API calls to the `quiz` microservice via `Xikolo.api(:quiz)` for updates and type plausibility checks.",
        "interaction_14": "Redirects to course item editing paths or `root_url` after actions.",
        "interaction_15": "Includes `CourseContextHelper` for context-specific authorization."
      },
      "techDebt": [
        "\"Ugly hotfix: question.type is nil and overwrites model in service\" during question move operations [Source: app/controllers/quiz_questions_controller.rb]",
        "Commented as an \"Ugly hotfix\" for `question.type` being nil during move operations, indicating a potential issue in how question types are handled or persisted.",
        "The `question_type` method relies on checking `params[:xikolo_quiz_multiple_choice_question].nil?` which can be brittle and less explicit than other methods for determining parameter presence."
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_questions_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizSubmissionController": {
      "type": "Controller",
      "description": "Manages the entire lifecycle of a user's quiz submission. This includes starting new attempts, viewing past submissions, enforcing time limits and deadlines, handling proctoring, and processing submitted answers. It also publishes events to RabbitMQ upon submission.",
      "interactions": {
        "interaction_0": "Interacts with Quiz::Submission (wrapper model) for submission data ",
        "interaction_1": "Interacts with Xikolo::Submission::QuizSubmission (ACFS client model) for finding, creating, and updating submissions [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_2": "Interacts with Xikolo::Submission::UserQuizAttempts (ACFS client model) to track user attempts [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_3": "Communicates with the Quiz Service via `quiz_api` (Restify) to create new submissions and retrieve existing ones [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_4": "Communicates with the Course Service via `course_api` (Restify) to retrieve item and section details [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_5": "Publishes `xikolo.submission.submission.create` event to the Submission Service via Msgr after submission [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_6": "Utilizes `QuizResultPresenter` and `QuizSubmissionProctoringPresenter` for rendering submission results [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_7": "Integrates with `Proctoring::ItemContext` for proctoring logic [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_8": "Interacts with `Xikolo::Course::Item` and `Xikolo::Quiz::Quiz` to retrieve quiz context (via ACFS).",
        "interaction_9": "Interacts with `Xikolo::Submission::QuizSubmission` and `Xikolo::Submission::UserQuizAttempts` for submission and attempt tracking (via ACFS).",
        "interaction_10": "Communicates with the `Xikolo::QuizService` microservice via `quiz_api` for creating new submissions and retrieving submission details.",
        "interaction_11": "Communicates with the `Xikolo::CourseService` microservice via `course_api` for course and item details.",
        "interaction_12": "Uses `QuizResultPresenter` to format results.",
        "interaction_13": "Uses `QuizSubmissionProctoringPresenter` for proctoring display.",
        "interaction_14": "Publishes submission events to RabbitMQ via `Msgr` (`xikolo.submission.submission.create`).",
        "interaction_15": "Interacts with `Proctoring::ItemContext` for proctoring logic.",
        "interaction_16": "Includes `CourseContextHelper` and `ItemContextHelper` for contextual data.",
        "interaction_17": "Authenticates users via `ensure_logged_in`.",
        "interaction_18": "Interacts extensively with ACFS models: `Xikolo::Quiz::Quiz`, `Xikolo::Submission::QuizSubmission`, `Xikolo::Submission::UserQuizAttempts`, `Xikolo::Submission::QuizSubmissionSnapshot` to fetch and persist data from `quiz` and `submission` microservices.",
        "interaction_19": "Uses `Acfs.run` for concurrent data fetching.",
        "interaction_20": "Performs direct API calls to `quiz` and `course` microservices via `Xikolo.api(:quiz)` and `Xikolo.api(:course)`.",
        "interaction_21": "Publishes a `xikolo.submission.submission.create` event to RabbitMQ via `Msgr` upon successful submission.",
        "interaction_22": "Manages redirection logic based on quiz type, attempts, and deadlines."
      },
      "techDebt": [
        "Proctoring feature is noted as 'Temporary: We do not offer proctoring anymore' and should be removed or refactored. [Source: app/controllers/quiz_submission_controller.rb]",
        "TODO: 'Use the Restify response wrapped in a presenter everywhere' indicates an incomplete transition or inconsistency in API response handling. [Source: app/controllers/quiz_submission_controller.rb]",
        "TODO comment: \"Use the Restify response wrapped in a presenter everywhere\" suggests inconsistent data handling.",
        "Comments like \"Temporary: We do not offer proctoring anymore\" indicate features that are either deprecated or temporarily disabled, requiring review."
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizSubmissionSnapshotController": {
      "type": "Controller",
      "description": "Handles the creation of quiz submission snapshots. This controller is likely used for auto-saving a user's progress during a quiz attempt, ensuring data is not lost due to browser closures or network issues.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Submission::QuizSubmissionSnapshot (ACFS client model) to save snapshots ",
        "interaction_1": "Communicates with the `Xikolo::QuizService` microservice via `quiz_api` to create `quiz_submission_snapshots`.",
        "interaction_2": "Requires user to be logged in (`ensure_logged_in`).",
        "interaction_3": "Authenticates users via `ensure_logged_in`.",
        "interaction_4": "Posts snapshot data to the `quiz` microservice via `Xikolo.api(:quiz)`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "spec/controllers/quiz_submission_snapshot_controller_spec.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizRecapController": {
      "type": "Controller",
      "description": "Provides a JSON API endpoint for retrieving quiz recap data for a specific course. It fetches relevant questions and their answers, enriching the data with reference links to the corresponding course items.",
      "interactions": {
        "interaction_0": "Provides data to Course::QuizRecap (ViewComponent) for rendering ",
        "interaction_1": "Communicates with the Course Service via `course_api` (Restify) to find course items and generate reference links [Source: app/controllers/quiz_recap_controller.rb]",
        "interaction_2": "Communicates with the `Xikolo::QuizService` microservice via `quiz_api` to fetch questions.",
        "interaction_3": "Communicates with the `Xikolo::CourseService` microservice via `course_api` to fetch course items and generate reference links.",
        "interaction_4": "Requires user to be logged in (`ensure_logged_in`).",
        "interaction_5": "Authenticates users via `ensure_logged_in`.",
        "interaction_6": "Fetches questions from the `quiz` microservice using `Xikolo.api(:quiz)`.",
        "interaction_7": "Fetches course items from the `course` microservice using `Xikolo.api(:course)` to generate `referenceLink`.",
        "interaction_8": "Serializes fetched data into a structured JSON response."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_recap_controller.rb",
          "spec/requests/app/quiz-recap/show_spec.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Quiz::Submission": {
      "type": "Application Model (Wrapper)",
      "description": "A Ruby class that acts as a wrapper around a `Restify` resource from the Quiz Service, representing a quiz submission. It provides methods to access submission attributes and proctoring details.",
      "interactions": {
        "interaction_0": "Wraps Xikolo::Submission::QuizSubmission (ACFS client model) ",
        "interaction_1": "Interacts with QuizSubmissionController for submission data ",
        "interaction_2": "Interacts with QuizResultPresenter to provide submission data ",
        "interaction_3": "Initializes with a hash of submission attributes, typically from a Restify response or ACFS client object [Source: app/models/quiz/submission.rb]",
        "interaction_4": "Delegates proctoring-related logic to `Quiz::Submission::Proctoring` [Source: app/models/quiz/submission.rb]"
      },
      "techDebt": [
        "Explicitly noted as: \"This should become a real ActiveRecord model in the future.\" [Source: app/models/quiz/submission.rb]"
      ],
      "provenance": {
        "sources": [
          "app/models/quiz/submission.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Quiz::Submission::Proctoring": {
      "type": "Application Model",
      "description": "Handles the retrieval and processing of proctoring results for a specific quiz submission. It delegates the actual result parsing to an external adapter.",
      "interactions": {
        "interaction_0": "Initializes with a `Quiz::Submission` object [Source: app/models/quiz/submission/proctoring.rb].",
        "interaction_1": "Interacts with an implied `::Proctoring::SmowlAdapter` to get and interpret proctoring results from `vendor_data` [Source: app/models/quiz/submission/proctoring.rb].",
        "interaction_2": "Fetches `Course::Course` to provide context to the adapter [Source: app/models/quiz/submission/proctoring.rb].",
        "interaction_3": "Initializes with a quiz submission hash [Source: app/models/quiz/submission/proctoring.rb]",
        "interaction_4": "Utilizes `Proctoring::SmowlAdapter` to process `vendor_data` and retrieve proctoring results [Source: app/models/quiz/submission/proctoring.rb]",
        "interaction_5": "Interacts with `Course::Course` to find the associated course [Source: app/models/quiz/submission/proctoring.rb]"
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/quiz/submission/proctoring.rb",
          "cluster:10_LEARN_QuizAssessment",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment",
          "18_LEARN_Proctoring"
        ]
      }
    },
    "QuizItemPresenter": {
      "type": "Presenter",
      "description": "Decorates a `Course::Item` when its content type is a quiz, providing methods for displaying quiz-specific information. This includes instructions, basic quiz properties (time limits, attempts), submission status, and complex redirection logic based on user state, deadlines, and proctoring status. It determines if a quiz is graded, a survey, or a selftest.",
      "interactions": {
        "interaction_0": "Builds itself using `Xikolo::Quiz::Quiz` and `Xikolo::Course::Enrollment` ACFS client models [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_1": "Interacts with `Xikolo::Submission::QuizSubmission` and `Xikolo::Submission::UserQuizAttempts` to fetch submission and attempt data [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_2": "Delegates to `Proctoring::ItemContext` for proctoring logic [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_3": "Generates URLs using Rails route helpers [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_4": "Fetches `Xikolo::Quiz::Quiz`, `Xikolo::Course::Enrollment`, `Xikolo::Submission::QuizSubmission`, and `Xikolo::Submission::UserQuizAttempts` (via ACFS).",
        "interaction_5": "Interacts with `Proctoring::ItemContext` for proctoring-related logic.",
        "interaction_6": "Generates URLs using `Rails.application.routes.url_helpers`.",
        "interaction_7": "Delegates properties to `@quiz` (Xikolo::Quiz::Quiz) and `@attempts` (Xikolo::Submission::UserQuizAttempts) ACFS models.",
        "interaction_8": "Interacts with `Xikolo::Course::Enrollment`, `Xikolo::Submission::QuizSubmission` ACFS models.",
        "interaction_9": "Uses `Acfs.run` for concurrent data fetching.",
        "interaction_10": "Utilizes `Proctoring::ItemContext` and `Proctoring::SmowlAdapter` for proctoring-related logic."
      },
      "techDebt": [
        "TODO: \"move to correct possition -> feed back to controller\" regarding redirect logic [Source: app/presenters/quiz_item_presenter.rb]",
        "TODO: 'remove it -> generate urls without section' suggests a refactoring for URL generation. [Source: app/presenters/quiz_item_presenter.rb]",
        "TODO: '- move to correct possition -> feed back to controller' indicates some logic might be misplaced in the presenter. [Source: app/presenters/quiz_item_presenter.rb]",
        "Proctoring feature is noted as 'Temporary: Proctoring is not offered anymore.' and `proctoring_service_available?` is hardcoded to `false`. This indicates deprecated or dead code. [Source: app/presenters/quiz_item_presenter.rb]",
        "TODO comment: \"remove it -> generate urls without section\" indicates a potential routing or URL generation issue.",
        "TODO comment: \"move to correct possition -> feed back to controller\" suggests a responsibility mismatch or tight coupling.",
        "Comments like \"Temporary: Proctoring is not offered anymore\" indicate features that are either deprecated or temporarily disabled, requiring review."
      ],
      "provenance": {
        "sources": [
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizResultPresenter": {
      "type": "Presenter",
      "description": "Formats and calculates data related to a user's quiz results for display. This includes determining the achieved percentage, assembling historical submission data for charting, and generating labels for selecting past submissions.",
      "interactions": {
        "interaction_0": "Interacts with Quiz::Submission to get current and all submissions data ",
        "interaction_1": "Uses `ProgressHelper` to calculate progress percentages [Source: app/presenters/quiz_result_presenter.rb]",
        "interaction_2": "Receives `quiz`, `submission`, and `all_submissions` data in its constructor.",
        "interaction_3": "Uses `ProgressHelper` for percentage calculation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/quiz_result_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizSubmissionProctoringPresenter": {
      "type": "Presenter",
      "description": "Formats and presents proctoring results from a `Quiz::Submission::Proctoring` object into user-friendly callouts for display in the UI, indicating success, warnings, or errors.",
      "interactions": {
        "interaction_0": "Initializes with a `Quiz::Submission::Proctoring` object [Source: app/presenters/quiz_submission_proctoring_presenter.rb].",
        "interaction_1": "Calls `results` on the `Quiz::Submission::Proctoring` object to get the raw proctoring outcome [Source: app/presenters/quiz_submission_proctoring_presenter.rb].",
        "interaction_2": "Constructs `Global::Callout` objects based on the proctoring results [Source: app/presenters/quiz_submission_proctoring_presenter.rb].",
        "interaction_3": "Retrieves localized text via `I18n` [Source: app/presenters/quiz_submission_proctoring_presenter.rb].",
        "interaction_4": "Receives a `Quiz::Submission::Proctoring` object in its constructor."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/presenters/quiz_submission_proctoring_presenter.rb",
          "cluster:10_LEARN_QuizAssessment",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment",
          "18_LEARN_Proctoring"
        ]
      }
    },
    "app/assets/course/items/quiz.ts": {
      "type": "Frontend Component",
      "description": "Handles client-side navigation for quiz submissions. It listens for changes on a select element with `data-behavior='navigate-to-submission'` and redirects the browser to the selected URL.",
      "interactions": {
        "interaction_0": "Interacts with QuizSubmissionController (or its routes) for navigation ",
        "interaction_1": "Redirects the browser to the URL selected in the dropdown [Source: app/assets/course/items/quiz.ts]",
        "interaction_2": "Interacts with the DOM to attach an event listener to a select element.",
        "interaction_3": "Triggers a browser redirect (`window.location.replace`) based on user selection."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/course/items/quiz.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "app/assets/quiz-recap/quiz-recap.ts": {
      "type": "Frontend Component",
      "description": "Responsible for fetching quiz recap data and rendering the quiz recap component. It uses the `@openhpi/quiz-recap` library for UI rendering and maps Xikolo's internal question types to the component's expected types.",
      "interactions": {
        "interaction_0": "Fetches quiz recap data from the `app/quiz-recap` endpoint using `fetch` [Source: app/assets/quiz-recap/quiz-recap.ts]",
        "interaction_1": "Renders the quiz recap using `renderQuizRecap` from `@openhpi/quiz-recap` [Source: app/assets/quiz-recap/quiz-recap.ts]",
        "interaction_2": "Uses `I18n` for localization [Source: app/assets/quiz-recap/quiz-recap.ts]",
        "interaction_3": "Handles errors using `handleError` utility [Source: app/assets/quiz-recap/quiz-recap.ts]",
        "interaction_4": "Fetches quiz question data from the `/app/quiz-recap` endpoint using `fetch`.",
        "interaction_5": "Uses `I18n` for internationalization.",
        "interaction_6": "Renders the quiz recap UI using the `@openhpi/quiz-recap` library.",
        "interaction_7": "Interacts with `handleError` utility for error reporting."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/quiz-recap/quiz-recap.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "app/assets/teacher/items/quiz-edit.ts": {
      "type": "Frontend Component",
      "description": "A TypeScript module that dynamically loads and initializes quiz question and answer editing forms via AJAX. It integrates markdown editors and upload dropzones into the loaded forms.",
      "interactions": {
        "interaction_0": "Interacts with QuizQuestionsController (or its routes) to fetch question forms ",
        "interaction_1": "Interacts with QuizAnswersController (or its routes) to fetch answer forms ",
        "interaction_2": "Handles loading indicators (`showLoading`, `hideLoading`) and errors (`handleError`) [Source: app/assets/teacher/items/quiz-edit.ts]",
        "interaction_3": "Attaches event listeners to 'edit-quiz-question', 'edit-quiz-answer', and 'add-quiz-answer' buttons [Source: app/assets/teacher/items/quiz-edit.ts]",
        "interaction_4": "Fetches HTML content for question/answer forms from specified URLs using `fetch` [Source: app/assets/teacher/items/quiz-edit.ts]",
        "interaction_5": "Initializes markdown editors (`initMarkdownEditorOnSelector`) and markdown upload dropzones (`mdupload.scan`) on the loaded content [Source: app/assets/teacher/items/quiz-edit.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/quiz-edit.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "app/assets/teacher/items/quiz-item.ts": {
      "type": "Frontend Component",
      "description": "A TypeScript module that manages the UI for configuring quiz-specific properties, such as exercise type (main, bonus, survey), time limits, and allowed attempts. It dynamically shows/hides related input fields.",
      "interactions": {
        "interaction_0": "Handles changes to quiz exercise type to adjust visibility and default values of instructions, time limits, and allowed attempts [Source: app/assets/teacher/items/quiz-item.ts]",
        "interaction_1": "Manages 'unlimited-time-switch' and 'unlimited-attempts-switch' to toggle visibility of corresponding input fields [Source: app/assets/teacher/items/quiz-item.ts]",
        "interaction_2": "Uses `I18n` for localized text [Source: app/assets/teacher/items/quiz-item.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/quiz-item.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "app/assets/teacher/items/quiz-questions.ts": {
      "type": "Frontend Component",
      "description": "A TypeScript module responsible for dynamically rendering and managing the correct question form based on the selected question type (e.g., multiple choice, free text). It initializes markdown editors and upload functionalities for questions.",
      "interactions": {
        "interaction_0": "Dynamically appends the appropriate question form (multiple choice, multiple answer, free text, essay) to the UI based on a selector's value [Source: app/assets/teacher/items/quiz-questions.ts]",
        "interaction_1": "Initializes markdown editors (`initMarkdownEditorOnSelector`), upload dropzones (`upload.scan`, `mdupload.scan`), and dropdowns (`initDropdownsOnSelector`) within the question forms [Source: app/assets/teacher/items/quiz-questions.ts]",
        "interaction_2": "Toggles visibility of generic question fields [Source: app/assets/teacher/items/quiz-questions.ts]",
        "interaction_3": "Uses `toggleUuids` for UUID display [Source: app/assets/teacher/items/quiz-questions.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/quiz-questions.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "app/assets/teacher/items/quiz.ts": {
      "type": "Frontend Component",
      "description": "The main TypeScript module for the teacher's quiz item editing page. It orchestrates the initialization of quiz properties, question management, and proctoring settings.",
      "interactions": {
        "interaction_0": "Calls `handleQuizExerciseTypes` and `setTimeAndAttemptsSwitches` from `quiz-item.ts` to configure quiz properties [Source: app/assets/teacher/items/quiz.ts]",
        "interaction_1": "Calls `setQuizQuestions` from `quiz-questions.ts` to manage question forms [Source: app/assets/teacher/items/quiz.ts]",
        "interaction_2": "Handles the visibility and state of the proctoring switch based on exercise type and initial state [Source: app/assets/teacher/items/quiz.ts]",
        "interaction_3": "Listens to changes in exercise type to update quiz properties and proctoring settings [Source: app/assets/teacher/items/quiz.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/quiz.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Quiz::Quiz": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model representing a quiz, used by the main application to interact with the Quiz Service. It provides access to quiz properties like instructions, attempts, time limits, and questions.",
      "interactions": {
        "interaction_0": "Used by QuizAnswersController to find questions for new answers ",
        "interaction_1": "Provides attributes like `allowed_attempts`, `time_limit_seconds`, `instructions`.",
        "interaction_2": "Used by `QuizItemPresenter` to build quiz item views and determine submission logic [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_3": "Created, updated, and fetched by `ItemsController` for quiz content [Source: app/controllers/items_controller.rb]",
        "interaction_4": "Interacts with `Xikolo::Quiz::Question` and `Xikolo::Quiz::Answer` for quiz details [Source: app/controllers/items_controller.rb]",
        "interaction_5": "Deleted by `ItemsController#destroy` [Source: app/controllers/items_controller.rb]",
        "interaction_6": "Used by `ItemsController` when creating or editing quiz items.",
        "interaction_7": "Used by `QuizQuestionsController` to find the associated quiz for question management [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_8": "Used by `QuizSubmissionController` to retrieve quiz details, questions, and answers for submissions [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "app/controllers/items_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation",
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Quiz::Question": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model representing a quiz question, used by the main application to interact with the Quiz Service. It serves as a base for different question types.",
      "interactions": {
        "interaction_0": "Used by `QuizAnswersController` to find the question for which answers are being managed [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_1": "Used by `QuizQuestionsController` for finding, creating, updating, and moving questions [Source: app/controllers/quiz_questions_controller.rb]",
        "interaction_2": "Used by `QuizSubmissionController` to retrieve questions for a quiz submission [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Quiz::Answer": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model representing a quiz answer, used by the main application to interact with the Quiz Service. It serves as a base for different answer types.",
      "interactions": {
        "interaction_0": "Used by `QuizAnswersController` for finding, creating, updating, moving, and deleting answers [Source: app/controllers/quiz_answers_controller.rb]",
        "interaction_1": "Used by `QuizSubmissionController` to retrieve answers for quiz questions during submission [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Submission::QuizSubmission": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model representing a user's submission to a quiz, used by the main application to interact with the Quiz Service (and implicitly, the Submission Service). It holds submission data, points, and proctoring information.",
      "interactions": {
        "interaction_0": "Interacts with Quiz::Submission (wrapper model) ",
        "interaction_1": "Used by `QuizItemPresenter` to determine the user's submission status and redirect logic [Source: app/presenters/quiz_item_presenter.rb]",
        "interaction_2": "Used by `QuizSubmissionController` for finding, creating, and updating quiz submissions [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Submission::QuizSubmissionSnapshot": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model representing a snapshot of a quiz submission, used by the main application to interact with the Quiz Service for saving partial submission data.",
      "interactions": {
        "interaction_0": "Used by QuizSubmissionSnapshotController to save quiz submission snapshots ",
        "interaction_1": "Used by `QuizSubmissionController` to find and load submission snapshots [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Submission::UserQuizAttempts": {
      "type": "ACFS Client Model",
      "description": "An ACFS client model used by the main application to track and manage the number of attempts a user has made for a specific quiz, interacting with the Quiz Service.",
      "interactions": {
        "interaction_0": "Used by `QuizSubmissionController` to check remaining attempts before allowing a new submission [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_1": "Used by `QuizItemPresenter` to determine if further attempts are allowed [Source: app/presenters/quiz_item_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Quiz Service": {
      "type": "Microservice",
      "description": "A dedicated API-only Rails microservice responsible for managing all quiz-related data, including quizzes, questions, answers, and user submissions. It is the authoritative source for quiz content and submission records.",
      "interactions": {
        "interaction_0": "Provides data to/receives data from Xikolo::Quiz::Quiz (ACFS client model) ",
        "interaction_1": "Provides data to/receives data from Xikolo::Quiz::Question (ACFS client model) ",
        "interaction_2": "Provides data to/receives data from Xikolo::Quiz::Answer (ACFS client model) ",
        "interaction_3": "Provides data to/receives data from Xikolo::Submission::QuizSubmission (ACFS client model) ",
        "interaction_4": "Provides data to/receives data from Xikolo::Submission::QuizSubmissionSnapshot (ACFS client model) ",
        "interaction_5": "Provides data to/receives data from Xikolo::Submission::UserQuizAttempts (ACFS client model) ",
        "interaction_6": "Interacts with the Account Service to retrieve user information for submissions and grading. [Source: services/quiz/config/services.yml]",
        "interaction_7": "Communicates with the Course Service to integrate quizzes into course structures and update course results after regrading. ",
        "interaction_8": "Handles its own 'submission' data, as indicated by the service configuration. [Source: services/quiz/config/services.yml]",
        "interaction_9": "Communicates with PostgreSQL for data persistence.",
        "interaction_10": "Uses RabbitMQ for asynchronous inter-service communication.",
        "interaction_11": "Relies on Redis for caching and Sidekiq job queueing.",
        "interaction_12": "Interacts with the Account Service for user authentication and authorization contexts.",
        "interaction_13": "Interacts with the Course Service for course-related data and associations.",
        "interaction_14": "Stores quiz-related assets in S3 buckets."
      },
      "techDebt": [
        "The reliance on `rake` tasks for critical regrading operations suggests a lack of a user interface or dedicated API endpoints for these functionalities, potentially leading to manual errors or requiring specialized knowledge for execution. "
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "app/controllers/quiz_recap_controller.rb",
          "services/quiz/README.md",
          "services/quiz/config/services.yml",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Course Service": {
      "type": "Microservice",
      "description": "A dedicated API-only Rails microservice responsible for managing course-related data, including course items and enrollments. It provides information necessary for context and linking within the quiz feature.",
      "interactions": {
        "interaction_0": "Provides data to/receives data from Xikolo::Course::Course (Microservice Client) ",
        "interaction_1": "Provides data to/receives data from Xikolo::Course::Section (Microservice Client) ",
        "interaction_2": "Provides data to/receives data from Xikolo::Course::Item (Microservice Client) ",
        "interaction_3": "Provides data to/receives data from Xikolo::Course::Visit (Microservice Client) ",
        "interaction_4": "Receives requests from Course::EnrollmentsController for enrollment management ",
        "interaction_5": "Receives requests from Course::LaunchController for course details ",
        "interaction_6": "Receives requests from Course::FreeReactivationsController for enrollment/reactivation ",
        "interaction_7": "Receives requests from Course::ProgressController for progress data ",
        "interaction_8": "Receives requests from Course::SyllabusController for syllabus data ",
        "interaction_9": "Receives requests from Admin::Ajax::CoursesController for course data ",
        "interaction_10": "Receives requests from Admin::Ajax::DetailStatisticsController for course items ",
        "interaction_11": "Receives requests from Admin::Ajax::PlatformStatisticsController for global course statistics ",
        "interaction_12": "Receives requests from Admin::ReportsController for course parameters ",
        "interaction_13": "Receives requests from Course::Statistics for certificate data ",
        "interaction_14": "Receives requests from VoucherPresenter for course details ",
        "interaction_15": "Receives requests from Home::GoController for item and course details ",
        "interaction_16": "Receives requests from IcalController for next dates ",
        "interaction_17": "Receives requests from UsersController for teacher information ",
        "interaction_18": "Receives requests from Voucher::ProductTypes::Proctoring to update enrollment status ",
        "interaction_19": "Receives requests from Course::DocumentsPresenter to fetch course details ",
        "interaction_20": "Receives requests from Admin::DocumentLocalizationsController to manage DocumentLocalization records ",
        "interaction_21": "Receives requests from Admin::DocumentsController to manage Document records ",
        "interaction_22": "Provides API endpoints consumed by `QuizSubmissionController` to retrieve item and section details [Source: app/controllers/quiz_submission_controller.rb]",
        "interaction_23": "Provides API endpoints consumed by `QuizRecapController` to find course items for generating reference links [Source: app/controllers/quiz_recap_controller.rb]",
        "interaction_24": "Used by `QuizItemPresenter` to retrieve course enrollment information [Source: app/presenters/quiz_item_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_recap_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Submission Service": {
      "type": "Microservice",
      "description": "A microservice that processes and stores submission-related events. It receives notifications about new quiz submissions from the main application.",
      "interactions": {
        "interaction_0": "Receives events from Xikolo::Submission::QuizSubmission (ACFS client model) via Msgr ",
        "interaction_1": "Receives `xikolo.submission.submission.create` events via Msgr from `QuizSubmissionController` [Source: app/controllers/quiz_submission_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Course::QuizRecap": {
      "type": "ViewComponent",
      "description": "A Rails ViewComponent intended for rendering quiz recap information. The provided code shows an empty component, suggesting its primary logic or data fetching is handled by a presenter or controller, or it's a placeholder for future UI elements.",
      "interactions": {
        "interaction_0": "Receives data from QuizRecapController ",
        "interaction_1": "Interacts with app/assets/quiz-recap/quiz-recap.ts (frontend component) for rendering "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/course/quiz_recap.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "OmniAuth Configuration": {
      "type": "Configuration",
      "description": "Manages external authentication providers and their settings, dynamically loaded from `omniauth.yml`. ",
      "interactions": {
        "interaction_0": "Provides authentication callbacks to ApplicationController (or related auth controller) ",
        "interaction_1": "Provides authentication callbacks to the main application. [Source: config/initializers/omniauth.rb]",
        "interaction_2": "Integrates with various external Identity Providers (IdPs) like SAML and OpenID Connect. [Source: config/initializers/omniauth.rb]"
      },
      "techDebt": [
        "Allowing `GET` requests for OmniAuth callbacks is a security concern and should be restricted to `POST` requests. [Source: config/initializers/omniauth.rb]"
      ],
      "provenance": {
        "sources": [
          "config/initializers/omniauth.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Custom Fields Management": {
      "type": "Feature",
      "description": "Allows administrators to define and collect custom user data (Text, Select, Multi-select) which users can edit on their profile pages. Fields can be mandatory. ",
      "interactions": {
        "interaction_0": "Interacts with UsersController for user profile data input ",
        "interaction_1": "Administrators configure fields via Rails console. ",
        "interaction_2": "Users interact with their profile page to input data. "
      },
      "techDebt": [
        "Configuration is currently console-only, which might not be scalable for non-technical administrators. "
      ],
      "provenance": {
        "sources": [
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Consent Management": {
      "type": "Feature",
      "description": "Manages user permissions for data usage and communication, supporting required, optional, and external consents. ",
      "interactions": {
        "interaction_0": "Interacts with UsersController for user consent management ",
        "interaction_1": "The system enforces required consents. ",
        "interaction_2": "Custom integrations handle external consent managers. ",
        "interaction_3": "Users manage consents on their profile page. "
      },
      "techDebt": [
        "Custom integration required for each external consent manager type. "
      ],
      "provenance": {
        "sources": [
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Xikolo Account Service": {
      "type": "Microservice",
      "description": "A dedicated API-only Rails microservice responsible for core user account management, profile data, and authorization logic. ",
      "interactions": {
        "interaction_0": "Provides data to/receives data from Xikolo::Account::User (ACFS client model) ",
        "interaction_1": "Exposed via Xikolo::Account::Application.routes (Microservice Routing) ",
        "interaction_2": "Manages permissions based on defined roles and grants. ",
        "interaction_3": "Likely exposes API endpoints for user operations.",
        "interaction_4": "Interacts with the main application for authentication flows and profile data display."
      },
      "techDebt": [
        "`README.md` is a placeholder, indicating a lack of comprehensive service documentation. "
      ],
      "provenance": {
        "sources": [
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Authorization System": {
      "type": "Configuration/System",
      "description": "Defines a role-based access control (RBAC) system using groups, roles, and grants to manage permissions within the `Xikolo Account Service`. ",
      "interactions": {
        "interaction_0": "Composed of Role (Model), Grant (Model), Context (Model) ",
        "interaction_1": "Groups are granted specific permissions within a context. ",
        "interaction_2": "Roles are assigned to groups. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Portal API Authentication": {
      "type": "API Authentication",
      "description": "Secures API endpoints by requiring a valid OAuth 2.0 Bearer Token in the `Authorization` header for all requests. ",
      "interactions": {
        "interaction_0": "Authenticates requests for PortalApi (Rails Module/Namespace) ",
        "interaction_1": "Interacts with Xi::Controllers::RequireBearerToken for token validation ",
        "interaction_2": "Clients send requests with Bearer Tokens.",
        "interaction_3": "The API validates tokens."
      },
      "techDebt": [
        "Token exchange endpoints do not yet exist, requiring manual shared secret distribution. "
      ],
      "provenance": {
        "sources": [
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Admin::CourseForm": {
      "type": "Form",
      "description": "Handles the creation and editing of course metadata and configuration in the admin interface. It defines attributes for course title, code, abstract, description, dates, status, and various feature flags like ROA, COP, pinboard, and invite-only. It also manages course classifiers and validates input.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course data ",
        "interaction_1": "Uses `ChannelHelper` for image dimension constants.",
        "interaction_2": "Validates course status, code, title, language, description, and classifier formats.",
        "interaction_3": "Interacts with the underlying Course model (via microservice) for persistence."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/course_form.rb",
          "app/helpers/channel_helper.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "SectionsController": {
      "type": "Controller",
      "description": "Manages `Section` resources, which organize `Item`s within a `Course`. It provides API endpoints for listing, viewing, creating, updating, and destroying sections. It also handles alternative sections. [Source: services/course/app/controllers/sections_controller.rb]",
      "interactions": {
        "interaction_0": "Uses `CourseContextHelper` for course context and eligibility checks.",
        "interaction_1": "Interacts with `Xikolo::Course::Section` microservice client for section data.",
        "interaction_2": "Interacts with `Course::Course` model to determine legacy status.",
        "interaction_3": "Creates `Xikolo::Pinboard::ImplicitTag` when a section is created.",
        "interaction_4": "Redirects to `course_item_path` or `course_resume_path` after section show action.",
        "interaction_5": "Manages CRUD operations for `Section` models. [Source: services/course/app/controllers/sections_controller.rb]",
        "interaction_6": "Filters sections by `course_id`, `published`, `available`, `id`, `position`, `parent_id`, and `include_alternatives`. [Source: services/course/app/controllers/sections_controller.rb]",
        "interaction_7": "Delegates section destruction to `Section::Destroy.call`. [Source: services/course/app/controllers/sections_controller.rb]",
        "interaction_8": "Updates `alternative_state` of a parent section when a child section is created. [Source: services/course/app/controllers/sections_controller.rb]",
        "interaction_9": "Interacts with Course::Item to find the first item in a section [Source: app/controllers/sections_controller.rb]",
        "interaction_10": "Uses SectionPresenter for alternative section display [Source: app/controllers/sections_controller.rb]",
        "interaction_11": "Creates Xikolo::Pinboard::ImplicitTag upon section creation [Source: app/controllers/sections_controller.rb]",
        "interaction_12": "Creates Xikolo::Course::SectionChoice for alternative section selection [Source: app/controllers/sections_controller.rb]",
        "interaction_13": "Interacts with Course::Structure::Node for moving sections in non-legacy courses [Source: app/controllers/sections_controller.rb]",
        "interaction_14": "Uses CourseContextHelper for course context [Source: app/controllers/sections_controller.rb]",
        "interaction_15": "Uses CoursePresenter to create course presentation data [Source: app/controllers/sections_controller.rb]",
        "interaction_16": "Interacts with Xikolo::Course::Section for section data and management [Source: app/controllers/sections_controller.rb]",
        "interaction_17": "Interacts with Course::Course.find to check for legacy course structure [Source: app/controllers/sections_controller.rb]"
      },
      "techDebt": [
        "TODO@JG: null values in section_params for dates.",
        "TODO: the redirect should differentiate between logged in and anonymous users in `show` action.",
        "TODO for handling null values in section parameters during creation [Source: app/controllers/sections_controller.rb]",
        "The redirect logic for alternative sections needs to differentiate between logged-in and anonymous users [Source: app/controllers/sections_controller.rb]",
        "The `load_raw_sections` method is deprecated for courses migrated to the new content tree [Source: app/controllers/sections_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/sections_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/presenters/section_presenter.rb",
          "services/course/app/controllers/sections_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:03_CORE_CourseService",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "03_CORE_CourseService",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "ItemsController": {
      "type": "Controller",
      "description": "Manages `Item` resources, which represent individual learning content units within sections. It provides extensive filtering for listing items and handles CRUD operations. It also includes logic for 'open mode' and user-specific item access. [Source: services/course/app/controllers/items_controller.rb, docs/app/features/courses/open_mode.md]",
      "interactions": {
        "interaction_0": "Uses `CourseContextHelper` and `ItemContextHelper` for context and eligibility.",
        "interaction_1": "Interacts with `Xikolo::Course::Item` microservice client for item data.",
        "interaction_2": "Interacts with `Video::Video`, `Course::Richtext`, `Xikolo::Quiz::Quiz`, `Lti::Exercise` for content-specific data.",
        "interaction_3": "Utilizes `Item::Create` operation for item creation.",
        "interaction_4": "Uses `Video::Store`, `Course::Richtext::Store`, `Lti::Exercise::Store` for content persistence.",
        "interaction_5": "Creates `Xikolo::Course::Visit` records for item views.",
        "interaction_6": "Loads `Lti::Provider` for LTI exercises.",
        "interaction_7": "Redirects based on content type after creation or update.",
        "interaction_8": "Manages CRUD operations for `Item` models. [Source: services/course/app/controllers/items_controller.rb]",
        "interaction_9": "Filters items by `content_type`, `exercise_type`, `section_id`, `content_id`, `id`, `available`, `all_available`, `was_available`, `published`, `course_id`, `featured`, `open_mode`, `required_items`, `state_for`, `proctored`, `user_id`, and `new_for`. [Source: services/course/app/controllers/items_controller.rb]",
        "interaction_10": "Interacts with `Section`, `Course`, `Visit`, and `Structure::UserItemsSelector` for complex filtering and access control. [Source: services/course/app/controllers/items_controller.rb]",
        "interaction_11": "Handles versioning of items using `paper_trail`. [Source: services/course/app/controllers/items_controller.rb]",
        "interaction_12": "Determines 'current' item for a user based on last visit or first available item. [Source: services/course/app/controllers/items_controller.rb]",
        "interaction_13": "Interacts with Xikolo::Quiz::Quiz, Xikolo::Quiz::Question, etc., for quiz content [Source: app/controllers/items_controller.rb]",
        "interaction_14": "Interacts with Lti::Exercise and Lti::Exercise::Store for LTI exercise content [Source: app/controllers/items_controller.rb]",
        "interaction_15": "Creates Xikolo::Course::Visit records for item views [Source: app/controllers/items_controller.rb]",
        "interaction_16": "Uses Course::Item.find and Course::Structure::Node for item movement logic [Source: app/controllers/items_controller.rb]",
        "interaction_17": "Interacts with Xikolo::Account::Preferences to load user preferences [Source: app/controllers/items_controller.rb]",
        "interaction_18": "Uses FileUpload for handling video-related file uploads [Source: app/controllers/items_controller.rb]",
        "interaction_19": "Uses ItemContextHelper for item-specific context and presentation [Source: app/controllers/items_controller.rb]",
        "interaction_20": "Interacts with Xikolo::Course::Item for item data [Source: app/controllers/items_controller.rb]",
        "interaction_21": "Uses ItemPresenter.lookup to select appropriate item presenter based on content type [Source: app/controllers/items_controller.rb, app/presenters/item_presenter.rb]",
        "interaction_22": "Interacts with Video::Video and Video::Store for video content [Source: app/controllers/items_controller.rb]",
        "interaction_23": "Interacts with Course::Richtext and Course::Richtext::Store for rich text content [Source: app/controllers/items_controller.rb]"
      },
      "techDebt": [
        "Error handling inconsistencies between content types for inline vs. flash messages.",
        "TODO: reuse passed in upload ids in `create_video_uploads!`.",
        "Inconsistencies in error handling between content types for create/update actions [Source: app/controllers/items_controller.rb]",
        "TODO to reuse passed-in upload IDs in `create_video_uploads!` [Source: app/controllers/items_controller.rb]",
        "The `open_mode` restriction to video items is temporary [Source: app/controllers/items_controller.rb]",
        "The `index` method has a complex conditional logic for filtering, especially regarding `exercise_type` and `available` scopes, which could be simplified. [Source: services/course/app/controllers/items_controller.rb]",
        "The `TODO` comment regarding dropping items where requirements are not fulfilled suggests a known limitation due to the microservice architecture. [Source: services/course/app/controllers/items_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/helpers/item_context_helper.rb",
          "app/operations/item/create.rb",
          "app/operations/course/richtext/store.rb",
          "docs/app/development/implementation/course_items_form.md",
          "app/presenters/item_presenter.rb",
          "services/course/app/controllers/items_controller.rb",
          "docs/app/features/courses/open_mode.md",
          "cluster:02_CORE_CourseContent",
          "cluster:03_CORE_CourseService",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "03_CORE_CourseService",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Course::DocumentsController": {
      "type": "Controller",
      "description": "Manages HTTP requests related to course documents, including listing all documents and displaying a specific document. It acts as an intermediary between the frontend and the `Xikolo::CourseService` API.",
      "interactions": {
        "interaction_0": "Interacts with Document (Model - Course Microservice) to fetch documents ",
        "interaction_1": "Interacts with DocumentLocalization (Model - Course Microservice) to fetch localized documents ",
        "interaction_2": "Includes DocumentHelper for file upload functionalities ",
        "interaction_3": "Gated by `Xikolo.config.beta_features['documents']`. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_4": "Uses `CourseContextHelper` for course context.",
        "interaction_5": "Uses `DocumentHelper` for document-related actions and helpers.",
        "interaction_6": "Interacts with `course_api` (Xikolo::CourseService) to fetch document lists and individual documents.",
        "interaction_7": "Inherits from `Abstract::FrontendController` and includes `CourseContextHelper` and `DocumentHelper`. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_8": "Requires `Xikolo.config.beta_features['documents']` to be enabled for access. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_9": "Fetches a list of documents from `course_api.rel(:documents)` for the `index` action, applying `tag` and `language` filters from `params`. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_10": "Fetches a specific document from `course_api.rel(:document)` for the `show` action. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_11": "Uses `Xikolo.api(:course)` (a `Restify` client) to interact with the `Xikolo::CourseService`. [Source: app/controllers/course/documents_controller.rb]",
        "interaction_12": "Ensures user is logged in via `ensure_logged_in` before actions. [Source: app/controllers/course/documents_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/documents_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/helpers/document_helper.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::EnrollmentsController": {
      "type": "Controller",
      "description": "Handles user enrollment and unenrollment in courses. It manages the creation and deletion of enrollments, checking for course restrictions, user permissions, and prerequisites.",
      "interactions": {
        "interaction_0": "Interacts with Enrollment (Model/Entity) for enrollment management ",
        "interaction_1": "Interacts with `course_api` (Xikolo::CourseService) to check existing enrollments, create new ones, and destroy them.",
        "interaction_2": "Handles `Restify::UnprocessableEntity` errors for access restrictions and unfulfilled prerequisites.",
        "interaction_3": "Communicates with `Xikolo.api(:course)` (specifically `Xikolo::CourseService`) for enrollment creation, retrieval, and deletion.",
        "interaction_4": "Checks `current_user.allowed?('course.content.access')` for invite-only courses.",
        "interaction_5": "Handles `Restify::UnprocessableEntity` exceptions for various enrollment restrictions (e.g., access restricted, prerequisites unfulfilled).",
        "interaction_6": "Redirects to `course_resume_path`, `course_path`, or `dashboard_path` based on action outcome."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/enrollments_controller.rb",
          "services/course/README.md",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::LaunchController": {
      "type": "Controller",
      "description": "Manages the initial launch flow for a course, redirecting users to enrollment or login based on their authentication status.",
      "interactions": {
        "interaction_0": "Interacts with Course::EnrollmentsController to redirect to enrollment creation ",
        "interaction_1": "Redirects to `create_enrollment_path` if authenticated.",
        "interaction_2": "Redirects to `login_url` if anonymous and no `auth` parameter is present.",
        "interaction_3": "Stores the intended course location for post-login redirection.",
        "interaction_4": "Fetches course details from `Xikolo.api(:course)`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/launch_controller.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::FreeReactivationsController": {
      "type": "Controller",
      "description": "Allows users to reactivate courses for which they have a 'free reactivation' prerequisite. It interacts with the `Xikolo::CourseService` to verify eligibility and perform the reactivation.",
      "interactions": {
        "interaction_0": "Interacts with Enrollment (Model/Entity) to create new enrollments/reactivations ",
        "interaction_1": "Interacts with `course_api` to fetch course prerequisites and create new enrollments/reactivations.",
        "interaction_2": "Responds with JSON status codes for success or failure.",
        "interaction_3": "Communicates with `Xikolo.api(:course)` to fetch prerequisite status and post reactivation requests.",
        "interaction_4": "Uses `CourseReactivation.config('period')` to determine the duration of the reactivation period.",
        "interaction_5": "Handles `Restify::UnprocessableEntity` for failed reactivation attempts."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/free_reactivations_controller.rb",
          "docs/app/features/reactivation.md",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::ProgressController": {
      "type": "Controller",
      "description": "Displays the progress of a user within a specific course. It can show progress for the `current_user` or, with appropriate permissions, for other users.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) for course progress ",
        "interaction_1": "Interacts with Xikolo::Course::Section (Microservice Client) for course progress ",
        "interaction_2": "Fetches user details from `Xikolo::Account::User` if a specific user ID is provided.",
        "interaction_3": "Interacts with `course_api` (Xikolo::CourseService) to retrieve progress data.",
        "interaction_4": "Uses `Course::DocumentsPresenter` to display course documents and certificates.",
        "interaction_5": "Fetches user data from Xikolo::Account::User [Source: app/controllers/course/progress_controller.rb]",
        "interaction_6": "Uses Course::DocumentsPresenter to display course documents related to progress [Source: app/controllers/course/progress_controller.rb]",
        "interaction_7": "Queries the course_api for progress data [Source: app/controllers/course/progress_controller.rb]",
        "interaction_8": "Leverages CourseContextHelper for course context [Source: app/controllers/course/progress_controller.rb]",
        "interaction_9": "Uses `CourseContextHelper` to establish the course context.",
        "interaction_10": "Instantiates `Course::DocumentsPresenter` and uses `Acfs.run` to fetch course documents.",
        "interaction_11": "Communicates with `Xikolo.api(:course)` to retrieve course progress data.",
        "interaction_12": "Sets the page title using `set_page_title`."
      },
      "techDebt": [
        "The `current_user` passed to `Course::DocumentsPresenter` might be an admin/teacher, not the actual user whose progress is being monitored, which needs refactoring.",
        "The `current_user` passed to `Course::DocumentsPresenter` might be an admin/teacher monitoring progress, not the actual user, which needs refactoring [Source: app/controllers/course/progress_controller.rb]",
        "The `current_user` is passed to `Course::DocumentsPresenter` to check for features, even when an admin is monitoring another user's progress. This indicates a potential design flaw or area for refactoring the user object interface. [Source: app/controllers/course/progress_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/progress_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/presenters/documents_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Course::SyllabusController": {
      "type": "Controller",
      "description": "Displays the course syllabus and an overview of course progress. Overrides standard course eligibility checks to support 'open mode' for previewable content.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Section (Microservice Client) for syllabus display ",
        "interaction_1": "Interacts with Xikolo::Course::Item (Microservice Client) for syllabus display ",
        "interaction_2": "Uses `Course::ProgressPresenter` to build progress data.",
        "interaction_3": "Interacts with `Xikolo.api(:course)` to fetch previewable items for open mode.",
        "interaction_4": "Uses Course::ProgressPresenter to build user progress data [Source: app/controllers/course/syllabus_controller.rb]",
        "interaction_5": "Leverages CourseContextHelper for course context and eligibility checks [Source: app/controllers/course/syllabus_controller.rb]",
        "interaction_6": "Interacts with Xikolo.api(:course) to fetch previewable items in open mode [Source: app/controllers/course/syllabus_controller.rb]",
        "interaction_7": "Uses `CourseContextHelper` for course context.",
        "interaction_8": "Loads section navigation (`load_section_nav`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/syllabus_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "CourseContextHelper": {
      "type": "Helper",
      "description": "Provides methods and `before_action` hooks to establish the context of the current course, section, and item. Includes logic for course eligibility, resource loading, and navigation setup.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course context ",
        "interaction_1": "Interacts with Xikolo::Course::Section (Microservice Client) for section context ",
        "interaction_2": "Interacts with Xikolo::Course::Item (Microservice Client) for item context ",
        "interaction_3": "Loads section navigation using `Navigation::TableOfContents`.",
        "interaction_4": "Defines `inside_course` macro for controllers [Source: app/helpers/course_context_helper.rb]",
        "interaction_5": "Loads `the_course`, `the_section`, `the_item` from Xikolo::Course::Course, Xikolo.api(:course) [Source: app/helpers/course_context_helper.rb]",
        "interaction_6": "Performs `check_course_eligibility` based on user permissions and course availability [Source: app/helpers/course_context_helper.rb]",
        "interaction_7": "Builds `Navigation::TableOfContents` for section navigation [Source: app/helpers/course_context_helper.rb]",
        "interaction_8": "Uses Course::LayoutPresenter for course layout [Source: app/helpers/course_context_helper.rb]",
        "interaction_9": "Includes itself into `base_controller` to provide `inside_course` and `helper_method` declarations. [Source: app/helpers/course_context_helper.rb]",
        "interaction_10": "Calls `Course::LayoutPresenter.new` to get course layout information. [Source: app/helpers/course_context_helper.rb]",
        "interaction_11": "Interacts with `current_user` for permission checks (`allowed?`). [Source: app/helpers/course_context_helper.rb]",
        "interaction_12": "Fetches course data using `Xikolo::Course::Course.find` and `Xikolo.api(:course).value!.rel(:section).get`. [Source: app/helpers/course_context_helper.rb]",
        "interaction_13": "Raises `Status::NotFound` or `Status::Redirect` for eligibility failures. [Source: app/helpers/course_context_helper.rb]",
        "interaction_14": "Uses `Navigation::TableOfContents.for_course` to load section navigation. [Source: app/helpers/course_context_helper.rb]",
        "interaction_15": "Relies on `Acfs.run` for asynchronous data fetching. [Source: app/helpers/course_context_helper.rb]",
        "interaction_16": "Defines `inside_course` which calls `layout` and `before_action :check_course_eligibility`.",
        "interaction_17": "The `check_course_eligibility` method checks user permissions, course availability, and enrollment status.",
        "interaction_18": "Provides `the_course`, `the_section`, `the_item` promises for lazy loading resources."
      },
      "techDebt": [
        "TODO: improve checks in `check_course_eligibility`.",
        "TODO for improving checks in `check_course_eligibility` [Source: app/helpers/course_context_helper.rb]",
        "The `check_course_eligibility` method has a `TODO: improve checks` comment. [Source: app/helpers/course_context_helper.rb]",
        "The `request_item` method is currently `nil`, indicating an incomplete or placeholder implementation. [Source: app/helpers/course_context_helper.rb]",
        "The `the_table_of_content` method raises a runtime error if the table of content is not pre-loaded, which could lead to unexpected failures. [Source: app/helpers/course_context_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/course_context_helper.rb",
          "docs/app/development/implementation/helper_inside_course.md",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "ItemContextHelper": {
      "type": "Helper",
      "description": "Provides common functionality and lifecycle hooks for course item-related controllers. Defines `inside_item` to set layout, load navigation, and create presenters.",
      "interactions": {
        "interaction_0": "Defines `inside_item` which calls `layout`, `before_action :load_section_nav`, `before_action :create_position_presenter!`, `before_action :create_item_presenter!`, and `before_action :check_course_path`.",
        "interaction_1": "Creates `Course::PositionPresenter` and `ItemPresenter` instances.",
        "interaction_2": "Records user visits to items via `Xikolo::Course::Visit.create`.",
        "interaction_3": "Defines `inside_item` macro for controllers [Source: app/helpers/item_context_helper.rb]",
        "interaction_4": "Ensures item belongs to the course [Source: app/helpers/item_context_helper.rb]",
        "interaction_5": "Creates `Course::PositionPresenter` for item navigation [Source: app/helpers/item_context_helper.rb]",
        "interaction_6": "Creates `ItemPresenter` for item display [Source: app/helpers/item_context_helper.rb]",
        "interaction_7": "Creates `Xikolo::Course::Visit` records [Source: app/helpers/item_context_helper.rb]",
        "interaction_8": "Relies on `the_item` from `CourseContextHelper` [Source: app/helpers/item_context_helper.rb]",
        "interaction_9": "Includes itself into `base_controller` to provide `inside_item` and `before_action` callbacks. [Source: app/helpers/item_context_helper.rb]",
        "interaction_10": "Calls `load_section_nav` (from `CourseContextHelper`) to load navigation. [Source: app/helpers/item_context_helper.rb]",
        "interaction_11": "Builds `Course::PositionPresenter` and `ItemPresenter` instances. [Source: app/helpers/item_context_helper.rb]",
        "interaction_12": "Creates `Xikolo::Course::Visit` records for tracking item views. [Source: app/helpers/item_context_helper.rb]",
        "interaction_13": "Interacts with `the_course` and `the_section` (from `CourseContextHelper`) to validate item path. [Source: app/helpers/item_context_helper.rb]",
        "interaction_14": "Handles `Restify::NotFound` for items by redirecting to the course resume path. [Source: app/helpers/item_context_helper.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/item_context_helper.rb",
          "docs/app/development/implementation/helper_inside_course.md",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "DocumentHelper": {
      "type": "Helper",
      "description": "Provides methods for CRUD operations on documents and localizations by interacting directly with the `Xikolo::CourseService` API. It also defines `Struct`s to represent document and localization data.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::S3::UploadByUri (Utility - S3) for file uploads ",
        "interaction_1": "Interacts with Xikolo::S3::SingleFileUpload (Utility - S3) for file uploads ",
        "interaction_2": "Handles error messages for document creation.",
        "interaction_3": "Interacts with `Xikolo.api(:course)` (CourseService) for document and localization CRUD operations.",
        "interaction_4": "Uses `FileUpload` for S3 uploads of document files.",
        "interaction_5": "Defines `Document` and `Localization` `Struct`s with `ActiveModel` concerns for data representation. [Source: app/helpers/document_helper.rb]",
        "interaction_6": "Performs `POST`, `PATCH`, `DELETE` requests to `Xikolo.api(:course)` (Course API) for document and localization management. [Source: app/helpers/document_helper.rb]",
        "interaction_7": "Handles error cases during document creation, specifically for title uniqueness. [Source: app/helpers/document_helper.rb]",
        "interaction_8": "Uses `FileUpload` for managing file attachments to localizations. [Source: app/helpers/document_helper.rb]",
        "interaction_9": "Loads all tags from the Course API for dropdowns. [Source: app/helpers/document_helper.rb]"
      },
      "techDebt": [
        "TODO: Get rid of `Rails/HelperInstanceVariable`.",
        "The actual implementation of `DocumentHelper` is not provided, making it difficult to fully assess its responsibilities and potential complexities. [Source: N/A]",
        "Explicit `TODO: Get rid of this helper` indicates it's an anti-pattern and should be refactored, likely into a service object or dedicated model layer. [Source: app/helpers/document_helper.rb]",
        "Rubocop disable comments (`rubocop:disable Rails/HelperInstanceVariable`) suggest potential issues with instance variable usage in a helper. [Source: app/helpers/document_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/document_helper.rb",
          "app/controllers/admin/document_localizations_controller.rb",
          "app/controllers/admin/documents_controller.rb",
          "app/controllers/course/documents_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "ProgressHelper": {
      "type": "Helper",
      "description": "Provides a utility method `calc_progress` to calculate a percentage progress, ensuring it's capped at 100% and handles edge cases like zero total points.",
      "interactions": {
        "interaction_0": "Used by views or other components to display calculated progress percentages."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/progress_helper.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::Metadata::Store": {
      "type": "Operation",
      "description": "Handles the storage and validation of course metadata, particularly for skills, educational alignment, and licenses, by processing S3 file uploads.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo::S3::SingleFileUpload` to manage uploaded files.",
        "interaction_1": "Parses and validates JSON data from uploaded files against a schema.",
        "interaction_2": "Persists metadata to the `Metadata` ActiveRecord model within a transaction.",
        "interaction_3": "Captures errors with `Mnemosyne` and `Sentry`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/course/metadata/store.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::Richtext::Store": {
      "type": "Operation",
      "description": "An operation class that encapsulates the logic for storing and updating `Course::Richtext` content, including handling embedded S3 file uploads and conditional deletion of obsolete files.",
      "interactions": {
        "interaction_0": "Uses `Xikolo::S3::TextWithUploadsProcessor` to parse and manage text with embedded uploads.",
        "interaction_1": "Interacts with `S3FileDeletionJob` for asynchronous deletion of obsolete S3 files.",
        "interaction_2": "Persists rich text content to the `Course::Richtext` model.",
        "interaction_3": "Interacts with Course::Richtext model to save/update content. [Source: app/operations/course/richtext/store.rb]",
        "interaction_4": "Interacts with Xikolo::S3 gem for S3 file operations, via Xikolo::S3::TextWithUploadsProcessor. ",
        "interaction_5": "Interacts with Xikolo::S3::Markup attribute type via Course::Richtext model. [Source: app/models/course/richtext.rb]",
        "interaction_6": "Receives `Course::Richtext` instance and parameters.",
        "interaction_7": "Uses `Xikolo::S3::TextWithUploadsProcessor` to manage text and S3 uploads.",
        "interaction_8": "Schedules `S3FileDeletionJob` for obsolete URIs, checking if they are referenced elsewhere."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/course/richtext/store.rb",
          "spec/operations/course/richtext/store_spec.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::Visual::Store": {
      "type": "Operation",
      "description": "Manages the storage of course visuals (images) and teaser videos, including associated subtitles. Handles S3 uploads and updates to the `Course::Visual` and `Video::Video` models.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo::S3::SingleFileUpload` and `Xikolo::S3::UploadByUri` for S3 file management.",
        "interaction_1": "Persists visual data to `Course::Visual` and video data to `Video::Video`.",
        "interaction_2": "Uses `S3FileDeletionJob` for asynchronous deletion of old S3 files.",
        "interaction_3": "Captures errors with `Mnemosyne`."
      },
      "techDebt": [
        "TODO: Improve generic error handling for more helpful inline messages."
      ],
      "provenance": {
        "sources": [
          "app/operations/course/visual/store.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Item::Create": {
      "type": "Operation",
      "description": "Orchestrates the creation of a course item and its associated content resource (e.g., video, rich text, quiz). Ensures content validity and handles rollback if item creation fails.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) to save the item ",
        "interaction_1": "Interacts with Video::Video (Model) for video content ",
        "interaction_2": "Interacts with Course::Richtext (Model) for rich text content ",
        "interaction_3": "Interacts with Xikolo::Quiz::Quiz (ACFS Client Model) for quiz content ",
        "interaction_4": "Interacts with Lti::Exercise (Model) for LTI exercise content ",
        "interaction_5": "Validates and saves the content resource (`@content`).",
        "interaction_6": "Sets `content_id` and `section_id` on the item.",
        "interaction_7": "Saves the item resource (`@item`).",
        "interaction_8": "Creates `Xikolo::Pinboard::ImplicitTag` for the new item.",
        "interaction_9": "Handles `Restify::ClientError`, `Acfs::InvalidResource`, and `Acfs::ErroneousResponse` for content and item creation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/item/create.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Home::CourseCard": {
      "type": "ViewComponent",
      "description": "A UI component for displaying a course card on the homepage or course lists. It shows course details, visuals, dates, and actions.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Enrollment (ACFS client model) for enrollment status ",
        "interaction_1": "Interacts with User (Model/Entity) for user-specific data ",
        "interaction_2": "Uses `Imagecrop` for visual resizing and `Xikolo::S3` for course visuals.",
        "interaction_3": "Fetches `Course::Cluster` data for classifiers.",
        "interaction_4": "Determines subtitle information from `Course::Course`.",
        "interaction_5": "Receives `course`, `enrollment`, `user`, and `type` as initialization parameters.",
        "interaction_6": "Renders actions and conditional buttons based on user features (e.g., `course_reactivation`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/home/course_card.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Navigation::CoursesMenu": {
      "type": "ViewComponent",
      "description": "A UI component for the main navigation menu that displays a list of current, upcoming, and archived courses. It's only rendered if the `course_list` feature is enabled for the user.",
      "interactions": {
        "interaction_0": "Fetches course data from `Catalog::Course` (released, for global list, for guests).",
        "interaction_1": "Caches course lists for 30 minutes.",
        "interaction_2": "Checks `user.feature?('course_list')` to determine rendering."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/navigation/courses_menu.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "BasicCoursePresenter": {
      "type": "Presenter",
      "description": "A basic presenter for course information, providing common attributes and methods related to course identity, certificates, and proctoring status.",
      "interactions": {
        "interaction_0": "Wraps a course hash (`@course`).",
        "interaction_1": "Checks for `Certificate::Template` and `Certificate::OpenBadgeTemplate` existence for certificate availability."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/basic_course_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CourseInfoPresenter": {
      "type": "Presenter",
      "description": "Presents detailed course information for public display, including abstract, description, dates, classifiers, and enrollment status. It handles markdown rendering and external URLs.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_1": "Renders markdown for abstract and description.",
        "interaction_2": "Determines `date_label` based on start/end dates.",
        "interaction_3": "Checks `user.feature?` for `course_details.learning_goals`, `course_reactivation`, `certificate_requirements`, `course_rating`.",
        "interaction_4": "Interacts with `Course::Visual` for visual URLs.",
        "interaction_5": "Uses `BasicCoursePresenter` for shared certificate logic.",
        "interaction_6": "Delegates attributes to the `@course` object (Restify resource)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course_info_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CourseLargePreviewPresenter": {
      "type": "Presenter",
      "description": "Extends `CourseInfoPresenter` to provide additional information relevant for a large course preview, including teaser video, unenrollment options, and proctoring context.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_1": "Determines `unenrollment_enabled?` based on `invite_only` and `external_registration_url`.",
        "interaction_2": "Initializes `Proctoring::CourseContext` for proctoring status.",
        "interaction_3": "Checks `user.feature?('proctoring')`.",
        "interaction_4": "Initializes a `VideoPresenter` if a teaser video exists."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course_large_preview_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CourseNav": {
      "type": "Presenter",
      "description": "Defines the navigation menu items for learners within a course, including links to sections, discussions, progress, certificates, and announcements.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_1": "Interacts with User (Model/Entity) for permissions ",
        "interaction_2": "Determines active state based on controller name.",
        "interaction_3": "Uses `MenuWithPermissions` for permission-based item visibility.",
        "interaction_4": "Checks `course.pinboard_enabled` and `Xikolo.config.beta_features['documents']` for item visibility."
      },
      "techDebt": [
        "FIXME: `user.feature?('quiz_recap') && course.was_available?` should not use `was_available?` for quiz recap."
      ],
      "provenance": {
        "sources": [
          "app/presenters/course_nav.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CoursePresenter": {
      "type": "Presenter",
      "description": "Presents `Course` model data for display in various contexts. It includes methods relevant to navigation and layout, such as generating course URLs (`feed_course_url`) and displaying status ribbons (`ribbon`). It handles internationalization for UI elements.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_1": "Fetches item and section collections from `Course::Course`.",
        "interaction_2": "Checks `user.allowed?('course.course.recalculate')` and `the_course.needs_recalculation?` for recalculation features.",
        "interaction_3": "Created by DashboardController. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_4": "Delegates attributes to the `@course` object.",
        "interaction_5": "Delegates to the `course` object for core data.",
        "interaction_6": "Uses `ActionView::Helpers::TagHelper` and `ActionView::Context` for HTML generation within the presenter.",
        "interaction_7": "Interacts with `PublicCoursePage` for URL generation.",
        "interaction_8": "Reads configuration from `Xikolo.config` for feature flags (e.g., `recalculation_enabled?`).",
        "interaction_9": "Inherits from `CourseInfoPresenter` (which is likely a `PrivatePresenter` descendant).",
        "interaction_10": "Uses `I18n.t` for translations. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course_presenter.rb",
          "app/controllers/dashboard_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "CourseTeacherNav": {
      "type": "Presenter",
      "description": "Defines the navigation menu items for teachers within a course, including links to dashboards, content management, settings, enrollments, and grading.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_1": "Interacts with User (Model/Entity) for permissions ",
        "interaction_2": "Checks `Xikolo.config.beta_features['teaching_team_pinboard_activity']` and `Transpipe.enabled?` for specific features.",
        "interaction_3": "Uses `MenuWithPermissions` for permission-based item visibility.",
        "interaction_4": "Checks `user.allowed?` for various course-related permissions (e.g., `course.dashboard.view`, `course.content.edit`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course_teacher_nav.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "DocumentsListPresenter": {
      "type": "Presenter",
      "description": "Formats and filters a list of documents for display in the administrative interface. It aggregates data from documents, courses, and tags, and provides methods for pagination and filtering.",
      "interactions": {
        "interaction_0": "Interacts with Document (Model - Course Microservice) for document data ",
        "interaction_1": "Interacts with Xikolo::Course::Course (Microservice Client) for course data ",
        "interaction_2": "Interacts with Tag (implied model from Course Service) for tag data ",
        "interaction_3": "Delegates to `DocumentPresenter` for individual document display.",
        "interaction_4": "Wraps a collection of document resources.",
        "interaction_5": "Extracts unique languages from document localizations.",
        "interaction_6": "Creates `DocumentListFilter` instances for filtering UI.",
        "interaction_7": "Delegates document properties to `DocumentPresenter` for individual document display. [Source: app/presenters/documents_list_presenter.rb]",
        "interaction_8": "Extracts unique languages from `document['localizations']` and tags from `@tags` for filter options. [Source: app/presenters/documents_list_presenter.rb]",
        "interaction_9": "Reads pagination headers (`X_TOTAL_PAGES`, `X_CURRENT_PAGE`) from the API response. [Source: app/presenters/documents_list_presenter.rb]",
        "interaction_10": "Constructs filter objects using `DocumentListFilter` for UI presentation. [Source: app/presenters/documents_list_presenter.rb]",
        "interaction_11": "Uses `helpers` to generate URLs for filter options. [Source: app/presenters/documents_list_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/documents_list_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "DocumentsListPresenter::DocumentPresenter": {
      "type": "Presenter",
      "description": "Presents details of a single document within a list, including its title, description, tags, and associated courses and localizations.",
      "interactions": {
        "interaction_0": "Interacts with Document (Model - Course Microservice) for document details ",
        "interaction_1": "Interacts with Xikolo::Course::Course (Microservice Client) for course details ",
        "interaction_2": "Uses `I18nData` to translate localization languages.",
        "interaction_3": "Wraps a document resource and a collection of courses.",
        "interaction_4": "Maps course IDs to course titles."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/documents_list_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "DocumentsPresenter": {
      "type": "Presenter",
      "description": "A presenter responsible for determining the availability and download status of various certificate types (COP, ROA, CERT, TOR, Open Badge) for a given enrollment and user. It interacts with the course API and certificate templates.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo.api(:course)` to fetch course details. [Source: app/presenters/documents_presenter.rb]",
        "interaction_1": "Finds `Certificate::Template` and `Certificate::OpenBadgeTemplate` based on course and certificate type. [Source: app/presenters/documents_presenter.rb]",
        "interaction_2": "Checks user features (`user.feature?('proctoring')`) and proctoring status (`Proctoring::SmowlAdapter`) for certificate download eligibility. [Source: app/presenters/documents_presenter.rb]",
        "interaction_3": "Interacts with `Proctoring::SmowlAdapter` to check if user passed proctoring.",
        "interaction_4": "Created by DashboardController. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_5": "Fetches course details via `course_api` and wraps them in `BasicCoursePresenter`.",
        "interaction_6": "Checks `enrollment.certificates` and `user.feature?('proctoring')`.",
        "interaction_7": "Fetches course details from `course_api` using `enrollment.course_id`. [Source: app/presenters/documents_presenter.rb]",
        "interaction_8": "Checks `enrollment.certificates` hash for certificate availability flags. [Source: app/presenters/documents_presenter.rb]",
        "interaction_9": "Integrates with `Proctoring` and `Proctoring::SmowlAdapter` to check proctoring status for certificate download conditions. [Source: app/presenters/documents_presenter.rb]",
        "interaction_10": "Checks `user.feature?('proctoring')` and `Xikolo.config.roa_threshold_percentage`, `Xikolo.config.cop_threshold_percentage` for certificate requirements. [Source: app/presenters/documents_presenter.rb]",
        "interaction_11": "Uses `RequestStore` to cache `course_api` root. [Source: app/presenters/documents_presenter.rb]"
      },
      "techDebt": [
        "The name `DocumentsPresenter` is generic and could be confused with `DocumentsListPresenter` or `Course::DocumentsPresenter`. A more specific name like `CertificateDocumentsPresenter` might improve clarity."
      ],
      "provenance": {
        "sources": [
          "app/presenters/documents_presenter.rb",
          "app/controllers/dashboard_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "FeaturedItemPresenter": {
      "type": "Presenter",
      "description": "A factory presenter for featured course items. Currently supports only video items.",
      "interactions": {
        "interaction_0": "Builds `FeaturedVideoItem` for video content types.",
        "interaction_1": "Raises an error for unsupported content types."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/featured_item_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "ItemPresenter": {
      "type": "Presenter",
      "description": "A base presenter for course items, responsible for formatting item data, determining display logic (e.g., locked/unlocked, visited status), and handling item prerequisites.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) for item details ",
        "interaction_1": "Interacts with Xikolo::Course::Course (Microservice Client) for course context ",
        "interaction_2": "Checks `Course::RequiredItemPresenter` for item requirements.",
        "interaction_3": "Uses `Course::Item::Icon` for icon classes.",
        "interaction_4": "Checks `user.feature?('time_effort')` for time effort display.",
        "interaction_5": "Determines `locked?` status based on user permissions, item availability, and open mode.",
        "interaction_6": "Delegates attributes from `@item` (Xikolo::Course::Item resource) and `@course` (Xikolo::Course::Course resource) [Source: app/presenters/item_presenter.rb]",
        "interaction_7": "Looks up specific presenters based on `content_type` (e.g., `VideoItemPresenter`, `QuizItemPresenter`) [Source: app/presenters/item_presenter.rb]",
        "interaction_8": "Determines `required_items` using `Course::RequiredItemPresenter` [Source: app/presenters/item_presenter.rb]",
        "interaction_9": "Calculates `unlocked?` status based on effective start/end dates and course archived status [Source: app/presenters/item_presenter.rb]",
        "interaction_10": "Provides `type_label`, `icon_class`, `css_classes`, `status_type` for UI rendering [Source: app/presenters/item_presenter.rb]",
        "interaction_11": "Checks for `time_effort` feature and formats it [Source: app/presenters/item_presenter.rb]",
        "interaction_12": "Checks for `Transpipe` integration for video subtitles [Source: app/presenters/item_presenter.rb]",
        "interaction_13": "Delegates attributes to the `@item` and `@course` objects.",
        "interaction_14": "Determines `partial_name` and `layout` based on content type."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/item_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "RichTextItemPresenter": {
      "type": "Presenter",
      "description": "Presents rich text course items, rendering their markdown content to HTML.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) for item details ",
        "interaction_1": "Interacts with Xikolo::Course::Course (Microservice Client) for course context ",
        "interaction_2": "Uses `MarkdownHelper` to render the rich text content.",
        "interaction_3": "Extends `ItemPresenter`.",
        "interaction_4": "Finds the associated `Course::Richtext` content."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/rich_text_item_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "SectionPresenter": {
      "type": "Presenter",
      "description": "Presents course section details, including title, published status, description, and item availability. It also handles alternative sections and section choices.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Section (Microservice Client) for section details ",
        "interaction_1": "Fetches items for the section from `Xikolo.api(:course)`.",
        "interaction_2": "Determines `unlocked?` status based on start/end dates.",
        "interaction_3": "Fetches `Xikolo::Course::SectionChoice` and `Course::Section` for alternative sections.",
        "interaction_4": "Enqueues implicit tags for pinboards.",
        "interaction_5": "Delegates attributes from `@section` (Xikolo::Course::Section resource) [Source: app/presenters/section_presenter.rb]",
        "interaction_6": "Fetches `items` for the section from Xikolo.api(:course) [Source: app/presenters/section_presenter.rb]",
        "interaction_7": "Determines `available?` and `unlocked?` status based on dates and published status [Source: app/presenters/section_presenter.rb]",
        "interaction_8": "Handles `alternative_state` and fetches `section_choices` and `alternatives` from Xikolo.api(:course) and Course::Section [Source: app/presenters/section_presenter.rb]",
        "interaction_9": "Enqueues implicit tags for pinboard integration [Source: app/presenters/section_presenter.rb]",
        "interaction_10": "Determines `required_sections` using `Course::RequiredSectionPresenter` [Source: app/presenters/section_presenter.rb]",
        "interaction_11": "Delegates attributes to the `@section` object."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/section_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "StageItemPresenter": {
      "type": "Presenter",
      "description": "Presents content for the course stage (e.g., a promotional banner or statement). It parses statements to extract quotes and renders markdown.",
      "interactions": {
        "interaction_0": "Uses `MarkdownHelper` to render statements.",
        "interaction_1": "Parses the statement string to extract `quote_by`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/stage_item_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "UnsupportedItemPresenter": {
      "type": "Presenter",
      "description": "A fallback presenter for course items with unsupported content types. It displays a generic unsupported item view.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) for item details ",
        "interaction_1": "Interacts with Xikolo::Course::Course (Microservice Client) for course context ",
        "interaction_2": "Extends `ItemPresenter`.",
        "interaction_3": "Sets `partial_name` to `items/show_unsupported_item`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/unsupported_item_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "handleRichTextType": {
      "type": "Frontend Script",
      "description": "A TypeScript function that dynamically adjusts the visibility of form inputs in the course item creation/edit form when the content type is 'rich text'. It hides fields irrelevant to rich text content.",
      "interactions": {
        "interaction_0": "Interacts with HTML form elements to adjust visibility ",
        "interaction_1": "Called when the content type selection changes to 'rich text'.",
        "interaction_2": "Modifies DOM elements using `setVisibility`, `hidePublicDescription`, and `hideAndUncheckSwitch` helpers."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/rich-text.ts",
          "docs/app/development/implementation/course_items_form.md",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "sections.js": {
      "type": "Frontend Script",
      "description": "A JavaScript file that provides client-side functionality for managing course sections, including saving/restoring scroll position and handling delete restrictions.",
      "interactions": {
        "interaction_0": "Interacts with HTML form elements for section management ",
        "interaction_1": "Attaches event listeners to 'new item' and 'delete section' buttons.",
        "interaction_2": "Uses `sessionStorage` to preserve scroll position.",
        "interaction_3": "Displays `swal` (SweetAlert2) for delete forbidden messages.",
        "interaction_4": "Uses `toggleUuids` to show/hide section UUIDs."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/sections/sections.js",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Xikolo::Course::Course": {
      "type": "Microservice Client",
      "description": "A client-side representation of the Course resource from the `Xikolo::CourseService` microservice. It is used to fetch course details, manage enrollments, and access related resources like sections and items.",
      "interactions": {
        "interaction_0": "Used by Admin::CourseForm for course data ",
        "interaction_1": "Used by Course::EnrollmentsController for enrollment checks ",
        "interaction_2": "Used by Course::LaunchController to fetch course details ",
        "interaction_3": "Used by Course::FreeReactivationsController for course prerequisites ",
        "interaction_4": "Used by Course::ProgressController to retrieve progress data ",
        "interaction_5": "Used by Course::SyllabusController to fetch previewable items ",
        "interaction_6": "Used by CourseNav for navigation items ",
        "interaction_7": "Used by CourseTeacherNav for navigation items ",
        "interaction_8": "Used by DocumentsListPresenter for course data ",
        "interaction_9": "Used by DocumentsListPresenter::DocumentPresenter for course details ",
        "interaction_10": "Used by PinboardController for course context ",
        "interaction_11": "Used by QuestionController for course context ",
        "interaction_12": "Used by Admin::AnnouncementEmailForm to fetch course titles ",
        "interaction_13": "Used by Admin::StatisticsPresenter to find relevant courses ",
        "interaction_14": "Used by Helpdesk::Ticket (Model) as an optional association ",
        "interaction_15": "Used by HelpdeskController to determine course association ",
        "interaction_16": "Used by IcalController to fetch next dates ",
        "interaction_17": "Used by LearningModeController for course-specific context ",
        "interaction_18": "Used by UsersController for teacher information ",
        "interaction_19": "Used by Home::GoController to fetch course details ",
        "interaction_20": "Used by Home::HomeController for homepage course loading ",
        "interaction_21": "Used by Voucher::ProductTypes::Proctoring to check proctored status ",
        "interaction_22": "Used by Course::Enrollment::Proctoring for course context ",
        "interaction_23": "Fetched by `Course::CoursesController`, `ItemsController`, `SectionsController`, `CourseContextHelper` [Source: app/controllers/course/courses_controller.rb, app/controllers/items_controller.rb, app/controllers/sections_controller.rb, app/helpers/course_context_helper.rb]",
        "interaction_24": "Provides attributes like `id`, `course_code`, `title`, `sections`, `items`, `published`, `context_id`, `pinboard_enabled`, `forum_is_locked`, `lang`, `legacy?`, `node` [Source: app/controllers/course/courses_controller.rb, app/controllers/items_controller.rb, app/controllers/sections_controller.rb, app/presenters/item_presenter.rb, app/helpers/course_context_helper.rb]",
        "interaction_25": "Queried by DashboardController. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_26": "Used by `Course::CoursesController`, `CourseContextHelper`, `CourseInfoPresenter`, `CoursePresenter`, `Home::CourseCard` and others to fetch course data.",
        "interaction_27": "Provides methods for checking course availability (`was_available?`, `published?`).",
        "interaction_28": "Exposes relations like `sections`, `items`, `enrollments`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/courses_controller.rb",
          "app/helpers/course_context_helper.rb",
          "services/course/README.md",
          "app/controllers/items_controller.rb",
          "app/controllers/sections_controller.rb",
          "app/presenters/item_presenter.rb",
          "app/controllers/dashboard_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Xikolo::Course::Section": {
      "type": "Microservice Client",
      "description": "Represents a section within a course, fetched from the `Xikolo::CourseService` microservice. Contains information about its title, position, description, and associated items.",
      "interactions": {
        "interaction_0": "Used by Course::ProgressController for course progress ",
        "interaction_1": "Used by Course::SyllabusController for syllabus display ",
        "interaction_2": "Used by QuestionController for section-scoped questions ",
        "interaction_3": "Fetched by `Course::CoursesController`, `ItemsController`, `SectionsController`, `CourseContextHelper` [Source: app/controllers/course/courses_controller.rb, app/controllers/items_controller.rb, app/controllers/sections_controller.rb, app/helpers/course_context_helper.rb]",
        "interaction_4": "Created and updated by `SectionsController` [Source: app/controllers/sections_controller.rb]",
        "interaction_5": "Provides attributes like `id`, `title`, `description`, `published`, `alternative_state`, `parent_id`, `required_section_ids`, `course_id`, `effective_start_date`, `effective_end_date` [Source: app/controllers/sections_controller.rb, app/presenters/section_presenter.rb, app/helpers/course_context_helper.rb]",
        "interaction_6": "Used by `SectionsController` for CRUD operations on sections.",
        "interaction_7": "Used by `CourseContextHelper` to fetch the current section.",
        "interaction_8": "Used by `Item::Create` to associate items with sections."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/sections_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/operations/item/create.rb",
          "app/controllers/course/courses_controller.rb",
          "app/controllers/items_controller.rb",
          "app/presenters/section_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Xikolo::Course::Item": {
      "type": "Microservice Client",
      "description": "Represents a learning item within a section, fetched from the `Xikolo::CourseService` microservice. Contains details about its content type, title, dates, and prerequisites.",
      "interactions": {
        "interaction_0": "Used by Course::ProgressController for course progress ",
        "interaction_1": "Used by Course::SyllabusController for syllabus display ",
        "interaction_2": "Used by Course::Admin::ItemTimeEffortController for item context ",
        "interaction_3": "Used by _time_effort.html.slim (View / Frontend Component) for time effort display ",
        "interaction_4": "Used by Xikolo::TimeEffort Microservice (Client Proxy) for item time effort data ",
        "interaction_5": "Fetched by `Course::CoursesController`, `ItemsController`, `CourseContextHelper` [Source: app/controllers/course/courses_controller.rb, app/controllers/items_controller.rb, app/helpers/course_context_helper.rb]",
        "interaction_6": "Created and updated by `ItemsController` [Source: app/controllers/items_controller.rb]",
        "interaction_7": "Provides attributes like `id`, `content_id`, `content_type`, `title`, `max_points`, `optional`, `position`, `section_id`, `featured`, `public_description`, `open_mode`, `time_effort`, `required_item_ids`, `published`, `exercise_type`, `effective_start_date`, `effective_end_date`, `user_state` [Source: app/controllers/items_controller.rb, app/presenters/item_presenter.rb, app/helpers/course_context_helper.rb]",
        "interaction_8": "Used by `ItemsController` for CRUD operations on items.",
        "interaction_9": "Used by `CourseContextHelper` to fetch the current item.",
        "interaction_10": "Used by `Item::Create` to create new items.",
        "interaction_11": "Provides attributes like `content_type`, `content_id`, `open_mode`, `featured`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/operations/item/create.rb",
          "app/controllers/course/courses_controller.rb",
          "app/presenters/item_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Xikolo::Course::Visit": {
      "type": "Microservice Client",
      "description": "A client-side representation of the Visit resource from the `Xikolo::CourseService` microservice. Used to record user visits to course items for progress tracking.",
      "interactions": {
        "interaction_0": "Used by Course::Statistics to query visit records ",
        "interaction_1": "Created by `ItemContextHelper#create_visit!` [Source: app/helpers/item_context_helper.rb]",
        "interaction_2": "Created by `ItemContextHelper#create_visit!` when a user views an item."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/item_context_helper.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Lti::Exercise": {
      "type": "Model",
      "description": "An ActiveRecord model representing an LTI exercise, used as a content type for course items. It stores details like custom fields, instructions, and LTI provider ID.",
      "interactions": {
        "interaction_0": "Used by Item::Create as a content resource ",
        "interaction_1": "Used by LtiController for LTI tool launch ",
        "interaction_2": "Used by Lti::Gradebook for grade management ",
        "interaction_3": "Referenced by `LtiExerciseItemPresenter` to retrieve exercise details and instructions [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_4": "Has a `provider` association [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_5": "Associated with Course::Item. [Source: app/presenters/lti_exercise_item_presenter.rb]",
        "interaction_6": "Interacted with by Lti::Exercise::Store. [Source: app/operations/lti/exercise/store.rb]",
        "interaction_7": "Interacted with by LtiExerciseItemPresenter. [Source: app/presenters/lti_exercise_item_presenter.rb]",
        "interaction_8": "Linked to `Lti::Gradebook` entries for grade tracking.",
        "interaction_9": "Used by `ItemsController` when creating or editing LTI exercise items.",
        "interaction_10": "Interacts with `Lti::Exercise::Store` for persistence.",
        "interaction_11": "Created, updated, and fetched by `ItemsController` for LTI exercise content [Source: app/controllers/items_controller.rb]",
        "interaction_12": "Interacts with `Lti::Provider` for LTI provider details [Source: app/controllers/items_controller.rb]",
        "interaction_13": "Associated with `Course::Item` as its content.",
        "interaction_14": "Managed by `Lti::Exercise::Store` for creation and updates, especially for `instructions`.",
        "interaction_15": "Referenced by `LtiExerciseItemPresenter` to display exercise details and instructions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/operations/lti/exercise/store.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "app/controllers/lti_controller.rb",
          "spec/operations/lti/exercise/store_spec.rb",
          "spec/presenters/lti_exercise_item_presenter_spec.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation",
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Video::Video": {
      "type": "Model",
      "description": "Represents a video asset within the Xikolo platform. It stores metadata such as description, references to various stream types (PIP, lecturer, slides, subtitled), thumbnail, and URLs for supplementary materials like slides, transcripts, reading material, and audio.",
      "interactions": {
        "interaction_0": "Used by Item::Create as a content resource ",
        "interaction_1": "Used by VideoItemTopicPresenter for discussion topics ",
        "interaction_2": "Used by TransPipeBridgeAPI for video details ",
        "interaction_3": "Accessed by `VideoItemPresenter` and `VideoPresenter` for UI display.",
        "interaction_4": "Used by `Video::PlaylistsController` and `M3u8Playlist` to retrieve video-specific information for playlist generation.",
        "interaction_5": "Contains `subtitles` association (inferred from `M3u8Playlist`).",
        "interaction_6": "Used by `ItemsController` when creating or editing video items.",
        "interaction_7": "Used by `Course::Visual::Store` for managing teaser videos.",
        "interaction_8": "Interacts with `Video::Store` for persistence and file management.",
        "interaction_9": "Created, updated, and fetched by `ItemsController` for video content [Source: app/controllers/items_controller.rb]",
        "interaction_10": "Interacts with `Video::Store` for video storage operations [Source: app/controllers/items_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/operations/course/visual/store.rb",
          "app/presenters/video_item_presenter.rb",
          "app/presenters/video_presenter.rb",
          "app/controllers/video/playlists_controller.rb",
          "app/lib/m3u8_playlist.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation",
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Course::Richtext": {
      "type": "Model",
      "description": "Represents rich text content within a course, typically linked to a `Course::Item`. Manages S3 file references embedded in the text and handles conditional deletion of S3 objects upon destruction.",
      "interactions": {
        "interaction_0": "Used by Item::Create as a content resource ",
        "interaction_1": "Interacts with `Course::Richtext::Store` for persistence and file management.",
        "interaction_2": "Created, updated, and fetched by `ItemsController` for rich text content [Source: app/controllers/items_controller.rb]",
        "interaction_3": "Interacts with `Course::Richtext::Store` for rich text storage operations [Source: app/controllers/items_controller.rb]",
        "interaction_4": "Belongs to Course::Course. [Source: app/models/course/richtext.rb]",
        "interaction_5": "Has one Course::Item. [Source: app/models/course/richtext.rb]",
        "interaction_6": "Uses Xikolo::S3::Markup. [Source: app/models/course/richtext.rb]",
        "interaction_7": "Schedules S3FileDeletionJob. [Source: app/models/course/richtext.rb]",
        "interaction_8": "Interacted with by Course::Richtext::Store. [Source: app/operations/course/richtext/store.rb]",
        "interaction_9": "Used by `ItemsController` when creating or editing rich text items.",
        "interaction_10": "Belongs to `Course::Course`.",
        "interaction_11": "Has one `Course::Item` polymorphically as its content.",
        "interaction_12": "Uses `Xikolo::S3::Markup` for its `text` attribute to manage S3 file references.",
        "interaction_13": "Schedules `S3FileDeletionJob` for referenced S3 objects upon destruction, after checking for other references.",
        "interaction_14": "Interacts with `Course::Richtext::Store` for creation and updates."
      },
      "techDebt": [
        "The `referenced?` method uses `LIKE` queries on text columns, which could be a performance bottleneck for large datasets. Consider leveraging `pg_trgm` for faster lookups if performance becomes an issue."
      ],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/operations/course/richtext/store.rb",
          "app/models/course/richtext.rb",
          "spec/models/course/richtext_spec.rb",
          "integration/features/xikolo/content/richtexts/create_richtext_item.feature",
          "cluster:02_CORE_CourseContent",
          "cluster:04_CORE_CourseNavigation",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "04_CORE_CourseNavigation",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Admin::Announcement::RecipientsController": {
      "type": "Controller",
      "description": "An AJAX controller responsible for providing a list of potential recipients (users, courses, groups) for announcement emails to the frontend. It fetches data from the Account and Course microservices and caches the results.",
      "interactions": {
        "interaction_0": "Authorizes 'news.announcement.send' permission.",
        "interaction_1": "Fetches user data from Xikolo::Account service via `account_api.rel(:users).get`.",
        "interaction_2": "Fetches course data from Xikolo::CourseService via `Xikolo.api(:course).value!.rel(:courses).get`.",
        "interaction_3": "Fetches group data (access, content_test, custom_recipients) from Xikolo::Account service via `account_api.rel(:groups).get`.",
        "interaction_4": "Caches API responses using `Rails.cache`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement/recipients_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailsController": {
      "type": "Controller",
      "description": "Manages the creation and viewing of announcement emails. It interacts with the NewsService to send and retrieve email-related data.",
      "interactions": {
        "interaction_0": "Requires 'admin_announcements' feature.",
        "interaction_1": "Interacts with Xikolo::NewsService via `news_service` to get announcement and message details.",
        "interaction_2": "Uses `Admin::AnnouncementEmailForm` for creating new email messages.",
        "interaction_3": "Uses `Admin::AnnouncementEmailPresenter` to display email details.",
        "interaction_4": "Handles `Restify::UnprocessableEntity` errors during email creation."
      },
      "techDebt": [
        "Missing permission check for the `show` action. [Source: app/controllers/admin/announcement_emails_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement_emails_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementsController": {
      "type": "Controller",
      "description": "Handles CRUD operations for general announcements within the admin interface. It manages drafts and published announcements.",
      "interactions": {
        "interaction_0": "Requires 'admin_announcements' feature.",
        "interaction_1": "Authorizes 'news.announcement.create' and 'news.announcement.update' permissions.",
        "interaction_2": "Interacts with Xikolo::NewsService via `news_service` to fetch, create, update announcements.",
        "interaction_3": "Uses `Admin::AnnouncementForm` for announcement data input.",
        "interaction_4": "Uses `Admin::AnnouncementsListPresenter` to display lists of announcements.",
        "interaction_5": "Handles `Restify::UnprocessableEntity` errors during creation and update."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcements_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "AnnouncementsController": {
      "type": "Controller",
      "description": "Handles administrative CRUD operations for announcements (create, read, update, delete). It enforces permissions and interacts with the 'news' microservice for data persistence and email sending.",
      "interactions": {
        "interaction_0": "Requires 'announcements' feature.",
        "interaction_1": "Authorizes 'news.announcement.create', 'news.announcement.update', 'news.announcement.delete', 'news.announcement.send', 'news.announcement.send_test' permissions.",
        "interaction_2": "Interacts with Xikolo::NewsService via `news_service` to manage news items and send emails.",
        "interaction_3": "Uses `Admin::NewsForm` for news item data input.",
        "interaction_4": "Sends emails via `announcement.rel(:email).post` based on user permissions and parameters.",
        "interaction_5": "Handles `Restify::UnprocessableEntity` errors.",
        "interaction_6": "Authorizes actions using `authorize!` and `current_user.allowed?` based on permissions like `news.announcement.create`, `news.announcement.update`, `news.announcement.delete`, `news.announcement.send`, `news.announcement.send_test` .",
        "interaction_7": "Uses `Admin::NewsForm` for data binding and validation of announcement attributes [Source: app/controllers/announcements_controller.rb, app/forms/admin/news_form.rb].",
        "interaction_8": "Interacts with the `news` microservice (`Xikolo.api(:news)`) to create, fetch, update, and delete announcements [Source: app/controllers/announcements_controller.rb].",
        "interaction_9": "Sends email notifications (test or full) via the `news` microservice's email endpoint if `send_emails?` is true [Source: app/controllers/announcements_controller.rb].",
        "interaction_10": "Handles `Restify::UnprocessableEntity` errors from the `news` service for remote validation failures [Source: app/controllers/announcements_controller.rb]."
      },
      "techDebt": [
        "The `send_emails?` and `email_params` methods contain conditional logic for sending test vs. full emails. This could be refactored into a dedicated service object for better separation of concerns if email notification requirements become more complex [Source: app/controllers/announcements_controller.rb]."
      ],
      "provenance": {
        "sources": [
          "app/controllers/announcements_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Home::AnnouncementsController": {
      "type": "Controller",
      "description": "Manages the public display of announcements, fetching them from the 'news' microservice and preparing them for rendering.",
      "interactions": {
        "interaction_0": "Requires 'announcements' feature.",
        "interaction_1": "Interacts with Xikolo::NewsService via `Xikolo.api(:news).value!.rel(:posts).get` to fetch news posts.",
        "interaction_2": "Filters posts based on user permissions: regular users see published posts, privileged users (with 'news.announcement.show' permission) can see unpublished posts.",
        "interaction_3": "Uses `AnnouncementPresenter` to format posts for display.",
        "interaction_4": "Sets meta tags for the page.",
        "interaction_5": "Checks for the 'announcements' feature flag [Source: app/controllers/home/announcements_controller.rb].",
        "interaction_6": "Fetches announcement posts from the `news` microservice (`Xikolo.api(:news).rel(:posts).get`) [Source: app/controllers/home/announcements_controller.rb].",
        "interaction_7": "Adjusts query parameters (`published`, `user_id`, `language`) based on `current_user` login status and `news.announcement.show` permission [Source: app/controllers/home/announcements_controller.rb, spec/requests/announcements/index_spec.rb].",
        "interaction_8": "Maps raw post resources to `AnnouncementPresenter` instances for display [Source: app/controllers/home/announcements_controller.rb, app/presenters/announcement_presenter.rb].",
        "interaction_9": "Sets meta tags for the page title [Source: app/controllers/home/announcements_controller.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/announcements_controller.rb",
          "spec/requests/announcements/index_spec.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailForm": {
      "type": "Form",
      "description": "A form object for creating and editing announcement emails, including recipient selection and multi-language content.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo Account Service to fetch consent treatments ",
        "interaction_1": "Uses `RecipientsArray` processor to transform recipient IDs to URNs for the NewsService.",
        "interaction_2": "Uses `TranslationsArray` processor to manage default and additional language translations.",
        "interaction_3": "Validates presence of subject, content, and recipients.",
        "interaction_4": "Fetches user and group details for recipient display from Xikolo::Account service.",
        "interaction_5": "Fetches course titles from `Course::Course` model for recipient display.",
        "interaction_6": "Fetches consent treatments from Xikolo::Account service.",
        "interaction_7": "Contains nested `Translation` subforms for subject and content in different languages."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_email_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailForm::Translation": {
      "type": "Form (Nested)",
      "description": "A subform for handling translated subject and content of an announcement email.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_email_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailForm::RecipientsArray": {
      "type": "Form Processor",
      "description": "Transforms recipient identifiers (e.g., 'user:ID', 'group:NAME') between the UI format and URNs expected by the NewsService API.",
      "interactions": {
        "interaction_0": "Processes `recipients` attribute for `Admin::AnnouncementEmailForm`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_email_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailForm::TranslationsArray": {
      "type": "Form Processor",
      "description": "Manages the structure of translations for `Admin::AnnouncementEmailForm`, converting between a flat structure and a nested hash for the NewsService API.",
      "interactions": {
        "interaction_0": "Processes `translations` attribute for `Admin::AnnouncementEmailForm`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_email_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementForm": {
      "type": "Form",
      "description": "A form object for creating and editing general announcements, supporting multi-language content.",
      "interactions": {
        "interaction_0": "Contains nested `Translation` subforms for subject and content in different languages.",
        "interaction_1": "Uses `TranslationsArray` processor to manage default and additional language translations.",
        "interaction_2": "Validates presence of subject and content."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementForm::Translation": {
      "type": "Form (Nested)",
      "description": "A subform for handling translated subject and content of a general announcement.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementForm::TranslationsArray": {
      "type": "Form Processor",
      "description": "Manages the structure of translations for `Admin::AnnouncementForm`, converting between a flat structure and a nested hash for the NewsService API.",
      "interactions": {
        "interaction_0": "Processes `translations` attribute for `Admin::AnnouncementForm`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/announcement_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::NewsForm": {
      "type": "Form",
      "description": "Encapsulates the data, validations, and resource transformation logic for creating and updating announcements in the admin interface, including handling multilingual translations.",
      "interactions": {
        "interaction_0": "Contains nested `Translation` subforms for title and text in different languages.",
        "interaction_1": "Uses `TranslationsArray` processor to manage translations.",
        "interaction_2": "Validates presence of title, publish_at, and text.",
        "interaction_3": "Provides an `audience_collection` based on `Xikolo.config.access_groups`.",
        "interaction_4": "Inherits from `XUI::Form` [Source: app/forms/admin/news_form.rb].",
        "interaction_5": "Defines attributes for announcement properties like `title`, `text`, `publish_at`, `language`, `visual_url`, `audience`, and `translations` [Source: app/forms/admin/news_form.rb].",
        "interaction_6": "Includes nested `Translation` subforms for managing multilingual content [Source: app/forms/admin/news_form.rb].",
        "interaction_7": "Performs validations for presence of `title`, `publish_at`, `text`, and a custom validation `title_and_text?` for translations [Source: app/forms/admin/news_form.rb].",
        "interaction_8": "Uses a `TranslationsArray` processor to convert translation data between form and resource formats for the `news` microservice [Source: app/forms/admin/news_form.rb]."
      },
      "techDebt": [
        "The `TranslationsArray` class is a nested class within `Admin::NewsForm`. If similar translation handling is required across many forms, extracting this logic into a reusable module or dedicated class could improve modularity and prevent duplication [Source: app/forms/admin/news_form.rb]."
      ],
      "provenance": {
        "sources": [
          "app/forms/admin/news_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::NewsForm::Translation": {
      "type": "Form (Nested)",
      "description": "Represents a single translation for an announcement within the `Admin::NewsForm`.",
      "interactions": {
        "interaction_0": "Defines attributes for `title`, `text`, and `language` of a translation [Source: app/forms/admin/news_form.rb].",
        "interaction_1": "Used as a `subtype` for the `translations` attribute in `Admin::NewsForm` [Source: app/forms/admin/news_form.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/news_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::NewsForm::TranslationsArray": {
      "type": "Form Processor",
      "description": "Manages the structure of translations for `Admin::NewsForm`, converting between a flat structure and a nested hash for the NewsService API.",
      "interactions": {
        "interaction_0": "Processes `translations` attribute for `Admin::NewsForm`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/admin/news_form.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Alert": {
      "type": "Model",
      "description": "An ActiveRecord model representing system-wide alerts, which are similar in concept to announcements. It stores translated content and manages publication dates.",
      "interactions": {
        "interaction_0": "Uses `translations` (likely a JSONB or hstore column) to store multi-language content.",
        "interaction_1": "Defines scopes `by_publication_date` and `published` for filtering.",
        "interaction_2": "Ensures a default translation exists via `default_translation_exists` validation.",
        "interaction_3": "Is queried by `Navigation::SystemAlerts` to retrieve active alerts.",
        "interaction_4": "Stores localized content in a `jsonb` column, accessed via the nested `Translation` class.",
        "interaction_5": "Used by Navigation::SystemAlerts (Ruby View Component). [Source: app/components/navigation/system_alerts.rb]",
        "interaction_6": "Validates against Xikolo.config. [Source: app/models/alert.rb]",
        "interaction_7": "Defines `published` scope to filter alerts that are currently active based on `publish_at` and `publish_until` timestamps [Source: app/models/alert.rb].",
        "interaction_8": "Validates the presence of a default translation based on `Xikolo.config.locales['default']` [Source: app/models/alert.rb].",
        "interaction_9": "Stores translations in a `translations` column (likely `jsonb` or `hstore`) [Source: app/models/alert.rb].",
        "interaction_10": "Includes a nested `Translation` class for structured access to localized title and text [Source: app/models/alert.rb]."
      },
      "techDebt": [
        "Storing translations in a `jsonb`/`hstore` column is flexible but might lack strong schema enforcement for complex multi-language content compared to dedicated translation tables or a more structured approach [Source: app/models/alert.rb]."
      ],
      "provenance": {
        "sources": [
          "app/models/alert.rb",
          "spec/models/alert_spec.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Alert::Translation": {
      "type": "Model (Nested)",
      "description": "A nested class within `Alert` to provide convenient access to translated title and text content for a specific locale.",
      "interactions": {
        "interaction_0": "Initializes with a locale and data hash, providing `title` and `text` methods.",
        "interaction_1": "Instantiated by `Alert#try_translation` to encapsulate localized alert data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/alert.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementEmailPresenter": {
      "type": "Presenter",
      "description": "Formats and presents data related to an announcement's email notification for administrative views, including delivery statistics and sender/author information.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::NewsService to get announcement and email resources ",
        "interaction_1": "Fetches author and sender details asynchronously from Xikolo::Account service.",
        "interaction_2": "Calculates delivery percentages and open rates.",
        "interaction_3": "Formats dates and recipient lists.",
        "interaction_4": "Initializes with announcement and email resources [Source: app/presenters/admin/announcement_email_presenter.rb].",
        "interaction_5": "Asynchronously fetches author and sender user details from the `account` microservice (`Xikolo.api(:account)`) [Source: app/presenters/admin/announcement_email_presenter.rb].",
        "interaction_6": "Calculates and provides email delivery percentages and open percentages [Source: app/presenters/admin/announcement_email_presenter.rb]."
      },
      "techDebt": [
        "Counts for `disabled_deliveries` and `error_deliveries` are not yet implemented. [Source: app/presenters/admin/announcement_email_presenter.rb]",
        "The comments indicate that counts for `disabled_deliveries` and `error_deliveries` are not yet fully implemented or provided by the `news` service, leading to potential gaps in email delivery reporting [Source: app/presenters/admin/announcement_email_presenter.rb]."
      ],
      "provenance": {
        "sources": [
          "app/presenters/admin/announcement_email_presenter.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementPresenter": {
      "type": "Presenter",
      "description": "Presents information about a general announcement for display in the admin list, including its publication channels and links to email management.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::NewsService to get announcement resources ",
        "interaction_1": "Determines if the announcement is published to a blog or email channel.",
        "interaction_2": "Provides paths for blog display, email creation, and email statistics.",
        "interaction_3": "Initializes with an announcement resource [Source: app/presenters/admin/announcement_presenter.rb].",
        "interaction_4": "Provides formatted `created_at` and `title` [Source: app/presenters/admin/announcement_presenter.rb].",
        "interaction_5": "Indicates publication channels (`blog`, `email`) and generates relevant paths (e.g., `blog_path`, `email_create_path`, `email_stats_path`) [Source: app/presenters/admin/announcement_presenter.rb]."
      },
      "techDebt": [
        "The `email_status` is hardcoded to 'sending'. [Source: app/presenters/admin/announcement_presenter.rb]"
      ],
      "provenance": {
        "sources": [
          "app/presenters/admin/announcement_presenter.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Admin::AnnouncementsListPresenter": {
      "type": "Presenter",
      "description": "A presenter that wraps a collection of `Admin::AnnouncementPresenter` objects, providing pagination capabilities for the admin announcement list.",
      "interactions": {
        "interaction_0": "Delegates iteration (`each`, `any?`) to the underlying collection of `Admin::AnnouncementPresenter` instances.",
        "interaction_1": "Uses `RestifyPaginationCollection` for pagination.",
        "interaction_2": "Delegates iteration methods (`each`, `any?`) to the underlying collection [Source: app/presenters/admin/announcements_list_presenter.rb].",
        "interaction_3": "Uses `RestifyPaginationCollection` for handling pagination metadata from the `news` service [Source: app/presenters/admin/announcements_list_presenter.rb].",
        "interaction_4": "Maps raw announcement resources to `Admin::AnnouncementPresenter` instances [Source: app/presenters/admin/announcements_list_presenter.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/announcements_list_presenter.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "AnnouncementPresenter": {
      "type": "Presenter",
      "description": "Presents public-facing details of a news or announcement item, including title, text, teaser, publication date, and visual URL.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::NewsService to get news resources ",
        "interaction_1": "Uses `HtmlTruncator` and `MarkdownHelper` to generate a `teaser` from the full text.",
        "interaction_2": "Created by `Home::HomeController#posts`.",
        "interaction_3": "Includes `MarkdownHelper` to render markdown content [Source: app/presenters/announcement_presenter.rb].",
        "interaction_4": "Uses `HtmlTruncator` to generate a `teaser` from the rendered markdown text [Source: app/presenters/announcement_presenter.rb].",
        "interaction_5": "Initializes with a news resource [Source: app/presenters/announcement_presenter.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/announcement_presenter.rb",
          "app/controllers/home/home_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Middleware::NewsTracker": {
      "type": "Middleware",
      "description": "A Rack middleware that tracks when users view announcements by sending an asynchronous request to the NewsService.",
      "interactions": {
        "interaction_0": "Intercepts HTTP requests to check for 'news' tracking parameters (`tracking_type`, `tracking_id`, `tracking_user`).",
        "interaction_1": "Sends an asynchronous POST request to `Xikolo.api(:news).value!.rel(:visits)` to mark an announcement as read, without blocking the main request-response cycle.",
        "interaction_2": "Intercepts incoming requests. [Source: config/application.rb]",
        "interaction_3": "Performs custom tracking logic for news-related operations. [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "lib/middleware/news_tracker.rb",
          "config/application.rb",
          "cluster:20_COMM_Announcements",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "20_COMM_Announcements",
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo::NewsService": {
      "type": "Microservice",
      "description": "An API-only Ruby on Rails microservice responsible for managing and serving global and course-specific news and announcements. It provides endpoints for creating, retrieving, updating, and deleting news items and potentially handles their distribution, including email notifications. ",
      "interactions": {
        "interaction_0": "Exposed via Xikolo::News::Application.routes (Microservice Routing) ",
        "interaction_1": "Handles email sending for announcements.",
        "interaction_2": "Processes tracking requests to mark announcements as read.",
        "interaction_3": "Provides translated content for emails. ",
        "interaction_4": "Communicates with `Xikolo::Account` service to potentially retrieve user or account-related information. ",
        "interaction_5": "Communicates with `Xikolo::CourseService` to associate news with specific courses or retrieve course details. ",
        "interaction_6": "Utilizes RabbitMQ (`msgr` gem) for inter-service communication. ",
        "interaction_7": "Sends emails, potentially using custom branded templates and stylesheets. ",
        "interaction_8": "Persists data in PostgreSQL. ",
        "interaction_9": "Leverages `xikolo-sidekiq` for background job processing. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement_emails_controller.rb",
          "app/controllers/admin/announcements_controller.rb",
          "app/controllers/announcements_controller.rb",
          "app/controllers/home/announcements_controller.rb",
          "lib/middleware/news_tracker.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Xikolo::Account": {
      "type": "Microservice",
      "description": "An API-only Rails microservice providing user and group management. It is leveraged by the main application to retrieve recipient information and user details for announcements.",
      "interactions": {
        "interaction_0": "Receives requests from NotificationUserDisablesController to update user preferences ",
        "interaction_1": "Receives requests from UsersController for user data and password changes ",
        "interaction_2": "Receives requests from SessionHelper to delete user sessions ",
        "interaction_3": "Receives requests from IcalController to retrieve user language ",
        "interaction_4": "Receives requests from Admin::Ajax::PlatformStatisticsController for user statistics ",
        "interaction_5": "Receives requests from Admin::Ajax::UsersController to fetch user details ",
        "interaction_6": "Receives requests from VoucherPresenter to fetch claimant details ",
        "interaction_7": "Receives requests from ApplicationController for user session management ",
        "interaction_8": "Provides user data (name, email) for announcement recipient selection.",
        "interaction_9": "Provides group data (access, content_test, custom_recipients) for recipient selection.",
        "interaction_10": "Provides user details (full name) for displaying author and sender information in announcement emails.",
        "interaction_11": "Provides consent treatment information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement/recipients_controller.rb",
          "app/forms/admin/announcement_email_form.rb",
          "app/presenters/admin/announcement_email_presenter.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Xikolo::CourseService": {
      "type": "Microservice",
      "description": "An API-only Rails microservice managing course-related data. It is used by the main application to retrieve course information for announcement recipient selection.",
      "interactions": {
        "interaction_0": "Receives requests from Admin::Ajax::ClassifiersController to query classifiers ",
        "interaction_1": "Provides course data (title, course_code) for announcement recipient selection."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement/recipients_controller.rb",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "PinboardCommentController": {
      "type": "Controller",
      "description": "Handles CRUD operations for pinboard comments, including abuse reporting, blocking, and unblocking. It interacts with the `pinboard` microservice via `Xikolo::Pinboard::Comment` and `Xikolo::Pinboard::AbuseReport`.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Pinboard::Comment (ACFS resource) for comment data.",
        "interaction_1": "Interacts with Xikolo::Pinboard::Answer (ACFS resource) to retrieve answers for comments.",
        "interaction_2": "Interacts with Xikolo::Pinboard::AbuseReport (ACFS resource) for reporting.",
        "interaction_3": "Uses `current_user` for authorization and user identification.",
        "interaction_4": "Leverages `Acfs.run` to execute API calls.",
        "interaction_5": "Uses `PinboardRoutesHelper` for generating redirect paths.",
        "interaction_6": "Interacts with Xikolo::Pinboard::Comment for comment data manipulation [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_7": "Interacts with Xikolo::Pinboard::Answer to find parent answers for comments [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_8": "Interacts with Xikolo::Pinboard::AbuseReport to create new abuse reports [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_9": "Uses Acfs.run to execute asynchronous API calls to the Pinboard microservice [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_10": "Utilizes CourseContextHelper for course context and PinboardRoutesHelper for dynamic routing [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_11": "Performs authorization checks using `authorize!` [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_12": "Creates, updates, and deletes comments via `Xikolo::Pinboard::Comment` [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_13": "Finds comments and answers via `Xikolo::Pinboard::Comment.find` and `Xikolo::Pinboard::Answer.find` [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_14": "Creates abuse reports via `Xikolo::Pinboard::AbuseReport.new` [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_15": "Publishes notifications (though the `notification_params` has a TODO) [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_16": "Uses `CourseContextHelper` for course context [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_17": "Uses `PinboardRoutesHelper` for dynamic routing [Source: app/controllers/pinboard_comment_controller.rb].",
        "interaction_18": "Authorizes actions using `authorize!` [Source: app/controllers/pinboard_comment_controller.rb]."
      },
      "techDebt": [
        "Redirect logic in `create` and `notification_params` incorrectly references question ID for answers, leading to potential confusion or bugs.",
        "Ambiguous ID referencing in `create` and `notification_params` methods: \"both these id reference the QUESTION, I have no idea why...\" [Source: app/controllers/pinboard_comment_controller.rb].",
        "Ambiguity in ID handling: 'both these id reference the QUESTION, I have no idea why...' in `create` and `notification_params` methods [Source: app/controllers/pinboard_comment_controller.rb].",
        "Temporary notification URL: 'TODO: remove question_path once all consumer are rolled out' in `notification_params` [Source: app/controllers/pinboard_comment_controller.rb]."
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_comment_controller.rb",
          "spec/controllers/pinboard_comment_controller_spec.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardController": {
      "type": "Controller",
      "description": "Manages the main pinboard index page, displaying questions (topics) for a course or specific section. It handles filtering by tags and sections, and displays the new question form.",
      "interactions": {
        "interaction_0": "Accesses `the_course` for course context.",
        "interaction_1": "Uses `current_user` for user-specific data and permissions.",
        "interaction_2": "Interacts with `Xikolo.api(:pinboard)` to fetch pinboard data.",
        "interaction_3": "Fetches course subscriptions via `Xikolo::Pinboard::CourseSubscription` (ACFS resource).",
        "interaction_4": "Retrieves implicit tags via `Xikolo::Pinboard::ImplicitTag` (ACFS resource).",
        "interaction_5": "Creates new questions using `Xikolo::Pinboard::Question` (ACFS resource).",
        "interaction_6": "Fetches explicit tags via `Xikolo::Pinboard::ExplicitTag` (ACFS resource).",
        "interaction_7": "Retrieves course sections via `Xikolo::Course::Section` (ACFS resource, likely from CourseService).",
        "interaction_8": "Leverages `Acfs.run` for API calls.",
        "interaction_9": "Uses `PinboardPresenter` to prepare data for the view.",
        "interaction_10": "Utilizes `PinboardRoutesHelper` for dynamic route generation.",
        "interaction_11": "Uses `PinboardHelper` for upload configurations.",
        "interaction_12": "Fetches course subscriptions from Xikolo.api(:pinboard) [Source: app/controllers/pinboard_controller.rb].",
        "interaction_13": "Retrieves implicit tags from Xikolo::Pinboard::ImplicitTag [Source: app/controllers/pinboard_controller.rb].",
        "interaction_14": "Retrieves explicit tags from Xikolo::Pinboard::ExplicitTag [Source: app/controllers/pinboard_controller.rb].",
        "interaction_15": "Fetches course sections from Xikolo::Course::Section [Source: app/controllers/pinboard_controller.rb].",
        "interaction_16": "Uses PinboardPresenter to prepare data for the view [Source: app/controllers/pinboard_controller.rb].",
        "interaction_17": "Initializes new Xikolo::Pinboard::Question objects for the creation form [Source: app/controllers/pinboard_controller.rb].",
        "interaction_18": "Utilizes CourseContextHelper, PinboardRoutesHelper, and PinboardHelper [Source: app/controllers/pinboard_controller.rb].",
        "interaction_19": "Interacts with Xikolo.config to check for disabled features like 'technical issues' section [Source: app/controllers/pinboard_controller.rb].",
        "interaction_20": "Fetches course details via `the_course` [Source: app/controllers/pinboard_controller.rb].",
        "interaction_21": "Fetches course subscriptions via `Xikolo.api(:pinboard).rel(:course_subscriptions)` [Source: app/controllers/pinboard_controller.rb].",
        "interaction_22": "Fetches implicit and explicit tags via `Xikolo::Pinboard::ImplicitTag` and `Xikolo::Pinboard::ExplicitTag` [Source: app/controllers/pinboard_controller.rb].",
        "interaction_23": "Fetches sections via `Xikolo::Course::Section` [Source: app/controllers/pinboard_controller.rb].",
        "interaction_24": "Fetches questions (topics) via `pinboard_api.rel(:questions)` [Source: app/controllers/pinboard_controller.rb].",
        "interaction_25": "Uses `CourseContextHelper` for course context [Source: app/controllers/pinboard_controller.rb].",
        "interaction_26": "Uses `PinboardRoutesHelper` for dynamic routing [Source: app/controllers/pinboard_controller.rb].",
        "interaction_27": "Uses `PinboardHelper` for utility methods [Source: app/controllers/pinboard_controller.rb].",
        "interaction_28": "Uses `PinboardPresenter` for display logic [Source: app/controllers/pinboard_controller.rb].",
        "interaction_29": "Uses `SectionPresenter` for section-related logic [Source: app/controllers/pinboard_controller.rb].",
        "interaction_30": "Checks `Xikolo.config` for `disable_technical_issues_section` [Source: app/controllers/pinboard_controller.rb]."
      },
      "techDebt": [
        "`questions_per_page` is hardcoded with a TODO to adjust it."
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "spec/controllers/pinboard_controller_spec.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "QuestionController": {
      "type": "Controller",
      "description": "Manages the lifecycle of questions, including creation, viewing, editing, updating, deletion, voting, accepting answers, closing/reopening, abuse reporting, and blocking/unblocking. It orchestrates the display of questions, answers, and comments.",
      "interactions": {
        "interaction_0": "Accesses `the_course` for course context.",
        "interaction_1": "Uses `current_user` for user-specific data, permissions, and voting.",
        "interaction_2": "Interacts with `Xikolo.api(:pinboard)` and `Xikolo.api(:course)` for data retrieval.",
        "interaction_3": "Manages questions via `Xikolo::Pinboard::Question` (ACFS resource).",
        "interaction_4": "Manages answers via `Xikolo::Pinboard::Answer` (ACFS resource).",
        "interaction_5": "Manages comments via `Xikolo::Pinboard::Comment` (ACFS resource).",
        "interaction_6": "Handles voting via `Xikolo::Pinboard::Vote` (ACFS resource).",
        "interaction_7": "Manages subscriptions via `Xikolo::Pinboard::Subscription` (ACFS resource).",
        "interaction_8": "Handles abuse reports via `Xikolo::Pinboard::AbuseReport` (ACFS resource).",
        "interaction_9": "Retrieves tags via `Xikolo::Pinboard::ImplicitTag` and `Xikolo::Pinboard::ExplicitTag` (ACFS resources).",
        "interaction_10": "Leverages `Acfs.run` for API calls, with a noted double call workaround.",
        "interaction_11": "Publishes analytics events via `Msgr` (e.g., `xikolo.pinboard.answer.accept`, `xikolo.pinboard.read_question`).",
        "interaction_12": "Uses `PinboardUserStatePresenter` and `PinboardPresenter` for view data preparation.",
        "interaction_13": "Utilizes `PinboardRoutesHelper` for dynamic route generation.",
        "interaction_14": "Interacts with Xikolo::Pinboard::Question for question data manipulation [Source: app/controllers/question_controller.rb].",
        "interaction_15": "Interacts with Xikolo::Pinboard::Answer and Xikolo::Pinboard::Comment for associated content [Source: app/controllers/question_controller.rb].",
        "interaction_16": "Manages votes using Xikolo::Pinboard::Vote [Source: app/controllers/question_controller.rb].",
        "interaction_17": "Handles subscriptions with Xikolo::Pinboard::Subscription [Source: app/controllers/question_controller.rb].",
        "interaction_18": "Creates abuse reports using Xikolo::Pinboard::AbuseReport [Source: app/controllers/question_controller.rb].",
        "interaction_19": "Uses Acfs.run extensively for asynchronous API calls to Pinboard and Course microservices [Source: app/controllers/question_controller.rb].",
        "interaction_20": "Publishes messages to RabbitMQ via Msgr for analytics and events (e.g., 'xikolo.pinboard.answer.accept', 'xikolo.pinboard.read_question') [Source: app/controllers/question_controller.rb].",
        "interaction_21": "Utilizes PinboardUserStatePresenter and PinboardPresenter for view data preparation [Source: app/controllers/question_controller.rb].",
        "interaction_22": "Performs authorization checks using `authorize!` and `current_user.allowed?` [Source: app/controllers/question_controller.rb].",
        "interaction_23": "Caches author names using Rails.cache [Source: app/controllers/question_controller.rb].",
        "interaction_24": "Fetches, creates, updates, and deletes questions via `Xikolo::Pinboard::Question` [Source: app/controllers/question_controller.rb].",
        "interaction_25": "Fetches and creates votes via `Xikolo::Pinboard::Vote` [Source: app/controllers/question_controller.rb].",
        "interaction_26": "Creates abuse reports via `Xikolo::Pinboard::AbuseReport` [Source: app/controllers/question_controller.rb].",
        "interaction_27": "Publishes events to RabbitMQ (`Msgr.publish`) for `xikolo.pinboard.answer.accept` and `xikolo.pinboard.read_question` [Source: app/controllers/question_controller.rb].",
        "interaction_28": "Fetches subscriptions via `Xikolo::Pinboard::Subscription` [Source: app/controllers/question_controller.rb].",
        "interaction_29": "Fetches sections via `course_api.rel(:sections)` [Source: app/controllers/question_controller.rb].",
        "interaction_30": "Uses `CourseContextHelper` for course context [Source: app/controllers/question_controller.rb].",
        "interaction_31": "Uses `PinboardRoutesHelper` for dynamic routing [Source: app/controllers/question_controller.rb].",
        "interaction_32": "Uses `Interruptible` module [Source: app/controllers/question_controller.rb].",
        "interaction_33": "Authorizes actions using `authorize!` and `current_user.allowed?` [Source: app/controllers/question_controller.rb].",
        "interaction_34": "Uses `Acfs.run` extensively for asynchronous data fetching [Source: app/controllers/question_controller.rb]."
      },
      "techDebt": [
        "A double `Acfs.run` call is used as a workaround for ACFS callback reliability issues.",
        "The assignment of `course_id` in `question_params` has a TODO for a better solution.",
        "The `response_count` logic has a TODO (referencing XI-853) indicating ongoing discussion/potential refactor.",
        "Double `Acfs.run` call in `show` method, indicating a potential workaround for `Acfs` callback execution issues [Source: app/controllers/question_controller.rb].",
        "TODO: \"solve better\" for `p[:course_id] = the_course.id` in `question_params` [Source: app/controllers/question_controller.rb].",
        "ACFS callback issue: 'the double Acfs.run call is not a mistake - acfs seems to have some problems sometimes executing all callbacks...' in `show` method [Source: app/controllers/question_controller.rb].",
        "Course ID assignment: 'TODO: solve better' for `p[:course_id] = the_course.id` in `question_params` [Source: app/controllers/question_controller.rb].",
        "Rubocop disablement: `rubocop:enable all` at the end of the file, implying linting was disabled [Source: app/controllers/question_controller.rb]."
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "spec/controllers/question_controller_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardRoutesHelper": {
      "type": "Helper",
      "description": "Dynamically generates route helpers for pinboard resources (questions, answers, comments) based on whether the current context is a course or a section. This allows using generic route names (e.g., `question_path`) which resolve to `course_question_path` or `course_section_question_path` depending on `params[:section_id]`.",
      "interactions": {
        "interaction_0": "Interacts with Rails.application.routes.url_helpers to generate dynamic routes ",
        "interaction_1": "Calls standard Rails route helpers dynamically.",
        "interaction_2": "Inspects `params[:section_id]` to determine the routing context [Source: app/helpers/pinboard_routes_helper.rb].",
        "interaction_3": "Defines dynamic methods that proxy to standard Rails route helpers [Source: app/helpers/pinboard_routes_helper.rb].",
        "interaction_4": "Handles various resource and action routes for questions, answers, and comments [Source: app/helpers/pinboard_routes_helper.rb].",
        "interaction_5": "Included in `PinboardCommentController`, `PinboardController`, `QuestionController` [Source: app/helpers/pinboard_routes_helper.rb].",
        "interaction_6": "Uses `params[:section_id]` to determine context [Source: app/helpers/pinboard_routes_helper.rb].",
        "interaction_7": "Relies on Rails' route helpers [Source: app/helpers/pinboard_routes_helper.rb]."
      },
      "techDebt": [
        "Relies on `send` for dynamic method calls, which can reduce code clarity and make debugging more challenging.",
        "The presence of `rubocop:enable all` suggests this file might contain complex logic or style deviations that required temporary disabling of Rubocop rules [Source: app/helpers/pinboard_routes_helper.rb].",
        "Fragile module inclusion: 'for some reason some other module seems to want to include this return unless base_controller.respond_to? :helper_method' in `self.included` [Source: app/helpers/pinboard_routes_helper.rb].",
        "Rubocop disablement: `rubocop:enable all` at the end of the file, implying linting was disabled [Source: app/helpers/pinboard_routes_helper.rb]."
      ],
      "provenance": {
        "sources": [
          "app/helpers/pinboard_routes_helper.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardHelper": {
      "type": "Helper",
      "description": "Offers utility methods for pinboard features, specifically for configuring file uploads (purpose, size limits, content types) and defining a default number of questions per page.",
      "interactions": {
        "interaction_0": "Checks `current_user` permissions for upload capabilities.",
        "interaction_1": "Accesses `Rails.configuration` for maximum document size.",
        "interaction_2": "References `Rails.configuration.max_document_size` for upload limits [Source: app/helpers/pinboard_helper.rb].",
        "interaction_3": "Checks `current_user.allowed?` for upload permissions [Source: app/helpers/pinboard_helper.rb].",
        "interaction_4": "Used by views and potentially controllers [Source: app/helpers/pinboard_helper.rb]."
      },
      "techDebt": [
        "`questions_per_page` is hardcoded with a TODO to adjust it.",
        "TODO: \"adjust this number as needed\" for `questions_per_page` [Source: app/helpers/pinboard_helper.rb].",
        "Hardcoded value: 'TODO: adjust this number as needed' for `questions_per_page` [Source: app/helpers/pinboard_helper.rb]."
      ],
      "provenance": {
        "sources": [
          "app/helpers/pinboard_helper.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Pinboard::TopicForm": {
      "type": "Form Object",
      "description": "A form object for creating/updating pinboard topics (questions). It defines attributes like `title`, `text`, and `video_timestamp` and includes validation. It uses a custom processor `FirstPostAndMetaData` to transform form data into a format expected by the backend service.",
      "interactions": {
        "interaction_0": "Inherits from `XUI::Form`.",
        "interaction_1": "Uses `FirstPostAndMetaData` as an internal processor to prepare data for the API.",
        "interaction_2": "Uses XUI::Form as its base [Source: app/forms/pinboard/topic_form.rb].",
        "interaction_3": "Applies validations for presence of title and text [Source: app/forms/pinboard/topic_form.rb].",
        "interaction_4": "Employs a custom `FirstPostAndMetaData` processor to map form attributes to resource attributes for the Pinboard microservice API [Source: app/forms/pinboard/topic_form.rb].",
        "interaction_5": "Used by controllers (likely `QuestionController`) to handle form submissions [Source: app/forms/pinboard/topic_form.rb].",
        "interaction_6": "Transforms `text` into `first_post` and `video_timestamp` into `meta` for the backend service [Source: app/forms/pinboard/topic_form.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/pinboard/topic_form.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardBreadcrumbsPresenter": {
      "type": "Presenter",
      "description": "Manages the display logic for breadcrumbs within the pinboard, adapting them for lists of topics or individual topic threads.",
      "interactions": {
        "interaction_0": "Interacts with an assumed `Breadcrumbs` component for building breadcrumb paths.",
        "interaction_1": "Receives a `Breadcrumbs` object and a block for thread-specific breadcrumbs during initialization [Source: app/presenters/pinboard_breadcrumbs_presenter.rb].",
        "interaction_2": "Used by `PinboardPresenter` [Source: app/presenters/pinboard_breadcrumbs_presenter.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/pinboard_breadcrumbs_presenter.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardPresenter": {
      "type": "Presenter",
      "description": "Orchestrates the presentation logic for the pinboard, including determining if posting is allowed (locking), generating breadcrumbs, and handling filters. It uses nested context classes (`TechnicalIssuesContext`, `SectionContext`, `CourseContext`) to encapsulate logic specific to different pinboard views.",
      "interactions": {
        "interaction_0": "Utilizes nested context classes (`CourseContext`, `SectionContext`, `TechnicalIssuesContext`) to adapt behavior.",
        "interaction_1": "Uses `PinboardBreadcrumbsPresenter` for breadcrumb generation.",
        "interaction_2": "Relies on `I18n` for localized messages.",
        "interaction_3": "Initializes with `course`, `section`, `technical_issues` flag, and `filters` [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_4": "Delegates context-specific logic to nested classes: `TechnicalIssuesContext`, `SectionContext`, `CourseContext` [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_5": "Uses `I18n` for localized messages, especially for lock reasons and breadcrumb titles [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_6": "Receives `course`, `section`, `technical_issues`, and `filters` as input [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_7": "Delegates breadcrumb generation to `PinboardBreadcrumbsPresenter` [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_8": "Accesses `course.forum_is_locked` and `section['pinboard_closed']` to determine lock status [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_9": "Uses `I18n` for localized messages [Source: app/presenters/pinboard_presenter.rb].",
        "interaction_10": "Includes `Rails.application.routes.url_helpers` for generating paths [Source: app/presenters/pinboard_presenter.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/pinboard_presenter.rb",
          "spec/presenters/pinboard_presenter_spec.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "PinboardUserStatePresenter": {
      "type": "Presenter",
      "description": "Determines and presents user-specific states (e.g., gamification levels) for authors of pinboard items, based on their scores and feature flags. It integrates with the gamification system.",
      "interactions": {
        "interaction_0": "Interacts with Gamification::UserLevels (YAML) to determine user levels ",
        "interaction_1": "Interacts with `Gamification::Level` to determine user levels.",
        "interaction_2": "Checks `current_user` for gamification feature enablement.",
        "interaction_3": "Uses `ActionController::Base.helpers` for asset path generation.",
        "interaction_4": "Interacts with `Gamification::Score` to retrieve user scores [Source: app/presenters/pinboard_user_state_presenter.rb].",
        "interaction_5": "Checks `user.feature?('gamification')` to enable/disable gamification features [Source: app/presenters/pinboard_user_state_presenter.rb].",
        "interaction_6": "Receives `question` and `user` as input [Source: app/presenters/pinboard_user_state_presenter.rb].",
        "interaction_7": "Checks `user.feature?('gamification')` [Source: app/presenters/pinboard_user_state_presenter.rb].",
        "interaction_8": "Fetches `Gamification::Score` and `Gamification::Level` data [Source: app/presenters/pinboard_user_state_presenter.rb].",
        "interaction_9": "Accesses `question.user_id`, `question.comments`, `question.answers` to get author IDs [Source: app/presenters/pinboard_user_state_presenter.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/pinboard_user_state_presenter.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "QuestionPresenter": {
      "type": "Presenter",
      "description": "Presents a single pinboard question, providing formatted data like reply counts, author name, read status, view count, and title (including blocked status). It also handles caching for author names.",
      "interactions": {
        "interaction_0": "Decorates `Xikolo::Pinboard::Question` (ACFS resource).",
        "interaction_1": "Uses `Rails.cache` for author name caching.",
        "interaction_2": "Relies on `I18n` for localized messages, especially for blocked titles.",
        "interaction_3": "Delegates to the underlying `question` object for core attributes [Source: app/presenters/question_presenter.rb].",
        "interaction_4": "Enqueues comments, answers, explicit tags, sections, and items for the question [Source: app/presenters/question_presenter.rb].",
        "interaction_5": "Caches author names using `Rails.cache` to optimize performance [Source: app/presenters/question_presenter.rb].",
        "interaction_6": "Uses `I18n` for localized strings, e.g., for blocked status [Source: app/presenters/question_presenter.rb].",
        "interaction_7": "Receives `question`, `course`, `section_id` as input [Source: app/presenters/question_presenter.rb].",
        "interaction_8": "Delegates to `question` for core attributes [Source: app/presenters/question_presenter.rb].",
        "interaction_9": "Fetches `question.comments`, `question.answers`, `question.explicit_tags`, `question.section`, `question.item`, `question.author` via `enqueue_` methods (ACFS) [Source: app/presenters/question_presenter.rb].",
        "interaction_10": "Uses `Rails.cache` for author names [Source: app/presenters/question_presenter.rb].",
        "interaction_11": "Includes `Rails.application.routes.url_helpers` for generating paths [Source: app/presenters/question_presenter.rb]."
      },
      "techDebt": [
        "The `response_count` method has a TODO (referencing XI-853) indicating an ongoing discussion or potential refactor.",
        "TODO: \"Oh really? See XI-853. :P\" regarding `response_count` indicates an unresolved design decision or a temporary workaround [Source: app/presenters/question_presenter.rb].",
        "Unresolved design decision: 'TODO: Oh really? See XI-853. :P' in `response_count` method [Source: app/presenters/question_presenter.rb]."
      ],
      "provenance": {
        "sources": [
          "app/presenters/question_presenter.rb",
          "spec/presenters/question_presenter_spec.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::Comment": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a comment in the Pinboard microservice. Used for creating, retrieving, updating, and deleting comments on questions and answers.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardCommentController` and `QuestionController`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_comment_controller.rb",
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::Question": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a question (topic) in the Pinboard microservice. Used for managing questions, including their content, state (closed, sticky), and associated data like answers, comments, and tags.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardController`, `QuestionController`, and `QuestionPresenter`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "app/controllers/question_controller.rb",
          "app/presenters/question_presenter.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::Answer": {
      "type": "ACFS Resource",
      "description": "Client-side representation of an answer to a question in the Pinboard microservice. Used for retrieving and managing answers and their associated comments.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardCommentController` and `QuestionController`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_comment_controller.rb",
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::Vote": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a vote on a pinboard entity (e.g., question or answer) in the Pinboard microservice. Used for recording user votes.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `QuestionController` for upvoting questions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::Subscription": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a user's subscription to a question in the Pinboard microservice. Used to check and manage user subscriptions to discussion threads.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `QuestionController` to load user subscriptions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::AbuseReport": {
      "type": "ACFS Resource",
      "description": "Client-side representation of an abuse report for a pinboard entity (question, answer, or comment) in the Pinboard microservice. Used for submitting reports.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardCommentController` and `QuestionController` for reporting abuse."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_comment_controller.rb",
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::ExplicitTag": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a user-defined tag for pinboard questions in the Pinboard microservice. Used for filtering and managing tags.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardController` and `QuestionController` for tag management and display."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "app/controllers/question_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::ImplicitTag": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a system-generated tag (e.g., based on sections or technical issues) for pinboard questions in the Pinboard microservice. Used for filtering and categorizing discussions.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardController` and `QuestionController` for managing section-based tags.",
        "interaction_2": "Created by `SectionsController#create` upon section creation [Source: app/controllers/sections_controller.rb]",
        "interaction_3": "Fetched by `SectionPresenter#enqueue_implicit_tags` [Source: app/presenters/section_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "app/controllers/question_controller.rb",
          "app/controllers/sections_controller.rb",
          "app/presenters/section_presenter.rb",
          "cluster:04_CORE_CourseNavigation",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation",
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::Pinboard::CourseSubscription": {
      "type": "ACFS Resource",
      "description": "Client-side representation of a user's subscription to an entire course's pinboard discussions in the Pinboard microservice. Used to check if a user is subscribed to all discussions within a course.",
      "interactions": {
        "interaction_0": "Interacts with the `PinboardService` microservice via the ACFS framework.",
        "interaction_1": "Used by `PinboardController` to determine course-level subscription status."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "NotificationUserDisablesController": {
      "type": "Controller",
      "description": "Handles one-click unsubscribe requests from email notifications. It validates incoming parameters, verifies security hashes, and updates user notification preferences via the Account microservice.",
      "interactions": {
        "interaction_0": "Interacts with the Account microservice (via `Xikolo.api(:account)`) to fetch user email details and update user preferences. [Source: app/controllers/notification_user_disables_controller.rb]",
        "interaction_1": "Utilizes `NotificationUserSettingsHelper` for hash generation and settings key translation. [Source: app/controllers/notification_user_disables_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/notification_user_disables_controller.rb",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "NotificationUserSettingsHelper": {
      "type": "Helper",
      "description": "Provides utility methods for generating security hashes for email unsubscribe links and translating simplified notification keys into full preference paths.",
      "interactions": {
        "interaction_0": "Used by `NotificationUserDisablesController` to validate unsubscribe requests and map preference keys. [Source: app/controllers/notification_user_disables_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/notification_user_settings_helper.rb",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "NotificationService": {
      "type": "Microservice",
      "description": "A dedicated API-only Rails microservice responsible for centralized email notification sending. It consumes events from other services, generates email content, applies styling, and handles tracking.",
      "interactions": {
        "interaction_0": "Exposed via Xikolo::Notification::Application.routes (Microservice Routing) ",
        "interaction_1": "Utilizes `MarkdownService` to render email content. [Source: services/notification/lib/markdown_service.rb]",
        "interaction_2": "Employs `TrackingMailInterceptor` to modify outgoing emails for tracking purposes. [Source: services/notification/lib/tracking_mail_interceptor.rb]",
        "interaction_3": "Interacts with external email clients for delivery.",
        "interaction_4": "Receives notification events from other Xikolo services via `Msgr` (RabbitMQ). "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/lib/markdown_service.rb",
          "services/notification/lib/tracking_mail_interceptor.rb",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "MarkdownService": {
      "type": "Service Module",
      "description": "A utility module within the Notification Service responsible for converting Markdown formatted text into HTML, primarily for use in email content.",
      "interactions": {
        "interaction_0": "Used by the `NotificationService` (or its mailers/workers) to render email bodies. [Source: services/notification/lib/markdown_service.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/lib/markdown_service.rb",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "TrackingMailInterceptor": {
      "type": "Mailer Interceptor",
      "description": "Intercepts outgoing emails from the Notification Service to inject tracking parameters into local links and images, and to redirect external links through a tracking mechanism.",
      "interactions": {
        "interaction_0": "Intercepts emails being delivered by the `NotificationService`'s mailers. [Source: services/notification/lib/tracking_mail_interceptor.rb]",
        "interaction_1": "Uses `Nokogiri` for HTML parsing and modification. [Source: services/notification/lib/tracking_mail_interceptor.rb]",
        "interaction_2": "Interacts with `Xikolo::Common::Tracking::ExternalLink` (implied) for external link redirection. [Source: services/notification/lib/tracking_mail_interceptor.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/lib/tracking_mail_interceptor.rb",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "AdminNavigation": {
      "type": "Presenter",
      "description": "Manages the structure and access control for the main administration navigation menu. It dynamically generates menu items based on user permissions and global feature flags.",
      "interactions": {
        "interaction_0": "Interacts with the `User` object to check permissions using `user.allowed?` and feature flags using `user.feature?` [Source: app/presenters/admin_navigation.rb].",
        "interaction_1": "References various Rails routes (e.g., `admin_dashboard`, `users`, `videos`) for navigation links [Source: app/presenters/admin_navigation.rb].",
        "interaction_2": "Accesses `Xikolo.config` to check for enabled beta features and voucher system status [Source: app/presenters/admin_navigation.rb].",
        "interaction_3": "Interacts with Xikolo::Common::Auth::CurrentUser for user permissions and feature flags. [Source: app/presenters/admin_navigation.rb]",
        "interaction_4": "Accesses Xikolo.config for beta features. [Source: app/presenters/admin_navigation.rb]",
        "interaction_5": "Checks user permissions using `user.allowed?`.",
        "interaction_6": "Checks feature flags using `user.feature?` and `Xikolo.config.beta_features`."
      },
      "techDebt": [
        "Direct dependency on `Xikolo.config` for feature flags couples UI presentation logic to a global configuration object, potentially making testing and refactoring more complex [Source: app/presenters/admin_navigation.rb]."
      ],
      "provenance": {
        "sources": [
          "app/presenters/admin_navigation.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Role": {
      "type": "Model (Account Service)",
      "description": "Represents a permission role within the system, defining a set of capabilities or access levels. Used to grant specific administrative access, such as the `lanalytics.report.admin` role for sensitive reporting data.",
      "interactions": {
        "interaction_0": "Associated with `Grant` objects to link roles to principals (e.g., users) .",
        "interaction_1": "Queried by name to identify specific roles for assignment or revocation ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Grant": {
      "type": "Model (Account Service)",
      "description": "Establishes a link between a `Principal` (e.g., a `User`) and a `Role` within a specific `Context`. It is the mechanism by which permissions are assigned.",
      "interactions": {
        "interaction_0": "Links a `User` (as `principal`) to a `Role` and a `Context` .",
        "interaction_1": "Created and destroyed to manage user permissions, particularly for sensitive roles like reporting ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Context": {
      "type": "Model (Account Service)",
      "description": "Defines the scope or boundary within which a permission `Grant` is valid. The `root` context is used for global administrative permissions.",
      "interactions": {
        "interaction_0": "Used in conjunction with `Role` and `User` to create `Grant` records, specifying the scope of the granted permission ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::API": {
      "type": "Grape API",
      "description": "The main public API, mounted at `/api`, serving as the primary data access point for mobile applications. It adheres to the JSON-API standard and REST architectural style, providing resources for various platform entities.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo Account Service to fetch and store data ",
        "interaction_1": "Interacts with Xikolo Course Service to fetch and store data ",
        "interaction_2": "Interacts with Xikolo News Service to fetch and store data ",
        "interaction_3": "Interacts with Xikolo Pinboard Service to fetch and store data ",
        "interaction_4": "Interacts with Xikolo Quiz Service to fetch and store data ",
        "interaction_5": "Interacts with Xikolo TimeEffort Microservice (Client Proxy) to fetch and store data ",
        "interaction_6": "Includes Xikolo::V2::Helpdesk::Tickets (API Endpoint) ",
        "interaction_7": "Uses `Xikolo::Versioning::Middleware` for API version negotiation.",
        "interaction_8": "Uses `Auth::Middleware::LegacyToken` and `Auth::Middleware::Session` for authentication.",
        "interaction_9": "Rescues from `Error::Base` exceptions to standardize error responses.",
        "interaction_10": "Mounts `V2::Base` to expose version 2 API endpoints.",
        "interaction_11": "Utilizes `Format::PrettyJSON` for JSON formatting and `Grape::Parser::Json` for JSON parsing.",
        "interaction_12": "Calls `Xikolo::Docs::Generator` to produce API documentation.",
        "interaction_13": "Consumes data from backend microservices (e.g., Account, Course, News, Pinboard, Quiz, TimeEffort services).",
        "interaction_14": "Provides data to mobile applications and potentially other client-side applications.",
        "interaction_15": "Receives write requests (POST/PATCH) from clients and forwards them to appropriate backend services."
      },
      "techDebt": [
        "The `api/CHANGELOG.md` indicates frequent changes, deprecations, and removals, suggesting a need for careful client management and potential for breaking changes if not handled correctly. ",
        "Managing backwards compatibility and deprecation of API versions to ensure smooth transitions for mobile clients. ",
        "Ensuring consistent data transformation and serialization across numerous endpoints and backend services. "
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "api/xikolo/api.rb",
          "api/README.md",
          "api/VERSIONING.md",
          "docs/portalapi/docs/authentication.md",
          "docs/portalapi/docs/errors.md",
          "docs/portalapi/docs/negotiation.md",
          "api/CHANGELOG.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "PortalApi": {
      "type": "Rails Module/Namespace",
      "description": "A dedicated API namespace (`portalapi-beta`) for customer portal interactions, exposing resources like courses, users, and enrollments. It is distinct from the main `Xikolo::API` and has its own authentication and negotiation requirements.",
      "interactions": {
        "interaction_0": "Implemented by PortalApiBeta (API) ",
        "interaction_1": "Requires bearer token authentication. ",
        "interaction_2": "Utilizes content negotiation for API versioning. ",
        "interaction_3": "Provides `index`, `show` for `courses`, `update`, `destroy` for `users`, and `index`, `create` for `enrollments`. [Source: config/routes.rb]"
      },
      "techDebt": [
        "The \"beta\" designation suggests it might still be under active development or subject to more frequent changes. [Source: config/routes.rb]"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Bridges": {
      "type": "Rails Module/Namespace",
      "description": "A collection of internal API endpoints designed for integration with various external systems or internal microservices (e.g., `transpipe`, `lanalytics`, `moochub`, `chatbot`, `shop`). These facilitate specialized data exchange and communication.",
      "interactions": {
        "interaction_0": "Interacts with TransPipeBridgeAPI (External API Interface) ",
        "interaction_1": "Interacts with LanalyticsBridgeAPI (External API Interface) ",
        "interaction_2": "Interacts with MoochubBridgeAPI (External API Interface) ",
        "interaction_3": "Interacts with ChatbotBridgeAPI (External API Interface) ",
        "interaction_4": "Interacts with ShopBridgeAPI (External API Interface) ",
        "interaction_5": "`Transpipe`: Manages courses and video subtitles. [Source: config/routes.rb]",
        "interaction_6": "`Lanalytics`: Provides course and video statistics. [Source: config/routes.rb]",
        "interaction_7": "`Moochub`: Lists courses. [Source: config/routes.rb]",
        "interaction_8": "`Chatbot`: Handles authentication, user courses, achievements, and quizzes. [Source: config/routes.rb]",
        "interaction_9": "`Shop`: Manages vouchers. [Source: config/routes.rb]"
      },
      "techDebt": [
        "The diverse nature of these bridges suggests potential for inconsistent API design or authentication mechanisms across sub-modules if not carefully managed."
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Xi::Controllers::RequireBearerToken": {
      "type": "Middleware",
      "description": "A Rack-compatible middleware class responsible for enforcing bearer token authentication on API endpoints. It checks for the presence and validity of the `Authorization` header and returns RFC 6750-compliant `401 Unauthorized` responses if authentication fails.",
      "interactions": {
        "interaction_0": "Authenticates requests for PortalApi (Rails Module/Namespace) ",
        "interaction_1": "Authenticates requests for Bridges (Rails Module/Namespace) ",
        "interaction_2": "Interacts with Abstract::BridgeAPIController (Base Controller) ",
        "interaction_3": "Renders `application/problem+json` error responses. ",
        "interaction_4": "Included in Bridges::Shop::VouchersController. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_5": "Included in Chatbot API (Controller/Service Layer). ",
        "interaction_6": "Included in Shop API (Controller/Service Layer). ",
        "interaction_7": "Included in TransPipe API (Controller/Service Layer). ",
        "interaction_8": "Included in MOOChub API (Controller/Service Layer). ",
        "interaction_9": "Included in Bridge API controllers to secure endpoints requiring bearer token authentication."
      },
      "techDebt": [
        "The current implementation uses a `token.call` which implies a dynamic token, but the comparison `controller.request.headers['HTTP_AUTHORIZATION'] != \"Bearer #{@token.call}\"` suggests a simple string comparison, which might not be robust enough for complex token types (e.g., JWT, PASETO) without further processing. It expects the exact \"Bearer <token>\" string. [Source: lib/xi/controllers/require_bearer_token.rb]",
        "Verify consistent application of this concern across all bridge API controllers to maintain a uniform security posture."
      ],
      "provenance": {
        "sources": [
          "lib/xi/controllers/require_bearer_token.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Rails.application.routes": {
      "type": "Routing Configuration",
      "description": "The central routing configuration for the main Rails application, defining all URL patterns and mapping them to specific controllers and actions. It includes definitions for the main web application, admin interfaces, and various API endpoints.",
      "interactions": {
        "interaction_0": "Used by Xikolo::V2::URL (Singleton Utility) for URL generation ",
        "interaction_1": "Used by PinboardRoutesHelper (Helper) for dynamic route generation ",
        "interaction_2": "Used by VideoItemPresenter (Presenter) for URL generation ",
        "interaction_3": "Used by VideoItemTopicPresenter (Presenter) for URL generation ",
        "interaction_4": "Used by VideoPresenter (Presenter) for download path generation ",
        "interaction_5": "Used by LtiExerciseItemPresenter (Presenter) for URL generation ",
        "interaction_6": "Used by MenuWithPermissions (Presenter) for link generation ",
        "interaction_7": "Used by ViewMethodsHelper (Helper) for URL helpers ",
        "interaction_8": "Directs incoming HTTP requests to the appropriate controllers. [Source: config/routes.rb]",
        "interaction_9": "Mounts the `Xikolo::API` Grape application. [Source: config/routes.rb]",
        "interaction_10": "Defines scoped routes for `PortalApi` and `Bridges` modules. [Source: config/routes.rb]"
      },
      "techDebt": [
        "The `config/routes.rb` file is very large and contains a mix of public web routes, admin routes, and multiple API definitions. This can make it difficult to manage and understand the routing logic, potentially leading to conflicts or unintended exposures. The use of `pinboard_routes` as a `def` block is a minor attempt at modularity but doesn't fully address the complexity. [Source: config/routes.rb]",
        "The `config/routes.rb` file contains numerous custom `get` and `post` routes outside of standard `resources` blocks, which could be refactored to better adhere to RESTful principles and the project guidelines. ",
        "The `pinboard_routes` helper is defined as a `def` block, which is less idiomatic for reusable route sets compared to `concern` or `namespace` in Rails. [Source: config/routes.rb]"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "api/xikolo/v2/url.rb",
          "app/models/well_known_file/apple_app_site_association.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Webpack": {
      "type": "Asset Bundler",
      "description": "The primary bundler for frontend assets (JavaScript, TypeScript, Sass). It processes entry points, resolves dependencies, and outputs optimized bundles. Configured via `config/assets/webpack.config.mjs`.",
      "interactions": {
        "interaction_0": "Processes React (Client-Side UI Library) code ",
        "interaction_1": "Processes TypeScript (Programming Language) code ",
        "interaction_2": "Processes Sass (CSS Preprocessor) files ",
        "interaction_3": "Processes PostCSS (CSS Post-processor) output ",
        "interaction_4": "Processes app/assets/main.js (JavaScript Entrypoint) ",
        "interaction_5": "Processes app/assets/main.scss (CSS Entrypoint) ",
        "interaction_6": "Uses Babel for JavaScript/TypeScript transpilation.",
        "interaction_7": "Uses Sass-embedded and Sass-loader for SCSS compilation.",
        "interaction_8": "Uses PostCSS and PostCSS-loader for CSS post-processing.",
        "interaction_9": "Integrates with MiniCssExtractPlugin for extracting CSS into separate files.",
        "interaction_10": "Uses TerserWebpackPlugin for JavaScript minification and CompressionWebpackPlugin for asset compression.",
        "interaction_11": "Generates asset manifests via WebpackAssetsManifest.",
        "interaction_12": "Processes JavaScript/TypeScript files from `app/assets/`.",
        "interaction_13": "Processes Sass files from `app/assets/` and `brand/*/assets`.",
        "interaction_14": "Utilizes Babel for JavaScript transpilation.",
        "interaction_15": "Uses `sass-embedded` and `sass-loader` for Sass compilation.",
        "interaction_16": "Generates output bundles for deployment."
      },
      "techDebt": [
        "The `main.js` bundle tends to become inflated with JavaScript belonging to globally scoped components, indicating a need to rethink the bundling strategy for shared components. ",
        "Coexists with Sprockets, potentially leading to a complex and fragmented asset pipeline.",
        "The 'main' bundle tends to become inflated, requiring a re-evaluation of modularization strategy. "
      ],
      "provenance": {
        "sources": [
          "package.json",
          "config/assets/webpack.config.mjs",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Yarn": {
      "type": "Package Manager",
      "description": "Manages frontend (Node.js) dependencies, ensuring consistent installation and versioning of libraries.",
      "interactions": {
        "interaction_0": "Installs packages defined in `package.json`.",
        "interaction_1": "Executes various frontend-related scripts defined in `package.json` (e.g., `build`, `start`, `format`, `lint`).",
        "interaction_2": "Installs dependencies listed in `package.json`.",
        "interaction_3": "Used for running build, start, format, and lint scripts.",
        "interaction_4": "Manages `node_modules`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ViewComponent": {
      "type": "Server-Side UI Component Framework",
      "description": "A Ruby on Rails library for building reusable, testable, and encapsulated UI components on the server-side, combining presentation logic and HTML templates.",
      "interactions": {
        "interaction_0": "Renders Global::Accordion (ViewComponent) ",
        "interaction_1": "Renders Global::ActionsDropdown (ViewComponent) ",
        "interaction_2": "Renders Global::BasicTooltip (ViewComponent) ",
        "interaction_3": "Renders Global::Callout (ViewComponent) ",
        "interaction_4": "Renders Global::CookieConsentBanner (ViewComponent) ",
        "interaction_5": "Renders Global::CopyToClipboard (ViewComponent) ",
        "interaction_6": "Renders Global::CourseListBanner (ViewComponent) ",
        "interaction_7": "Renders Global::CustomHeadSnippets (ViewComponent) ",
        "interaction_8": "Renders Global::DisclosureWidget (ViewComponent) ",
        "interaction_9": "Renders Global::DownloadButton (ViewComponent) ",
        "interaction_10": "Renders Global::FaIcon (ViewComponent) ",
        "interaction_11": "Renders Global::FilterBar::Controls (ViewComponent) ",
        "interaction_12": "Renders Global::FilterBar::Filter (ViewComponent) ",
        "interaction_13": "Renders Global::FilterBar::Search (ViewComponent) ",
        "interaction_14": "Renders Global::FlashBlock (ViewComponent) ",
        "interaction_15": "Renders Global::FlashLayer (ViewComponent) ",
        "interaction_16": "Renders Global::FlashMessage (ViewComponent) ",
        "interaction_17": "Renders Global::HeadlineTooltip (ViewComponent) ",
        "interaction_18": "Renders Global::HelpdeskButton (ViewComponent) ",
        "interaction_19": "Renders Global::ItemStatus (ViewComponent) ",
        "interaction_20": "Renders Global::LabeledCopyButton (ViewComponent) ",
        "interaction_21": "Renders Global::LinkItem (ViewComponent) ",
        "interaction_22": "Renders Global::Meter (ViewComponent) ",
        "interaction_23": "Renders Global::PageHeader (ViewComponent) ",
        "interaction_24": "Renders Global::Pill (ViewComponent) ",
        "interaction_25": "Renders Global::Slider (ViewComponent) ",
        "interaction_26": "Renders Global::SvgIcon (ViewComponent) ",
        "interaction_27": "Renders Global::Table (ViewComponent) ",
        "interaction_28": "Renders Global::UserAvatar (ViewComponent) ",
        "interaction_29": "Renders Course::QuizRecap (ViewComponent) ",
        "interaction_30": "Renders Dashboard::GamificationBadge (ViewComponent) ",
        "interaction_31": "Renders Form::DynamicSortableList (ViewComponent) ",
        "interaction_32": "Components are rendered within Rails views (e.g., `.html.slim` templates) using the `render` helper.",
        "interaction_33": "Integrates with `lookbook` for cataloging, documenting, and previewing component variants.",
        "interaction_34": "Components are unit-tested using `RSpec` with specific test helpers provided by the library."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "React": {
      "type": "Client-Side UI Library",
      "description": "A JavaScript library for building interactive user interfaces, enabling dynamic and responsive frontend experiences.",
      "interactions": {
        "interaction_0": "Uses TypeScript (Programming Language) for code development ",
        "interaction_1": "Code is written in TypeScript and transpiled by Babel via Webpack.",
        "interaction_2": "Likely interacts with Rails-generated HTML and API endpoints for data exchange.",
        "interaction_3": "Components are bundled by Webpack and transpiled by Babel."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "TypeScript": {
      "type": "Programming Language",
      "description": "A superset of JavaScript that adds static typing, used for improved code quality, maintainability, and developer experience. Strongly recommended for new scripts.",
      "interactions": {
        "interaction_0": "Processes app/assets/teacher/items/quiz-edit.ts (Frontend Component) ",
        "interaction_1": "Processes app/assets/teacher/items/quiz-item.ts (Frontend Component) ",
        "interaction_2": "Processes app/assets/teacher/items/quiz-questions.ts (Frontend Component) ",
        "interaction_3": "Processes app/assets/teacher/items/quiz.ts (Frontend Component) ",
        "interaction_4": "Processes app/assets/quiz-recap/quiz-recap.ts (Frontend Component) ",
        "interaction_5": "Processes app/assets/teacher/items/video-streams.ts (Frontend Script) ",
        "interaction_6": "Processes app/assets/teacher/items/video.ts (Frontend Script) ",
        "interaction_7": "Transpiled by Babel.",
        "interaction_8": "Configuration defined in `tsconfig.json`.",
        "interaction_9": "Uses `typescript-eslint` for linting.",
        "interaction_10": "Provides global type declarations via `app/assets/global.d.ts`."
      },
      "techDebt": [
        "Legacy JavaScript in `app/assets/javascripts` is excluded from TypeScript compilation, indicating a split codebase. [Source: tsconfig.json]"
      ],
      "provenance": {
        "sources": [
          "tsconfig.json",
          "package.json",
          "eslint.config.mjs",
          "app/assets/global.d.ts",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Sass": {
      "type": "CSS Preprocessor",
      "description": "Extends CSS with features like variables, nesting, mixins, and functions, making stylesheets more organized and maintainable.",
      "interactions": {
        "interaction_0": "Processes app/assets/main.scss (CSS Entrypoint) ",
        "interaction_1": "Compiled CSS is then processed by `PostCSS`.",
        "interaction_2": "Linted by `Stylelint` to enforce styling conventions.",
        "interaction_3": "Sass files are compiled by `sass-embedded` via `sass-loader` within the Webpack pipeline."
      },
      "techDebt": [
        "The `ruby-sass` compiler (using libsass) does not support CSS Color Level 4 syntax, requiring specific `Stylelint` rules for alpha value notation and color function notation. [Source: .stylelintrc.js]"
      ],
      "provenance": {
        "sources": [
          "package.json",
          "Gemfile",
          ".stylelintrc.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PostCSS": {
      "type": "CSS Post-processor",
      "description": "A tool for transforming CSS with JavaScript plugins, used to enhance and optimize stylesheets after Sass compilation (e.g., adding vendor prefixes).",
      "interactions": {
        "interaction_0": "Processes CSS output from `Sass` compilation via `postcss-loader` in the Webpack pipeline.",
        "interaction_1": "Integrated into Webpack via `postcss-loader`.",
        "interaction_2": "Processes output from Sass."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ESLint": {
      "type": "Code Linter",
      "description": "Static analysis tool for JavaScript and TypeScript code, enforcing best practices and style guidelines. Configured for browser globals and specific project variables.",
      "interactions": {
        "interaction_0": "Analyzes `.js`, `.mjs`, `.cjs`, and `.ts` files.",
        "interaction_1": "Configured via `eslint.config.mjs`, extending recommended rules for JavaScript and TypeScript.",
        "interaction_2": "Ignores legacy JavaScript assets in `app/assets/javascripts` and `vendor/assets/javascripts`.",
        "interaction_3": "Runs as a pre-commit hook via Husky and lint-staged.",
        "interaction_4": "Uses `typescript-eslint` for TypeScript specific rules.",
        "interaction_5": "Analyzes `**/*.{js,mjs,cjs,ts}` files.",
        "interaction_6": "Integrated into the pre-commit hook via `lint-staged`."
      },
      "techDebt": [
        "Explicitly ignores legacy JavaScript assets in `app/assets/javascripts` and `vendor/assets/javascripts`, allowing non-compliant code to persist. [Source: eslint.config.mjs]",
        "Ignores `app/assets/javascripts` and `vendor/assets/javascripts` due to legacy code."
      ],
      "provenance": {
        "sources": [
          "package.json",
          "eslint.config.mjs",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Stylelint": {
      "type": "CSS Linter",
      "description": "Linter for SCSS files, ensuring consistent styling, idiomatic order, and BEM naming conventions. Configured to be compatible with `ruby-sass` compiler limitations.",
      "interactions": {
        "interaction_0": "Analyzes SCSS files.",
        "interaction_1": "Configured via `.stylelintrc.js`, extending recommended SCSS, idiomatic order, and BEM conventions.",
        "interaction_2": "Includes specific rules to handle `ruby-sass` compiler limitations for CSS Color Level 4.",
        "interaction_3": "Runs as a pre-commit hook via Husky and lint-staged.",
        "interaction_4": "Analyzes `app/assets/**/*.{css,scss}` and `brand/*/assets/**/*.{css,scss}`.",
        "interaction_5": "Integrated into the pre-commit hook via `lint-staged`."
      },
      "techDebt": [
        "Ignores older CSS files, creating a backlog of code that does not conform to the current styleguide. ",
        "Custom rules for `alpha-value-notation` and `color-function-notation` are necessary due to limitations of the `ruby-sass` compiler (libsass), indicating a potential need to update the Sass compiler or migrate to Dart Sass fully."
      ],
      "provenance": {
        "sources": [
          "package.json",
          ".stylelintrc.js",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Prettier": {
      "type": "Code Formatter",
      "description": "An opinionated code formatter that enforces a consistent style across the entire codebase, supporting various languages including JavaScript, TypeScript, SCSS, and YAML.",
      "interactions": {
        "interaction_0": "Formats code files automatically.",
        "interaction_1": "Configured via `.prettierrc.yml` with specific overrides for SCSS and YAML/YML files.",
        "interaction_2": "Formats various file types on commit via `lint-staged`.",
        "interaction_3": "Ignores specific auto-generated or vendored directories and files."
      },
      "techDebt": [
        "Ignores `*.md` files because 'Prettier isn't able to understand all advanced markdown extensions', which might lead to inconsistent Markdown formatting for advanced features."
      ],
      "provenance": {
        "sources": [
          "package.json",
          ".prettierrc.yml",
          ".prettierignore",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "61_DEVOPS_Testing"
        ]
      }
    },
    "I18n-js": {
      "type": "Internationalization Library",
      "description": "A JavaScript library that provides client-side internationalization capabilities, likely synchronizing with Rails' I18n system for translations.",
      "interactions": {
        "interaction_0": "Used by app/assets/course/items/quiz.ts (Frontend Component) for localization ",
        "interaction_1": "Used by app/assets/quiz-recap/quiz-recap.ts (Frontend Component) for localization ",
        "interaction_2": "Used by app/assets/teacher/items/quiz-item.ts (Frontend Component) for localization ",
        "interaction_3": "Used by app/assets/teacher/items/quiz.ts (Frontend Component) for localization ",
        "interaction_4": "Used by app/assets/course/items/video.js (Frontend Script) for localization ",
        "interaction_5": "Used in client-side JavaScript code for displaying localized text.",
        "interaction_6": "The `I18n` global variable is exposed and marked as `readonly` in ESLint configuration."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "eslint.config.mjs",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "XikoloVideoPlayer": {
      "type": "External UI Component / Library",
      "description": "A custom video player component developed externally by OpenHPI, integrated into the application as an npm package.",
      "interactions": {
        "interaction_0": "Interacts with app/assets/course/items/video.js (Frontend Script) for video playback ",
        "interaction_1": "Managed as a Node.js dependency via `Yarn`.",
        "interaction_2": "Follows semantic versioning and has a dedicated release process on GitHub and npmjs.org.",
        "interaction_3": "Used within the application to embed and manage video playback."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "GamificationConsumer": {
      "type": "Consumer",
      "description": "An Msgr consumer responsible for processing various gamification-related events published across the system. It dispatches event payloads to specific `Gamification::Rules` classes to calculate and create user scores, provided the gamification feature is enabled.",
      "interactions": {
        "interaction_0": "Consumes messages from RabbitMQ (Msgr).",
        "interaction_1": "Instantiates and calls `create_score!` on various `Gamification::Rules` classes (e.g., `Gamification::Rules::Course::TakeExam`, `Gamification::Rules::Pinboard::UpvoteAnswer`).",
        "interaction_2": "Checks `Xikolo.config.gamification['enabled']` to determine if gamification is active.",
        "interaction_3": "Consumes messages from RabbitMQ via the `Msgr` gem.",
        "interaction_4": "Inherits from Msgr::Consumer. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_5": "Receives messages from RabbitMQ (via Msgr). [Source: app/consumers/gamification_consumer.rb]",
        "interaction_6": "Interacts with Xikolo.config.gamification to check if enabled. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_7": "Instantiates Gamification::Rules::* classes. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_8": "Receives messages from RabbitMQ (e.g., `result_create`, `visit_create`, `vote_create`, `comment_create`, `question_create`, `answer_accepted`, `answer_create`).",
        "interaction_9": "Interacts with `Xikolo.config` to check if gamification is enabled. [Source: app/consumers/gamification_consumer.rb]"
      },
      "techDebt": [
        "The consumer's internal documentation highlights a potential for brittle rule dependencies if rules are deactivated by removing/commenting them in the config, suggesting a need for careful management of rule interdependencies.",
        "Comments suggest two ways to deactivate rules (remove/comment or award 0 points), with a warning about side effects for the first option, indicating potential complexity in rule management [Source: app/consumers/gamification_consumer.rb]",
        "The extensive `case` statements for `exercise_type` and `votable_type` could potentially be refactored using a more dynamic dispatch mechanism or a registry pattern if the number of rules grows significantly. [Source: app/consumers/gamification_consumer.rb]"
      ],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb",
          "spec/events/xikolo.course.result.create_spec.rb",
          "spec/events/xikolo.course.visit.create_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "cluster:15_LEARN_Gamification",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Gamification::Rules::*": {
      "type": "Service/Rule",
      "description": "A conceptual group of classes (e.g., `Gamification::Rules::Course::TakeExam`, `Gamification::Rules::Pinboard::UpvoteAnswer`) responsible for defining the logic for specific gamification events and creating scores. Each rule class encapsulates the logic for a particular user action and its corresponding score calculation.",
      "interactions": {
        "interaction_0": "Interacts with Gamification::Score (Implied Model) to create scores ",
        "interaction_1": "Calls `create_score!` (implying interaction with a `Gamification::Score` model or service).",
        "interaction_2": "Instantiated by `GamificationConsumer` with an event `payload`.",
        "interaction_3": "Executes the `create_score!` method to apply gamification logic and persist scores.",
        "interaction_4": "Created by GamificationConsumer. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_5": "Creates Gamification::Score instances. [Source: app/consumers/gamification_consumer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb",
          "spec/events/xikolo.course.result.create_spec.rb",
          "spec/events/xikolo.course.visit.create_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "spec/factories/gamification.rb",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification::Badge (Implied Model)": {
      "type": "Model",
      "description": "An implied model representing a gamification badge, likely storing its name, level, and whether it has been gained by a user. It is used by the `Dashboard::GamificationBadge` component.",
      "interactions": {
        "interaction_0": "Configured by Gamification::BadgeTypes (YAML) ",
        "interaction_1": "Its attributes (`name`, `level`, `persisted?`) are accessed by `Dashboard::GamificationBadge`.",
        "interaction_2": "Provided as an input to `Dashboard::GamificationBadge`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/dashboard/gamification_badge.rb",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Dashboard::GamificationBadge": {
      "type": "ViewComponent",
      "description": "Renders a single gamification badge, displaying its image and title. It dynamically selects the image source and title based on whether the badge has been gained and its current level. It leverages I18n for localized level titles.",
      "interactions": {
        "interaction_0": "Receives a `Gamification::Badge` object as input.",
        "interaction_1": "Generates image paths based on badge name and level, referencing `app/assets/images/gamification/badges/`.",
        "interaction_2": "Uses `I18n` for localized level titles.",
        "interaction_3": "Receives a `Gamification::Badge` object during initialization.",
        "interaction_4": "Uses `helpers.image_tag` to render the badge image, constructing the path based on badge name and level/gained status.",
        "interaction_5": "Interacts with `I18n` for looking up localized badge level titles.",
        "interaction_6": "Assumes badge images are located in `app/assets/images/gamification/badges/`.",
        "interaction_7": "Receives Gamification::Badge object. [Source: app/components/dashboard/gamification_badge.rb]",
        "interaction_8": "Uses I18n for localization. [Source: app/components/dashboard/gamification_badge.rb]",
        "interaction_9": "Uses `I18n.t` for localizing badge level titles [Source: app/components/dashboard/gamification_badge.rb]"
      },
      "techDebt": [
        "TODO: Move badge names to locale file for better internationalization.",
        "The badge title generation logic (e.g., `\"#{@badge.name.titleize} (#{level_title})\"`) contains a TODO to move to a locale file for better internationalization and maintainability.",
        "TODO: Move badge level titles to locale files for better internationalization [Source: app/components/dashboard/gamification_badge.rb]"
      ],
      "provenance": {
        "sources": [
          "app/components/dashboard/gamification_badge.rb",
          "app/views/dashboard/achievements.html.slim",
          "app/assets/images/gamification/**/*",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification::Configuration": {
      "type": "Configuration",
      "description": "The system configuration for the gamification feature, controlled by `Xikolo.config.gamification['enabled']`. It determines whether the gamification system is active.",
      "interactions": {
        "interaction_0": "Checked by `GamificationConsumer` before processing events.",
        "interaction_1": "Manipulated by integration tests to enable/disable the feature."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb",
          "integration/features/steps/gamification/user_score.rb",
          "integration/features/xikolo/global/gamification/user_score.feature",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification::BadgeTypes (YAML)": {
      "type": "Configuration",
      "description": "A YAML configuration file (`app/models/gamification/badge_types.yml`) that defines all available badges, the rules (events) that contribute to them, and the score thresholds for achieving different levels of each badge.",
      "interactions": {
        "interaction_0": "Defines the structure and requirements for `Gamification::Badge` instances."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification::UserLevels (YAML)": {
      "type": "Configuration",
      "description": "A YAML configuration file (`app/models/gamification/user_levels.yml`) that defines the different user levels, their required experience points (XP), titles, and associated images.",
      "interactions": {
        "interaction_0": "Used by PinboardUserStatePresenter to determine user levels ",
        "interaction_1": "Defines the progression and display properties for user levels based on accumulated XP."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Course::Admin::CertificateTemplatesController": {
      "type": "Controller",
      "description": "Manages CRUD operations for certificate templates within a specific course. Handles file uploads for PDF templates and provides a preview function for certificates. Requires 'certificate.template.manage' permission.",
      "interactions": {
        "interaction_0": "Interacts with Course::CertificateTemplatePresenter for display ",
        "interaction_1": "Manages Certificate::Template objects (inferred) [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_2": "Uses FileUpload for PDF uploads [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_3": "Delegates PDF rendering for preview to Certificate::Record::Render [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_4": "Uses Course::CertificateTemplatePresenter for display (inferred) [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_5": "Interacts with `Course::Course` to identify the current course. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_6": "Interacts with `Certificate::Template` model for persistence and data retrieval. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_7": "Utilizes `FileUpload` for handling PDF template uploads. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_8": "Calls `Certificate::Template#process_upload!` to associate uploaded files. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_9": "Invokes `Certificate::Template#preview_for` to generate preview data. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_10": "Delegates PDF rendering to `Certificate::Record::Render.call` for previews. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_11": "Uses `Course::CertificateTemplatePresenter` to prepare template data for display. [Source: app/controllers/course/admin/certificate_templates_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Course::Admin::OpenBadgeTemplatesController": {
      "type": "Controller",
      "description": "Manages CRUD operations for Open Badge templates within a specific course. Handles file uploads for PNG badge images. Requires 'certificate.template.manage' permission.",
      "interactions": {
        "interaction_0": "Interacts with Course::Course to find the current course [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_1": "Manages Certificate::OpenBadgeTemplate objects (inferred) [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_2": "Uses FileUpload for PNG image uploads [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_3": "Interacts with `Course::Course` to identify the current course. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_4": "Interacts with `Certificate::OpenBadgeTemplate` model for persistence and data retrieval. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_5": "Utilizes `FileUpload` for handling PNG badge image uploads. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_6": "Calls `Certificate::OpenBadgeTemplate#process_upload!` to associate uploaded files. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/open_badge_templates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Course::CertificatesController": {
      "type": "Controller",
      "description": "Handles user-facing display, download, and public verification of digital certificates and Open Badges. Integrates with proctoring services and external achievement data.",
      "interactions": {
        "interaction_0": "Interacts with Certificate::RecordPresenter for display ",
        "interaction_1": "Retrieves Certificate::Template and Certificate::Record objects (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_2": "Retrieves and \"bakes\" Certificate::OpenBadgeTemplate objects (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_3": "Uses Certificate::RecordPresenter and Course::DocumentsPresenter for display (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_4": "Communicates with external services for achievements via Restify [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_5": "Integrates with Proctoring::SmowlAdapter for proctoring checks (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_6": "Delegates PDF rendering to Certificate::Record::Render [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_7": "Sets meta tags for SEO/social sharing [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_8": "Uses Acfs for asynchronous data fetching [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_9": "Interacts with Course::Course and Course::Enrollment [Source: app/controllers/course/certificates_controller.rb]"
      },
      "techDebt": [
        "Multiple Acfs.run calls within actions, potentially indicating less optimized data fetching [Source: app/controllers/course/certificates_controller.rb]",
        "TODO: Improve checks in check_course_eligibility, suggesting potential gaps in access control [Source: app/controllers/course/certificates_controller.rb]",
        "Proctoring check (ensure_proctoring_passed!) only applied to CERT type, not ROA, which might be inconsistent [Source: app/controllers/course/certificates_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/certificates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::RecordRenderer": {
      "type": "Library/Service",
      "description": "A library responsible for generating PDF documents for certificates using Prawn and Prawn::QRCode. It handles template loading, dynamic content rendering (SVG), QR code embedding, proctoring images, and a transcript of records table. Supports custom brand-specific fonts.",
      "interactions": {
        "interaction_0": "Interacts with Certificate::Record (Model) to read certificate data ",
        "interaction_1": "Reads certificate data from an object (inferred to be Certificate::Record#render_data) [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_2": "Accesses Xikolo.config for certificate-related configurations (fonts, transcript of records) [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_3": "Loads fonts from brand-specific paths or default paths [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_4": "Uses `Prawn::Document` for PDF generation. [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_5": "Uses `Prawn::QRCode` for embedding QR codes. [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_6": "Reads configuration from `Xikolo.config` for font paths and transcript of records table settings. [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_7": "Accesses file system for font files and PDF templates. [Source: app/lib/certificate/record_renderer.rb]",
        "interaction_8": "Receives data for rendering from a `Certificate::RenderDataPresenter` (or similar data object). [Source: spec/lib/certificate/record_renderer_spec.rb]"
      },
      "techDebt": [
        "Hardcoded coordinates for proctoring image placement, potentially inflexible for different designs [Source: app/lib/certificate/record_renderer.rb]",
        "Specific workarounds for Prawn's font handling (disabling subsetting, custom identifiers), suggesting underlying complexities [Source: app/lib/certificate/record_renderer.rb]",
        "Font subsetting is currently disabled due to a Prawn issue, potentially leading to larger PDF file sizes. [Source: app/lib/certificate/record_renderer.rb]"
      ],
      "provenance": {
        "sources": [
          "app/lib/certificate/record_renderer.rb",
          "spec/lib/certificate/record_renderer_spec.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::Record::Render": {
      "type": "Operation",
      "description": "An application operation (service object) that encapsulates the process of rendering a certificate record into a PDF document. It acts as a wrapper for `Certificate::RecordRenderer`.",
      "interactions": {
        "interaction_0": "Interacts with Certificate::Record (Model) for rendering data ",
        "interaction_1": "Calls Certificate::RecordRenderer.as_pdf with the record's render data [Source: app/operations/certificate/record/render.rb]",
        "interaction_2": "Initializes with a `record` object (e.g., `Certificate::RecordOfAchievement`). [Source: app/operations/certificate/record/render.rb]",
        "interaction_3": "Calls `@record.render_data` to obtain the necessary data for rendering. [Source: app/operations/certificate/record/render.rb]",
        "interaction_4": "Delegates the actual PDF generation to `Certificate::RecordRenderer.as_pdf`. [Source: app/operations/certificate/record/render.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/certificate/record/render.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Proctoring::UploadCertificateImageJob": {
      "type": "Background Job",
      "description": "Intended to load a user's proctoring image from SMOWL and upload it to S3 for inclusion on certificates. Designed to be triggered after a proctored quiz submission.",
      "interactions": {
        "interaction_0": "(Intended) Interacts with Proctoring::SmowlAdapter to fetch images (inferred from description) [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_1": "(Intended) Interacts with S3 for image storage (inferred from description) [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_2": "Handles Proctoring::ServiceError with retries [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_3": "Inherits from ApplicationJob. [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_4": "Processed by Delayed (Delayed Job). [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_5": "Interacts with SMOWL API (external). [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_6": "Uploads images to Xikolo::S3. [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_7": "Queued on the `default` queue with `eventual` priority. [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_8": "Includes retry logic for `Proctoring::ServiceError`. [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "interaction_9": "Expected to interact with SMOWL API to fetch images and AWS S3 for storage (implementation not shown). [Source: app/jobs/proctoring/upload_certificate_image_job.rb]"
      },
      "techDebt": [
        "The perform method is currently empty, indicating that the core functionality is not implemented [Source: app/jobs/proctoring/upload_certificate_image_job.rb]",
        "The `perform` method is empty, suggesting the core logic for fetching and uploading the image is either missing or handled elsewhere. This could lead to confusion or incomplete functionality. [Source: app/jobs/proctoring/upload_certificate_image_job.rb]"
      ],
      "provenance": {
        "sources": [
          "app/jobs/proctoring/upload_certificate_image_job.rb",
          "cluster:14_LEARN_Achievements",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Certificate::Template": {
      "type": "Model",
      "description": "Represents a template for PDF certificates. Stores dynamic content (SVG), QR code position, certificate type, and a file URI for the PDF background. Can have associated `Certificate::Record`s.",
      "interactions": {
        "interaction_0": "Interacts with FileUpload (implied) for PDF uploads ",
        "interaction_1": "Has an association to Certificate::Record (implied by records.any? check) [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_2": "Handles file uploads (via process_upload!) (inferred) [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_3": "Provides methods for previewing and generating records (preview_for, record_for!) (inferred) [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_4": "Managed by `Course::Admin::CertificateTemplatesController`. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_5": "Processes file uploads via `process_upload!`. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_6": "Generates preview data via `preview_for`. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_7": "Associated with `Certificate::RecordOfAchievement` instances. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::OpenBadgeTemplate": {
      "type": "Model",
      "description": "Represents a template for Open Badges. Stores a file URI for the badge image, along with a name and description. Typically one per course.",
      "interactions": {
        "interaction_0": "Interacts with FileUpload (implied) for PNG image uploads ",
        "interaction_1": "Handles file uploads (via process_upload!) (inferred) [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_2": "Provides a method to \"bake\" an Open Badge for a user (bake!) (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_3": "Managed by `Course::Admin::OpenBadgeTemplatesController`. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_4": "Processes file uploads via `process_upload!`. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_5": "Associated with `Certificate::V2::OpenBadge` instances. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/open_badge_templates_controller.rb",
          "app/controllers/course/certificates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::Record": {
      "type": "Model",
      "description": "Represents an issued digital certificate or credential to a specific user for a specific course. Includes a unique verification code.",
      "interactions": {
        "interaction_0": "Associated with Certificate::Template, Course::Course, and User (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_1": "Provides a class method for verification (verify) (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_2": "Has methods to check eligibility for badges (eligible_for_badge?) and user status (user_deleted?) (inferred) [Source: app/controllers/course/certificates_controller.rb]",
        "interaction_3": "Provides data for rendering (render_data) (inferred) [Source: app/operations/certificate/record/render.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/certificates_controller.rb",
          "app/operations/certificate/record/render.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Admin::LtiProvidersController": {
      "type": "Controller",
      "description": "Manages global LTI Providers from the administrative interface. It provides standard CRUD operations for Lti::Provider records, allowing administrators to create, view, edit, and delete LTI tool configurations that are available across the platform.",
      "interactions": {
        "interaction_0": "Interacts with Course::Admin::LtiProviderForm (Form Object) for data input ",
        "interaction_1": "Requires `lti.provider.manage` permission for access .",
        "interaction_2": "Interacts with the `Lti::Provider` model for all data operations (e.g., `Lti::Provider.global.paginate`, `Lti::Provider.new`, `Lti::Provider.find`, `provider.save`, `provider.update`, `provider.destroy`) [Source: app/controllers/admin/lti_providers_controller.rb].",
        "interaction_3": "Uses `lti_provider_params` for strong parameter filtering, permitting fields like `consumer_key`, `shared_secret`, `domain`, `name`, `description`, `presentation_mode`, `privacy`, and `custom_fields` [Source: app/controllers/admin/lti_providers_controller.rb].",
        "interaction_4": "Inherits from `Admin::BaseController` for base administrative functionality."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/lti_providers_controller.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "LtiController": {
      "type": "Controller",
      "description": "Handles the core LTI consumer functionality, including launching external tools, processing grading callbacks from LTI tools, and managing returns after tool interactions. It acts as the primary interface for LTI-enabled course items.",
      "interactions": {
        "interaction_0": "Interacts with Course::LtiLaunchPresenter to prepare launch data ",
        "interaction_1": "Uses `before_action :set_no_cache_headers` to prevent caching.",
        "interaction_2": "Requires `ensure_logged_in` for `tool_launch` and `tool_return` actions [Source: app/controllers/lti_controller.rb].",
        "interaction_3": "Skips `verify_authenticity_token` for `tool_grading` and `tool_return` [Source: app/controllers/lti_controller.rb].",
        "interaction_4": "Skips `auth_middleware` for `tool_grading` [Source: app/controllers/lti_controller.rb].",
        "interaction_5": "`tool_launch` action finds `Course::Item` by UUID, uses `Course::LtiLaunchPresenter` to prepare launch data, and renders a plain layout view `items/lti_exercise/tool_launch` [Source: app/controllers/lti_controller.rb].",
        "interaction_6": "`tool_grading` action initializes `LtiController::ToolGrading` to process LTI outcome requests, handles errors, and renders an XML response [Source: app/controllers/lti_controller.rb].",
        "interaction_7": "`tool_return` action processes LTI messages/errors from external tools and redirects to the course item URL [Source: app/controllers/lti_controller.rb].",
        "interaction_8": "Interacts with `Course::Course` to retrieve course context [Source: app/controllers/lti_controller.rb].",
        "interaction_9": "Interacts with `Course::Item` to find the LTI exercise for launch [Source: app/controllers/lti_controller.rb].",
        "interaction_10": "Delegates LTI grade processing and validation to `LtiController::ToolGrading` [Source: app/controllers/lti_controller.rb].",
        "interaction_11": "Publishes analytics events via `Msgr` for LTI submissions [Source: app/controllers/lti_controller.rb].",
        "interaction_12": "Redirects users to course item URLs after LTI tool returns [Source: app/controllers/lti_controller.rb].",
        "interaction_13": "Interacts with `Course::Course` to determine authentication context [Source: app/controllers/lti_controller.rb].",
        "interaction_14": "Delegates to LtiController::ToolGrading for LTI outcome processing. [Source: app/controllers/lti_controller.rb]",
        "interaction_15": "Uses Course::LtiLaunchPresenter to prepare launch data. [Source: app/controllers/lti_controller.rb]",
        "interaction_16": "Redirects users after LTI interactions (`tool_return`), displaying messages or errors.",
        "interaction_17": "Interacts with `Course::Item` and `Course::Course` models to retrieve context.",
        "interaction_18": "Skips CSRF verification and authentication middleware for `tool_grading` to accommodate LTI 1.x callback requirements.",
        "interaction_19": "Receives LTI launch requests (`tool_launch`) and prepares data using `Course::LtiLaunchPresenter`.",
        "interaction_20": "Receives LTI outcome requests (`tool_grading`) and delegates processing to the nested `ToolGrading` class."
      },
      "techDebt": [
        "The `ToolGrading` class is an inner class; extracting it into a dedicated service object would improve modularity and testability [Source: app/controllers/lti_controller.rb].",
        "Hardcoded constants like `MAXIMUM_SESSION_AGE` and `SCORE_REGEXP` within `ToolGrading` could be externalized for better configuration management [Source: app/controllers/lti_controller.rb].",
        "The `user_agent` is unavailable for backend LTI submission requests, leading to a gap in analytics data [Source: app/controllers/lti_controller.rb].",
        "The `ToolGrading` class, while nested, is substantial and could be extracted into a dedicated service object for better modularity and testability."
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "spec/controllers/lti_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "LtiController::ToolGrading": {
      "type": "Service Object",
      "description": "A nested service object within `LtiController` responsible for processing incoming LTI tool grading requests. It handles request validation, score submission to the gradebook, and publishing analytics events.",
      "interactions": {
        "interaction_0": "Initialized with the `request` object and `course_id` [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Parses LTI outcome requests using `IMS::LTI::OutcomeRequest.from_post_request(request)` [Source: app/controllers/lti_controller.rb].",
        "interaction_2": "Authorizes requests using `IMS::LTI::ToolConsumer` with `Lti::Provider`'s `consumer_key` and `shared_secret` [Source: app/controllers/lti_controller.rb].",
        "interaction_3": "Validates request ID and checks for session expiry based on `MAXIMUM_SESSION_AGE` [Source: app/controllers/lti_controller.rb].",
        "interaction_4": "Submits scores to `Lti::Gradebook` via `gradebook.submit!` [Source: app/controllers/lti_controller.rb].",
        "interaction_5": "Publishes LTI submission events to `xikolo.web.exp_event.create` via `Msgr` for analytics, including `user` (UUID), `verb` (SUBMITTED_LTI_V2), `resource` (LTI exercise UUID), and `in_context` (course_id, score, provider details, user_ip) [Source: app/controllers/lti_controller.rb].",
        "interaction_6": "Generates XML responses for the LTI tool using `IMS::LTI::OutcomeResponse` [Source: app/controllers/lti_controller.rb].",
        "interaction_7": "Interacts with `Lti::Gradebook`, `Lti::Exercise`, and `Lti::Provider` models [Source: app/controllers/lti_controller.rb].",
        "interaction_8": "Receives `request` and `course_id` from `LtiController` [Source: app/controllers/lti_controller.rb].",
        "interaction_9": "Uses `IMS::LTI::OutcomeRequest` to parse the incoming LTI request [Source: app/controllers/lti_controller.rb].",
        "interaction_10": "Interacts with `Lti::Gradebook` to find the relevant gradebook entry and submit the score [Source: app/controllers/lti_controller.rb].",
        "interaction_11": "Uses `IMS::LTI::ToolConsumer` for OAuth signature verification with `Lti::Provider` credentials [Source: app/controllers/lti_controller.rb].",
        "interaction_12": "Publishes `SUBMITTED_LTI_V2` events via `Msgr` [Source: app/controllers/lti_controller.rb].",
        "interaction_13": "Publishes messages via Msgr (RabbitMQ). [Source: app/controllers/lti_controller.rb]",
        "interaction_14": "Verifies LTI OAuth 1.0a signatures and session validity using `IMS::LTI::ToolConsumer`.",
        "interaction_15": "Interacts with `Lti::Gradebook` to find and update grade entries.",
        "interaction_16": "Creates `Lti::Grade` records.",
        "interaction_17": "Publishes `SUBMITTED_LTI_V2` analytics events to RabbitMQ via `Msgr`.",
        "interaction_18": "Retrieves LTI provider credentials (`consumer_key`, `shared_secret`) from `Lti::Provider`.",
        "interaction_19": "Parses incoming LTI XML using `IMS::LTI::OutcomeRequest`."
      },
      "techDebt": [
        "Being an inner class limits its reusability and makes testing slightly more cumbersome than a standalone service object [Source: app/controllers/lti_controller.rb].",
        "Hardcoded `MAXIMUM_SESSION_AGE` and `SCORE_REGEXP` could be configurable [Source: app/controllers/lti_controller.rb].",
        "Could be extracted into a standalone service object (`Lti::ToolGradingService`) for improved separation of concerns and easier testing outside the controller context.",
        "Error handling for `ValidationError` could provide more specific feedback for debugging."
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "spec/controllers/lti_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "LtiProvidersController": {
      "type": "Controller",
      "description": "Manages course-specific LTI Providers. This controller allows users with appropriate permissions (e.g., course administrators) to create, update, and delete LTI tool configurations tied to a particular course.",
      "interactions": {
        "interaction_0": "Interacts with Course::Admin::LtiProviderForm (Form Object) for data input ",
        "interaction_1": "Requires `lti.provider.manage` permission for access .",
        "interaction_2": "Responds to JSON requests (`respond_to :json`) [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_3": "Uses `Acfs.run` due to `inside_course` and before actions needing Acfs [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_4": "Interacts with `Lti::Provider` model, specifically `Lti::Provider.where(course_id: the_course.id)` for course-scoped operations [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_5": "Filters `privacy` parameter based on `current_user.allowed?('lti.provider.edit_privacy_mode')`, restricting who can change this setting .",
        "interaction_6": "Uses `lti_provider_params` for strong parameter filtering, including `course_id` [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_7": "Uses `CourseContextHelper` to operate within a course context [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_8": "Interacts with `Lti::Provider` model for CRUD operations [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_9": "Filters `lti_provider_params` based on `current_user` permissions, specifically for the `privacy` attribute [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_10": "Uses Course::Admin::LtiProviderForm for form handling. [Source: app/controllers/lti_providers_controller.rb]",
        "interaction_11": "Uses Acfs for concurrent data fetching. [Source: app/controllers/lti_providers_controller.rb]",
        "interaction_12": "Checks current_user permissions via Xikolo::Common::Auth::CurrentUser. [Source: app/controllers/lti_providers_controller.rb]",
        "interaction_13": "Renders the `index` view, which likely includes forms for new and existing providers.",
        "interaction_14": "Uses `Acfs.run` to ensure microservice context is available for course-related data.",
        "interaction_15": "Interacts with the `Lti::Provider` model for all database operations.",
        "interaction_16": "Uses `CourseContextHelper` to establish the course context.",
        "interaction_17": "Filters `privacy` parameters based on the `lti.provider.edit_privacy_mode` permission of the `current_user`."
      },
      "techDebt": [
        "The client-side logic for the privacy confirmation modal (as per RAG) is not visible in the controller, which is expected but means the full interaction flow is split .",
        "The `filter_privacy` method directly manipulates `params`. A more robust approach might involve a policy object or conditional attribute assignment within the form object."
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_providers_controller.rb",
          "spec/controllers/lti_providers_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Course::Admin::LtiProviderForm": {
      "type": "Form Object",
      "description": "A form object used for validating and structuring input data for LTI Provider creation and updates, primarily within the administrative interface. It defines the expected attributes and applies validations.",
      "interactions": {
        "interaction_0": "Inherits from `XUI::Form` [Source: app/forms/course/admin/lti_provider_form.rb].",
        "interaction_1": "Defines attributes such as `id` (uuid), `name`, `description`, `domain`, `consumer_key`, `shared_secret`, `presentation_mode`, `privacy`, and `custom_fields` [Source: app/forms/course/admin/lti_provider_form.rb].",
        "interaction_2": "Includes validations for `name`, `domain`, `consumer_key`, and `shared_secret` to ensure their presence [Source: app/forms/course/admin/lti_provider_form.rb].",
        "interaction_3": "Inherits from XUI::Form. [Source: app/forms/course/admin/lti_provider_form.rb]",
        "interaction_4": "Defines attributes like `name`, `domain`, `consumer_key`, `shared_secret`, `presentation_mode`, `privacy`, and `custom_fields`.",
        "interaction_5": "Used by `LtiProvidersController` to handle form submissions and apply validations."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/course/admin/lti_provider_form.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Lti::PublishGradeJob": {
      "type": "Background Job",
      "description": "A background job responsible for publishing a user's LTI grade to the course service. This ensures that LTI grades are properly accounted for in the overall course progress and grading system.",
      "interactions": {
        "interaction_0": "Queued with `queue_as :default` [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_1": "Performs by finding an `Lti::Grade` record by `grade_id` [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_2": "Calls the `publish!` method on the found `Lti::Grade` object, which integrates the grade into the course progress [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_3": "Finds an `Lti::Grade` by ID [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_4": "Calls the `publish!` method on the `Lti::Grade` instance, which is expected to interact with the `CourseService` for grade integration [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_5": "Inherits from ApplicationJob. [Source: app/jobs/lti/publish_grade_job.rb]",
        "interaction_6": "Processed by Delayed (Delayed Job). [Source: app/jobs/lti/publish_grade_job.rb]",
        "interaction_7": "Invokes the `publish!` method on the `Lti::Grade` instance. [Source: app/jobs/lti/publish_grade_job.rb]",
        "interaction_8": "Finds an `Lti::Grade` record by ID.",
        "interaction_9": "Queued on the `default` queue. [Source: app/jobs/lti/publish_grade_job.rb]",
        "interaction_10": "Finds an `Lti::Grade` record by ID. [Source: app/jobs/lti/publish_grade_job.rb]"
      },
      "techDebt": [
        "The implementation of `Lti::Grade#publish!` is not provided, making it difficult to assess its robustness, error handling, and interaction with other services (e.g., `CourseService`) [Source: app/jobs/lti/publish_grade_job.rb]."
      ],
      "provenance": {
        "sources": [
          "app/jobs/lti/publish_grade_job.rb",
          "cluster:17_LEARN_LTIIntegration",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Lti::Exercise::Store": {
      "type": "Operation",
      "description": "An operation class dedicated to storing and updating `Lti::Exercise` objects, with a specific focus on managing exercise instructions that may contain embedded S3 file uploads.",
      "interactions": {
        "interaction_0": "Initializes with an `Lti::Exercise` object and `params` [Source: app/operations/lti/exercise/store.rb].",
        "interaction_1": "If `instructions` are present in params, it uses `Xikolo::S3::TextWithUploadsProcessor` to manage the text and associated S3 files [Source: app/operations/lti/exercise/store.rb].",
        "interaction_2": "Configures S3 upload properties like `bucket`, `purpose`, `key`, `acl`, `cache_control`, `content_disposition`, and `content_type` [Source: app/operations/lti/exercise/store.rb].",
        "interaction_3": "Schedules `S3FileDeletionJob` to remove obsolete S3 files after a 1-minute delay, providing fault tolerance [Source: app/operations/lti/exercise/store.rb].",
        "interaction_4": "Handles saving the `Lti::Exercise` and committing/rolling back `Xikolo::S3::TextWithUploadsProcessor` changes based on validation success [Source: app/operations/lti/exercise/store.rb].",
        "interaction_5": "Enqueues S3FileDeletionJob. [Source: app/operations/lti/exercise/store.rb]",
        "interaction_6": "Uses `Xikolo::S3::TextWithUploadsProcessor` to parse and manage S3 file references within the exercise instructions.",
        "interaction_7": "Configures S3 upload parameters (bucket, purpose, ACL, cache control).",
        "interaction_8": "Enqueues `S3FileDeletionJob` for obsolete S3 files after a delay to ensure pages with old references have loaded.",
        "interaction_9": "Updates attributes of an `Lti::Exercise` model."
      },
      "techDebt": [
        "The delayed deletion of S3 files, while fault-tolerant, requires careful consideration of eventual consistency and potential race conditions if instructions are rapidly updated."
      ],
      "provenance": {
        "sources": [
          "app/operations/lti/exercise/store.rb",
          "spec/operations/lti/exercise/store_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "LtiExerciseItemPresenter": {
      "type": "Presenter",
      "description": "Prepares and formats data for displaying LTI exercise items in the user interface. It determines how an LTI exercise should be rendered (e.g., intro page or iframe), calculates scores, and provides necessary URLs.",
      "interactions": {
        "interaction_0": "Inherits from `ItemPresenter` and includes `MarkdownHelper` for rendering markdown content [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_1": "Builds presenter instances with `item`, `course`, `user`, and `params` [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_2": "Determines if an intro page or an embedded launch iframe (`items/lti_exercise/launch_iframe`) should be shown based on `needs_intro?` logic, which considers `external?`, `exercise_without_points?`, and `@initial_click` [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_3": "Calculates `score` and `percentage` based on `lti_grades` retrieved from `Lti::Gradebook` and `Lti::Grade` for the current user [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_4": "Provides `instructions_html` by rendering markdown from `exercise.instructions` [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_5": "Generates `tool_launch_path` and `open_path` using `Rails.application.routes.url_helpers` [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_6": "Interacts with `Lti::Exercise` to get exercise details and `Lti::Provider` (via exercise) for presentation mode [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_7": "Interacts with `Lti::Exercise` to retrieve exercise details [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_8": "Interacts with `Lti::Provider` to determine presentation mode and retrieve provider details [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_9": "Retrieves `Lti::Gradebook` and `Lti::Grade` records for the current user and exercise to display scores [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_10": "Generates URLs for LTI tool launches using `Rails.application.routes.url_helpers` [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_11": "Interacts with Lti::Exercise model. [Source: app/presenters/lti_exercise_item_presenter.rb]",
        "interaction_12": "Interacts with Lti::Gradebook model. [Source: app/presenters/lti_exercise_item_presenter.rb]",
        "interaction_13": "Calculates and presents the user's score and percentage for the LTI exercise.",
        "interaction_14": "Determines the `partial_name` to render, deciding between an intro page or an embedded iframe based on exercise type and presentation mode.",
        "interaction_15": "Generates `tool_launch_path` and `open_path` for LTI tool interaction."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/lti_exercise_item_presenter.rb",
          "spec/presenters/lti_exercise_item_presenter_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Lti::Provider": {
      "type": "Model",
      "description": "Represents an external LTI tool provider, storing its configuration details such as name, domain, consumer key, shared secret, presentation mode, and privacy settings. It can be global or course-specific.",
      "interactions": {
        "interaction_0": "Used by Course::Admin::LtiProviderForm (Form Object) for attribute definition ",
        "interaction_1": "Managed by `LtiProvidersController` for course-specific instances [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_2": "Attributes include `consumer_key`, `shared_secret`, `domain`, `name`, `description`, `presentation_mode`, `privacy`, and `custom_fields` [Source: app/controllers/admin/lti_providers_controller.rb, app/controllers/lti_providers_controller.rb, app/forms/course/admin/lti_provider_form.rb].",
        "interaction_3": "Used by `LtiController::ToolGrading` to authorize incoming LTI requests via `IMS::LTI::ToolConsumer` [Source: app/controllers/lti_controller.rb].",
        "interaction_4": "Referenced by `Lti::Exercise` to determine the associated tool provider [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_5": "Managed by `LtiProvidersController` (CRUD operations) [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_6": "Used by `LtiController::ToolGrading` for OAuth signature verification [Source: app/controllers/lti_controller.rb].",
        "interaction_7": "Referenced by `Lti::Exercise` to link an exercise to its provider [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_8": "Used by `LtiExerciseItemPresenter` to determine presentation mode and display provider details [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_9": "Used by LtiController::ToolGrading. [Source: app/controllers/lti_controller.rb]",
        "interaction_10": "Used by Course::LtiLaunchPresenter. [Source: app/presenters/course/lti_launch_presenter.rb]",
        "interaction_11": "Determines user data sharing based on its `privacy` attribute during LTI launches.",
        "interaction_12": "Influences the `presentation_mode` for LTI tool launches.",
        "interaction_13": "Created, read, updated, and deleted by `LtiProvidersController`.",
        "interaction_14": "Provides `consumer_key` and `shared_secret` for LTI OAuth 1.0a signature verification in `ToolGrading`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/lti_providers_controller.rb",
          "app/controllers/lti_controller.rb",
          "app/controllers/lti_providers_controller.rb",
          "app/forms/course/admin/lti_provider_form.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "spec/controllers/lti_controller_spec.rb",
          "spec/controllers/lti_providers_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Lti::Gradebook": {
      "type": "Model",
      "description": "Acts as a bridge between a user, an LTI exercise, and the grades submitted for it. It is identified by the `sourcedId` provided by the LTI tool.",
      "interactions": {
        "interaction_0": "Interacts with Lti::Exercise (Model) for exercise context ",
        "interaction_1": "Interacts with User (Model/Entity) for user context ",
        "interaction_2": "Interacts with Course::Course (Model) for course context ",
        "interaction_3": "Used by `LtiController::ToolGrading` to find the correct gradebook entry and submit scores [Source: app/controllers/lti_controller.rb].",
        "interaction_4": "Has `grades` association, used by `LtiExerciseItemPresenter` to retrieve user scores [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_5": "Interacted with by LtiController::ToolGrading. [Source: app/controllers/lti_controller.rb]",
        "interaction_6": "Manages Lti::Grade records. [Source: app/controllers/lti_controller.rb]",
        "interaction_7": "Manages `Lti::Grade` records for a specific user and exercise.",
        "interaction_8": "Provides a `submit!` method to record new grades.",
        "interaction_9": "Found by `ToolGrading` using the `lis_result_sourcedid` from LTI outcome requests.",
        "interaction_10": "Stores `user_id` and `lti_exercise_id`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "spec/controllers/lti_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Lti::Grade": {
      "type": "Model",
      "description": "Represents a single grade submission for an LTI exercise, storing the score and potentially other metadata.",
      "interactions": {
        "interaction_0": "Created or updated via `Lti::Gradebook` (`gradebook.submit!`) [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Processed by `Lti::PublishGradeJob` to publish the grade to the course service (`grade.publish!`) [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_2": "Queried by `LtiExerciseItemPresenter` to display user scores (`gradebooks.where(user_id: @user.id).first&.grades`) [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_3": "Created/updated by `LtiController::ToolGrading` via `Lti::Gradebook` [Source: app/controllers/lti_controller.rb].",
        "interaction_4": "Retrieved by `LtiExerciseItemPresenter` to display user scores [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_5": "Processed by `Lti::PublishGradeJob` to publish grades to the course service [Source: app/jobs/lti/publish_grade_job.rb].",
        "interaction_6": "Created/updated by Lti::Gradebook. [Source: app/controllers/lti_controller.rb]",
        "interaction_7": "Processed by Lti::PublishGradeJob. [Source: app/jobs/lti/publish_grade_job.rb]",
        "interaction_8": "Processed by `Lti::PublishGradeJob` to update course progress.",
        "interaction_9": "Created or updated by `Lti::Gradebook#submit!`.",
        "interaction_10": "Referenced by `LtiExerciseItemPresenter` to display user scores."
      },
      "techDebt": [
        "The `publish!` method's implementation is not provided, which is a critical part of the grade integration workflow [Source: app/jobs/lti/publish_grade_job.rb]."
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/jobs/lti/publish_grade_job.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "spec/controllers/lti_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Course::Item": {
      "type": "Model",
      "description": "Represents an individual content item within a course, which can be configured as an LTI exercise.",
      "interactions": {
        "interaction_0": "Found by `LtiController#tool_launch` using its UUID to initiate an LTI launch [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Passed to `LtiExerciseItemPresenter` for rendering and data preparation [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_2": "Belongs to a `Course::Section`. [Source: app/models/course/item.rb]",
        "interaction_3": "Belongs to a polymorphic `content` (e.g., `Lti::Exercise`, `Video::Video`, `Course::Richtext`). [Source: app/models/course/item.rb]",
        "interaction_4": "Has one `Course::Structure::Item` (node). [Source: app/models/course/item.rb]",
        "interaction_5": "Has many `Course::Result` and `Course::Visit` records. [Source: app/models/course/item.rb]",
        "interaction_6": "Delegates `course` to `section`. [Source: app/models/course/item.rb]",
        "interaction_7": "Interacts with `Course::Enrollment` for submission deadlines in reactivated courses. [Source: app/models/course/item.rb]"
      },
      "techDebt": [
        "The `course_archived` method has a `TODO: This needs to be fixed in a presenter to avoid N+1 queries` comment. [Source: app/models/course/item.rb]",
        "Known limitations for item prerequisites: surveys cannot be required, deletion of required items is not handled, and locked/unpublished items should not be required. "
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "app/models/course/item.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Course::Course": {
      "type": "Model",
      "description": "Represents a course within the platform, providing the context for course-specific LTI providers and LTI-enabled items.",
      "interactions": {
        "interaction_0": "Used by `LtiController` to retrieve the course context (`course.context_id`) and find courses by identifier (`Course::Course.by_identifier`) [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Used by `LtiProvidersController` to scope LTI providers to a specific course (`course_id: the_course.id`) [Source: app/controllers/lti_providers_controller.rb].",
        "interaction_2": "Passed to `LtiExerciseItemPresenter` to generate course-specific URLs [Source: app/presenters/lti_exercise_item_presenter.rb].",
        "interaction_3": "Accessed by `Course::Admin::CertificateTemplatesController` to scope templates. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_4": "Accessed by `Course::Admin::OpenBadgeTemplatesController` to scope templates. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]",
        "interaction_5": "Belongs to a `Course::Channel`. [Source: app/models/course/course.rb]",
        "interaction_6": "Initializes `Course::Statistics` for course statistics. [Source: app/models/course/course.rb]",
        "interaction_7": "Retrieves visual assets from `Xikolo::S3`. [Source: app/models/course/course.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/controllers/lti_providers_controller.rb",
          "app/presenters/lti_exercise_item_presenter.rb",
          "app/models/course/course.rb",
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "app/controllers/course/admin/open_badge_templates_controller.rb",
          "cluster:14_LEARN_Achievements",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements",
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Xikolo::S3::TextWithUploadsProcessor": {
      "type": "Service",
      "description": "A service object responsible for parsing text content, identifying new file uploads, managing existing S3 references, and preparing the text for storage. It handles the actual S3 upload/deletion operations and ensures consistency of file references within the text.",
      "interactions": {
        "interaction_0": "Scans text for `upload://` URIs. [Source: gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb]",
        "interaction_1": "Interacts with `Xikolo::S3.bucket_for` for both upload and destination buckets. [Source: gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb]",
        "interaction_2": "Checks S3 object metadata (`xikolo-state`, `xikolo-purpose`) for validity of uploads. [Source: gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb]",
        "interaction_3": "Copies files between S3 locations. [Source: gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb]",
        "interaction_4": "Reports errors related to S3 operations or invalid references. [Source: gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb]",
        "interaction_5": "Invoked by `PagesController` to process page content before saving.",
        "interaction_6": "Interacts with S3 (via `xikolo-s3` gem) to upload and manage files.",
        "interaction_7": "Provides `result` (processed text), `valid?`, `commit!`, `rollback!`, and `obsolete_uris` methods to `PagesController`.",
        "interaction_8": "Used by `PagesController` for static page updates.",
        "interaction_9": "Used by `Course::Richtext::Store` for course rich text updates.",
        "interaction_10": "Interacts with S3 for file operations (upload, check existence).",
        "interaction_11": "Provides `obsolete_uris` for `S3FileDeletionJob`.",
        "interaction_12": "Used by `Video::Store` to handle video descriptions. [Source: app/operations/video/store.rb]",
        "interaction_13": "Instantiated by `Lti::Exercise::Store` to handle the `instructions` field of an `Lti::Exercise` [Source: app/operations/lti/exercise/store.rb].",
        "interaction_14": "Configured with `bucket`, `purpose`, `current` text, `text` input, and `valid_refs` [Source: app/operations/lti/exercise/store.rb].",
        "interaction_15": "Defines `on_new` callback to specify S3 key, ACL, cache control, content disposition, and content type for new uploads [Source: app/operations/lti/exercise/store.rb].",
        "interaction_16": "Provides methods like `parse!`, `result`, `valid?`, `commit!`, `rollback!`, and `obsolete_uris` [Source: app/operations/lti/exercise/store.rb]."
      },
      "techDebt": [
        "As a custom implementation, it carries a maintenance burden; comprehensive tests and clear documentation are crucial."
      ],
      "provenance": {
        "sources": [
          "app/operations/lti/exercise/store.rb",
          "gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb",
          "app/controllers/pages_controller.rb",
          "app/operations/video/store.rb",
          "app/operations/course/richtext/store.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:17_LEARN_LTIIntegration",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "17_LEARN_LTIIntegration",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "S3FileDeletionJob": {
      "type": "Background Job",
      "description": "An asynchronous background job responsible for deleting obsolete files from S3. It is scheduled by `PagesController` with a delay to provide fault tolerance and allow pages to finish loading for users with slow connections.",
      "interactions": {
        "interaction_0": "Scheduled by `Lti::Exercise::Store` to delete obsolete S3 files associated with LTI exercise instructions. The job is set to wait for 1 minute before performing [Source: app/operations/lti/exercise/store.rb].",
        "interaction_1": "Enqueued by `PagesController` after a successful page update that results in obsolete S3 files.",
        "interaction_2": "Scheduled by `PagesController` for obsolete static page files.",
        "interaction_3": "Scheduled by `Course::Richtext` (on destroy) and `Course::Richtext::Store` (on update) for obsolete course rich text files.",
        "interaction_4": "Interacts with `Xikolo::S3` to perform the actual S3 object deletion (implied, as it takes `file_uri` as argument and `Banner` uses `Xikolo::S3` for deletion) [Source: app/models/banner.rb, lib/tasks/create_banner.rake].",
        "interaction_5": "Enqueued by `Video::Store` to delete replaced attachment files. [Source: app/operations/video/store.rb]",
        "interaction_6": "Receives an S3 URI as an argument. [Source: app/jobs/s3_file_deletion_job.rb]",
        "interaction_7": "Calls `Xikolo::S3.object(uri).delete` to remove the file from S3. [Source: app/jobs/s3_file_deletion_job.rb]",
        "interaction_8": "Reports errors to Mnemosyne and Sentry. [Source: app/jobs/s3_file_deletion_job.rb]"
      },
      "techDebt": [
        "The delayed deletion means obsolete files temporarily remain in S3 storage, which is a trade-off for fault tolerance."
      ],
      "provenance": {
        "sources": [
          "app/operations/lti/exercise/store.rb",
          "app/controllers/pages_controller.rb",
          "app/models/course/visual.rb",
          "app/operations/video/store.rb",
          "spec/operations/video/store_spec.rb",
          "app/jobs/s3_file_deletion_job.rb",
          "app/models/banner.rb",
          "lib/tasks/create_banner.rake",
          "app/models/course/richtext.rb",
          "app/operations/course/richtext/store.rb",
          "spec/models/course/richtext_spec.rb",
          "spec/operations/course/richtext/store_spec.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:13_LEARN_FileManagement",
          "cluster:17_LEARN_LTIIntegration",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "13_LEARN_FileManagement",
          "17_LEARN_LTIIntegration",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Msgr": {
      "type": "Library/Service",
      "description": "A client for the RabbitMQ message broker, used for asynchronous inter-service communication. In this context, it's used to publish referrer tracking data to a dedicated topic for the `lanalytics` service.",
      "interactions": {
        "interaction_0": "Receives events from Xikolo::Account::Application.routes (Microservice Routing) ",
        "interaction_1": "Receives events from Xikolo::Course::Application.routes (Microservice Routing) ",
        "interaction_2": "Receives events from Xikolo::News::Application.routes (Microservice Routing) ",
        "interaction_3": "Receives events from Xikolo::Notification::Application.routes (Microservice Routing) ",
        "interaction_4": "Receives events from Xikolo::Pinboard::Application.routes (Microservice Routing) ",
        "interaction_5": "Receives events from Xikolo::Quiz::Application.routes (Microservice Routing) ",
        "interaction_6": "Receives events from Xikolo::TimeEffort::Application.routes (Microservice Routing) ",
        "interaction_7": "Receives events from Document (Model - Course Microservice) ",
        "interaction_8": "Receives events from DocumentLocalization (Model - Course Microservice) ",
        "interaction_9": "Publishes `Helpdesk::Ticket` creation events to RabbitMQ. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_10": "Subscribes to specific message queues on RabbitMQ based on defined routes. [Source: config/msgr.rb]",
        "interaction_11": "Routes incoming RabbitMQ messages to designated application controllers or handlers (e.g., `gamification#vote_create`). [Source: config/msgr.rb]",
        "interaction_12": "Receives a `Helpdesk::Ticket`'s JSON representation and publishes it to the `xikolo.helpdesk.ticket.create` topic. [Source: app/models/helpdesk/ticket.rb, spec/models/helpdesk/ticket_spec.rb]",
        "interaction_13": "Run as a separate process via `bundle exec msgr` in `Procfile` and `bin/entrypoint` [Source: Procfile, bin/entrypoint]",
        "interaction_14": "Configured via `config/rabbitmq.yml` using `ENV['XIKOLO_RABBITMQ_URL']` ",
        "interaction_15": "Publishes `xikolo.submission.submission.create` events to the RabbitMQ message queue.",
        "interaction_16": "Used by `LtiController::ToolGrading` to publish LTI submission events to the `xikolo.web.exp_event.create` topic [Source: app/controllers/lti_controller.rb].",
        "interaction_17": "Other services publish notification event data to Msgr topics. [Source: services/notification/README.md]",
        "interaction_18": "NotificationService subscribes to Msgr topics to receive event data. [Source: services/notification/README.md]",
        "interaction_19": "Receives JSON payloads from `TracksReferrers` and publishes them to the `xikolo.web.referrer` topic. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_20": "Receives messages from `Document` model (after_create, after_update, soft_delete).",
        "interaction_21": "Receives messages from `DocumentLocalization` model (after_create, after_update, soft_delete).",
        "interaction_22": "Connects to RabbitMQ for message exchange [Source: Gemfile, config/rabbitmq.yml]",
        "interaction_23": "Routes messages to specific handlers (e.g., for gamification events) [Source: config/msgr.rb]",
        "interaction_24": "Integrates with Puma's `before_fork` hook to stop client connections gracefully [Source: config/puma.rb]",
        "interaction_25": "Consumes messages from RabbitMQ (configured via `config/rabbitmq.yml`).",
        "interaction_26": "Routes messages to the `Gamification` component (e.g., `gamification#vote_create`).",
        "interaction_27": "Receives events from `Xikolo::Pinboard` and `Xikolo::Course` services.",
        "interaction_28": "Publishes messages from services to RabbitMQ. [Source: Gemfile, services/*/Gemfile]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "Gemfile",
          "config/msgr.rb",
          "config/rabbitmq.yml",
          "config/puma.rb",
          "app/models/helpdesk/ticket.rb",
          "services/course/app/models/document.rb",
          "services/course/app/models/document_localization.rb",
          "services/notification/README.md",
          "services/*/Gemfile",
          "Procfile",
          "bin/entrypoint",
          "app/controllers/quiz_submission_controller.rb",
          "spec/models/helpdesk/ticket_spec.rb",
          "cluster:10_LEARN_QuizAssessment",
          "cluster:17_LEARN_LTIIntegration",
          "cluster:21_COMM_Notifications",
          "cluster:22_COMM_ReferralTracking",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:33_ADMIN_Support",
          "cluster:40_INFRA_SystemCore",
          "cluster:42_INFRA_BackgroundJobs",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment",
          "17_LEARN_LTIIntegration",
          "21_COMM_Notifications",
          "22_COMM_ReferralTracking",
          "32_ADMIN_ContentManagement",
          "33_ADMIN_Support",
          "40_INFRA_SystemCore",
          "42_INFRA_BackgroundJobs",
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "IMS::LTI::OutcomeRequest": {
      "type": "Library Class",
      "description": "A class from the IMS LTI library used to parse and represent incoming LTI outcome requests, which typically contain grading information.",
      "interactions": {
        "interaction_0": "Used by `LtiController::ToolGrading` to parse the raw HTTP request into a structured LTI outcome request object (`IMS::LTI::OutcomeRequest.from_post_request(request)`) [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Provides access to request parameters like `lis_result_sourcedid` (grading ID), `score`, `message_identifier`, and `operation` [Source: app/controllers/lti_controller.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "IMS::LTI::ToolConsumer": {
      "type": "Library Class",
      "description": "A class from the IMS LTI library used to represent the LTI tool consumer (i.e., the Xikolo platform) and perform authentication/authorization checks for incoming LTI requests.",
      "interactions": {
        "interaction_0": "Instantiated by `LtiController::ToolGrading` with the `Lti::Provider`'s `consumer_key` and `shared_secret` [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Used to validate the authenticity of incoming LTI requests via `consumer.valid_request? @request` [Source: app/controllers/lti_controller.rb].",
        "interaction_2": "Provides access to OAuth parameters like `request_oauth_timestamp` and `request_oauth_nonce` for session expiry checks and nonce generation [Source: app/controllers/lti_controller.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "IMS::LTI::OutcomeResponse": {
      "type": "Library Class",
      "description": "A class from the IMS LTI library used to construct and generate XML responses for LTI outcome requests, indicating the success or failure of a grading operation.",
      "interactions": {
        "interaction_0": "Instantiated by `LtiController::ToolGrading` to build the response XML [Source: app/controllers/lti_controller.rb].",
        "interaction_1": "Configured with `message_ref_identifier`, `operation`, `severity`, `code_major` (e.g., 'success', 'failure', 'unsupported'), based on the processing outcome [Source: app/controllers/lti_controller.rb].",
        "interaction_2": "Generates the final XML response via `generate_response_xml` [Source: app/controllers/lti_controller.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Course::Admin::ItemTimeEffortController": {
      "type": "Controller",
      "description": "A Rails controller in the main application responsible for handling administrative requests related to course item time effort. It acts as an intermediary, processing frontend AJAX requests, performing authorization, and communicating with the `Xikolo::TimeEffort` and `Xikolo::CourseService` microservices.",
      "interactions": {
        "interaction_0": "Interacts with User (Model/Entity) for authorization ",
        "interaction_1": "Communicates with the `Xikolo::TimeEffort` microservice (via `Xikolo.api(:timeeffort)` and `Restify`) to fetch, update, or delete time effort data for course items. [Source: app/controllers/course/admin/item_time_effort_controller.rb]",
        "interaction_2": "Communicates with the `Xikolo::CourseService` microservice (via `Xikolo.api(:course)` and `Restify`) to retrieve course context for authorization. [Source: app/controllers/course/admin/item_time_effort_controller.rb]",
        "interaction_3": "Performs authorization checks using `authorize! 'course.content.edit'`. [Source: app/controllers/course/admin/item_time_effort_controller.rb]",
        "interaction_4": "Receives AJAX GET, PUT, and DELETE requests from the `_time_effort.html.slim` frontend component. [Source: app/controllers/course/admin/item_time_effort_controller.rb]"
      },
      "techDebt": [
        "Error handling for `Restify::ClientError` is generic, returning simple messages like 'show_time_effort_failed'. It does not appear to parse or utilize the more specific error types defined within the `Xikolo::TimeEffort` microservice, leading to less informative user feedback. [Source: app/controllers/course/admin/item_time_effort_controller.rb, services/timeeffort/lib/errors.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/item_time_effort_controller.rb",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "_time_effort.html.slim": {
      "type": "View / Frontend Component",
      "description": "A Slim template partial that renders the user interface for displaying and managing the time effort of a course item. It includes embedded JavaScript to handle interactive elements and AJAX communication with the backend.",
      "interactions": {
        "interaction_0": "Interacts with Course::Admin::ItemTimeEffortController for AJAX requests ",
        "interaction_1": "Interacts with Xikolo::Course::Item (Microservice Client) for item context ",
        "interaction_2": "Initiates AJAX GET requests to `Course::Admin::ItemTimeEffortController#show` to fetch initial time effort data. [Source: app/views/items/_time_effort.html.slim]",
        "interaction_3": "Sends AJAX PUT requests to `Course::Admin::ItemTimeEffortController#update` to overwrite time effort. [Source: app/views/items/_time_effort.html.slim]",
        "interaction_4": "Sends AJAX DELETE requests to `Course::Admin::ItemTimeEffortController#destroy` to reset overwritten time effort. [Source: app/views/items/_time_effort.html.slim]",
        "interaction_5": "Updates the UI dynamically based on AJAX responses, showing calculated time effort, overwritten status, and error messages. [Source: app/views/items/_time_effort.html.slim]",
        "interaction_6": "Renders HTML for the time effort display and editable input field. [Source: app/views/items/_time_effort.html.slim]",
        "interaction_7": "Uses `bootstrap-editable` for in-place editing of the time effort value. [Source: app/views/items/_time_effort.html.slim]"
      },
      "techDebt": [
        "Contains a significant amount of inline JavaScript logic, which could be extracted into a separate JavaScript file or a dedicated ViewComponent for better organization, maintainability, and testability. [Source: app/views/items/_time_effort.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/views/items/_time_effort.html.slim",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Xikolo::TimeEffort Microservice (Client Proxy)": {
      "type": "External Service Client / Proxy",
      "description": "Represents the client-side interface within the main application for interacting with the `Xikolo::TimeEffort` microservice. It abstracts the HTTP communication, allowing the main application to request time effort data.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Item (Microservice Client) for item time effort data ",
        "interaction_1": "Sends HTTP requests to Xikolo::TimeEffort::Application.routes (Microservice Routing) ",
        "interaction_2": "Receives calls from `Course::Admin::ItemTimeEffortController` to perform GET, PUT, and DELETE operations on item time effort. [Source: app/controllers/course/admin/item_time_effort_controller.rb]",
        "interaction_3": "Sends HTTP requests to the actual `Xikolo::TimeEffort` microservice, likely using `Restify` for inter-service communication. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/item_time_effort_controller.rb",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Xikolo::CourseService Microservice (Client Proxy)": {
      "type": "External Service Client / Proxy",
      "description": "Represents the client-side interface within the main application for interacting with the `Xikolo::CourseService` microservice. Used specifically by the `ItemTimeEffortController` to retrieve course context for authorization purposes.",
      "interactions": {
        "interaction_0": "Sends HTTP requests to Xikolo::Course::Application.routes (Microservice Routing) ",
        "interaction_1": "Sends HTTP requests to the actual `Xikolo::CourseService` microservice, likely using `Restify`. ",
        "interaction_2": "Receives calls from `Course::Admin::ItemTimeEffortController` to fetch course details. [Source: app/controllers/course/admin/item_time_effort_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/item_time_effort_controller.rb",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Errors (TimeEffort Service)": {
      "type": "Utility / Error Handling Module",
      "description": "A module within the `Xikolo::TimeEffort` microservice that defines custom error classes. These classes inherit from `StandardError` and provide structured error reasons, including an `as_json` method for consistent API error responses.",
      "interactions": {
        "interaction_0": "Error classes within this module are intended to be raised by the `Xikolo::TimeEffort` microservice's business logic when specific validation or operational failures occur. [Source: services/timeeffort/lib/errors.rb]",
        "interaction_1": "Provides a standardized format for error messages that can be serialized into JSON for API responses. [Source: services/timeeffort/lib/errors.rb]"
      },
      "techDebt": [
        "The `Course::Admin::ItemTimeEffortController` in the main application does not currently parse or specifically handle these detailed error types from the microservice, potentially leading to generic error messages for the user. [Source: app/controllers/course/admin/item_time_effort_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "services/timeeffort/lib/errors.rb",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Operation (TimeEffort Service)": {
      "type": "Utility / Business Logic Wrapper",
      "description": "A generic class within the `Xikolo::TimeEffort` microservice designed to encapsulate the outcome of a business operation, including success/failure status and associated `ActiveModel::Errors`. It provides a consistent way to return results from service methods.",
      "interactions": {
        "interaction_0": "Used internally within the `Xikolo::TimeEffort` microservice to wrap the results of business logic executions. [Source: services/timeeffort/lib/operation.rb]",
        "interaction_1": "Provides methods (`error!`, `success?`) to manage and query the operation's status and errors. [Source: services/timeeffort/lib/operation.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/timeeffort/lib/operation.rb",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Xikolo::Web::Application": {
      "type": "Rails Application",
      "description": "The main Rails application class, responsible for loading frameworks, configuring middleware, setting up autoload paths, and defining global application behaviors. It integrates common modules for secrets and Nomad-specific configurations.",
      "interactions": {
        "interaction_0": "Interacts with Msgr (Library/Service) for message queuing ",
        "interaction_1": "Interacts with ActiveRecord::Base (Rails ORM) for database operations ",
        "interaction_2": "Interacts with I18nJS (Internationalization Library) for i18n assets ",
        "interaction_3": "Interacts with Sidekiq (Background Job Processor) for background tasks ",
        "interaction_4": "Processes background jobs using Delayed Job [Source: Gemfile, config/application.rb]",
        "interaction_5": "Sends metrics to Telegraf [Source: Gemfile, config/application.rb]",
        "interaction_6": "Integrates with Sentry for error tracking [Source: Gemfile]",
        "interaction_7": "Loads configuration from Xikolo.config [Source: config/application.rb]",
        "interaction_8": "Handles asset serving and compilation via Sprockets [Source: Gemfile, config/application.rb]",
        "interaction_9": "Manages authentication via Devise-related gems (bcrypt, oauth2, omniauth) [Source: Gemfile]",
        "interaction_10": "Applies Rack::Attack for request throttling and Rack::Cors for CORS policies [Source: config/application.rb]",
        "interaction_11": "Loads Rails frameworks (ActiveRecord, ActionController, etc.). [Source: config/application.rb]",
        "interaction_12": "Configures `Xikolo.brand` based on `ENV['BRAND']`. [Source: config/application.rb]",
        "interaction_13": "Includes `Xikolo::Common::Secrets` and `Xikolo::Common::Nomad`. [Source: config/application.rb]",
        "interaction_14": "Configures `ActiveJob` to use `:delayed` adapter. [Source: config/application.rb]",
        "interaction_15": "Sets `ActionMailer` default URL options and queue. [Source: config/application.rb]",
        "interaction_16": "Configures `I18n` available locales, default locale, and fallbacks. [Source: config/application.rb]",
        "interaction_17": "Registers `ErrorsController` for exception handling. [Source: config/application.rb]",
        "interaction_18": "Applies `Rack::Attack` and `Middleware::NewsTracker` middleware. [Source: config/application.rb]",
        "interaction_19": "Configures `Rack::Cors` for cross-origin resource sharing. [Source: config/application.rb]",
        "interaction_20": "Configures `Telegraf` for event collection. [Source: config/application.rb]",
        "interaction_21": "Whitelists classes for `ActiveRecord` YAML serialization for `paper_trail` compatibility. [Source: config/application.rb]",
        "interaction_22": "Configures `ViewComponent` instrumentation and previews. [Source: config/application.rb]",
        "interaction_23": "Sets `ActionController::Base.asset_host` dynamically after initialization. [Source: config/application.rb]",
        "interaction_24": "Loads brand-specific initializers and library code. ",
        "interaction_25": "Loads and initializes Rails frameworks and gems [Source: config/application.rb]",
        "interaction_26": "Configures `ActiveJob` to use `:delayed` queue adapter [Source: config/application.rb]",
        "interaction_27": "Sets `ActionMailer` default URL options based on `Xikolo.base_url` [Source: config/application.rb]",
        "interaction_28": "Defines `I18n` available locales, default locale, and fallbacks [Source: config/application.rb]",
        "interaction_29": "Configures `Rack::Attack`, `Middleware::NewsTracker`, and `Rack::Cors` middleware [Source: config/application.rb]",
        "interaction_30": "Integrates `Sentry` and `Telegraf` for monitoring [Source: config/application.rb]",
        "interaction_31": "Configures `ViewComponent` and `Lookbook` for UI development and documentation [Source: config/application.rb]",
        "interaction_32": "Loads brand-specific initializers and library paths based on `ENV['BRAND']` [Source: config/application.rb]",
        "interaction_33": "Handles exceptions by mapping them to HTTP status codes via `ErrorsController` [Source: config/application.rb]"
      },
      "techDebt": [
        "YAML serialization for PaperTrail requires explicit class whitelisting, with a recommendation to migrate to JSONB columns [Source: config/application.rb]",
        "The explicit whitelisting of `yaml_column_permitted_classes` for `ActiveRecord` YAML serialization is a workaround for `paper_trail` and older YAML data, with a recommendation to migrate to JSON. [Source: config/application.rb]",
        "YAML serialization for `paper_trail` requires explicit whitelisting of classes; migration to JSON is recommended. [Source: config/application.rb]"
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "config/database.yml",
          "config/cache_redis.yml",
          "config/puma.rb",
          "config/unicorn.rb",
          "config/msgr.rb",
          "config/initializers/inflections.rb",
          "config/initializers/session_store.rb",
          "config/initializers/wrap_parameters.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo.config": {
      "type": "Configuration Manager",
      "description": "A centralized key-value store for site-specific configuration, provided by the `xikolo-config` gem. It loads settings from `app/xikolo.yml` and environment-specific overrides, defining global options, feature toggles, course settings, integrations, and more.",
      "interactions": {
        "interaction_0": "Used by Home::HomeController for homepage content loading ",
        "interaction_1": "Used by ::Proctoring (Module) for global proctoring configuration ",
        "interaction_2": "Influences asset host, CSP, and various feature behaviors [Source: app/xikolo.yml, config/application.rb]",
        "interaction_3": "Accessed by Admin::Ajax::PlatformStatisticsController (for permissions). [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_4": "Accessed by Admin::DocumentLocalizationsController (for beta features). [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_5": "Accessed by Admin::DocumentsController (for beta features). [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_6": "Accessed by Admin::CourseEditPresenter (for course languages, access groups, feature flags). [Source: app/presenters/admin/course_edit_presenter.rb]",
        "interaction_7": "Accessed by AdminNavigation (for beta features). [Source: app/presenters/admin_navigation.rb]",
        "interaction_8": "Accessed by GamificationConsumer (for gamification enabled). [Source: app/consumers/gamification_consumer.rb]",
        "interaction_9": "Accessed by Xikolo.config.gamification. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_10": "Accessed by CustomHeadSnippets (for custom HTML). [Source: app/components/global/custom_head_snippets.rb]",
        "interaction_11": "Accessed by Helpdesk::TicketMailer (for helpdesk email). [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_12": "Accessed by Admin::VouchersController (for voucher enabled). [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_13": "Accessed by Course::VoucherRedemptionsController (for voucher enabled). [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_14": "Accessed by Alert (for default locale validation). [Source: app/models/alert.rb]",
        "interaction_15": "Part of Xikolo (Global Config/Namespace). [Source: config/application.rb]",
        "interaction_16": "Accessed by `Helpdesk::TicketMailer` to get the recipient email address [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_17": "Provides configuration values to Xikolo::Web::Application and other components [Source: config/application.rb]",
        "interaction_18": "Reads configuration from `app/xikolo.yml` and environment-specific YAML files ",
        "interaction_19": "Accessed by the `Locale` concern to retrieve default and available locales for validation and fallback. [Source: app/controllers/concerns/locale.rb]",
        "interaction_20": "Accessed by the `Translations` class to determine the application's default locale. [Source: app/lib/translations.rb]",
        "interaction_21": "Configured via `config/i18n.yml` for translation export settings. [Source: config/i18n.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/xikolo.yml",
          "config/application.rb",
          "config/xikolo.test.yml",
          "app/mailers/helpdesk/ticket_mailer.rb",
          "app/controllers/concerns/locale.rb",
          "app/lib/translations.rb",
          "spec/controllers/concerns/locale_spec.rb",
          "config/i18n.yml",
          "cluster:33_ADMIN_Support",
          "cluster:40_INFRA_SystemCore",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support",
          "40_INFRA_SystemCore",
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "Xikolo.metrics": {
      "type": "Metrics Collector",
      "description": "A utility provided by the `xikolo-common` gem for sending app-specific metrics to a pre-configured Telegraf data collector. It allows tracking custom application and engineering metrics over time.",
      "interactions": {
        "interaction_0": "Receives job execution events (run, error, failure) from ActiveSupport::Notifications.",
        "interaction_1": "Records detailed metrics including job ID, attempts, run time, and duration.",
        "interaction_2": "Sends data to Telegraf ",
        "interaction_3": "Used by various application components to report custom events and values "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/initializers/delayed.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Xikolo::S3": {
      "type": "S3 Integration Library",
      "description": "A helper library provided by the `xikolo-s3` gem for S3 file operations. It handles S3 client instantiation, configuration, and provides high-level methods for interacting with `Aws::S3::Bucket` and `Aws::S3::Object` instances. It enforces principles for file handling, including S3 URIs and metadata for upload state and purpose.",
      "interactions": {
        "interaction_0": "Manages file uploads and storage in S3 buckets ",
        "interaction_1": "Provides methods to reference S3 buckets and objects ",
        "interaction_2": "Supports upload processing and validation via `SingleFileUpload` and `UploadByUri` ",
        "interaction_3": "Assists in processing markup fields with file references ",
        "interaction_4": "Configures the AWS S3 client using settings from `xikolo-config`. ",
        "interaction_5": "Interacts with AWS S3 for storing, retrieving, and managing files (e.g., `Aws::S3::Bucket`, `Aws::S3::Object`). ",
        "interaction_6": "Processes and validates file uploads, handling temporary storage, metadata (`xikolo-state`, `xikolo-purpose`), and copying to final destinations. ",
        "interaction_7": "Assists services in managing file references within markup fields, including converting S3 URIs to external URLs and handling file lifecycle (creation, deletion). ",
        "interaction_8": "Provides `Xikolo::S3.bucket_for(purpose)` to get an `Aws::S3::Bucket` instance. ",
        "interaction_9": "Provides `Xikolo::S3.object(uri)` to get an `Aws::S3::Object` instance. ",
        "interaction_10": "Defines `SingleFileUpload` and `UploadByUri` contracts for processing uploads. ",
        "interaction_11": "Offers `Xikolo::S3::TextWithUploadsProcessor` for managing files embedded in markup. ",
        "interaction_12": "Used by `S3FileDeletionJob` for deleting S3 objects. [Source: app/jobs/s3_file_deletion_job.rb]",
        "interaction_13": "Provides `bucket_for(:uploads)` method used by `FileUpload` to get an S3 bucket instance.",
        "interaction_14": "Defines the `xikolo-purpose` and `xikolo-state` metadata fields, which are set by `FileUpload` during presigning and used by backend services for validation. ",
        "interaction_15": "Mentions `SingleFileUpload` (upload by ID) and `UploadByUri` as upload contracts, guiding how services should interact with uploaded files. ",
        "interaction_16": "Used by `DocumentLocalization` for file uploads and key generation.",
        "interaction_17": "Used by `Duplicated::Visual` to generate public image URLs.",
        "interaction_18": "Used by `Course::Visual::Clone` for copying image files.",
        "interaction_19": "Used by `FileDeletionWorker` for deleting files.",
        "interaction_20": "Configures AWS S3 client using `xikolo-config`. ",
        "interaction_21": "Interacts with AWS S3 buckets and objects for file storage and retrieval. ",
        "interaction_22": "Receives upload references from the frontend for processing. ",
        "interaction_23": "Provides `Xikolo::S3.stub_responses!` for testing S3 interactions. "
      },
      "techDebt": [
        "The `SingleFileUpload` approach has drawbacks; `UploadByUri` is recommended for new implementations ",
        "The `SingleFileUpload` approach has drawbacks (e.g., HTTP call even if empty, fails on multiple files) and `UploadByUri` is recommended for new implementations. ",
        "The `TextWithUploadsProcessor` class, while powerful, introduces complexity in managing file lifecycle (commit/rollback) and callbacks. ",
        "`Xikolo::S3::SingleFileUpload` is deprecated; `UploadByUri` should be used for new implementations. ",
        "The `SingleFileUpload` approach is noted as having drawbacks, with `UploadByUri` recommended for new implementations, indicating potential legacy code. "
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/xikolo.test.yml",
          "services/course/app/models/document_localization.rb",
          "services/course/app/models/duplicated/visual.rb",
          "services/course/app/operations/course/visual/clone.rb",
          "services/course/app/workers/file_deletion_worker.rb",
          "gems/xikolo-s3/README.md",
          "cluster:13_LEARN_FileManagement",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:40_INFRA_SystemCore",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement",
          "32_ADMIN_ContentManagement",
          "40_INFRA_SystemCore",
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "Puma": {
      "type": "Application Server",
      "description": "The primary web server for the Rails application, configured for multi-threaded and multi-worker operation. It uses `preload_app!` for memory optimization and manages database connections across worker forks.",
      "interactions": {
        "interaction_0": "Serves HTTP requests for the Rails application [Source: Gemfile, config/puma.rb]",
        "interaction_1": "Manages ActiveRecord database connections during worker lifecycle [Source: config/puma.rb]",
        "interaction_2": "Integrates with Msgr to stop RabbitMQ client connections before forking [Source: config/puma.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/puma.rb",
          "config/puma.production.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Rack::Attack": {
      "type": "Middleware",
      "description": "A Rack middleware used for protecting the application from malicious traffic by throttling and blacklisting requests based on defined rules.",
      "interactions": {
        "interaction_0": "Intercepts incoming HTTP requests [Source: config/application.rb]",
        "interaction_1": "Applies throttling and blacklisting rules before requests reach the application [Source: config/application.rb]",
        "interaction_2": "Intercepts incoming requests before they reach the Rails application. [Source: config/application.rb]",
        "interaction_3": "Applies rate limiting and blocking rules to requests. [Source: config/application.rb]",
        "interaction_4": "Inserted into the Rails middleware stack in `config/application.rb` [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Delayed Job": {
      "type": "Background Job Processor",
      "description": "The Active Job queue adapter used for processing background tasks asynchronously, such as sending emails.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo.metrics (Metrics Collector) for job monitoring ",
        "interaction_1": "Utilizes a dedicated 'mails' queue for email delivery [Source: config/application.rb]",
        "interaction_2": "Processes jobs enqueued via Active Job [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Sidekiq": {
      "type": "Background Job Processor",
      "description": "A background job processing system, primarily used in microservices and potentially the main app, configured via the `xikolo-sidekiq` gem. It uses Redis for job storage and supports `sidekiq-cron` for scheduled tasks.",
      "interactions": {
        "interaction_0": "Receives jobs from sidekiq-cron (Scheduling Gem) ",
        "interaction_1": "Processes Voucher::DeleteClaimantIPJob (ActiveJob) ",
        "interaction_2": "Processes Video::SyncVideosJob (ActiveJob) ",
        "interaction_3": "Workers are started via `bundle exec sidekiq` in `Procfile` and `bin/entrypoint` [Source: Procfile, bin/entrypoint]",
        "interaction_4": "Integrated via `sidekiq-cron` gem [Source: Gemfile]",
        "interaction_5": "Uses Redis for job queue storage, configured via `SIDEKIQ_REDIS_URL` [Source: docker/.env]",
        "interaction_6": "Processes background jobs using Redis [Source: Gemfile, config/sidekiq_redis.yml]",
        "interaction_7": "Runs scheduled cron jobs defined in `config/cron.yml` ",
        "interaction_8": "Processes background jobs (implied by `sidekiq-cron` and `xikolo-sidekiq` gem).",
        "interaction_9": "Executes scheduled jobs defined in `config/cron.yml`.",
        "interaction_10": "Uses Redis for job queue management (configured via `config/sidekiq_redis.yml`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/sidekiq_redis.yml",
          "Procfile",
          "bin/entrypoint",
          "docker/.env",
          "cluster:40_INFRA_SystemCore",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Telegraf": {
      "type": "Monitoring Agent Integration",
      "description": "Integration with the Telegraf data collector for sending application-specific metrics. The `xikolo-common` gem provides `Xikolo.metrics` for custom metric collection.",
      "interactions": {
        "interaction_0": "Receives metrics from `Xikolo.metrics` ",
        "interaction_1": "Sends collected data to a configured Telegraf endpoint [Source: config/application.rb]",
        "interaction_2": "Integrated via `telegraf` gem [Source: Gemfile]",
        "interaction_3": "Configured in `config/application.rb` with `connect` URL and `tags` (e.g., `application: 'web'`) [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Bootsnap": {
      "type": "Boot Optimization Gem",
      "description": "A gem that speeds up application boot by caching Ruby instruction sequences, load paths, and YAML configurations. It is conditionally loaded only in the development environment.",
      "interactions": {
        "interaction_0": "Caches Ruby code for faster application startup [Source: config/boot.rb]",
        "interaction_1": "Accelerates application startup by caching various Ruby artifacts. [Source: config/boot.rb]",
        "interaction_2": "Loaded conditionally based on the Rails environment (development only). [Source: config/boot.rb]",
        "interaction_3": "Conditionally required in `config/boot.rb` based on the Rails environment [Source: config/boot.rb]"
      },
      "techDebt": [
        "Bootsnap has assumptions about the environment (e.g., running as the same user) that make it less suitable for production, hence its restriction to development [Source: config/boot.rb]",
        "Bootsnap has assumptions about the environment (e.g., running as the same user) which makes it less suitable for production environments where different users or system services might interact with the codebase. [Source: config/boot.rb]"
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/boot.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Grape": {
      "type": "API Framework",
      "description": "A Rack-based API framework used to build public and internal APIs for the main application, mounted at `/api`.",
      "interactions": {
        "interaction_0": "Implements Xikolo::API (Grape API) ",
        "interaction_1": "Implements Xikolo::V2::Helpdesk::Tickets (API Endpoint) ",
        "interaction_2": "Defines API endpoints for the main application [Source: Gemfile]",
        "interaction_3": "Integrates with `grape-entity` for API response serialization [Source: Gemfile]"
      },
      "techDebt": [
        "Version constraint `< 2.3` due to breaking changes with deprecated API::V2 [Source: Gemfile]"
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Restify": {
      "type": "HTTP Client",
      "description": "A gem used for HTTP communication between services. It is the preferred client over `Acfs` for new implementations.",
      "interactions": {
        "interaction_0": "Used by Xikolo::Submission::QuizSubmission (ACFS Client Model) as underlying HTTP client ",
        "interaction_1": "Used by Quiz::Submission (Application Model - Wrapper) as underlying HTTP client ",
        "interaction_2": "Used by `M3u8Playlist` to fetch external HLS playlist content from upstream providers.",
        "interaction_3": "Used by `ApplicationController#current_user` to handle `Restify::NotFound` exceptions (session expired) [Source: app/controllers/application_controller.rb]",
        "interaction_4": "Exceptions (`Restify::BadGateway`, `Restify::ServiceUnavailable`, `Restify::GatewayTimeout`) are mapped to HTTP status codes [Source: config/application.rb]",
        "interaction_5": "Facilitates HTTP requests to other microservices [Source: Gemfile]",
        "interaction_6": "Handles `BadGateway`, `ServiceUnavailable`, and `GatewayTimeout` exceptions [Source: config/application.rb]"
      },
      "techDebt": [
        "Part of an ongoing migration to replace `Acfs` "
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "app/lib/m3u8_playlist.rb",
          "Foundational Context",
          "app/controllers/application_controller.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Admin::VideoProviderSyncController": {
      "type": "Controller",
      "description": "Handles requests to initiate synchronization of videos from a specific video provider. It prevents immediate re-syncs if a sync is already in progress or recently completed. Dispatches a background job for the actual synchronization.",
      "interactions": {
        "interaction_0": "Dispatches `Video::SyncVideosJob` to perform synchronization asynchronously. [Source: app/controllers/admin/video_provider_sync_controller.rb]",
        "interaction_1": "Interacts with `Video::Provider` to check sync status. [Source: app/controllers/admin/video_provider_sync_controller.rb]",
        "interaction_2": "Redirects to `admin_video_providers_path` after action. [Source: app/controllers/admin/video_provider_sync_controller.rb]",
        "interaction_3": "Requires `video.video.manage` permission. ",
        "interaction_4": "Enqueues `Video::SyncVideosJob` for asynchronous processing. [Source: app/controllers/admin/video_provider_sync_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/video_provider_sync_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Admin::VideoProvidersController": {
      "type": "Controller",
      "description": "Manages CRUD operations for video providers within the admin interface. It allows administrators to create, edit, update, and delete video provider configurations.",
      "interactions": {
        "interaction_0": "Interacts with `Video::Provider` model for data persistence. [Source: app/controllers/admin/video_providers_controller.rb]",
        "interaction_1": "Uses `Video::Provider.new(provider_type: type).type` to determine credential attributes for different provider types. [Source: app/controllers/admin/video_providers_controller.rb]",
        "interaction_2": "Handles `ActiveRecord::DeleteRestrictionError` if a provider cannot be deleted due to dependencies. [Source: app/controllers/admin/video_providers_controller.rb]",
        "interaction_3": "Requires `video.provider.manage` permission. ",
        "interaction_4": "Manages `Video::Provider` records. [Source: app/controllers/admin/video_providers_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/video_providers_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Admin::VideosController": {
      "type": "Controller",
      "description": "Provides administrative functionality for listing and deleting individual video streams. Requires `video.video.manage` permission.",
      "interactions": {
        "interaction_0": "Queries `Video::Stream` for listing and deletion. [Source: app/controllers/admin/videos_controller.rb]",
        "interaction_1": "Authorizes actions using `authorize! 'video.video.manage'`. [Source: app/controllers/admin/videos_controller.rb]",
        "interaction_2": "Handles `ActiveRecord::DeleteRestrictionError` for stream deletion. [Source: app/controllers/admin/videos_controller.rb]",
        "interaction_3": "Requires `video.video.manage` permission. ",
        "interaction_4": "Interacts with `Video::Stream` for querying and destruction. [Source: app/controllers/admin/videos_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/videos_controller.rb",
          "spec/controllers/admin/videos_controller_spec.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Stream::DownloadsController": {
      "type": "Controller",
      "description": "Manages the download of video streams. It ensures the user is logged in (unless a bot) and redirects to the appropriate external download link based on stream ID and requested quality.",
      "interactions": {
        "interaction_0": "Interacts with `Video::Download` service to obtain download links. [Source: app/controllers/stream/downloads_controller.rb]",
        "interaction_1": "Handles various exceptions related to video download availability and quality. [Source: app/controllers/stream/downloads_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/stream/downloads_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Stream::SyncsController": {
      "type": "Controller",
      "description": "Handles requests to synchronize a single video stream. Requires `video.video.index` permission.",
      "interactions": {
        "interaction_0": "Finds `Video::Stream` by ID and calls its `sync` method. [Source: app/controllers/stream/syncs_controller.rb]",
        "interaction_1": "Authorizes actions using `authorize! 'video.video.index'`. [Source: app/controllers/stream/syncs_controller.rb]",
        "interaction_2": "Handles `ActiveRecord::RecordNotFound` and `Kaltura::KalturaAPIError`. [Source: app/controllers/stream/syncs_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/stream/syncs_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "SubtitlesController": {
      "type": "Controller",
      "description": "Manages the serving and deletion of video subtitles. It ensures proper CORS headers for web-based video players and requires `video.subtitle.manage` permission for deletion.",
      "interactions": {
        "interaction_0": "Finds `Video::Subtitle` by ID to render its VTT content. [Source: app/controllers/subtitles_controller.rb]",
        "interaction_1": "Handles `ActiveRecord::RecordNotFound` for missing subtitles. [Source: app/controllers/subtitles_controller.rb]",
        "interaction_2": "Authorizes deletion using `authorize! 'video.subtitle.manage'`. [Source: app/controllers/subtitles_controller.rb]",
        "interaction_3": "Interacts with the `Video::Subtitle` model to find and render subtitle content.",
        "interaction_4": "Sets `Access-Control-Allow-Origin: *` header to support Google Cast and other web-based video players.",
        "interaction_5": "Requires `video.subtitle.manage` permission for destruction. ",
        "interaction_6": "Interacts with `Video::Subtitle` to retrieve and destroy subtitle records. [Source: app/controllers/subtitles_controller.rb]",
        "interaction_7": "Renders plain text VTT content. [Source: app/controllers/subtitles_controller.rb]"
      },
      "techDebt": [
        "The use of a wildcard `Access-Control-Allow-Origin: *` is broad and could be a security concern; restricting to specific domains is generally recommended if feasible."
      ],
      "provenance": {
        "sources": [
          "app/controllers/subtitles_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::PlaylistsController": {
      "type": "Controller",
      "description": "Serves HTTP Live Streaming (HLS) master, stream, and subtitle playlists. It dynamically transforms these playlists to integrate Xikolo's custom subtitles, rewrite URIs, and ensure compatibility with various players.",
      "interactions": {
        "interaction_0": "Interacts with `M3u8Playlist` to construct the HLS playlists. [Source: app/controllers/video/playlists_controller.rb]",
        "interaction_1": "Finds `Video::Stream` and `Video::Video` objects to gather necessary data for playlist generation. [Source: app/controllers/video/playlists_controller.rb]",
        "interaction_2": "Finds `Video::Subtitle` for specific language subtitles. [Source: app/controllers/video/playlists_controller.rb]",
        "interaction_3": "Interacts with `Video::Stream` and `Video::Video` models to retrieve stream and video data.",
        "interaction_4": "Utilizes `M3u8Playlist` to fetch, parse, and transform HLS playlists.",
        "interaction_5": "Sets `Cache-Control` headers to improve offline playback on iOS.",
        "interaction_6": "Sets `Access-Control-Allow-Origin: *` and `Access-Control-Allow-Headers` for CORS compatibility with web-based HLS players.",
        "interaction_7": "Responds with `application/x-mpegURL` content type."
      },
      "techDebt": [
        "The use of a wildcard `Access-Control-Allow-Origin: *` is broad and could be a security concern; restricting to specific domains is generally recommended if feasible."
      ],
      "provenance": {
        "sources": [
          "app/controllers/video/playlists_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "M3u8Playlist": {
      "type": "Library",
      "description": "A utility class that wraps the `M3u8` gem to read, manipulate, and generate HLS playlists. It transforms master playlists (rewriting stream URIs, embedding Xikolo subtitles) and stream playlists (making segment URIs absolute). It can also generate standalone subtitle playlists.",
      "interactions": {
        "interaction_0": "Uses `Restify` to fetch external HLS playlist content. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_1": "Generates URLs for playlists and subtitles using `Xikolo::V2::URL`. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_2": "Interacts with `Video::Stream` and `Video::Video` (via options) to get stream URLs and subtitle data. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_3": "Fetches external HLS content using `Restify`.",
        "interaction_4": "Generates internal URLs for playlists and subtitles using `Xikolo::V2::URL`.",
        "interaction_5": "Receives `Video::Video` and `Video::Subtitle` information via options to embed Xikolo's subtitles.",
        "interaction_6": "Fetches HLS playlist data using `Restify`. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_7": "Generates `M3u8::Playlist` objects. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_8": "Interacts with `Xikolo::V2::URL` to generate playlist and subtitle URLs. [Source: app/lib/m3u8_playlist.rb]",
        "interaction_9": "Retrieves video subtitles from a `Video` object. [Source: app/lib/m3u8_playlist.rb]"
      },
      "techDebt": [
        "The order of stream playlist items from Vimeo is noted as 'not deterministic', requiring manual sorting for optimal iOS playback. [Source: app/lib/m3u8_playlist.rb]"
      ],
      "provenance": {
        "sources": [
          "app/lib/m3u8_playlist.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Transpipe::URL": {
      "type": "Module",
      "description": "A Ruby module providing helper methods to construct external URLs for courses and video items, specifically for integration with the TransPipe service. It leverages `Addressable::Template` for dynamic URL expansion based on application configuration.",
      "interactions": {
        "interaction_0": "Reads configuration from `Xikolo.config.transpipe`. [Source: app/lib/transpipe.rb]",
        "interaction_1": "Uses `Addressable::Template` for URL expansion. [Source: app/lib/transpipe.rb]",
        "interaction_2": "Reads configuration settings from `Xikolo.config.transpipe` to retrieve URL templates. [Source: app/lib/transpipe.rb]",
        "interaction_3": "Generates fully qualified URLs for courses and video content, intended for use by the TransPipe service. [Source: app/lib/transpipe.rb]",
        "interaction_4": "Used by the `Transpipe` module to generate external service URLs."
      },
      "techDebt": [
        "The `rescue TypeError` for template parsing is very generic and might mask other configuration or parsing issues; more specific error handling could be beneficial.",
        "The generic `rescue TypeError` for template parsing could be made more specific or include logging to provide better diagnostics in case of malformed templates. [Source: app/lib/transpipe.rb]"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb",
          "cluster:05_CORE_APIGateway",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway",
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::Store": {
      "type": "Operation",
      "description": "An operation class responsible for storing and updating video records, including handling associated attachments (reading material, slides, transcript) and subtitles. It manages S3 uploads, rich text processing, and ensures data integrity through transactions and error handling.",
      "interactions": {
        "interaction_0": "Interacts with `Video::Video` model to assign attributes and save. [Source: app/operations/video/store.rb]",
        "interaction_1": "Uses `Xikolo::S3::TextWithUploadsProcessor` for rich text description processing. [Source: app/operations/video/store.rb]",
        "interaction_2": "Uses `Xikolo::S3::SingleFileUpload` and `Xikolo::S3::UploadByUri` for handling file uploads to S3. [Source: app/operations/video/store.rb]",
        "interaction_3": "Interacts with `Video::Subtitle` for subtitle extraction and attachment. [Source: app/operations/video/store.rb]",
        "interaction_4": "Dispatches `S3FileDeletionJob` for obsolete S3 files. [Source: app/operations/video/store.rb]",
        "interaction_5": "Captures errors with `Mnemosyne` and `Sentry`. [Source: app/operations/video/store.rb]",
        "interaction_6": "Utilizes `Xikolo::S3::SingleFileUpload` and `Xikolo::S3::UploadByUri` for attachment uploads. [Source: app/operations/video/store.rb]",
        "interaction_7": "Enqueues `S3FileDeletionJob` for asynchronous deletion of replaced files. [Source: app/operations/video/store.rb]"
      },
      "techDebt": [
        "Assigns errors to non-existent attributes (e.g., `:invalid_subtitle`) on the `Video` model, requiring a workaround with a dummy attribute to prevent `NoMethodError` in Rails 6.1+. [Source: app/operations/video/store.rb]",
        "ActiveModel contract violation: The operation assigns errors to non-existent attributes (e.g., `:invalid_subtitle`) on the `Video` model as a workaround for Rails 6.1, requiring an unused dump attribute. [Source: app/operations/video/store.rb]"
      ],
      "provenance": {
        "sources": [
          "app/operations/video/store.rb",
          "spec/operations/video/store_spec.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "VideoItemPresenter": {
      "type": "Presenter",
      "description": "Presents video item data in the context of a course, providing methods for OpenGraph metadata generation and checking forum lock status. It wraps a `VideoPresenter` for video-specific details.",
      "interactions": {
        "interaction_0": "Initializes and uses `VideoPresenter` for video details. [Source: app/presenters/video_item_presenter.rb]",
        "interaction_1": "Interacts with `Course::Section` to determine if the pinboard is closed. [Source: app/presenters/video_item_presenter.rb]",
        "interaction_2": "Generates URLs using `Rails.application.routes.url_helpers`. [Source: app/presenters/video_item_presenter.rb]",
        "interaction_3": "Delegates video-specific presentation to `VideoPresenter`.",
        "interaction_4": "Interacts with `Course::Section` to check pinboard status.",
        "interaction_5": "Uses `Rails.application.routes.url_helpers` to generate URLs.",
        "interaction_6": "Merges Open Graph meta tags for video content."
      },
      "techDebt": [
        "Inconsistent use of `UUID4` and `UUID` for UUID conversion; standardizing on one approach or clarifying their distinct uses could improve consistency."
      ],
      "provenance": {
        "sources": [
          "app/presenters/video_item_presenter.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "VideoItemTopicPresenter": {
      "type": "Presenter",
      "description": "Presents discussion topics related to video items, formatting timestamps, truncating abstracts, and generating URLs to specific questions.",
      "interactions": {
        "interaction_0": "Interacts with Video::Video (Model) for video context ",
        "interaction_1": "Uses `MarkdownHelper` to render markdown content. [Source: app/presenters/video_item_topic_presenter.rb]",
        "interaction_2": "Generates URLs using `Rails.application.routes.url_helpers`. [Source: app/presenters/video_item_topic_presenter.rb]",
        "interaction_3": "Uses `HtmlTruncator` and `MarkdownHelper` for content formatting.",
        "interaction_4": "Uses `Rails.application.routes.url_helpers` to generate topic URLs."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/video_item_topic_presenter.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "VideoPresenter": {
      "type": "Presenter",
      "description": "Prepares detailed video information for the UI, including different stream types (PIP, lecturer, slides, subtitled), thumbnail, and a comprehensive list of download options. It also initializes the `Video::VideoPlayer`.",
      "interactions": {
        "interaction_0": "Interacts with `Video::Video` to retrieve stream and resource URLs. [Source: app/presenters/video_presenter.rb]",
        "interaction_1": "Uses `Video::VideoPlayer` to build player configurations. [Source: app/presenters/video_presenter.rb]",
        "interaction_2": "Generates download paths using `Rails.application.routes.url_helpers`. [Source: app/presenters/video_presenter.rb]",
        "interaction_3": "Interacts with `Video::Video` model to retrieve video details and stream URLs.",
        "interaction_4": "Initializes the `Video::VideoPlayer` component.",
        "interaction_5": "Uses `Rails.application.routes.url_helpers` to generate download paths.",
        "interaction_6": "Uses `I18n` for localized download button captions."
      },
      "techDebt": [
        "Inconsistent use of `UUID4` and `UUID` for UUID conversion; standardizing on one approach or clarifying their distinct uses could improve consistency."
      ],
      "provenance": {
        "sources": [
          "app/presenters/video_presenter.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "app/assets/course/items/video.js": {
      "type": "Frontend Script",
      "description": "Client-side JavaScript for enhancing video item pages. It handles adding timestamp listeners for seeking in the video player, managing the UI for creating new discussion topics linked to video timestamps, and forwarding keyboard shortcuts to the `xm-player`.",
      "interactions": {
        "interaction_0": "Interacts with QuestionController (or its routes) to create new topics ",
        "interaction_1": "Sends AJAX requests to create new topics. [Source: app/assets/course/items/video.js]",
        "interaction_2": "Manipulates DOM elements for topic form visibility and error display. [Source: app/assets/course/items/video.js]",
        "interaction_3": "Uses `I18n` for localization. [Source: app/assets/course/items/video.js]",
        "interaction_4": "Interacts with the `xm-player` custom element for seeking and getting progress. [Source: app/assets/course/items/video.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/course/items/video.js",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "app/assets/teacher/items/video-streams.ts": {
      "type": "Frontend Script",
      "description": "TypeScript logic for autocompleting related video streams (lecturer, slides) when a Picture-in-Picture (PIP) stream is selected in the teacher's video editing interface. It fetches stream data from an admin API.",
      "interactions": {
        "interaction_0": "Interacts with Admin::Ajax::StreamsController for stream data ",
        "interaction_1": "Fetches stream data from `/admin/streams?q=...` API endpoint. [Source: app/assets/teacher/items/video-streams.ts]",
        "interaction_2": "Updates `TomInput` selectors for lecturer and slides streams. [Source: app/assets/teacher/items/video-streams.ts]",
        "interaction_3": "Listens for 'change' events on the PIP stream selector (`#video_pip_stream_id`). [Source: app/assets/teacher/items/video-streams.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/video-streams.ts",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "app/assets/teacher/items/video.ts": {
      "type": "Frontend Script",
      "description": "TypeScript logic for managing the visibility of various form elements in the teacher's video editing interface based on the selected video type and 'open mode' status.",
      "interactions": {
        "interaction_0": "Calls `videoStreamsAutocompletion` to initialize stream matching. [Source: app/assets/teacher/items/video.ts]",
        "interaction_1": "Manipulates visibility of form elements based on checkbox states. [Source: app/assets/teacher/items/video.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/video.ts",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Delayed::Job": {
      "type": "Background Job Processor",
      "description": "The primary background job processing system used in the main application. It handles asynchronous task execution, managing job queues, retries, and execution time limits.",
      "interactions": {
        "interaction_0": "Processes jobs enqueued via ActiveJob (e.g., Voucher::DeleteClaimantIPJob, Video::SyncVideosJob).",
        "interaction_1": "Publishes job events to ActiveSupport::Notifications.",
        "interaction_2": "Sends metrics to Xikolo.metrics for monitoring."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/delayed.rb",
          "config/cron.yml",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "ActiveJob": {
      "type": "Abstraction Layer",
      "description": "A framework for declaring, enqueuing, and running background jobs. It provides a common interface, allowing the application to switch between different backend job processors (like Delayed::Job or Sidekiq) without modifying job code.",
      "interactions": {
        "interaction_0": "Processes Voucher::DeleteClaimantIPJob (ActiveJob) ",
        "interaction_1": "Processes Video::SyncVideosJob (ActiveJob) ",
        "interaction_2": "Processes Lti::PublishGradeJob (Background Job) ",
        "interaction_3": "Processes Proctoring::UploadCertificateImageJob (Background Job) ",
        "interaction_4": "Jobs defined as ActiveJob classes are enqueued for processing.",
        "interaction_5": "Jobs are processed by either Delayed::Job or Sidekiq depending on the environment and configuration."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/cron.yml",
          "config/initializers/delayed.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Voucher::DeleteClaimantIPJob": {
      "type": "ActiveJob",
      "description": "A daily cron job responsible for data privacy by clearing `claimant_ip` fields for vouchers claimed more than one year ago. It directly executes a PostgreSQL `UPDATE` statement. [Source: app/jobs/voucher/delete_claimant_ip_job.rb, spec/jobs/voucher/delete_claimant_ip_job_spec.rb]",
      "interactions": {
        "interaction_0": "Interacts with Voucher::Voucher (Model) via direct SQL for IP deletion ",
        "interaction_1": "Processed by Delayed::Job on the 'default' queue.",
        "interaction_2": "Directly executes SQL against `ActiveRecord::Base.connection` to update the `vouchers` table [Source: app/jobs/voucher/delete_claimant_ip_job.rb].",
        "interaction_3": "Inherits from ApplicationJob. [Source: app/jobs/voucher/delete_claimant_ip_job.rb]",
        "interaction_4": "Interacts with Voucher::Voucher model (via raw SQL). [Source: app/jobs/voucher/delete_claimant_ip_job.rb]",
        "interaction_5": "Processed by Sidekiq. ",
        "interaction_6": "Directly updates the `vouchers` table in the PostgreSQL database. [Source: app/jobs/voucher/delete_claimant_ip_job.rb]",
        "interaction_7": "Executed periodically by Sidekiq via `sidekiq-cron`."
      },
      "techDebt": [
        "The job uses direct SQL (`ActiveRecord::Base.connection.execute`) for updating records, which bypasses ActiveRecord's ORM layer. While potentially performant for bulk updates, it can be less maintainable and less idiomatic Rails than using ActiveRecord methods [Source: app/jobs/voucher/delete_claimant_ip_job.rb].",
        "Direct SQL execution, while efficient, bypasses ActiveRecord's ORM layer, which might make schema changes or database migrations more brittle if not carefully managed [Source: app/jobs/voucher/delete_claimant_ip_job.rb].",
        "Uses raw SQL for updating the `claimant_ip` field. While efficient for this specific task, it bypasses ActiveRecord's ORM layer, potentially making it less maintainable or harder to track changes if the schema evolves. [Source: app/jobs/voucher/delete_claimant_ip_job.rb]"
      ],
      "provenance": {
        "sources": [
          "config/cron.yml",
          "app/jobs/voucher/delete_claimant_ip_job.rb",
          "spec/jobs/voucher/delete_claimant_ip_job_spec.rb",
          "cluster:34_ADMIN_Vouchers",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Video::SyncVideosJob": {
      "type": "ActiveJob",
      "description": "A scheduled ActiveJob designed to synchronize newly added videos. It runs at regular intervals to ensure video data consistency.",
      "interactions": {
        "interaction_0": "Executed periodically by Sidekiq via `sidekiq-cron`.",
        "interaction_1": "Processed by Delayed::Job on the 'long_running' queue.",
        "interaction_2": "Scheduled to run every 2 hours via `sidekiq-cron`. ",
        "interaction_3": "Processes jobs on the `long_running` queue. ",
        "interaction_4": "Is an `ActiveJob` compatible worker. ",
        "interaction_5": "Triggered by `Admin::VideoProviderSyncController`. [Source: app/controllers/admin/video_provider_sync_controller.rb]",
        "interaction_6": "Processes video data from a `Video::Provider`. [Source: app/controllers/admin/video_provider_sync_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/cron.yml",
          "app/controllers/admin/video_provider_sync_controller.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "sidekiq-cron": {
      "type": "Scheduling Gem",
      "description": "A gem that enables scheduling of Sidekiq workers (and ActiveJobs) using cron expressions defined in `config/cron.yml`. It provides the mechanism for recurring background tasks.",
      "interactions": {
        "interaction_0": "Reads and parses `config/cron.yml` to set up scheduled jobs.",
        "interaction_1": "Enqueues ActiveJobs (like Voucher::DeleteClaimantIPJob, Video::SyncVideosJob) into the background job processor."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/cron.yml",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "TokenSigning": {
      "type": "Module",
      "description": "A Ruby module responsible for cryptographic token signing and verification. It is specifically configured to use PASETO tokens for the Chatbot bridge, utilizing a private key for signing and multiple public keys for verification, ensuring secure communication with external systems.",
      "interactions": {
        "interaction_0": "Registers a `:chatbot` key for PASETO token operations.",
        "interaction_1": "Signs tokens using `chatbot_bridge_private_key` from application secrets.",
        "interaction_2": "Verifies tokens using `chatbot['bridge_public_keys']` from application configuration.",
        "interaction_3": "Utilizes Xikolo (Global Config/Namespace) for secrets and keys. [Source: config/initializers/chatbot.rb]",
        "interaction_4": "Utilizes application secrets for private key and configuration for public keys.",
        "interaction_5": "Used by Chatbot API controllers to issue and validate user-specific Paseto tokens."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/chatbot.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Abstract::BridgeAPIController": {
      "type": "Base Controller",
      "description": "A foundational controller class intended for all Bridge API controllers. It provides a minimal set of functionalities required for API-only applications, promoting consistency and reducing boilerplate across different bridge implementations. It likely handles common concerns such as error rendering and basic request parsing.",
      "interactions": {
        "interaction_0": "Serves as the base class for specific bridge API controllers (e.g., `Bridges::Chatbot::BaseController`).",
        "interaction_1": "Expected to integrate with authentication mechanisms like `Xi::Controllers::RequireBearerToken`.",
        "interaction_2": "Inherited by Bridges::Shop::VouchersController. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_3": "Inherited by Chatbot Bridge API. ",
        "interaction_4": "Inherited by Shop Bridge API. ",
        "interaction_5": "Inherited by Transpipe Bridge API. ",
        "interaction_6": "Inherited by Lanalytics Bridge API. ",
        "interaction_7": "Inherited by Moochub Bridge API. ",
        "interaction_8": "Inherited by concrete Bridge API controllers (e.g., Chatbot, Shop, TransPipe controllers)."
      },
      "techDebt": [
        "Ensure all new bridge API controllers consistently inherit from this base controller and adhere to its conventions."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "ChatbotBridgeAPI": {
      "type": "External API Interface",
      "description": "The external interface for the Chatbot system, providing endpoints for user authentication, course information retrieval, and enrollment management. It is secured using PASETO tokens.",
      "interactions": {
        "interaction_0": "Receives authentication requests via `POST /authenticate` (shared secret).",
        "interaction_1": "Provides user data via `GET /user`.",
        "interaction_2": "Provides course listings via `GET /courses` and `GET /my_courses`.",
        "interaction_3": "Manages user enrollments via `POST /my_courses/{id}` and `DELETE /my_courses/{id}`.",
        "interaction_4": "Retrieves course achievements via `GET /my_courses/{id}/achievements`.",
        "interaction_5": "Retrieves quizzes via `GET /my_quizzes`.",
        "interaction_6": "Interacts with `TokenSigning` for token generation and validation."
      },
      "techDebt": [
        "Ensure comprehensive API documentation (OpenAPI) is kept up-to-date with any changes to endpoints or data models.",
        "Monitor performance and scalability, especially for endpoints that retrieve large lists of courses or achievements."
      ],
      "provenance": {
        "sources": [
          "config/initializers/chatbot.rb",
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "ShopBridgeAPI": {
      "type": "External API Interface",
      "description": "The external interface for third-party shops to manage vouchers for the platform. It allows for bulk creation and listing of various types of vouchers.",
      "interactions": {
        "interaction_0": "Receives requests to create vouchers via `POST /vouchers`.",
        "interaction_1": "Responds to requests for listing vouchers via `GET /vouchers`.",
        "interaction_2": "Authenticates requests using a shared secret bearer token.",
        "interaction_3": "Consumed by `VoucherAdministrationUI` for voucher creation.",
        "interaction_4": "Consumed by external shop systems for automated voucher workflows.",
        "interaction_5": "Interacts with the core voucher system to create and verify vouchers."
      },
      "techDebt": [
        "Ensure robust validation for voucher creation parameters (e.g., `qty`, `product`, `country`).",
        "Implement proper logging and monitoring for voucher creation and claiming to track usage and potential abuse."
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "MoochubBridgeAPI": {
      "type": "External API Interface",
      "description": "The external interface for integration with the MOOChub schema, primarily for exchanging course data. Details are largely deferred to an external GitHub repository.",
      "interactions": {
        "interaction_0": "Exposes course data via `/bridges/moochub/courses`."
      },
      "techDebt": [
        "Ensure the external MOOChub Schema repository is actively maintained and its specifications are correctly implemented.",
        "Clarify internal implementation details and data mapping between Xikolo courses and MOOChub schema."
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "TransPipeBridgeAPI": {
      "type": "External API Interface",
      "description": "The external interface for the translation pipeline (TransPipe) to access video information and manage subtitles. It provides detailed course and video structures, including stream URLs and subtitle content.",
      "interactions": {
        "interaction_0": "Interacts with Transpipe::URL (Module) for URL generation ",
        "interaction_1": "Provides detailed course information via `GET /courses/{id}`.",
        "interaction_2": "Provides video details and stream URLs via `GET /videos/{id}`.",
        "interaction_3": "Retrieves video subtitles via `GET /videos/{id}/subtitles/{lang}`.",
        "interaction_4": "Updates video subtitles via `PATCH /videos/{id}/subtitles/{lang}`.",
        "interaction_5": "Authenticates requests using a bearer token.",
        "interaction_6": "Provides lists of courses via `GET /courses`."
      },
      "techDebt": [
        "Ensure subtitle validation is robust to prevent malformed VTT files from being stored.",
        "Monitor the performance of video and subtitle retrieval, especially for large courses or frequent requests."
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "LanalyticsBridgeAPI": {
      "type": "External API Interface (Conceptual)",
      "description": "A conceptual bridge API identified in the routing configuration, intended for integration with an analytics system (Lanalytics). Specific implementation details or OpenAPI documentation were not provided in the given context.",
      "interactions": {
        "interaction_0": "Expected to expose data relevant for analytics consumption."
      },
      "techDebt": [
        "Document the purpose, endpoints, and data models for the Lanalytics bridge API.",
        "Implement the API according to best practices for bridge APIs, including authentication and error handling."
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Admin::Ajax::ClassifiersController": {
      "type": "Controller",
      "description": "Provides AJAX endpoints for querying `Course::Classifier` objects, used for filtering or selecting classifiers in admin interfaces, such as report generation forms. It ensures the user is logged in and has `course.course.edit` permission.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Classifier` model to retrieve classifier data.",
        "interaction_1": "Interacts with `Course::Classifier` model to fetch and query data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/classifiers_controller.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::Ajax::CoursesController": {
      "type": "Controller",
      "description": "Provides AJAX endpoints for searching and retrieving course data from the `course_api` microservice, typically for auto-completion or selection in admin forms. It authorizes users with `course.course.index` or `course.document.manage` permissions.",
      "interactions": {
        "interaction_0": "Communicates with `course_api` service to fetch course details.",
        "interaction_1": "Communicates with the `course` microservice via `Xikolo.api(:course)` to fetch course data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/courses_controller.rb",
          "spec/requests/admin/ajax/find_courses_spec.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::Ajax::DetailStatisticsController": {
      "type": "Controller",
      "description": "Handles AJAX requests for course-specific detailed statistics, including geographical data (countries, cities), top item types, video statistics, and most active pinboard users. It aggregates data from various microservices and leverages caching. Requires `global.dashboard.show` permission.",
      "interactions": {
        "interaction_0": "Communicates with `lanalytics_api` (via `fetch_metric` for `top_countries`, `top_cities`, `top_items`, `video_statistics`).",
        "interaction_1": "Communicates with `course_api` to retrieve course items.",
        "interaction_2": "Communicates with `pinboard_api` for `most_active` pinboard users (if beta feature enabled).",
        "interaction_3": "Uses `Rails.cache` for performance.",
        "interaction_4": "Fetches 'top_countries', 'top_cities', 'top_items', 'video_statistics' metrics from `learnanalytics_api` via `fetch_metric` helper. [Source: app/controllers/admin/ajax/detail_statistics_controller.rb]",
        "interaction_5": "Fetches course items from `course_api`. [Source: app/controllers/admin/ajax/detail_statistics_controller.rb]",
        "interaction_6": "Fetches pinboard statistics from `pinboard_api` if `teaching_team_pinboard_activity` beta feature is enabled. [Source: app/controllers/admin/ajax/detail_statistics_controller.rb]",
        "interaction_7": "Uses `Rails.cache` to cache statistics data for 6 hours. [Source: app/controllers/admin/ajax/detail_statistics_controller.rb]",
        "interaction_8": "Communicates with the `course` microservice via `Xikolo.api(:course)` to fetch metric data.",
        "interaction_9": "Communicates with the `pinboard` microservice via `Xikolo.api(:pinboard)` for most active user statistics.",
        "interaction_10": "Uses `Rails.cache` for data caching."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/detail_statistics_controller.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::Ajax::PlatformStatisticsController": {
      "type": "Controller",
      "description": "Manages AJAX requests for platform-wide statistics, such as learner counts, enrollment figures, active user activity, and certificate issuance. It orchestrates concurrent calls to multiple microservices. Requires `global.dashboard.show` permission.",
      "interactions": {
        "interaction_0": "Communicates concurrently with `account_api` for user statistics.",
        "interaction_1": "Communicates concurrently with `course_api` for global course statistics.",
        "interaction_2": "Communicates with `lanalytics_api` (via `fetch_metric` for `active_user_count` and `certificates`).",
        "interaction_3": "Uses `Restify::Promise` for concurrent API calls.",
        "interaction_4": "Uses `Rails.cache` for performance.",
        "interaction_5": "Interacts with Xikolo.api(:account) to fetch account statistics. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_6": "Interacts with Xikolo.api(:course) to fetch course statistics. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_7": "Interacts with Xikolo.api(:learnanalytics) to fetch metrics. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_8": "Checks user permissions via Xikolo::Common::Auth::CurrentUser for `global.dashboard.show`. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_9": "Uses Restify for concurrent API calls. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_10": "Communicates with the `account` microservice via `Xikolo.api(:account)` for user statistics.",
        "interaction_11": "Communicates with the `course` microservice via `Xikolo.api(:course)` for enrollment and certificate statistics.",
        "interaction_12": "Uses `Restify::Promise` for concurrent API requests.",
        "interaction_13": "Uses `Rails.cache` for data caching.",
        "interaction_14": "Fetches account statistics from `account_api`. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_15": "Fetches course statistics (global enrollments, course count) from `course_api`. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_16": "Fetches 'active_user_count' and 'certificates' metrics from `learnanalytics_api` via `fetch_metric` helper. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_17": "Uses `Restify::Promise` for concurrent API calls to improve performance. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_18": "Uses `Rails.cache` to cache statistics data for 30 minutes to 1 hour. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/platform_statistics_controller.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::Ajax::StreamsController": {
      "type": "Controller",
      "description": "Provides AJAX endpoints for querying video streams, likely for selection in forms or reports. It authorizes users with `video.video.index` permission.",
      "interactions": {
        "interaction_0": "Provides stream data to app/assets/teacher/items/video-streams.ts (Frontend Script) ",
        "interaction_1": "Interacts with `Video::Stream` model to query and limit streams.",
        "interaction_2": "Interacts with `Video::Stream` model to retrieve stream data."
      },
      "techDebt": [
        "TODO: (XI-6286) add pagination (tomSelect supports this pretty easily, see https://tom-select.js.org/plugins/virtual_scroll/)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/streams_controller.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::Ajax::UsersController": {
      "type": "Controller",
      "description": "Provides AJAX endpoints for searching and retrieving user data from the `account_api` microservice, typically for auto-completion or selection in admin forms. Requires `account.user.find` permission.",
      "interactions": {
        "interaction_0": "Communicates with `account_api` service to fetch user details.",
        "interaction_1": "Communicates with the `account` microservice via `Xikolo.api(:account)` to fetch user data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/users_controller.rb",
          "spec/requests/admin/ajax/find_users_spec.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::ReportsController": {
      "type": "Controller",
      "description": "The main controller for managing analytics reports. It allows users to view, create, restart, and delete report generation jobs. It enforces specific permissions for report management, requiring `lanalytics.report.create` and `lanalytics.report.delete`.",
      "interactions": {
        "interaction_0": "Communicates with `lanalytics_api` to fetch report types, create report jobs, retrieve job status, and delete jobs.",
        "interaction_1": "Uses `Admin::ReportJobPresenter` to display report job details.",
        "interaction_2": "Uses `Admin::ReportPresenter` to display available report types and their options.",
        "interaction_3": "Fetches courses from `course_api` for report parameters.",
        "interaction_4": "Fetches classifiers from `Course::Classifier` for report parameters.",
        "interaction_5": "Interacts with `current_user` for permission checks and job ownership.",
        "interaction_6": "Interacts with Xikolo.api(:learnanalytics). [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_7": "Interacts with Xikolo.api(:course). [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_8": "Queries Course::Classifier model. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_9": "Receives AJAX requests from report-jobs.js. [Source: app/assets/admin/reports/report-jobs.js]",
        "interaction_10": "Requires `lanalytics.report.create` and `lanalytics.report.delete` permissions (via Xikolo::Common::Auth::CurrentUser). [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_11": "Handles `request.xhr?` for asynchronous rendering of report jobs table. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_12": "Fetches report jobs and report types from `learnanalytics_api`. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_13": "Creates, restarts, and deletes report jobs via `learnanalytics_api`. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_14": "Fetches courses from `course_api` for report options. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_15": "Fetches classifiers from local `Course::Classifier` model for report options. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_16": "Uses `Admin::ReportJobPresenter` and `Admin::ReportPresenter` to format data for views. [Source: app/controllers/admin/reports_controller.rb]"
      },
      "techDebt": [
        "The `task_options` method includes logic to cast checkbox values from '0'/'1' strings to booleans, which is a common Rails pattern but could be encapsulated more cleanly or handled by a custom type. [Source: app/controllers/admin/reports_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/reports_controller.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::StatisticsController": {
      "type": "Controller",
      "description": "A basic controller serving as an entry point for the admin statistics dashboard, primarily setting up navigation. Requires `global.dashboard.show` permission.",
      "interactions": {
        "interaction_0": "Uses `IconNavigationPresenter` and `PlatformDashboardNav` for dashboard navigation.",
        "interaction_1": "Requires `global.dashboard.show` permission (via Xikolo::Common::Auth::CurrentUser). [Source: app/controllers/admin/statistics_controller.rb]",
        "interaction_2": "Initializes `IconNavigationPresenter` for dashboard navigation. [Source: app/controllers/admin/statistics_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/statistics_controller.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "LanalyticsHelper": {
      "type": "Helper",
      "description": "Provides utility methods for analytics-related data, specifically `lanalytics_data` which prepares data for frontend consumption, including user ID and build version.",
      "interactions": {
        "interaction_0": "Accesses `current_user` to determine user ID.",
        "interaction_1": "Reads `ENV['RELEASE_NUMBER']` for build version."
      },
      "techDebt": [
        "TODO: Do not use instance variables"
      ],
      "provenance": {
        "sources": [
          "app/helpers/lanalytics_helper.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Course::EnrollmentsStatistics": {
      "type": "Service Object",
      "description": "Calculates various enrollment statistics for a given course, such as current enrollments and enrollments at specific dates (start/end of course), accounting for an `enrollment_delta`.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Course` and its `enrollments` association to count enrollments.",
        "interaction_1": "Queries Course::Enrollment model. [Source: app/models/course/enrollments_statistics.rb]",
        "interaction_2": "Used by Course::Statistics. [Source: app/models/course/statistics.rb]",
        "interaction_3": "Initialized with a `Course::Course` object.",
        "interaction_4": "Queries `course.enrollments` and uses `course.enrollment_delta` for calculations.",
        "interaction_5": "Used by `Course::EnrollmentStatistics` ViewComponent to display data.",
        "interaction_6": "Queries `Course::Enrollment` records directly from the database. [Source: app/models/course/enrollments_statistics.rb]",
        "interaction_7": "Considers `course.enrollment_delta` for adjusted counts. [Source: app/models/course/enrollments_statistics.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/enrollments_statistics.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Course::Statistics": {
      "type": "Service Object",
      "description": "Provides a comprehensive set of statistics for a specific course, including completion rates, certificate counts, and user engagement metrics. It aggregates data from internal models and external analytics services.",
      "interactions": {
        "interaction_0": "Uses `Course::EnrollmentsStatistics` to get enrollment figures.",
        "interaction_1": "Queries `Course::Visit` records to determine user engagement ('shows').",
        "interaction_2": "Communicates with `lanalytics_api` (via `Xikolo.api(:learnanalytics)`) to fetch certificate data.",
        "interaction_3": "Uses `Rails.cache` for certificate data.",
        "interaction_4": "Uses Rails.cache (implicit). [Source: app/models/course/statistics.rb]",
        "interaction_5": "Fetches certificate statistics from `learnanalytics_api` via `Xikolo.api(:learnanalytics)`. [Source: app/models/course/statistics.rb]",
        "interaction_6": "Uses `Rails.cache` to cache certificate data for 1 hour. [Source: app/models/course/statistics.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/statistics.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::ReportJobPresenter": {
      "type": "Presenter",
      "description": "Decorates raw report job data received from the `lanalytics_api` for display in the admin interface. It provides formatted status, download links, progress, and action-related flags (e.g., `downloadable?`, `restartable?`).",
      "interactions": {
        "interaction_0": "Receives report job data (hash) and `User` object for authorization checks (e.g., `masqueraded?`).",
        "interaction_1": "Used by Admin::ReportsController. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_2": "Determines if a job is downloadable, error-prone, or restartable based on its status. [Source: app/presenters/admin/report_job_presenter.rb]",
        "interaction_3": "Receives raw job data and `current_user` object. [Source: app/presenters/admin/report_job_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/report_job_presenter.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::ReportPresenter": {
      "type": "Presenter",
      "description": "Decorates report type definitions from the `lanalytics_api` to render report creation forms in the admin interface. It dynamically populates options like course and classifier selections based on the report type's configuration.",
      "interactions": {
        "interaction_0": "Receives report type data (hash), a list of courses, a list of classifiers, and prefill data.",
        "interaction_1": "Transforms raw options into formatted attributes for form rendering.",
        "interaction_2": "Used by Admin::ReportsController. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_3": "Maps `courses` and `classifiers` data to select input options. [Source: app/presenters/admin/report_presenter.rb]",
        "interaction_4": "Receives report type definition, list of courses, list of classifiers, and prefill data. [Source: app/presenters/admin/report_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/report_presenter.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Admin::StatisticsPresenter": {
      "type": "Presenter",
      "description": "Provides methods to prepare data for the statistics dashboard, specifically listing courses relevant for display based on a 'dashboard' classifier.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course (Microservice Client) to list relevant courses ",
        "interaction_1": "Wraps `Course` objects for presentation.",
        "interaction_2": "Queries Course::Classifier model. [Source: app/presenters/admin/statistics_presenter.rb]",
        "interaction_3": "Wraps Course::Course objects. [Source: app/presenters/admin/statistics_presenter.rb]",
        "interaction_4": "Queries `Course::Classifier` to find relevant courses. [Source: app/presenters/admin/statistics_presenter.rb]",
        "interaction_5": "Wraps `Course::Course` objects with an inner `Course` class for formatted display. [Source: app/presenters/admin/statistics_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/statistics_presenter.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "GeoIP::Lookup": {
      "type": "Utility/Service",
      "description": "A singleton module for resolving IP addresses to geographical locations using the MaxMind GeoLite2 database. It's a foundational component for geographical statistics, likely used by the `lanalytics_api` or a similar service.",
      "interactions": {
        "interaction_0": "Reads from the `vendor/GeoLite2-Country/GeoLite2-Country.mmdb` database."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "lib/geo_ip/lookup.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Helpdesk::Ticket": {
      "type": "Model",
      "description": "The ActiveRecord model representing a support ticket. It stores details like title, report, topic, language, user email, URL, and client data. It validates ticket data and manages associations with courses. Upon creation, it triggers email notifications and publishes a message to a RabbitMQ topic.",
      "interactions": {
        "interaction_0": "Interacts with Helpdesk::TicketMailer (Mailer) to trigger email notifications ",
        "interaction_1": "Interacts with Msgr (Library/Service) to publish messages ",
        "interaction_2": "Created by `Xikolo::V2::Helpdesk::Tickets` API endpoint [Source: api/xikolo/v2/helpdesk/tickets.rb]",
        "interaction_3": "Triggers `Helpdesk::TicketMailer.new_ticket_email` on create [Source: app/models/helpdesk/ticket.rb]",
        "interaction_4": "Publishes messages to RabbitMQ via `Msgr` on create [Source: app/models/helpdesk/ticket.rb]",
        "interaction_5": "Belongs to `::Course::Course` for course-specific tickets. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_6": "Publishes a message to RabbitMQ (`xikolo.helpdesk.ticket.create`) via `Msgr` after creation. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_7": "Uses `URI::DEFAULT_PARSER` for URL detection in title validation. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_8": "Belongs to Course::Course. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_9": "Publishes messages via Msgr (RabbitMQ). [Source: app/models/helpdesk/ticket.rb]",
        "interaction_10": "Publishes a message to RabbitMQ via `Msgr` upon creation. [Source: app/models/helpdesk/ticket.rb, spec/models/helpdesk/ticket_spec.rb]",
        "interaction_11": "Validated and created by `HelpdeskController`. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_12": "Belongs to `Course::Course` (optional) for course-specific tickets. [Source: app/models/helpdesk/ticket.rb]",
        "interaction_13": "Triggers `Helpdesk::TicketMailer` to send email notifications upon creation. [Source: app/models/helpdesk/ticket.rb, spec/models/helpdesk/ticket_spec.rb]"
      },
      "techDebt": [
        "The `data` field is a generic string, which could be better structured (e.g., JSONB) for consistency and querying [Source: app/models/helpdesk/ticket.rb].",
        "The `allowed_title` validation uses a complex regex for URLs, which might be brittle or have edge cases [Source: app/models/helpdesk/ticket.rb]",
        "The `allowed_title` validation uses a regular expression to detect URLs, which might be brittle and not cover all possible URL patterns. [Source: app/models/helpdesk/ticket.rb]",
        "The `EMAIL` regex for validation is complex; consider using a simpler regex or a dedicated gem for more robust email validation. [Source: app/models/helpdesk/ticket.rb]"
      ],
      "provenance": {
        "sources": [
          "app/models/helpdesk/ticket.rb",
          "spec/models/helpdesk/ticket_spec.rb",
          "spec/factories/helpdesk.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "HelpdeskController": {
      "type": "Controller",
      "description": "Handles web-based helpdesk ticket submissions. It integrates with reCAPTCHA for spam prevention, processes form data, and creates `Helpdesk::Ticket` records. It also manages metadata annotation and referrer URL extraction.",
      "interactions": {
        "interaction_0": "Uses `Xi::Recaptcha::Integration` for spam verification [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_1": "Instantiates and uses `Helpdesk::TicketForm` [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_2": "Creates `Helpdesk::Ticket` records [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_3": "Accesses `current_user` for user details [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_4": "Uses `I18n.locale` for language [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_5": "Relies on `Helpdesk::CategoryOptions` for topic derivation [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_6": "Interacts with `Xi::Recaptcha::Integration` for reCAPTCHA verification. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_7": "Initializes `Helpdesk::TicketForm` to handle form data. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_8": "Creates `Helpdesk::Ticket` records in the database. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_9": "Accesses `current_user` for user-specific information (email, ID). [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_10": "Uses `I18n.locale` for language information. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_11": "Determines ticket topic and course ID based on `Helpdesk::CategoryOptions`. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_12": "Parses referrer URLs using `URI`. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_13": "Accesses current_user via Xikolo::Common::Auth::CurrentUser. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_14": "Uses `Helpdesk::TicketForm` to initialize and annotate form data. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_15": "Creates `Helpdesk::Ticket` instances to persist support requests. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_16": "Utilizes `Helpdesk::CategoryOptions` to determine ticket topic and course association. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_17": "Accesses `current_user` for user email and ID if logged in. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_18": "Renders views for form display, success, or error. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_19": "Interacts with `Xi::Recaptcha::Integration` for spam prevention. [Source: app/controllers/helpdesk_controller.rb]"
      },
      "techDebt": [
        "Direct access to `params` in `create_ticket!` for some fields (e.g., `userAgent`, `cookie`, `language`, `category`) rather than using `ticket_params` could be a potential source of mass assignment vulnerabilities if not carefully managed [Source: app/controllers/helpdesk_controller.rb].",
        "The `create_ticket!` method contains significant business logic for determining `topic` and `course_id`, which could be extracted into a service object or the form object for better separation of concerns. [Source: app/controllers/helpdesk_controller.rb]",
        "Directly accesses `params` for various data points (`data`, `userAgent`, `cookie`, `language`) which could be more explicitly handled by the `ticket_params` or a dedicated form object. [Source: app/controllers/helpdesk_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Helpdesk::TicketForm": {
      "type": "Form Object",
      "description": "A form object inheriting from `XUI::Form` that encapsulates form-specific logic and attributes for helpdesk ticket submission. It provides category options to the view.",
      "interactions": {
        "interaction_0": "Used by `HelpdeskController` to manage form data [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_1": "Uses `Helpdesk::CategoryOptions` to provide categories [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_2": "Inherits functionality from `XUI::Form`. [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_3": "Retrieves helpdesk categories using `Helpdesk::CategoryOptions`. [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_4": "Receives data from `HelpdeskController` for annotation. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_5": "Inherits from XUI::Form. [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_6": "Used by `HelpdeskController` to manage form data. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_7": "Provides `categories_for` method, delegating to `Helpdesk::CategoryOptions`. [Source: app/forms/helpdesk/ticket_form.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/helpdesk/ticket_form.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Helpdesk::TicketMailer": {
      "type": "Mailer",
      "description": "Responsible for sending email notifications to the helpdesk system when a new ticket is created. It formats the email subject based on course details.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo.config (Configuration Manager) for recipient email ",
        "interaction_1": "Accesses `Xikolo.config.helpdesk_email` for recipient [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_2": "Accesses `Helpdesk::Ticket` object for email content and reply-to address [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_3": "Receives a `Helpdesk::Ticket` object to extract details for the email. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_4": "Retrieves the recipient email address from `Xikolo.config.helpdesk_email`. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_5": "Inherits from `::ApplicationMailer`. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_6": "Retrieves configuration from Xikolo.config. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_7": "Interacts with Course::Course. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_8": "Interacts with `Course::Course` (via `ticket.course`) to get course and channel codes for the subject. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_9": "Receives a `Helpdesk::Ticket` object to construct the email. [Source: app/mailers/helpdesk/ticket_mailer.rb]",
        "interaction_10": "Retrieves helpdesk email recipient from `Xikolo.config.helpdesk_email`. [Source: app/mailers/helpdesk/ticket_mailer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/mailers/helpdesk/ticket_mailer.rb",
          "app/models/helpdesk/ticket.rb",
          "spec/models/helpdesk/ticket_spec.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Xikolo::V2::Helpdesk::Tickets": {
      "type": "API Endpoint",
      "description": "A Grape-based API endpoint for programmatically creating helpdesk tickets. It defines writable attributes for ticket details and handles user authentication for automatic field population.",
      "interactions": {
        "interaction_0": "Part of Xikolo::API (Grape API) ",
        "interaction_1": "Accesses `current_user` for user details if authenticated [Source: api/xikolo/v2/helpdesk/tickets.rb]",
        "interaction_2": "Raises `Xikolo::Error::UnprocessableEntity` on `ActiveRecord::RecordInvalid` [Source: api/xikolo/v2/helpdesk/tickets.rb]",
        "interaction_3": "Creates `Helpdesk::Ticket` records [Source: api/xikolo/v2/helpdesk/tickets.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/v2/helpdesk/tickets.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Xi::Recaptcha::Integration": {
      "type": "Utility/Service",
      "description": "A service integration for Google reCAPTCHA, used to verify user requests and prevent spam in the helpdesk submission process.",
      "interactions": {
        "interaction_0": "Instantiated and used by `HelpdeskController` [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_1": "Used by `HelpdeskController` to verify incoming requests. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_2": "Used by HelpdeskController. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_3": "Used by `HelpdeskController` to verify form submissions. [Source: app/controllers/helpdesk_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Helpdesk::CategoryOptions": {
      "type": "Utility",
      "description": "A helper or service object (inferred from usage) responsible for providing and managing helpdesk ticket categories, potentially based on user context.",
      "interactions": {
        "interaction_0": "Used by `Helpdesk::TicketForm` to populate category options [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_1": "Used by `HelpdeskController` to determine ticket topic and course association [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_2": "Used by `Helpdesk::TicketForm` to retrieve categories for display. [Source: app/forms/helpdesk/ticket_form.rb]",
        "interaction_3": "Used by `HelpdeskController` to interpret category selection for ticket creation. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_4": "Used by HelpdeskController. [Source: app/controllers/helpdesk_controller.rb]",
        "interaction_5": "Used by Helpdesk::TicketForm. [Source: app/forms/helpdesk/ticket_form.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/helpdesk/ticket_form.rb",
          "app/controllers/helpdesk_controller.rb",
          "cluster:33_ADMIN_Support"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "33_ADMIN_Support"
        ]
      }
    },
    "Admin::VouchersController": {
      "type": "Controller",
      "description": "Handles administrative web requests for voucher management, including displaying an index, creating voucher batches, querying individual vouchers, and providing statistics. It ensures the voucher feature is enabled and requires specific permissions.",
      "interactions": {
        "interaction_0": "Interacts with Voucher::Stats (implied) for voucher statistics ",
        "interaction_1": "Queries `Voucher::Voucher` to find individual vouchers [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_2": "Instantiates `Voucher::Stats` (implied) for voucher statistics [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_3": "Loads `Course::Course` records for selection in voucher creation [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_4": "Uses `VoucherPresenter` to format voucher data for display [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_5": "Interacts with `Voucher::BatchCreateVouchers` to create new voucher batches [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_6": "Queries `Voucher::Voucher` for specific voucher details [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_7": "Retrieves voucher statistics via `Voucher::Stats` [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_8": "Loads available `Course::Course` records for selection during voucher creation [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_9": "Checks `Xikolo.config.voucher['enabled']` for feature activation [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_10": "Requires `course.vouchers.issue` permission (via Xikolo::Common::Auth::CurrentUser). [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_11": "Finds `Voucher::Voucher` records by code. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_12": "Uses `VoucherPresenter` to decorate voucher data for display. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_13": "Instantiates `Voucher::Stats` to retrieve voucher statistics. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_14": "Checks `Xikolo.config.voucher['enabled']` to ensure the feature is active. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_15": "Calls `Voucher::BatchCreateVouchers` to create new vouchers. [Source: app/controllers/admin/vouchers_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Bridges::Shop::VouchersController": {
      "type": "API Controller",
      "description": "Provides API endpoints for external shop systems to create and list vouchers. It handles JSON requests and responses, including data transformation for backward compatibility with older API versions. ",
      "interactions": {
        "interaction_0": "Queries `Voucher::Voucher` to list existing vouchers [Source: app/controllers/bridges/shop/vouchers_controller.rb].",
        "interaction_1": "Calls `Voucher::BatchCreateVouchers.call` to create new voucher batches [Source: app/controllers/bridges/shop/vouchers_controller.rb].",
        "interaction_2": "Uses `Responders::DecorateResponder` and `Responders::PaginateResponder` for API response formatting [Source: app/controllers/bridges/shop/vouchers_controller.rb].",
        "interaction_3": "Inherits from Abstract::BridgeAPIController. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_4": "Includes Xi::Controllers::RequireBearerToken. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_5": "Decorates voucher objects using VoucherPresenter. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_6": "Is an endpoint for Shop Bridge API. ",
        "interaction_7": "Calls `Voucher::BatchCreateVouchers` to create new vouchers based on API requests. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_8": "Queries `Voucher::Voucher` records based on various filters (tag, claimed status, date ranges). [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_9": "Decorates voucher objects for API responses. [Source: app/controllers/bridges/shop/vouchers_controller.rb]"
      },
      "techDebt": [
        "The `correct_in` and `correct_out` methods handle backward compatibility for API parameter names. This could be considered technical debt if the old API is intended to be deprecated, as it adds complexity for maintaining two sets of parameter names [Source: app/controllers/bridges/shop/vouchers_controller.rb].",
        "The `correct_in` and `correct_out` methods indicate a need for backward compatibility with an older service API, which could be removed or refactored if the old API is deprecated. [Source: app/controllers/bridges/shop/vouchers_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "docs/app/features/vouchers.md",
          "docs/bridges/shop/reference/shop-api.v1.yaml",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Course::VoucherRedemptionsController": {
      "type": "Controller",
      "description": "Manages the user-facing process of redeeming a voucher for a specific course product. It ensures user login, product prerequisites, and handles the voucher claiming logic. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
      "interactions": {
        "interaction_0": "Renders `VoucherRedemptionForm` for user input [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_1": "Calls `Voucher::ProductTypes.resolve` to determine the product type [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_2": "Queries `Course::Course` to retrieve the relevant course [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_3": "Calls `Voucher::Claim.call` to process the voucher redemption [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_4": "Interacts with `current_user` for claimant information [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_5": "Renders `Course::VoucherRedemptionForm` for user input [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_6": "Invokes `Voucher::Claim.call` to process voucher redemption [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_7": "Resolves product types using `Voucher::ProductTypes.resolve` [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_8": "Fetches `::Course::Course` details based on `course_id` [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_9": "Uses `current_user` for associating the claim [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_10": "Checks `Xikolo.config.voucher['enabled']` for feature activation [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_11": "Accesses current_user via Xikolo::Common::Auth::CurrentUser. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_12": "Calls `Voucher::Claim` to process the voucher redemption. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_13": "Uses `Voucher::ProductTypes` to resolve the product associated with the voucher. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_14": "Retrieves `Course::Course` details using `by_identifier`. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_15": "Accesses `current_user` for the claiming user. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_16": "Checks `Xikolo.config.voucher['enabled']` to ensure the feature is active. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_17": "Instantiates `VoucherRedemptionForm` for user input. [Source: app/controllers/course/voucher_redemptions_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/voucher_redemptions_controller.rb",
          "docs/app/features/vouchers.md",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Course::VoucherRedemptionForm": {
      "type": "Form Object",
      "description": "A form object used to encapsulate and validate the voucher code input during the redemption process. [Source: app/forms/course/voucher_redemption_form.rb]",
      "interactions": {
        "interaction_0": "Used by `Course::VoucherRedemptionsController` to handle form submissions [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_1": "Inherits from XUI::Form. [Source: app/forms/course/voucher_redemption_form.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/course/voucher_redemption_form.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Voucher::BatchCreateVouchers": {
      "type": "Service Object/Operation",
      "description": "An operation that encapsulates the business logic for creating multiple vouchers simultaneously. It returns a `Result` object indicating success or errors. [Source: app/controllers/admin/vouchers_controller.rb, app/controllers/bridges/shop/vouchers_controller.rb]",
      "interactions": {
        "interaction_0": "Creates new `Voucher::Voucher` records in a database transaction [Source: app/operations/voucher/batch_create_vouchers.rb].",
        "interaction_1": "Used by `Admin::VouchersController` for admin-initiated voucher creation [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_2": "Used by `Bridges::Shop::VouchersController` for API-initiated voucher creation [Source: app/controllers/bridges/shop/vouchers_controller.rb].",
        "interaction_3": "Called by `Admin::VouchersController` to initiate voucher creation [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_4": "Interacts with Voucher::Voucher model. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_5": "Called by `Bridges::Shop::VouchersController` for API-driven voucher creation. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_6": "Likely interacts with the `Voucher::Voucher` model to persist new voucher records.",
        "interaction_7": "Called by `Admin::VouchersController` for administrative voucher creation. [Source: app/controllers/admin/vouchers_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/voucher/batch_create_vouchers.rb",
          "app/controllers/admin/vouchers_controller.rb",
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Voucher::Claim": {
      "type": "Service Object/Operation",
      "description": "Encapsulates the complex business logic for claiming a single voucher. It performs extensive validations (user authentication, voucher existence, product type match, product prerequisites, user permissions) before claiming the voucher and activating the associated product.",
      "interactions": {
        "interaction_0": "Finds and updates a `Voucher::Voucher` record, setting claimant details and claimed_at timestamp [Source: app/operations/voucher/claim.rb].",
        "interaction_1": "Interacts with `Voucher::ProductTypes` to resolve and instantiate the specific product to be claimed [Source: app/operations/voucher/claim.rb].",
        "interaction_2": "Interacts with `Course::Course` and `User` (current_user) for context and claimant information [Source: app/operations/voucher/claim.rb].",
        "interaction_3": "Calls `product.claim!` which may involve external API calls (e.g., via `Restify` to `xi-course`) for product activation [Source: app/operations/voucher/claim.rb].",
        "interaction_4": "Used by `Course::VoucherRedemptionsController` to process user voucher redemptions [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_5": "Called by `Course::VoucherRedemptionsController` to process a voucher claim [Source: app/controllers/course/voucher_redemptions_controller.rb].",
        "interaction_6": "Interacts with Voucher::Voucher model. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_7": "Interacts with Course::Course model. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_8": "Interacts with User model (from Account Service). [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_9": "Called by `Course::VoucherRedemptionsController` when a user attempts to redeem a voucher. [Source: app/controllers/course/voucher_redemptions_controller.rb]",
        "interaction_10": "Likely interacts with the `Voucher::Voucher` model to mark a voucher as claimed and update claimant details.",
        "interaction_11": "Likely interacts with `Course::Course` and `User` models to apply the voucher's benefits."
      },
      "techDebt": [
        "The `rubocop:enable all` comment suggests that a section of code might temporarily bypass linting rules, potentially indicating areas of complexity or non-standard implementation that could benefit from refactoring to improve readability and maintainability [Source: app/operations/voucher/claim.rb]."
      ],
      "provenance": {
        "sources": [
          "app/operations/voucher/claim.rb",
          "app/controllers/course/voucher_redemptions_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "VoucherPresenter": {
      "type": "Presenter",
      "description": "Decorates `Voucher::Voucher` objects for display in the UI, enriching them with details about the claimant and associated course by fetching data from external microservices. [Source: app/presenters/voucher_presenter.rb]",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Account (Microservice) to fetch claimant details ",
        "interaction_1": "Interacts with Xikolo::CourseService (Microservice) to fetch course details ",
        "interaction_2": "Fetches course details from the `course` microservice via `Xikolo.api(:course)` [Source: app/presenters/voucher_presenter.rb].",
        "interaction_3": "Used by `Admin::VouchersController` to prepare voucher data for views [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_4": "Used by `Admin::VouchersController` to display voucher details [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_5": "Fetches claimant details from `Xikolo.api(:account)` (Account microservice) [Source: app/presenters/voucher_presenter.rb].",
        "interaction_6": "Fetches course details from `Xikolo.api(:course)` (Course microservice) [Source: app/presenters/voucher_presenter.rb].",
        "interaction_7": "Receives `Voucher::Voucher` object for presentation [Source: app/presenters/voucher_presenter.rb].",
        "interaction_8": "Used by Bridges::Shop::VouchersController. [Source: app/controllers/bridges/shop/vouchers_controller.rb]",
        "interaction_9": "Communicates with the `account` microservice via `Xikolo.api(:account)` to fetch claimant details. [Source: app/presenters/voucher_presenter.rb]",
        "interaction_10": "Communicates with the `course` microservice via `Xikolo.api(:course)` to fetch course details. [Source: app/presenters/voucher_presenter.rb]",
        "interaction_11": "Used by `Admin::VouchersController` for displaying voucher information. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_12": "Receives a `Voucher::Voucher` object. [Source: app/presenters/voucher_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/voucher_presenter.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Voucher::Voucher": {
      "type": "Model",
      "description": "Represents a voucher in the system. Stores attributes such as a unique ID (code), tag, country, product type, creation timestamp, expiration timestamp, and details about its claim status (claimed_at, claimant_id, claimant_ip, course_id). [Source: app/controllers/admin/vouchers_controller.rb, app/controllers/bridges/shop/vouchers_controller.rb, app/presenters/voucher_presenter.rb, app/jobs/voucher/delete_claimant_ip_job.rb, spec/jobs/voucher/delete_claimant_ip_job_spec.rb]",
      "interactions": {
        "interaction_0": "Persisted to PostgreSQL database ",
        "interaction_1": "Created by `Voucher::BatchCreateVouchers` [Source: app/operations/voucher/batch_create_vouchers.rb].",
        "interaction_2": "Queried by `Admin::VouchersController` and `Bridges::Shop::VouchersController` [Source: app/controllers/admin/vouchers_controller.rb, app/controllers/bridges/shop/vouchers_controller.rb].",
        "interaction_3": "Found and updated by `Voucher::Claim` during redemption [Source: app/operations/voucher/claim.rb].",
        "interaction_4": "Decorated by `VoucherPresenter` [Source: app/presenters/voucher_presenter.rb].",
        "interaction_5": "Directly updated by `Voucher::DeleteClaimantIPJob` for data privacy [Source: app/jobs/voucher/delete_claimant_ip_job.rb].",
        "interaction_6": "Queried by `Admin::VouchersController` to find specific vouchers [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_7": "Presented by `VoucherPresenter` [Source: app/presenters/voucher_presenter.rb].",
        "interaction_8": "Likely created/updated by `Voucher::BatchCreateVouchers` and `Voucher::Claim` operations (implied).",
        "interaction_9": "Interacted with by Shop API (Controller/Service Layer). ",
        "interaction_10": "Decorated by `VoucherPresenter`. [Source: app/presenters/voucher_presenter.rb]",
        "interaction_11": "Updated by `Voucher::Claim` (to mark as claimed) and `Voucher::DeleteClaimantIPJob` (to clear IP). [Source: app/controllers/course/voucher_redemptions_controller.rb, app/jobs/voucher/delete_claimant_ip_job.rb]",
        "interaction_12": "Created by `Voucher::BatchCreateVouchers`. [Source: app/controllers/admin/vouchers_controller.rb, app/controllers/bridges/shop/vouchers_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "app/operations/voucher/batch_create_vouchers.rb",
          "app/operations/voucher/claim.rb",
          "app/presenters/voucher_presenter.rb",
          "app/jobs/voucher/delete_claimant_ip_job.rb",
          "db/schema.rb",
          "spec/jobs/voucher/delete_claimant_ip_job_spec.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "Voucher::ProductTypes": {
      "type": "Module/Service",
      "description": "Manages and resolves the different types of products that can be activated by vouchers (e.g., Proctoring, Reactivation). It also checks if a product type is enabled for a given course. ",
      "interactions": {
        "interaction_0": "Includes Voucher::ProductTypes::Proctoring (Service Object/Product Type) ",
        "interaction_1": "Used by `Voucher::Claim` to validate the product type and its prerequisites before claiming a voucher [Source: app/operations/voucher/claim.rb].",
        "interaction_2": "Used by `Course::VoucherRedemptionsController` to determine the product associated with a voucher redemption [Source: app/controllers/course/voucher_redemptions_controller.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/voucher_redemptions_controller.rb",
          "app/operations/voucher/claim.rb",
          "docs/app/features/vouchers.md",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "ApplicationController": {
      "type": "Controller",
      "description": "The base controller for the application, handling global concerns such as authentication, authorization, session management, flash messages, and locale settings. It integrates feature toggles and ACFS queue clearing. It also defines how `current_user` is determined and handles redirects, including external ones.",
      "interactions": {
        "interaction_0": "Serves as the base for UsersController (Controller) ",
        "interaction_1": "Serves as the base for LtiController (Controller) ",
        "interaction_2": "Interacts with `Acfs.runner` to clear the queue [Source: app/controllers/application_controller.rb]",
        "interaction_3": "Uses `Xikolo::Common::Auth::Middleware` for authentication [Source: app/controllers/application_controller.rb]",
        "interaction_4": "Interacts with `Xikolo.api(:account)` for user session management [Source: app/controllers/application_controller.rb]",
        "interaction_5": "Sets `Sentry.set_user` for error tracking [Source: app/controllers/application_controller.rb]",
        "interaction_6": "Sets `Mnemosyne::Instrumenter` for tracing errors [Source: app/controllers/errors_controller.rb]",
        "interaction_7": "Uses `I18n.locale` for internationalization [Source: app/controllers/application_controller.rb]",
        "interaction_8": "Utilizes `cookies` for storing and forgetting user location [Source: app/controllers/application_controller.rb]",
        "interaction_9": "Includes `FeatureTogglesHelper` for feature flag checks. [Source: app/controllers/application_controller.rb]",
        "interaction_10": "Includes `Login` module for authentication logic. [Source: app/controllers/application_controller.rb]",
        "interaction_11": "Includes `Locale` module for internationalization. [Source: app/controllers/application_controller.rb]",
        "interaction_12": "Includes `Status` module for specific error classes and handling. [Source: app/controllers/application_controller.rb]",
        "interaction_13": "Interacts with `Acfs.runner` to clear the ACFS queue. [Source: app/controllers/application_controller.rb]",
        "interaction_14": "Interacts with `Xikolo.api(:account)` to manage user sessions. [Source: app/controllers/application_controller.rb]",
        "interaction_15": "Sets user context for `Sentry` for error tracking. [Source: app/controllers/application_controller.rb]",
        "interaction_16": "Manages `cookies.signed[:stored_location]` for post-login redirects. [Source: app/controllers/application_controller.rb]",
        "interaction_17": "Provides `helper_method :current_user` to make `current_user` available in views. [Source: app/controllers/application_controller.rb]",
        "interaction_18": "Includes `FeatureTogglesHelper` for feature flag evaluation [Source: app/controllers/application_controller.rb]",
        "interaction_19": "Includes `Login` module for authentication-related helpers [Source: app/controllers/application_controller.rb]",
        "interaction_20": "Includes `Locale` module for internationalization support [Source: app/controllers/application_controller.rb]",
        "interaction_21": "Uses `Xikolo::Common::Auth::Middleware` for handling authentication flow [Source: app/controllers/application_controller.rb]",
        "interaction_22": "Fetches `current_user` from `request.env` or `Xikolo::Common::Auth::CurrentUser` [Source: app/controllers/application_controller.rb]",
        "interaction_23": "Interacts with `Xikolo.api(:account)` to create new sessions for authenticated users [Source: app/controllers/application_controller.rb]",
        "interaction_24": "Clears `Acfs` queue before each action [Source: app/controllers/application_controller.rb]",
        "interaction_25": "Manages user authorization with `authorize!` and `authorize_any!` methods [Source: app/controllers/application_controller.rb]",
        "interaction_26": "Handles redirects and stores/forgets user location in cookies [Source: app/controllers/application_controller.rb]"
      },
      "techDebt": [
        "Continued reliance on `Acfs` for inter-service communication, with a stated goal to migrate to `Restify` "
      ],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb",
          "app/helpers/application_helper.rb",
          "app/helpers/session_helper.rb",
          "app/helpers/feature_toggles_helper.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "CookieConsentController": {
      "type": "Controller",
      "description": "Handles the HTTP POST requests for accepting or declining cookie consents. It processes the user's decision and updates the consent status in the client's cookies.",
      "interactions": {
        "interaction_0": "Receives form submissions from Global::CookieConsentBanner (ViewComponent) ",
        "interaction_1": "Interacts with `ConsentCookie` to manage cookie preferences [Source: app/controllers/cookie_consent_controller.rb]",
        "interaction_2": "Receives consent decisions from `Global::CookieConsentBanner`. [Source: app/components/global/cookie_consent_banner.html.slim]",
        "interaction_3": "Instantiates and uses `ConsentCookie` to manage the `cookie_consents` cookie based on user input. [Source: app/controllers/cookie_consent_controller.rb]",
        "interaction_4": "Redirects the user back to the previous page after processing the consent. [Source: app/controllers/cookie_consent_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/cookie_consent_controller.rb",
          "cluster:44_INFRA_UIComponents",
          "cluster:50_SEC_CookieConsent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "50_SEC_CookieConsent"
        ]
      }
    },
    "ErrorsController": {
      "type": "Controller",
      "description": "Handles HTTP 4xx/5xx errors by rendering custom error pages or JSON responses. It integrates with Sentry and Mnemosyne to log exceptions and provide trace IDs.",
      "interactions": {
        "interaction_0": "Used by ApplicationController (implicitly, as the error handler) ",
        "interaction_1": "Captures exceptions with `Sentry` [Source: app/controllers/errors_controller.rb]",
        "interaction_2": "Uses `I18n.t` for localized error messages ",
        "interaction_3": "Receives exceptions from the Rails application (`action_dispatch.exception`). [Source: app/controllers/errors_controller.rb]",
        "interaction_4": "Logs exceptions to Mnemosyne using `::Mnemosyne.attach_error`. [Source: app/controllers/errors_controller.rb]",
        "interaction_5": "Captures exceptions to Sentry using `::Sentry.capture_exception`. ",
        "interaction_6": "Renders HTML error templates (e.g., `errors/not_found`) with `layouts/error`. [Source: app/controllers/errors_controller.rb]",
        "interaction_7": "Renders JSON `application/problem+json` responses, including Mnemosyne trace ID and Sentry event ID. [Source: app/controllers/errors_controller.rb]",
        "interaction_8": "Uses `I18n` for localized error messages. [Source: app/controllers/errors_controller.rb]",
        "interaction_9": "Logs exceptions to `::Mnemosyne` [Source: app/controllers/errors_controller.rb]"
      },
      "techDebt": [
        "The `STATUS_TEMPLATES` hash is hardcoded, which might become less maintainable if a large number of custom error pages with specific templates are introduced. [Source: app/controllers/errors_controller.rb]",
        "Deriving `status_code` from `request.path_info[1..].to_i` is a common Rails pattern for `exceptions_app` but relies on a specific URL structure (e.g., `/404`) which could be brittle if routing changes. [Source: app/controllers/errors_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/errors_controller.rb",
          "cluster:44_INFRA_UIComponents",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "FilesController": {
      "type": "Controller",
      "description": "Serves various static files such as user avatars, logos, and favicons. It redirects to external image services or default images, applying image transformations if requested.",
      "interactions": {
        "interaction_0": "Fetches user data from `Xikolo::Account::User` [Source: app/controllers/files_controller.rb]",
        "interaction_1": "Uses `Imagecrop.transform` for image manipulation [Source: app/controllers/files_controller.rb]",
        "interaction_2": "Redirects to `view_context.image_url` for default images [Source: app/controllers/files_controller.rb]",
        "interaction_3": "Serves `logo.png` and `favicon.ico` as described in branding documentation "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/files_controller.rb",
          "app/helpers/application_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Home::GoController": {
      "type": "Controller",
      "description": "A frontend controller responsible for managing various redirection flows within the application, including safe external redirects, deep linking to internal resources (courses, items, pinboards), and integration with external survey platforms like LimeSurvey.",
      "interactions": {
        "interaction_0": "Interacts with app/views/home/go/redirect.html.slim (View) for interstitial redirects ",
        "interaction_1": "Interacts with `Xikolo.api(:course)` to fetch item and course details for item/pinboard redirects. [Source: app/controllers/home/go_controller.rb]",
        "interaction_2": "Interacts with `Xikolo.api(:pinboard)` to fetch tags for pinboard redirects. [Source: app/controllers/home/go_controller.rb]",
        "interaction_3": "Redirects to `course_launch_path` for course deep links. [Source: app/controllers/home/go_controller.rb]",
        "interaction_4": "Redirects to `course_pinboard_index_path` for pinboard deep links. [Source: app/controllers/home/go_controller.rb]",
        "interaction_5": "Redirects to `course_item_path` for item deep links. [Source: app/controllers/home/go_controller.rb]",
        "interaction_6": "Constructs and redirects to LimeSurvey URLs, forwarding filtered query parameters. [Source: app/controllers/home/go_controller.rb]",
        "interaction_7": "Renders `app/views/home/go/redirect.html.slim` for interstitial redirects. [Source: app/controllers/home/go_controller.rb]",
        "interaction_8": "Includes the `TracksReferrers` concern for referrer tracking. [Source: app/controllers/home/go_controller.rb]",
        "interaction_9": "Inherits from `Abstract::FrontendController`. [Source: app/controllers/home/go_controller.rb]",
        "interaction_10": "Performs safe external redirects using `Xikolo::Common::Tracking::ExternalLink` and `params[:checksum]` for validation. [Source: app/controllers/home/go_controller.rb]",
        "interaction_11": "Manages delayed redirects using HTTP `Refresh` headers and `cookies[:skip_redirect_notice]`. [Source: app/controllers/home/go_controller.rb]",
        "interaction_12": "Interacts with `Xikolo.api(:course)` to fetch course and item details for deep linking. [Source: app/controllers/home/go_controller.rb]",
        "interaction_13": "Interacts with `Xikolo.api(:pinboard)` to fetch pinboard tag information for deep linking. [Source: app/controllers/home/go_controller.rb]",
        "interaction_14": "Redirects to external LimeSurvey URLs, sanitizing query parameters and adding platform-specific data. [Source: app/controllers/home/go_controller.rb]",
        "interaction_15": "Uses `Xikolo.config.limesurvey_url` and `Xikolo.config.brand` for LimeSurvey configuration. [Source: app/controllers/home/go_controller.rb]",
        "interaction_16": "Accesses `current_user` to determine if a user is anonymous and to hash their ID for LimeSurvey. [Source: app/controllers/home/go_controller.rb]",
        "interaction_17": "Uses `Digest::SHA256.hexdigest` for user ID hashing. [Source: app/controllers/home/go_controller.rb]",
        "interaction_18": "Utilizes `Addressable::URI` for constructing and manipulating LimeSurvey URLs. [Source: app/controllers/home/go_controller.rb]",
        "interaction_19": "Converts UUIDs using `UUID4` for item and course IDs. [Source: app/controllers/home/go_controller.rb]",
        "interaction_20": "Uses `Xikolo::Common::Tracking::ExternalLink` for safe external redirects [Source: app/controllers/home/go_controller.rb]",
        "interaction_21": "Interacts with `Xikolo.api(:course)` and `Xikolo.api(:pinboard)` for deep linking [Source: app/controllers/home/go_controller.rb]",
        "interaction_22": "Integrates with `Xikolo.config.limesurvey_url` for survey redirects [Source: app/controllers/home/go_controller.rb]",
        "interaction_23": "Uses `current_user` to add pseudo ID to survey query params [Source: app/controllers/home/go_controller.rb]"
      },
      "techDebt": [
        "The controller handles multiple distinct redirection concerns (external links, course/item deep links, survey integration). While grouped under 'go', this might violate the single responsibility principle and could be split into more specialized controllers or services if the logic grows significantly. "
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "app/views/home/go/redirect.html.slim",
          "cluster:22_COMM_ReferralTracking",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "22_COMM_ReferralTracking",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Home::HomeController": {
      "type": "Controller",
      "description": "Renders the application's homepage, dynamically loading announcements, course categories, topics, and videos based on application configuration and feature toggles.",
      "interactions": {
        "interaction_0": "Interacts with AnnouncementPresenter (Presenter) to format news posts ",
        "interaction_1": "Uses `Rails.application.config.homepage_course_loader`, `homepage_topics_loader`, `homepage_video_loader` for dynamic content loading ",
        "interaction_2": "Interacts with `Xikolo.api(:news)` to fetch announcements [Source: app/controllers/home/home_controller.rb]",
        "interaction_3": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors [Source: app/controllers/home/home_controller.rb]",
        "interaction_4": "Interacts with Xikolo.api(:news). [Source: app/controllers/home/home_controller.rb]",
        "interaction_5": "Uses Home::Category (implicitly via homepage_course_loader). [Source: docs/app/development/branding/homepage.md]",
        "interaction_6": "Reports errors to Sentry. [Source: app/controllers/home/home_controller.rb]",
        "interaction_7": "Reports traces to Mnemosyne Configuration. [Source: app/controllers/home/home_controller.rb]",
        "interaction_8": "Checks `feature?('announcements')` and `Xikolo.api?(:news)` for news integration [Source: app/controllers/home/home_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/home_controller.rb",
          "app/presenters/announcement_presenter.rb",
          "spec/controllers/home/home_controller_spec.rb",
          "docs/app/development/branding/homepage.md",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Home::PagesController": {
      "type": "Controller",
      "description": "Handles the display of static content pages to end-users, retrieving them based on locale preferences. It also provides a mechanism for administrators to create missing pages.",
      "interactions": {
        "interaction_0": "Interacts with the `Page` model to retrieve page content and translations [Source: app/controllers/home/pages_controller.rb, app/models/page.rb]",
        "interaction_1": "Uses `PagePresenter` to format page data for views [Source: app/controllers/home/pages_controller.rb]",
        "interaction_2": "Checks `current_user.allowed?('helpdesk.page.store')` for administrative access [Source: app/controllers/home/pages_controller.rb]",
        "interaction_3": "Retrieves Page records. [Source: app/controllers/home/pages_controller.rb]",
        "interaction_4": "Checks current_user permissions via Xikolo::Common::Auth::CurrentUser. [Source: app/controllers/home/pages_controller.rb]",
        "interaction_5": "Checks `current_user` permissions (`helpdesk.page.store`) to determine if a missing page can be created by an admin.",
        "interaction_6": "Retrieves Page records using `Page.preferred_locales`.",
        "interaction_7": "Instantiates `PagePresenter` to format page data.",
        "interaction_8": "Checks `current_user` permissions (`allowed?('helpdesk.page.store')`) to determine if a missing page can be created.",
        "interaction_9": "Uses `I18n.locale` and `Xikolo.config.locales['default']` for locale resolution.",
        "interaction_10": "Sets page title via `set_page_title`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/pages_controller.rb",
          "app/models/page.rb",
          "app/presenters/page_presenter.rb",
          "spec/requests/pages/show_spec.rb",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "IcalController": {
      "type": "Controller",
      "description": "Generates iCalendar feeds for user-specific events, such as course start dates and submission deadlines. Requires the `ical_feed` feature to be enabled.",
      "interactions": {
        "interaction_0": "Requires `ical_feed` feature [Source: app/controllers/ical_controller.rb]",
        "interaction_1": "Fetches `next_dates` from `Xikolo.api(:course)` [Source: app/controllers/ical_controller.rb]",
        "interaction_2": "Uses `User.find` from `Xikolo::Account` to retrieve user language [Source: app/controllers/ical_controller.rb]",
        "interaction_3": "Utilizes `IcalHelper` for generating iCal hashes [Source: app/controllers/ical_controller.rb, app/helpers/ical_helper.rb]",
        "interaction_4": "Constructs iCalendar events using `Icalendar` gem [Source: app/controllers/ical_controller.rb]",
        "interaction_5": "Requires the 'ical_feed' feature to be enabled.",
        "interaction_6": "Uses `IcalHelper` for generating the authentication hash and URL.",
        "interaction_7": "Fetches `NextDate` events from `Xikolo.api(:course).rel(:next_dates)`.",
        "interaction_8": "Finds `User` from `Xikolo::Account` to set the user's locale for event descriptions.",
        "interaction_9": "Uses the `Icalendar` gem to construct the iCal calendar.",
        "interaction_10": "Uses `Course::NextDatePresenter` to format event details for the calendar."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/ical_controller.rb",
          "app/helpers/ical_helper.rb",
          "app/presenters/course/next_date_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "LearningModeController": {
      "type": "Controller",
      "description": "Manages functionalities related to learning modes, specifically the quiz recap feature. It requires the `quiz_recap` feature to be active.",
      "interactions": {
        "interaction_0": "Requires `quiz_recap` feature [Source: app/controllers/learning_mode_controller.rb]",
        "interaction_1": "Uses `CourseContextHelper` for course-specific context [Source: app/controllers/learning_mode_controller.rb]",
        "interaction_2": "Interacts with `Xikolo::Course::Item` to find quiz items [Source: app/controllers/learning_mode_controller.rb]",
        "interaction_3": "Uses `I18n.t` for flash messages "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/learning_mode_controller.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PagesController": {
      "type": "Controller",
      "description": "Manages the administrative interface for creating, editing, and updating static pages. It handles user permissions, retrieves and persists `Page` objects, and orchestrates the processing of embedded file uploads via `Xikolo::S3::TextWithUploadsProcessor`. It also schedules background jobs for S3 file deletions.",
      "interactions": {
        "interaction_0": "Requires `helpdesk.page.store` permission [Source: app/controllers/pages_controller.rb]",
        "interaction_1": "Interacts with the `Page` model for content management [Source: app/controllers/pages_controller.rb, app/models/page.rb]",
        "interaction_2": "Uses `Xikolo::S3::TextWithUploadsProcessor` for S3 file uploads within page content [Source: app/controllers/pages_controller.rb, Foundational Context]",
        "interaction_3": "Queues `S3FileDeletionJob` for obsolete S3 files [Source: app/controllers/pages_controller.rb]",
        "interaction_4": "Interacts with the `Page` model to find, initialize, and save page data.",
        "interaction_5": "Delegates embedded file processing to `Xikolo::S3::TextWithUploadsProcessor`.",
        "interaction_6": "Enqueues `S3FileDeletionJob` for obsolete S3 files.",
        "interaction_7": "Requires `helpdesk.page.store` permission for access.",
        "interaction_8": "Finds or initializes Page records. [Source: app/controllers/pages_controller.rb]",
        "interaction_9": "Uses Xikolo::S3::TextWithUploadsProcessor. [Source: app/controllers/pages_controller.rb]",
        "interaction_10": "Schedules S3FileDeletionJob. [Source: app/controllers/pages_controller.rb]",
        "interaction_11": "Requires `helpdesk.page.store` permission (via Xikolo::Common::Auth::CurrentUser). [Source: app/controllers/pages_controller.rb]"
      },
      "techDebt": [
        "S3 bucket name (`:pages`) and purpose (`'helpdesk_page_file'`) are hardcoded, which could be made more configurable. [Source: app/controllers/pages_controller.rb]",
        "Error handling for `processor.errors` in the `update` action adds generic `:text` errors, which might not provide the most specific or user-friendly feedback. [Source: app/controllers/pages_controller.rb]",
        "The `locale_param` method explicitly returns `nil`, overriding potential base controller logic for locale detection, which might indicate a specific, possibly less flexible, locale handling strategy for this controller. [Source: app/controllers/pages_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pages_controller.rb",
          "app/models/page.rb",
          "spec/requests/admin/pages/edit_spec.rb",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PingController": {
      "type": "Controller",
      "description": "A minimal controller for uptime checks, inheriting directly from `ActionController::Base` to avoid `ApplicationController` overhead. It returns a simple JSON 'Pong' message with timestamps.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/ping_controller.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "UsersController": {
      "type": "Controller",
      "description": "Manages user profiles, including viewing, password changes, and account deletion. It interacts with the `account` and `course` microservices.",
      "interactions": {
        "interaction_0": "Interacts with Custom Fields Management (Feature) for profile updates ",
        "interaction_1": "Interacts with Consent Management (Feature) for consent management ",
        "interaction_2": "Interacts with `Xikolo.api(:account)` for user data and password changes [Source: app/controllers/users_controller.rb]",
        "interaction_3": "Interacts with `Xikolo.api(:course)` for teacher information [Source: app/controllers/users_controller.rb]",
        "interaction_4": "Uses `UserProfilePresenter` and `UserPresenter` for data presentation [Source: app/controllers/users_controller.rb]",
        "interaction_5": "Uses `SessionHelper` for logout functionality [Source: app/controllers/users_controller.rb, app/helpers/session_helper.rb]",
        "interaction_6": "Uses `I18n.t` for flash messages ",
        "interaction_7": "Requires `ensure_logged_in` before actions [Source: app/controllers/users_controller.rb]",
        "interaction_8": "Authorizes `account.user.delete` and `account.user.change_password` permissions [Source: app/controllers/users_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/users_controller.rb",
          "app/helpers/session_helper.rb",
          "app/presenters/user_profile_presenter.rb",
          "app/presenters/user_presenter.rb",
          "app/presenters/course/teacher_list_presenter.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "WebManifestController": {
      "type": "Controller",
      "description": "Generates the `manifest.json` file for Progressive Web Applications (PWAs). It dynamically configures the manifest based on `WebManifest` settings and `Xikolo.config`.",
      "interactions": {
        "interaction_0": "Checks `WebManifest.configured?` before rendering [Source: app/controllers/web_manifest_controller.rb]",
        "interaction_1": "Uses `Xikolo.config.site_name` for manifest name [Source: app/controllers/web_manifest_controller.rb]",
        "interaction_2": "Retrieves icons, related applications, and background color from `WebManifest` [Source: app/controllers/web_manifest_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/web_manifest_controller.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ApplicationHelper": {
      "type": "Helper",
      "description": "Provides general utility methods for views, including browser support detection, image cropping, and Sentry trace propagation meta tags.",
      "interactions": {
        "interaction_0": "Uses `BrowserSupport` to detect browser capabilities [Source: app/helpers/application_helper.rb]",
        "interaction_1": "Interacts with `cookies` to manage browser warning visibility [Source: app/helpers/application_helper.rb]",
        "interaction_2": "Uses `Imagecrop.transform` for image manipulation [Source: app/helpers/application_helper.rb]",
        "interaction_3": "Retrieves Sentry trace propagation meta tags from `Sentry` [Source: app/helpers/application_helper.rb]",
        "interaction_4": "Uses `BrowserSupport` to determine browser compatibility. [Source: app/helpers/application_helper.rb]",
        "interaction_5": "Interacts with `Imagecrop` for image URL transformations. [Source: app/helpers/application_helper.rb]",
        "interaction_6": "Retrieves trace propagation meta tags from `Sentry`. [Source: app/helpers/application_helper.rb]",
        "interaction_7": "Checks `cookies[:_browser_warning]` to hide browser warnings. [Source: app/helpers/application_helper.rb]"
      },
      "techDebt": [
        "Use of instance variable `@in_app` and `@browser_support` in helper, which can lead to unexpected behavior if not carefully managed [Source: app/helpers/application_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/application_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "IcalHelper": {
      "type": "Helper",
      "description": "Provides methods for generating iCal hashes and URLs, used to create secure and unique links for calendar feeds.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo::Account::Token` to create user tokens [Source: app/helpers/ical_helper.rb]",
        "interaction_1": "Uses `Digest::SHA256` for hash generation [Source: app/helpers/ical_helper.rb]",
        "interaction_2": "Uses `UUID` for user ID formatting [Source: app/helpers/ical_helper.rb]",
        "interaction_3": "Constructs URLs using `Xikolo.base_url` [Source: app/helpers/ical_helper.rb]",
        "interaction_4": "Uses `Digest::SHA256` for hashing user ID and token.",
        "interaction_5": "Uses `UUID` for user ID formatting and `Xikolo.base_url` for URL construction."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/ical_helper.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "MarkdownHelper": {
      "type": "Helper",
      "description": "Provides methods for rendering Markdown content into HTML, including custom link handling (e.g., opening external links in new tabs, adding tracking parameters) and robust HTML sanitization.",
      "interactions": {
        "interaction_0": "Uses `Redcarpet::Markdown` for Markdown rendering [Source: app/helpers/markdown_helper.rb]",
        "interaction_1": "Uses `Sanitize.fragment` with `SANITIZE_CONFIG` for HTML sanitization [Source: app/helpers/markdown_helper.rb]",
        "interaction_2": "Interacts with `Xikolo::Common::Tracking::ExternalLink` for external link tracking [Source: app/helpers/markdown_helper.rb]",
        "interaction_3": "Uses `URI` and `Addressable::URI` for URL parsing and manipulation [Source: app/helpers/markdown_helper.rb]",
        "interaction_4": "Logs errors with `Rails.logger` [Source: app/helpers/markdown_helper.rb]",
        "interaction_5": "Included and used by `PagePresenter` to render page content for display."
      },
      "techDebt": [
        "Use of instance variables (`@internal_link_callback`, `@external_link_callback`) in `BlankTargets` class within a helper, which can lead to statefulness issues if not carefully managed [Source: app/helpers/markdown_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/markdown_helper.rb",
          "app/presenters/page_presenter.rb",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SessionHelper": {
      "type": "Helper",
      "description": "Manages user logout functionality, including interaction with the `account` microservice to delete sessions and preservation of SAML session information for Single Log-Out (SLO).",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo.api(:account)` to delete user sessions [Source: app/helpers/session_helper.rb]",
        "interaction_1": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors during logout [Source: app/helpers/session_helper.rb]",
        "interaction_2": "Manages `session` state, including `saml_uid`, `saml_session_index`, and `saml_provider` for SLO [Source: app/helpers/session_helper.rb]",
        "interaction_3": "Uses `OMNIAUTH_LOGOUT` for SAML provider checks [Source: app/helpers/session_helper.rb]"
      },
      "techDebt": [
        "Logout handling logic is copied to `OmniAuth::Strategies::XikoloSAML`, indicating potential for duplication or a need for a shared module [Source: app/helpers/session_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/session_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "UUIDHelper": {
      "type": "Helper",
      "description": "Provides a utility method for shortening UUIDs.",
      "interactions": {
        "interaction_0": "Uses `UUID4` for UUID conversion and parameterization [Source: app/helpers/uuid_helper.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/uuid_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ViewMethodsHelper": {
      "type": "Helper",
      "description": "A helper module that includes `ActionView::Helpers` and extends `SanitizeHelper::ClassMethods`, providing access to URL helpers and sanitization methods in views.",
      "interactions": {
        "interaction_0": "Interacts with Rails.application.routes (Routing Configuration) for URL helpers ",
        "interaction_1": "Extends `SanitizeHelper::ClassMethods` [Source: app/helpers/view_methods_helper.rb]",
        "interaction_2": "Provides `Rails.application.routes.url_helpers` [Source: app/helpers/view_methods_helper.rb]",
        "interaction_3": "Includes `ActionView::Helpers` [Source: app/helpers/view_methods_helper.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/view_methods_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Page": {
      "type": "Model",
      "description": "Represents a static content page, identified by a unique `name` and `locale`. It stores the page's `title` and `text`. The `text` attribute is a custom type (`Xikolo::S3::Markup`) designed to manage embedded S3 files within the content. Pages can have multiple language translations linked by their `name` attribute.",
      "interactions": {
        "interaction_0": "Validated by PagesController (Controller) ",
        "interaction_1": "Manages `has_many` associations for `translations` and `other_translations` [Source: app/models/page.rb]",
        "interaction_2": "Validates `name`, `title`, `text`, and `locale` [Source: app/models/page.rb]",
        "interaction_3": "Provides `preferred_locales` class method for ordering translations [Source: app/models/page.rb]",
        "interaction_4": "Is created, read, updated, and deleted by `PagesController`.",
        "interaction_5": "Its `text` attribute is processed by `Xikolo::S3::TextWithUploadsProcessor` for embedded file management.",
        "interaction_6": "Its data is formatted for display by `PagePresenter`.",
        "interaction_7": "Interacts with `Xikolo::S3::Markup` for custom attribute handling of text with embedded S3 references.",
        "interaction_8": "Interacted with by Home::PagesController. [Source: app/controllers/home/pages_controller.rb]",
        "interaction_9": "Interacted with by PagesController. [Source: app/controllers/pages_controller.rb]",
        "interaction_10": "Uses Xikolo::S3::Markup. [Source: app/models/page.rb]",
        "interaction_11": "Relies on S3FileDeletionJob. [Source: app/models/page.rb]",
        "interaction_12": "Uses `Xikolo::S3::Markup` for the `text` attribute, integrating with S3 for file uploads [Source: app/models/page.rb, Foundational Context]"
      },
      "techDebt": [
        "`has_many` associations use `inverse_of: false` which might prevent some ActiveRecord optimizations and lead to N+1 queries if not handled carefully [Source: app/models/page.rb]",
        "The `rubocop:disable Rails/HasManyOrHasOneDependent` comment on `has_many` associations suggests a potential design choice that might need re-evaluation regarding the lifecycle of translations when a 'parent' page (identified by `name`) is deleted. [Source: app/models/page.rb]",
        "Associations `translations` and `other_translations` use `inverse_of: false`, which might lead to N+1 query issues or unexpected ActiveRecord behavior if not carefully managed."
      ],
      "provenance": {
        "sources": [
          "app/models/page.rb",
          "app/models/application_record.rb",
          "spec/models/page_spec.rb",
          "spec/requests/pages/show_spec.rb",
          "spec/requests/admin/pages/edit_spec.rb",
          "cluster:32_ADMIN_ContentManagement",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "WellKnownFile": {
      "type": "Model",
      "description": "An ActiveRecord model for storing and retrieving content for `.well-known` files. It enforces a filename format that disallows slashes, supporting only top-level files.",
      "interactions": {
        "interaction_0": "Contains WellKnownFile::AppleAppSiteAssociation (Model/Configuration Generator) ",
        "interaction_1": "Contains WellKnownFile::GoogleAssetLinks (Model/Configuration Generator) "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/well_known_file.rb",
          "app/models/application_record.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ApplicationOperation": {
      "type": "Operation",
      "description": "A base class for defining business logic operations, promoting a structured approach to encapsulate specific functionalities. It includes a `ResultNegotiation` pattern for handling various outcomes (e.g., success, failure) without relying on type checking.",
      "interactions": {
        "interaction_0": "Extended by Certificate::Record::Render (Operation) ",
        "interaction_1": "Extended by Course::Metadata::Store (Operation) ",
        "interaction_2": "Extended by Course::Richtext::Store (Operation) ",
        "interaction_3": "Extended by Course::Visual::Store (Operation) ",
        "interaction_4": "Extended by Item::Create (Operation) ",
        "interaction_5": "Extended by Lti::Exercise::Store (Operation) ",
        "interaction_6": "Extended by Video::Store (Operation) ",
        "interaction_7": "Extended by Voucher::BatchCreateVouchers (Service Object/Operation) ",
        "interaction_8": "Extended by Voucher::Claim (Service Object/Operation) ",
        "interaction_9": "Provides a `call` class method to execute operations [Source: app/operations/application_operation.rb]",
        "interaction_10": "Uses `ResultNegotiation` to wrap operation results, allowing clients to react to different outcomes (e.g., `success`, `failure`) [Source: app/operations/application_operation.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/application_operation.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Breadcrumbs": {
      "type": "Presenter",
      "description": "Manages a collection of URL-text pairs to represent a navigation breadcrumb trail. It provides methods to add levels and iterate over them for rendering.",
      "interactions": {
        "interaction_0": "Used by views or layouts to render the breadcrumb navigation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/breadcrumbs.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "MenuWithPermissions": {
      "type": "Presenter",
      "description": "A base class for defining menu items with associated text, icons, links, and permission checks. It supports nested submenus and dynamic link generation based on context and user permissions.",
      "interactions": {
        "interaction_0": "Includes `Rails.application.routes.url_helpers` and `ActionView::Helpers::UrlHelper` for link generation [Source: app/presenters/menu_with_permissions.rb]",
        "interaction_1": "Checks user permissions via `user.allowed?` [Source: app/presenters/menu_with_permissions.rb]",
        "interaction_2": "Uses `I18n.t` for menu item text localization [Source: app/presenters/menu_with_permissions.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/menu_with_permissions.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PlatformDashboardNav": {
      "type": "Presenter",
      "description": "A specific implementation of `MenuWithPermissions` for the admin dashboard navigation, defining menu items and their associated permissions for platform administration.",
      "interactions": {
        "interaction_0": "Extends `MenuWithPermissions` [Source: app/presenters/platform_dashboard_nav.rb]",
        "interaction_1": "Defines menu items for 'Dashboard' and 'News' with `user.allowed?('global.dashboard.show')` permission checks [Source: app/presenters/platform_dashboard_nav.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/platform_dashboard_nav.rb",
          "app/presenters/menu_with_permissions.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Presenter": {
      "type": "Presenter",
      "description": "The foundational base class for all presenters in the application. It provides a generic `initialize` method to assign parameters to instance variables.",
      "interactions": {
        "interaction_0": "Inherited by `PrivatePresenter` and other presenter classes."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/presenter.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "AjaxPaginationRenderer": {
      "type": "Utility",
      "description": "Extends `PaginationRenderer` to add `data-remote: true` to pagination links, enabling AJAX-driven pagination for improved user experience.",
      "interactions": {
        "interaction_0": "Extends `PaginationRenderer` [Source: lib/ajax_pagination_renderer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "lib/ajax_pagination_renderer.rb",
          "lib/pagination_renderer.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PaginationRenderer": {
      "type": "Utility",
      "description": "A custom `WillPaginate::ActionView::LinkRenderer` that provides specific HTML structure and localization for pagination links, commonly used for features like pinboards.",
      "interactions": {
        "interaction_0": "Includes `ActionView::Helpers::OutputSafetyHelper` [Source: lib/pagination_renderer.rb]",
        "interaction_1": "Uses `I18n.t` for localized pagination texts "
      },
      "techDebt": [
        "Uses a self-made tag building mechanism that is not standard Rails rendering context, leading to `rubocop:disable Rails/ContentTag` [Source: lib/pagination_renderer.rb]"
      ],
      "provenance": {
        "sources": [
          "lib/pagination_renderer.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "RedirectURL": {
      "type": "Utility",
      "description": "A helper class designed to validate URLs for safe redirection, primarily to prevent open redirect vulnerabilities. It determines if a given URL is internal (relative or same-origin) compared to a base URL.",
      "interactions": {
        "interaction_0": "Used by `Home::GoController` to check the validity of external redirect URLs. [Source: app/controllers/home/go_controller.rb, lib/redirect_url.rb]",
        "interaction_1": "Initializes with a URL string, parsing it using `Addressable::URI`. [Source: lib/redirect_url.rb]",
        "interaction_2": "Provides `internal?(base)` method to check if the URL is relative or shares the same origin as the `base` URL. [Source: lib/redirect_url.rb]",
        "interaction_3": "Uses `Addressable::URI` for URL parsing and normalization [Source: lib/redirect_url.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "lib/redirect_url.rb",
          "cluster:22_COMM_ReferralTracking",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "22_COMM_ReferralTracking",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "app/assets/javascripts/application.js": {
      "type": "JavaScript Entrypoint",
      "description": "Legacy Sprockets manifest file that includes foundational JavaScript libraries like jQuery and Bootstrap, indicating a transitional phase towards a Webpack-centric frontend.",
      "interactions": {
        "interaction_0": "Requires `xfn/ready` for DOM readiness [Source: app/assets/javascripts/application.js]",
        "interaction_1": "Requires `jquery2` for DOM manipulation [Source: app/assets/javascripts/application.js]",
        "interaction_2": "Requires `bootstrap-sprockets.js` for Bootstrap functionality [Source: app/assets/javascripts/application.js]"
      },
      "techDebt": [
        "Represents a legacy asset pipeline approach, with a move towards Webpack for modern JavaScript management [Source: app/assets/javascripts/application.js]"
      ],
      "provenance": {
        "sources": [
          "app/assets/javascripts/application.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "app/assets/javascripts/xfn/ready.js": {
      "type": "JavaScript Utility",
      "description": "A small utility function that invokes a given callback when the DOM is fully loaded, ensuring scripts run at the appropriate time.",
      "interactions": {
        "interaction_0": "Interacts with `document.readyState` and `document.addEventListener('DOMContentLoaded')` [Source: app/assets/javascripts/xfn/ready.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/javascripts/xfn/ready.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "app/assets/main.js": {
      "type": "JavaScript Entrypoint",
      "description": "The main Webpack bundle entry point for the application. It includes polyfills, initializes Rails UJS, and imports numerous global UI components and form action modules, forming the core of the modern frontend.",
      "interactions": {
        "interaction_0": "Imports `form-request-submit-polyfill` [Source: app/assets/main.js]",
        "interaction_1": "Initializes `Rails` UJS [Source: app/assets/main.js]",
        "interaction_2": "Imports various form actions (e.g., `autosubmit`, `change-handler`, `hide-on-submit`) [Source: app/assets/main.js]",
        "interaction_3": "Imports numerous global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`, `markdown-editor`, `slider`, `system-alerts`) [Source: app/assets/main.js]",
        "interaction_4": "Imports utility functions (e.g., `upload`, `mdupload`, `get-relative-time`) [Source: app/assets/main.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/main.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "app/assets/main.scss": {
      "type": "CSS Entrypoint",
      "description": "The main entry point for the application's styles, importing the theme-specific and global stylesheets. It follows the branding guidelines for SCSS structure.",
      "interactions": {
        "interaction_0": "Imports `stylesheets/theme` for brand-specific styling ",
        "interaction_1": "Imports `stylesheets/global` for general application styles "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/main.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Accordion": {
      "type": "ViewComponent",
      "description": "A UI component that renders an accordion container, allowing multiple collapsible sections. It can display an optional headline.",
      "interactions": {
        "interaction_0": "Interacts with Stimulus.js controller (implied) for interactive behavior ",
        "interaction_1": "Uses `data-controller='accordion'` for JavaScript interaction [Source: app/components/global/accordion.html.slim]",
        "interaction_2": "Renders `Global::AccordionSection` components as its sections [Source: app/components/global/accordion.rb, app/components/global/accordion_section.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/accordion.rb",
          "app/components/global/accordion.html.slim",
          "app/components/global/accordion_preview.rb",
          "app/components/global/accordion_preview/default.html.slim",
          "app/components/global/accordion_preview/expanded.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::AccordionSection": {
      "type": "ViewComponent",
      "description": "A UI component representing a single collapsible section within an `Accordion`. It includes a toggle button with an icon and content area.",
      "interactions": {
        "interaction_0": "Interacts with Stimulus.js controller (implied) for interactive behavior ",
        "interaction_1": "Uses `data-accordion-target='toggle-button'` for JavaScript interaction [Source: app/components/global/accordion_section.html.slim]",
        "interaction_2": "Renders `Global::FaIcon` for the expand/collapse indicators [Source: app/components/global/accordion_section.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/accordion_section.rb",
          "app/components/global/accordion_section.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::ActionsDropdown": {
      "type": "ViewComponent",
      "description": "A UI component that renders a dropdown menu for various actions. It supports custom button text, alignment, and distinct styling for 'destructive' actions.",
      "interactions": {
        "interaction_0": "Interacts with JavaScript (dropdown logic) for interactive behavior ",
        "interaction_1": "Uses `data-behaviour='dropdown'` and `data-behaviour='menu-dropdown'` for JavaScript interaction [Source: app/components/global/actions_dropdown.html.slim]",
        "interaction_2": "Uses `I18n.t` for `aria_label` localization ",
        "interaction_3": "Renders `Global::FaIcon` for the dropdown control icon [Source: app/components/global/actions_dropdown.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/actions_dropdown.rb",
          "app/components/global/actions_dropdown.html.slim",
          "app/components/global/actions_dropdown_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::BasicTooltip": {
      "type": "ViewComponent",
      "description": "A simple UI component for displaying a basic tooltip with a question mark icon and text content.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/basic_tooltip.rb",
          "app/components/global/basic_tooltip.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Callout": {
      "type": "ViewComponent",
      "description": "A UI component for displaying styled messages (e.g., info, warning, error, success) with an icon, optional title, and content slot. It dynamically selects a default icon based on the message type.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` for the message indicator [Source: app/components/global/callout.html.slim, app/components/global/fa_icon.rb]",
        "interaction_1": "Used by `PollArchivePresenter` to display messages regarding poll status or voting requirements."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/callout.rb",
          "app/components/global/callout.html.slim",
          "app/components/global/callout_preview.rb",
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::CookieConsentBanner": {
      "type": "ViewComponent",
      "description": "Renders the cookie consent banner at the bottom of the page. It dynamically decides whether to display based on the user's current consent status and provides options to accept or decline the consent.",
      "interactions": {
        "interaction_0": "Interacts with CookieConsentController (Controller) to submit consent ",
        "interaction_1": "Uses `Translations` to render consent text [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_2": "Submits a form to `cookie_consent_path` [Source: app/components/global/cookie_consent_banner.html.slim]",
        "interaction_3": "Renders `Global::FaIcon` for the close button [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/fa_icon.rb]",
        "interaction_4": "Uses `I18n.t` for button labels ",
        "interaction_5": "Interacts with `ConsentCookie` to get current consent status [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_6": "Interacts with `ConsentCookie` to determine if a banner should be rendered and to retrieve current consent details. [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_7": "Interacts with `Translations` to fetch localized consent text. [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_8": "Submits user decisions (accept/decline) to `CookieConsentController` via a form. [Source: app/components/global/cookie_consent_banner.html.slim]"
      },
      "techDebt": [
        "Direct use of `html_safe` for `text` and `to_json` for `swal_options` [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/flash_layer.html.slim]",
        "Uses `html_safe` for rendering consent text, which is explicitly disabled for Rubocop. This poses a potential XSS risk if consent texts are not strictly controlled and sanitized. [Source: app/components/global/cookie_consent_banner.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/cookie_consent_banner.rb",
          "app/components/global/cookie_consent_banner.html.slim",
          "app/controllers/cookie_consent_controller.rb",
          "cluster:44_INFRA_UIComponents",
          "cluster:50_SEC_CookieConsent"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents",
          "50_SEC_CookieConsent"
        ]
      }
    },
    "Global::CopyToClipboard": {
      "type": "ViewComponent",
      "description": "A UI component that renders a button to copy specified text to the clipboard. It supports different visual types (icon or button) and optional labels/tooltips.",
      "interactions": {
        "interaction_0": "Interacts with JavaScript (clipboard logic) for copy functionality ",
        "interaction_1": "Renders `Global::FaIcon` for the copy icon [Source: app/components/global/copy_to_clipboard.html.slim, app/components/global/fa_icon.rb]",
        "interaction_2": "Uses `I18n.t` for `aria-label` localization ",
        "interaction_3": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/copy_to_clipboard.html.slim]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/copy_to_clipboard.rb",
          "app/components/global/copy_to_clipboard.html.slim",
          "app/components/global/copy_to_clipboard_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::CourseListBanner": {
      "type": "ViewComponent",
      "description": "A UI component that displays a promotional banner on course lists. It fetches the current banner from the `Banner` model, caches it, and handles external links with target options.",
      "interactions": {
        "interaction_0": "Interacts with Banner (Model) to fetch banner data ",
        "interaction_1": "Uses `Rails.cache.fetch` for server-side caching of banner data ",
        "interaction_2": "Uses `image_tag` and `link_to` for rendering [Source: app/components/global/course_list_banner.html.slim]",
        "interaction_3": "Fetches `Banner.current` from `Rails.cache` or directly from the `Banner` model.",
        "interaction_4": "Delegates image URL, link URL, alt text, and link target options to the `Banner` object.",
        "interaction_5": "Fetches `Banner.current` from the database [Source: app/components/global/course_list_banner.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/course_list_banner.rb",
          "app/components/global/course_list_banner.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::CustomHeadSnippets": {
      "type": "ViewComponent",
      "description": "A UI component responsible for rendering custom HTML snippets within the `<head>` section of the document. Snippets are conditionally rendered based on `Xikolo.config.custom_html` and `Requirements` (e.g., cookie consent).",
      "interactions": {
        "interaction_0": "Reads custom HTML snippets from `Xikolo.config.custom_html` [Source: app/components/global/custom_head_snippets.rb]",
        "interaction_1": "Uses `Global::CustomHeadSnippets::Requirements` to evaluate snippet conditions, including `CookieConsent` [Source: app/components/global/custom_head_snippets.rb]",
        "interaction_2": "Interacts with `ConsentCookie` for cookie consent checks [Source: app/components/global/custom_head_snippets.rb]"
      },
      "techDebt": [
        "Direct use of `raw snippet` for rendering HTML, requiring careful sanitization of `Xikolo.config.custom_html` content [Source: app/components/global/custom_head_snippets.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/custom_head_snippets.rb",
          "app/components/global/custom_head_snippets.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::DisclosureWidget": {
      "type": "ViewComponent",
      "description": "A UI component that implements a progressive disclosure widget using the HTML `<details>` element. It allows showing/hiding content with customizable summary labels, icons, and visual variants.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` for the open/closed state indicators [Source: app/components/global/disclosure_widget.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/disclosure_widget.rb",
          "app/components/global/disclosure_widget.html.slim",
          "app/components/global/disclosure_widget_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::DownloadButton": {
      "type": "ViewComponent",
      "description": "A UI component that renders a button for initiating file downloads. It supports disabled states, custom CSS classes, and can display a download icon.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` if the button type is `:download` [Source: app/components/global/download_button.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/download_button.rb",
          "app/components/global/download_button.html.slim",
          "app/components/global/download_button_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FaIcon": {
      "type": "ViewComponent",
      "description": "A UI component for rendering Font Awesome icons. It supports different styles (e.g., solid, regular) and a unique feature for stacking two icons, where one icon is masked and another is stacked on top.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/fa_icon.rb",
          "app/components/global/fa_icon.html.slim",
          "app/components/global/fa_icon_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FilterBar::Controls": {
      "type": "ViewComponent",
      "description": "A UI component that displays controls for a filter bar, including a reset button and an overview of applied filters. It can also show a results count and an 'adjust' link.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` for filter and reset icons [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/fa_icon.rb]",
        "interaction_1": "Renders `Global::Pill` for displaying the results count [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/pill.rb]",
        "interaction_2": "Uses `I18n.t` for localization of text elements "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/controls.rb",
          "app/components/global/filter_bar/controls.html.slim",
          "app/components/global/filter_bar/controls_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FilterBar::Filter": {
      "type": "ViewComponent",
      "description": "A UI component representing a single filter dropdown within a filter bar. It allows selecting options, supports multi-select, and can be conditionally visible or disabled.",
      "interactions": {
        "interaction_0": "Uses `select_tag` and `hidden_field_tag` for form elements [Source: app/components/global/filter_bar/filter.html.slim]",
        "interaction_1": "Uses `I18n.t` for localization of blank options and disabled text "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/filter.rb",
          "app/components/global/filter_bar/filter.html.slim",
          "app/components/global/filter_bar/filter_bar_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FilterBar::Search": {
      "type": "ViewComponent",
      "description": "A UI component for a search input field within a filter bar. It includes a clear button for resetting the search and a submit button with a magnifying glass icon.",
      "interactions": {
        "interaction_0": "Uses `text_field_tag` for the search input [Source: app/components/global/filter_bar/search.html.slim]",
        "interaction_1": "Renders `Global::FaIcon` for search and clear buttons [Source: app/components/global/filter_bar/search.html.slim, app/components/global/fa_icon.rb]",
        "interaction_2": "Uses `I18n.t` for localization of labels and button texts "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/search.rb",
          "app/components/global/filter_bar/search.html.slim",
          "app/components/global/filter_bar/filter_bar_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FlashBlock": {
      "type": "ViewComponent",
      "description": "A UI component that iterates through flash messages and layers from the Rails flash hash and renders them using `Global::FlashMessage` and `Global::FlashLayer` components.",
      "interactions": {
        "interaction_0": "Renders `Global::FlashMessage` for standard flash messages [Source: app/components/global/flash_block.html.slim, app/components/global/flash_message.rb]",
        "interaction_1": "Renders `Global::FlashLayer` for SweetAlert2-style flash layers [Source: app/components/global/flash_block.html.slim, app/components/global/flash_layer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/flash_block.rb",
          "app/components/global/flash_block.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FlashLayer": {
      "type": "ViewComponent",
      "description": "A UI component that renders a JavaScript snippet to display flash messages as SweetAlert2-style pop-up layers on DOM ready. It parses the flash text into a title and body.",
      "interactions": {
        "interaction_0": "Interacts with app/assets/javascripts/xfn/ready.js (JavaScript Utility) for DOM readiness ",
        "interaction_1": "Uses `ready` function for DOM readiness [Source: app/components/global/flash_layer.html.slim, app/assets/javascripts/xfn/ready.js]",
        "interaction_2": "Injects JavaScript to call `xuiSwal.fire` (SweetAlert2) [Source: app/components/global/flash_layer.html.slim]"
      },
      "techDebt": [
        "Direct use of `html_safe` for `swal_options.to_json` [Source: app/components/global/flash_layer.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/flash_layer.rb",
          "app/components/global/flash_layer.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::FlashMessage": {
      "type": "ViewComponent",
      "description": "A UI component that displays a single flash message with a type-specific icon and a close button. It supports different message types (success, error, alert, notice).",
      "interactions": {
        "interaction_0": "Interacts with JavaScript (dismiss logic) for message dismissal ",
        "interaction_1": "Uses `data-hide-on-click` for JavaScript interaction to dismiss the message [Source: app/components/global/flash_message.html.slim]",
        "interaction_2": "Uses `I18n.t` for the close button's `aria-label` ",
        "interaction_3": "Renders `Global::FaIcon` for the message icon and close button [Source: app/components/global/flash_message.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/flash_message.rb",
          "app/components/global/flash_message.html.slim",
          "app/components/global/flash_message_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::HeadlineTooltip": {
      "type": "ViewComponent",
      "description": "A UI component that combines a headline (of a specified level) with a `Global::BasicTooltip` for additional information.",
      "interactions": {
        "interaction_0": "Renders `Global::BasicTooltip` [Source: app/components/global/headline_tooltip.html.slim, app/components/global/basic_tooltip.rb]"
      },
      "techDebt": [
        "Direct use of `== \"<h#{@level} class=\\\"basic-tooltip-headline\\\">#{@headline}</h#{@level}>\"` for rendering the headline, which bypasses standard Rails helpers and could be more robust [Source: app/components/global/headline_tooltip.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/headline_tooltip.rb",
          "app/components/global/headline_tooltip.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::HelpdeskButton": {
      "type": "ViewComponent",
      "description": "A UI component that renders a button to open the helpdesk panel. It dynamically selects an icon and a chatbot version based on user features, integrating with `Xikolo::Common::Auth::CurrentUser`.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` for the button icon [Source: app/components/global/helpdesk_button.html.slim, app/components/global/fa_icon.rb]",
        "interaction_1": "Renders `State::Loading` while the helpdesk panel content loads [Source: app/components/global/helpdesk_button.html.slim]",
        "interaction_2": "Uses `I18n.t` for button labels and `aria-label` ",
        "interaction_3": "Checks `user.feature?` to determine chatbot version [Source: app/components/global/helpdesk_button.rb]",
        "interaction_4": "Interacts with `Xikolo::Common::Auth::CurrentUser` [Source: app/components/global/helpdesk_button.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/helpdesk_button.rb",
          "app/components/global/helpdesk_button.html.slim",
          "app/components/global/helpdesk_button_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::ItemStatus": {
      "type": "ViewComponent",
      "description": "A UI component that displays an item's status with an icon, title, text, and optional tooltip. It supports various color schemes and connection types for visual grouping.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` for the status icon [Source: app/components/global/item_status.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/item_status.rb",
          "app/components/global/item_status.html.slim",
          "app/components/global/item_status_preview.rb",
          "app/components/global/item_status_preview/connected.html.slim",
          "app/components/global/item_status_preview/connected_with_color_scheme_variations.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::LabeledCopyButton": {
      "type": "ViewComponent",
      "description": "A UI component that displays a label and a value, alongside a button to copy the value to the clipboard.",
      "interactions": {
        "interaction_0": "Interacts with JavaScript (clipboard logic) for copy functionality ",
        "interaction_1": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/labeled_copy_button.html.slim]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/labeled_copy_button.rb",
          "app/components/global/labeled_copy_button.html.slim",
          "app/components/global/labeled_copy_button_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::LinkItem": {
      "type": "ViewComponent",
      "description": "A UI component that renders a list item containing a link. It supports active states, custom titles, target attributes (e.g., `_blank`), and optional icons.",
      "interactions": {
        "interaction_0": "Renders `Global::FaIcon` if an icon class is provided [Source: app/components/global/link_item.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/link_item.rb",
          "app/components/global/link_item.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Meter": {
      "type": "ViewComponent",
      "description": "A UI component that renders an HTML `<meter>` element to display a scalar measurement within a known range. It supports optional labels and different visual styles.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/meter.rb",
          "app/components/global/meter.html.slim",
          "app/components/global/meter_preview.rb",
          "app/components/global/meter_preview/custom_width.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::PageHeader": {
      "type": "ViewComponent",
      "description": "A UI component that renders a standardized page header with a title, optional subtitle, and an optional `Pill` component. It supports a 'slim' variant for a more compact appearance.",
      "interactions": {
        "interaction_0": "Renders `Global::Pill` if a pill is provided [Source: app/components/global/page_header.rb, app/components/global/pill.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/page_header.rb",
          "app/components/global/page_header.html.slim",
          "app/components/global/page_header_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Pill": {
      "type": "ViewComponent",
      "description": "A UI component that renders a small, styled text pill. It supports different sizes and color schemes for visual emphasis.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/pill.rb",
          "app/components/global/pill_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Slider": {
      "type": "ViewComponent",
      "description": "A UI component that renders a horizontal content slider with scroll buttons. It uses a Stimulus.js controller for interactive scrolling and supports different visual variants.",
      "interactions": {
        "interaction_0": "Interacts with Stimulus.js controller (implied) for interactive scrolling ",
        "interaction_1": "Uses `data-controller='slider'` and `data-slider-target` for JavaScript interaction [Source: app/components/global/slider.html.slim]",
        "interaction_2": "Uses `I18n.t` for scroll button `aria-label` ",
        "interaction_3": "Renders `Global::FaIcon` for scroll buttons [Source: app/components/global/slider.html.slim, app/components/global/fa_icon.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/slider.rb",
          "app/components/global/slider.html.slim",
          "app/components/global/slider_preview.rb",
          "app/components/global/slider_preview/with_courses.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::SvgIcon": {
      "type": "ViewComponent",
      "description": "A UI component used to display an SVG file inline within the HTML. It wraps the SVG content in a `<span>` tag with a specified class.",
      "interactions": {
        "interaction_0": "Reads SVG content from Filesystem ",
        "interaction_1": "Reads SVG content from a file path [Source: app/components/global/svg_icon.rb]"
      },
      "techDebt": [
        "Direct use of `raw svg` for rendering SVG content, which requires careful handling of the SVG source to prevent XSS vulnerabilities [Source: app/components/global/svg_icon.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/svg_icon.rb",
          "app/components/global/svg_icon.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::Table": {
      "type": "ViewComponent",
      "description": "A UI component for rendering a data table. It accepts data as an array of hashes, optional headers, and a title. It displays a 'no data' message if the data is empty.",
      "interactions": {
        "interaction_0": "Renders `State::Empty` if no data is provided [Source: app/components/global/table.html.slim]",
        "interaction_1": "Uses `I18n.t` for the 'no data' message "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/table.rb",
          "app/components/global/table.html.slim",
          "app/components/global/table_preview.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Global::UserAvatar": {
      "type": "ViewComponent",
      "description": "A UI component that renders a user's avatar image. It fetches the avatar path using a helper and supports various predefined sizes and types (e.g., rounded).",
      "interactions": {
        "interaction_0": "Interacts with User (Model/Entity) to get avatar information ",
        "interaction_1": "Uses `avatar_path` helper to construct the image URL [Source: app/components/global/user_avatar.rb]"
      },
      "techDebt": [
        "Relies on `SIZE_MAPPING` and corresponding SCSS classes, requiring manual synchronization between Ruby and SCSS for size changes [Source: app/components/global/user_avatar.rb]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/user_avatar.rb",
          "app/components/global/user_avatar.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Sentry": {
      "type": "Error Tracking & Performance Monitoring",
      "description": "A service for capturing and reporting application errors and performance traces. It is configured to filter sensitive data, ignore specific common exceptions, and dynamically sample transactions based on rules and environment variables. It also sets global tags for better categorization.",
      "interactions": {
        "interaction_0": "Receives error and performance data from the Rails application.",
        "interaction_1": "Filters sensitive parameters using `ActiveSupport::ParameterFilter`.",
        "interaction_2": "Excludes specific exceptions to reduce noise.",
        "interaction_3": "Samples performance transactions and profiles based on configured rates and rules.",
        "interaction_4": "Receives Mnemosyne trace IDs from the `AnnotateSentryErrorsForMnemosyne` middleware for correlation.",
        "interaction_5": "Sends processed error and performance data to the Sentry SaaS/on-premise service.",
        "interaction_6": "Receives captured exceptions from `ErrorsController` and other parts of the application. ",
        "interaction_7": "Receives performance transaction data from the application. [Source: config/initializers/sentry.rb]",
        "interaction_8": "Integrates Mnemosyne trace IDs into its context via `AnnotateSentryErrorsForMnemosyne` middleware. [Source: config/initializers/sentry.rb]",
        "interaction_9": "Can be configured to exclude specific exceptions or ignore errors based on rules. ",
        "interaction_10": "Integrated via `sentry-rails`, `sentry-ruby`, `sentry-sidekiq` gems [Source: Gemfile]",
        "interaction_11": "Sets user context with `current_user.id` in `ApplicationController` [Source: app/controllers/application_controller.rb]",
        "interaction_12": "Provides `sentry_meta_tags` helper for trace propagation in views [Source: app/helpers/application_helper.rb]"
      },
      "techDebt": [
        "The default `traces_sample_rate` and `profiles_sample_rate` of `1.0` (100%) can lead to high data volume and associated costs for large-scale applications, despite dynamic sampling rules. This should be reviewed for cost optimization in production environments. [Source: config/initializers/sentry.rb]",
        "Managing `excluded_exceptions` lists can become unwieldy if not regularly reviewed and pruned, potentially hiding new, relevant errors. [Source: config/initializers/sentry.rb]"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "Gemfile",
          "app/controllers/application_controller.rb",
          "app/helpers/application_helper.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Mnemosyne": {
      "type": "Application Performance Monitoring (APM)",
      "description": "An APM tool primarily used for distributed tracing, collecting performance data and sending it to an AMQP sink (RabbitMQ). It helps in understanding the flow and latency across different services.",
      "interactions": {
        "interaction_0": "Collects performance trace data from the application.",
        "interaction_1": "Sends trace data to a RabbitMQ server via AMQP, configured by `XIKOLO_RABBITMQ_URL`.",
        "interaction_2": "Provides trace IDs that are consumed by the `AnnotateSentryErrorsForMnemosyne` middleware to link with Sentry events.",
        "interaction_3": "Receives attached errors from `ErrorsController` via `::Mnemosyne.attach_error`. [Source: app/controllers/errors_controller.rb]",
        "interaction_4": "Provides a trace ID (`current_trace&.uuid`) that can be correlated with Sentry events. [Source: app/controllers/errors_controller.rb, config/initializers/sentry.rb]",
        "interaction_5": "Configured to send data to RabbitMQ (AMQP sink). ",
        "interaction_6": "Captures query parameters for detailed debugging. ",
        "interaction_7": "Configured per application/service (e.g., 'web', 'account', 'course'). "
      },
      "techDebt": [
        "The `server` configuration defaults to `amqp://localhost` if `XIKOLO_RABBITMQ_URL` is not set. While suitable for development, this must be correctly configured in production environments to point to the central RabbitMQ instance. [Source: config/mnemosyne.yml]"
      ],
      "provenance": {
        "sources": [
          "config/mnemosyne.yml",
          "Gemfile",
          "config/initializers/sentry.rb",
          "app/controllers/errors_controller.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Telegraf::Agent (via Xikolo::Common::Metrics)": {
      "type": "Metrics Collection Agent",
      "description": "Provides an interface within the `Xikolo` module for sending custom application metrics (e.g., counters, gauges) to a local Telegraf agent via UDP.",
      "interactions": {
        "interaction_0": "Receives metric data from application code (e.g., `Xikolo.metrics.increment('event_name')`).",
        "interaction_1": "Sends metric data as UDP packets to `localhost:8094`, where a Telegraf agent is expected to be listening."
      },
      "techDebt": [
        "The `Telegraf::Agent` is configured to send metrics to `udp://localhost:8094`. This implies a strong coupling where a Telegraf agent must be running on the same host as the application instance. In containerized or distributed environments, this requires careful orchestration (e.g., sidecar containers or daemonsets) to ensure the agent is always available and correctly configured. [Source: gems/xikolo-common/lib/xikolo/common/metrics.rb]"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-common/lib/xikolo/common/metrics.rb",
          "Gemfile",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "AnnotateSentryErrorsForMnemosyne": {
      "type": "Middleware",
      "description": "A Rails middleware in the main `web` application responsible for injecting the current Mnemosyne trace ID into the Sentry context. This links Sentry error events to their corresponding distributed traces in Mnemosyne.",
      "interactions": {
        "interaction_0": "Intercepts incoming requests in the Rails application.",
        "interaction_1": "Queries `Mnemosyne::Instrumenter.current_trace` to retrieve the active trace.",
        "interaction_2": "Updates the current Sentry scope with the Mnemosyne trace ID, if available.",
        "interaction_3": "Intercepts incoming requests (`call(env)`). [Source: config/initializers/sentry.rb]",
        "interaction_4": "Retrieves the current Mnemosyne trace ID using `Mnemosyne::Instrumenter.current_trace`. [Source: config/initializers/sentry.rb]",
        "interaction_5": "Sets the Mnemosyne trace ID in the current Sentry scope's context. [Source: config/initializers/sentry.rb]",
        "interaction_6": "Is integrated into the Rails application's middleware stack. [Source: config/initializers/sentry.rb]",
        "interaction_7": "Interacts with `Mnemosyne::Instrumenter` to retrieve the current trace ID.",
        "interaction_8": "Sets context on `Sentry.get_current_scope` to include the Mnemosyne trace ID.",
        "interaction_9": "Processes HTTP requests within the Rails application stack."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "SimpleForm": {
      "type": "Framework Configuration",
      "description": "The primary Ruby gem for building forms, extensively customized to provide a consistent look and feel, and to integrate custom input types and behaviors across the application. It defines default CSS classes, error handling, and form wrappers.",
      "interactions": {
        "interaction_0": "Renders Form::DynamicSortableList (ViewComponent) ",
        "interaction_1": "Uses I18n for internationalization of labels, hints, and errors.",
        "interaction_2": "Integrates with custom input classes (e.g., ToggleSwitchInput, MarkdownInput, DatepickerInput, UploadInput).",
        "interaction_3": "Leverages ActionView for helper modules.",
        "interaction_4": "Interacts with ApplicationComponent (implicitly, as custom inputs are rendered within views)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Form::DynamicSortableList": {
      "type": "ViewComponent",
      "description": "A reusable UI component for rendering and managing a list of items that can be sorted, added (via input or auto-completing select), and deleted. It provides a dynamic interface for ordering and modifying collections.",
      "interactions": {
        "interaction_0": "Can interact with Admin::Ajax::ClassifiersController (Controller) for auto-completion ",
        "interaction_1": "Emits JavaScript events (via data-behavior attributes) for client-side sorting, adding, and deleting.",
        "interaction_2": "Can interact with a backend API for auto-completion if select_config is provided.",
        "interaction_3": "Receives list_items, name, input_id, and select_config as initialization parameters.",
        "interaction_4": "Renders Global::FaIcon for UI elements."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/form/dynamic_sortable_list.rb",
          "app/components/form/dynamic_sortable_list.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SimpleFormTranslateWithVariables": {
      "type": "Module",
      "description": "Extends SimpleForm::Inputs::Base to enable interpolation of variables into translated strings for form elements, enhancing the flexibility of i18n messages.",
      "interactions": {
        "interaction_0": "Prepends to SimpleForm::Inputs::Base.",
        "interaction_1": "Uses I18n for translation and interpolation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SubmitButtonPrimary": {
      "type": "Module",
      "description": "Extends SimpleForm::FormBuilder to provide a custom submit_button helper that automatically applies primary button styling.",
      "interactions": {
        "interaction_0": "Includes into SimpleForm::FormBuilder."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SimpleForm::Components::Pattern": {
      "type": "Module",
      "description": "A SimpleForm component that modifies the pattern attribute of input fields, specifically removing \\A and \\z regex anchors for broader browser compatibility.",
      "interactions": {
        "interaction_0": "Integrated into SimpleForm's wrapper configuration."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SimpleFormDynamicDefaultFormClass": {
      "type": "Module",
      "description": "Extends ActionView to dynamically apply form-horizontal CSS class to simple_form_for calls based on the configured SimpleForm wrapper, ensuring consistent layout for horizontal forms.",
      "interactions": {
        "interaction_0": "Included into ActionView.",
        "interaction_1": "Inspects SimpleForm's default wrapper configuration."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "AdvancedOptionsHelpers": {
      "type": "Module",
      "description": "Provides a helper method advanced_settings to create collapsible sections within forms for less frequently used options, improving UI clarity. It includes a toggle button with dynamic text.",
      "interactions": {
        "interaction_0": "Included into ActionView.",
        "interaction_1": "Uses SecureRandom.uuid for unique element IDs.",
        "interaction_2": "Uses I18n for button text.",
        "interaction_3": "Relies on frontend JavaScript (via data-behavior='toggle-visibility') for functionality."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FrontendFormHandler": {
      "type": "JavaScript Module",
      "description": "A client-side JavaScript module (specifically form.ts as documented) responsible for managing dynamic form inputs and content visibility based on user selections (e.g., content_type, exercise_type, open_mode). It dynamically loads and appends form templates.",
      "interactions": {
        "interaction_0": "Reads content_type and other input values from the DOM.",
        "interaction_1": "Modifies DOM elements to show/hide form sections.",
        "interaction_2": "Selects and appends templates from app/views/items/_form_wrapper.html.slim.",
        "interaction_3": "Attaches event listeners to form inputs."
      },
      "techDebt": [
        "The actual form.ts file was not provided, so its internal implementation details and potential tech debt cannot be fully assessed."
      ],
      "provenance": {
        "sources": [
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "RSpec": {
      "type": "Testing Framework",
      "description": "The primary testing framework for Ruby applications, used for unit, integration, request, feature, and view specifications. It provides a DSL for writing expressive tests.",
      "interactions": {
        "interaction_0": "Executes Ruby test files (`_spec.rb`).",
        "interaction_1": "Integrates with `rubocop-capybara` and `rubocop-rspec_rails` for specialized Rails and Capybara testing contexts.",
        "interaction_2": "Utilizes `SimpleCov` for code coverage reporting.",
        "interaction_3": "Executes test suites for various application layers.",
        "interaction_4": "Utilizes factories for test data generation.",
        "interaction_5": "Integrates with custom stubbing utilities for isolating microservice interactions.",
        "interaction_6": "Configured via `.rspec` for test patterns and exclusions, including brand-specific tests.",
        "interaction_7": "Works with SimpleCov for code coverage analysis."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          ".rspec",
          "bin/rspec",
          ".rubocop.yml",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "SimpleCov": {
      "type": "Code Coverage Tool",
      "description": "A code coverage tool that generates reports for the Ruby codebase. It is configured to filter out non-application files and group source files into logical categories for better readability.",
      "interactions": {
        "interaction_0": "Collects coverage data during RSpec test runs.",
        "interaction_1": "Analyzes code execution during test runs to determine coverage.",
        "interaction_2": "Filters specific directories (e.g., `bin/`, `db/`, `config/`, `spec/`, `services/`) from coverage reports.",
        "interaction_3": "Groups application code into categories like 'API', 'Business Logic', 'Controllers', 'UI', etc."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          ".simplecov",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "RuboCop": {
      "type": "Code Quality Tool",
      "description": "A static code analyzer and linter for Ruby, enforcing style guidelines and best practices. It is configured with various plugins for Rails, RSpec, Capybara, FactoryBot, and performance checks.",
      "interactions": {
        "interaction_0": "Analyzes Ruby source files.",
        "interaction_1": "Integrates with `slim-lint` for combined Ruby/Slim checks.",
        "interaction_2": "Can be run incrementally on changed files via `scripts/rubocop-changed`.",
        "interaction_3": "Analyzes Ruby code against a comprehensive set of rules defined in `.rubocop.yml`.",
        "interaction_4": "Integrates with `rubocop-changed` script to check only modified files.",
        "interaction_5": "Uses plugins like `rubocop-rails`, `rubocop-rspec`, `rubocop-capybara` to provide context-specific linting."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          ".rubocop.yml",
          "bin/rubocop",
          "scripts/rubocop-changed",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Slim-Lint": {
      "type": "Code Quality Tool",
      "description": "Linter for Slim template files, ensuring consistent style and preventing common issues like embedded engines. Integrates with RuboCop for Ruby code within Slim.",
      "interactions": {
        "interaction_0": "Analyzes `.slim` template files.",
        "interaction_1": "Leverages RuboCop for embedded Ruby code linting."
      },
      "techDebt": [
        "The `javascript` embedded engine is currently not forbidden, marked as 'TODO: Take care of this!' [Source: .slim-lint.yml].",
        "Instance variables in views are currently disabled, marked as 'TODO: Take care of this!' [Source: .slim-lint.yml]."
      ],
      "provenance": {
        "sources": [
          ".slim-lint.yml",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "bin/setup": {
      "type": "Development Utility Script",
      "description": "An idempotent script to set up and update the local development environment, handling gem installation, database preparation, and cleanup.",
      "interactions": {
        "interaction_0": "Installs Ruby gems via Bundler.",
        "interaction_1": "Prepares the database using `bin/rails db:prepare`.",
        "interaction_2": "Clears logs and temporary files.",
        "interaction_3": "Restarts the Rails application server."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "bin/setup",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "scripts/check-gem-versions": {
      "type": "Development Utility Script",
      "description": "A script to compare gem versions across `Gemfile.lock` files of the main application and microservices, identifying inconsistencies and generating reports.",
      "interactions": {
        "interaction_0": "Parses `Gemfile.lock` files from the main app and `services/*`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "scripts/check-gem-versions",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "scripts/rubocop-changed": {
      "type": "Development Utility Script",
      "description": "A utility script to run RuboCop only on files that have changed in the Git repository, optimizing code quality checks for incremental development.",
      "interactions": {
        "interaction_0": "Interacts with Git to identify changed files.",
        "interaction_1": "Executes RuboCop on the identified files."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "scripts/rubocop-changed",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Database Configuration": {
      "type": "Configuration",
      "description": "Manages PostgreSQL database connection settings for various environments (development, test, integration, production) across the main application and microservices. Utilizes environment variables for sensitive data and dynamic scaling of connection pools.",
      "interactions": {
        "interaction_0": "Used by Rails ActiveRecord to establish and manage database connections.",
        "interaction_1": "Reads environment variables like `DATABASE_URL`, `CONCURRENCY`, `RAILS_MAX_THREADS`.",
        "interaction_2": "Rails Application: Reads configuration to establish database connections.",
        "interaction_3": "Deployment Tooling: Overrides production settings during deployment.",
        "interaction_4": "Environment Variables: Reads `DATABASE_URL`, `CONCURRENCY`, `RAILS_MAX_THREADS` for dynamic settings."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/database.yml",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "PostgreSQL Extensions": {
      "type": "Database Feature",
      "description": "A set of enabled PostgreSQL extensions (`hstore`, `pg_trgm`, `pgcrypto`, `plpgsql`, `unaccent`, `uuid-ossp`) that provide advanced data storage, search, and cryptographic capabilities, crucial for the application's data models and performance.",
      "interactions": {
        "interaction_0": "Enabled directly within the database schema definition.",
        "interaction_1": "Used by various tables for specific column types (e.g., `hstore`) or default value generation (e.g., `pgcrypto` for UUIDs).",
        "interaction_2": "Provide underlying functionality for data types, search, and custom functions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "UUID Generation (uuid_generate_v7ms)": {
      "type": "Database Function / Utility",
      "description": "A custom PostgreSQL function that generates time-ordered UUIDv7 values. This function is set as the default primary key for most tables, improving indexing performance compared to random UUIDs. The `UUID4` gem is integrated to provide base62 encoding for URL parameters.",
      "interactions": {
        "interaction_0": "Interacts with UUID4 (gem) for base62 encoding ",
        "interaction_1": "The `UUID4` gem's `to_param` method is used in Ruby application code for URL-friendly UUID representation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "config/initializers/uuid.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Database Schema Definition": {
      "type": "Schema Management",
      "description": "The comprehensive definition of the PostgreSQL database structure, including tables, columns, data types (including custom enums and `jsonb`/`hstore`), indexes, foreign keys, and database views. It is automatically generated from migrations.",
      "interactions": {
        "interaction_0": "Represents the current state of the database, modified by migrations.",
        "interaction_1": "ActiveRecord models interact directly with this schema.",
        "interaction_2": "Database views like `embed_courses` provide denormalized data access."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Database Migrations": {
      "type": "Schema Evolution / Data Management",
      "description": "Ruby scripts used to incrementally modify the database schema and data over time. The project follows best practices for performance (e.g., bulk operations, batch processing) and reversibility, with a defined workflow for complex data migrations.",
      "interactions": {
        "interaction_0": "Modifies the database schema and data during deployment or development.",
        "interaction_1": "Relies on ActiveRecord's migration framework."
      },
      "techDebt": [
        "Ensuring all migrations adhere to performance best practices (e.g., batching, index management) to prevent long-running deployments."
      ],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Database Seeding": {
      "type": "Data Management",
      "description": "The mechanism for populating the database with initial or test data. It loads seed scripts from `db/seeds/all` and environment-specific directories (`db/seeds/<env>`) in alphabetical order.",
      "interactions": {
        "interaction_0": "Populates database tables with predefined data, typically during development or testing."
      },
      "techDebt": [
        "Maintaining a clear and consistent ordering of seed files, especially across different environments, to avoid data dependencies issues."
      ],
      "provenance": {
        "sources": [
          "db/seeds.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Fx Gem Configuration": {
      "type": "Gem Configuration",
      "description": "Configures the `Fx` gem to ensure that custom database functions (like `uuid_generate_v7ms()`) are dumped at the beginning of the `db/schema.rb` file. This is crucial for functions that are used as default values for table columns.",
      "interactions": {
        "interaction_0": "Influences the order and content of the generated `db/schema.rb` file."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/fx.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Custom Enums": {
      "type": "Database Feature",
      "description": "Defines custom PostgreSQL enum types (`link_target`, `node_type`, `offer_category`, `payment_frequency`, `sort_mode`) to enforce specific, predefined sets of values for database columns, enhancing data integrity and readability.",
      "interactions": {
        "interaction_0": "Used as column types in various tables, ensuring that data conforms to business logic categories."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Database Views (embed_courses)": {
      "type": "Database Object",
      "description": "A PostgreSQL view that denormalizes and aggregates course-related data, including classifiers and teacher names. It simplifies complex queries for displaying course information by pre-calculating derived fields.",
      "interactions": {
        "interaction_0": "Provides a read-only, simplified interface for retrieving course data, abstracting away joins and complex logic."
      },
      "techDebt": [
        "Potential for view definition to become stale if underlying table structures change without updating the view."
      ],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "PortalApiBeta": {
      "type": "API",
      "description": "The primary external API interface for course catalog, user profile, and enrollment management. It acts as an entry point for external systems to interact with the platform's core functionalities.",
      "interactions": {
        "interaction_0": "Part of PortalApi (Rails Module/Namespace) ",
        "interaction_1": "Routes requests to UserManagementAPI for user profile operations.",
        "interaction_2": "Routes requests to EnrollmentManagementAPI for enrollment actions.",
        "interaction_3": "Routes requests to CourseCatalogAPI for course information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "CourseCatalogAPI": {
      "type": "API Endpoint Group",
      "description": "Manages the retrieval of public course information, exposing endpoints for listing all courses and fetching details of a specific course.",
      "interactions": {
        "interaction_0": "Interacts with Course (Model/Entity) to fetch course data ",
        "interaction_1": "Exposes GET /courses/{id} to retrieve a single course.",
        "interaction_2": "Interacts with the underlying Course model/service to fetch course data.",
        "interaction_3": "Exposes GET /courses to retrieve a list of courses."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "UserManagementAPI": {
      "type": "API Endpoint Group",
      "description": "Handles operations related to user profiles, including updating user attributes and deleting user accounts.",
      "interactions": {
        "interaction_0": "Interacts with User (Model/Entity) to modify user data ",
        "interaction_1": "Exposes DELETE /users/{id} for deleting user accounts.",
        "interaction_2": "Interacts with the underlying User model/service to modify user data.",
        "interaction_3": "Exposes PATCH /users/{id} for updating user attributes."
      },
      "techDebt": [
        "The PATCH /users/{id} endpoint returns a 200 OK status even if the user resource was not fully updated due to malformed values or internal errors, requiring the client to explicitly check if changes were applied. This can lead to client-side complexity and potential for unnoticed data inconsistencies."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "EnrollmentManagementAPI": {
      "type": "API Endpoint Group",
      "description": "Manages user enrollments in courses, allowing retrieval of existing enrollments and creation of new ones.",
      "interactions": {
        "interaction_0": "Interacts with Enrollment (Model/Entity) to manage enrollment data ",
        "interaction_1": "Interacts with User (Model/Entity) to manage enrollment data ",
        "interaction_2": "Interacts with Course (Model/Entity) to manage enrollment data ",
        "interaction_3": "Exposes GET /enrollments to retrieve user enrollments.",
        "interaction_4": "Exposes POST /enrollments to create new enrollments.",
        "interaction_5": "Interacts with the underlying Enrollment, User, and Course models/services to manage enrollment data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Course": {
      "type": "Model/Entity",
      "description": "The central model for courses, encompassing attributes like title, status, dates, descriptions, and associations with sections, items, channels, and classifiers. It includes extensive logic for course states, access control, search indexing, and certificate conditions (CoP, RoA). [Source: services/course/app/models/course.rb, services/course/README.md, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Provides data to CourseCatalogAPI for course retrieval.",
        "interaction_1": "Referenced by Enrollment for linking users to courses.",
        "interaction_2": "Has one `Structure::Root` node (for content tree). [Source: services/course/app/models/course.rb]",
        "interaction_3": "Has many `Section`s and `Item`s (through sections). [Source: services/course/app/models/course.rb]",
        "interaction_4": "Belongs to `Channel`. [Source: services/course/app/models/course.rb]",
        "interaction_5": "Has and belongs to many `Classifier`s and `Document`s. [Source: services/course/app/models/course.rb]",
        "interaction_6": "Has many `Enrollment`s. [Source: services/course/app/models/course.rb]",
        "interaction_7": "Has many `ContentTest`s and `Duplicated::Offer`s. [Source: services/course/app/models/course.rb]",
        "interaction_8": "Interacts with `CourseSet`, `CourseSetEntry`, `CourseSetRelation` for course tracks and prerequisites. [Source: services/course/app/models/course.rb, docs/app/features/courses/relations.md]",
        "interaction_9": "Publishes `xikolo.course.course.create`, `xikolo.course.course.update`, `xikolo.course.course.destroy` events via `Msgr`. [Source: services/course/app/models/course.rb]",
        "interaction_10": "Triggers `NextDate::CourseStartSyncWorker`, `UpdateCourseSearchIndexWorker`, `NextDate::SectionStartSyncWorker`, `NextDate::ItemSubmissionDeadlineSyncWorker`, `NextDate::ItemSubmissionPublishingSyncWorker`, and `EnrollmentCompletionWorker` on various lifecycle events. [Source: services/course/app/models/course.rb]",
        "interaction_11": "Uses `ForGroups` and `CourseProviderSync` concerns. [Source: services/course/app/models/course.rb]"
      },
      "techDebt": [
        "The `mark_for_recalculation!` and `needs_recalculation?` methods contain `rubocop:disable Rails/SkipsModelValidations` comments, indicating direct attribute updates without full validation, which can be a source of data inconsistency if not carefully managed. [Source: services/course/app/models/course.rb]",
        "The `legacy?` method is marked as `@deprecated`, indicating that the course content tree (`Structure::Root`) is the preferred approach, and legacy courses represent technical debt. [Source: services/course/app/models/course.rb]"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "services/course/app/models/course.rb",
          "services/course/README.md",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService",
          "05_CORE_APIGateway"
        ]
      }
    },
    "User": {
      "type": "Model/Entity",
      "description": "The core model in the `account` service representing a user. It stores various user attributes, including a `preferences` attribute (likely a `hstore` or `jsonb` column) that holds key-value pairs for user settings.",
      "interactions": {
        "interaction_0": "Data is updated and deleted via UserManagementAPI.",
        "interaction_1": "Referenced by Enrollment to associate enrollments with specific users.",
        "interaction_2": "Decorated by PreferencesDecorator. [Source: services/account/app/decorators/preferences_decorator.rb]",
        "interaction_3": "Part of Account Service. [Source: services/account/app/models/user.rb]",
        "interaction_4": "Stores and retrieves user preferences in its `preferences` attribute.",
        "interaction_5": "Interacted with by `API::PreferencesController` for preference updates."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "services/account/app/models/user.rb",
          "cluster:01_CORE_UserAuthentication",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication",
          "05_CORE_APIGateway"
        ]
      }
    },
    "Enrollment": {
      "type": "Model/Entity",
      "description": "Represents a user's enrollment in a course, managing its state, completion, and associated learning evaluation. Provides scopes for filtering and methods for calculating completion status, effective quantile, and last visit.",
      "interactions": {
        "interaction_0": "Data is retrieved and created via EnrollmentManagementAPI.",
        "interaction_1": "Links a User to a Course.",
        "interaction_2": "Belongs to `Course`. [Source: services/course/app/models/enrollment.rb]",
        "interaction_3": "Has one `FixedLearningEvaluation` and `CourseProgress`. [Source: services/course/app/models/enrollment.rb]",
        "interaction_4": "Publishes `xikolo.course.enrollment.update` events via `Msgr` on update. [Source: services/course/app/models/enrollment.rb]",
        "interaction_5": "Triggers `LearningEvaluation::UpdateCourseProgressWorker` on creation and `NextDate::OnDemandExpiresSyncWorker` if `forced_submission_date` is present. [Source: services/course/app/models/enrollment.rb]",
        "interaction_6": "Interacts with `Xikolo.api(:account)` to create group memberships. [Source: services/course/app/models/enrollment.rb]",
        "interaction_7": "Calls Xikolo.api(:account) to create memberships.",
        "interaction_8": "Belongs to Course.",
        "interaction_9": "Has one FixedLearningEvaluation and CourseProgress.",
        "interaction_10": "Publishes Msgr events on update.",
        "interaction_11": "Triggers LearningEvaluation::UpdateCourseProgressWorker and NextDate::OnDemandExpiresSyncWorker.",
        "interaction_12": "Interacts with Item, Result, Visit for evaluation calculations."
      },
      "techDebt": [
        "The self.with_learning_evaluation method contains highly complex SQL queries for dynamic learning evaluation, which could be difficult to maintain and optimize.",
        "The completed? logic is intricate and depends on multiple attributes and course associations.",
        "The `with_learning_evaluation` scope contains complex SQL for dynamic calculation of visits and points, which is difficult to read and maintain. [Source: services/course/app/models/enrollment.rb]"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "services/course/app/models/enrollment.rb",
          "services/course/README.md",
          "cluster:03_CORE_CourseService",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService",
          "05_CORE_APIGateway"
        ]
      }
    },
    "Course::Enrollment::Proctoring": {
      "type": "Model Concern/Utility",
      "description": "Manages the generation of S3 object paths for proctoring-related images associated with a specific course enrollment. It uses UUIDs to construct unique paths for storing images in the `:certificate` S3 bucket.",
      "interactions": {
        "interaction_0": "Interacts with Course::Enrollment (Model/Entity) for enrollment context ",
        "interaction_1": "Interacts with `Xikolo::S3` to access the `:certificate` bucket [Source: app/models/course/enrollment/proctoring.rb].",
        "interaction_2": "Interacts with an implied `::Proctoring::SmowlAdapter` to get vendor-specific context [Source: app/models/course/enrollment/proctoring.rb].",
        "interaction_3": "Interacts with `UUID4` for generating unique identifiers [Source: app/models/course/enrollment/proctoring.rb]."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/course/enrollment/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "Voucher::ProductTypes::Proctoring": {
      "type": "Service Object/Product Type",
      "description": "Encapsulates the business logic for enabling, validating, and claiming proctored status for users, typically through a voucher system. It checks platform and course-level proctoring settings and user eligibility.",
      "interactions": {
        "interaction_0": "Interacts with Course::Enrollment (Model/Entity) for user enrollment and proctoring status ",
        "interaction_1": "Interacts with I18n (Rails Internationalization) for localized messages ",
        "interaction_2": "Validates user enrollment and proctoring status against `Course::Enrollment` records [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_3": "Uses an implied `::Proctoring::CourseContext` to check if a proctoring upgrade is possible for an enrollment [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_4": "Interacts with `Xikolo.api(:course)` to update enrollment status (set `proctored: true`) in the course microservice [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_5": "Retrieves localized text for messages via `I18n` [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_6": "Checks global proctoring enablement via `::Proctoring.enabled?` [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_7": "Checks course-specific proctoring enablement via `course.proctored?` [Source: app/models/voucher/product_types/proctoring.rb]."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/voucher/product_types/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "_proctoring_chart.html.slim": {
      "type": "View Component (Frontend)",
      "description": "A Slim template responsible for rendering a client-side bar chart to visualize proctoring data using `dimple.js` (a D3.js wrapper). It dynamically generates JavaScript to display the chart.",
      "interactions": {
        "interaction_0": "Interacts with QuizSubmissionProctoringPresenter (Presenter) to display proctoring results ",
        "interaction_1": "Interacts with I18n (Rails Internationalization) for localized tooltip text ",
        "interaction_2": "Uses jQuery for DOM manipulation and window resize event handling [Source: app/views/shared/_proctoring_chart.html.slim].",
        "interaction_3": "Retrieves localized tooltip text via `I18n` [Source: app/views/shared/_proctoring_chart.html.slim].",
        "interaction_4": "Receives `proctoring_data` as an input variable [Source: app/views/shared/_proctoring_chart.html.slim].",
        "interaction_5": "Uses `dimple.js` (which relies on D3.js) for chart rendering [Source: app/views/shared/_proctoring_chart.html.slim]."
      },
      "techDebt": [
        "Part of a deprecated feature .",
        "Uses embedded JavaScript with `raw` output, which can be a security risk (XSS) if `proctoring_data` is not properly sanitized [Source: app/views/shared/_proctoring_chart.html.slim].",
        "Relies on older frontend libraries (jQuery, dimple.js/D3.js) which might be inconsistent with the project's stated use of React and TypeScript [Source: app/views/shared/_proctoring_chart.html.slim]."
      ],
      "provenance": {
        "sources": [
          "app/views/shared/_proctoring_chart.html.slim",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "::Proctoring::SmowlAdapter": {
      "type": "External Service Adapter (Implied)",
      "description": "An adapter class (referenced but not provided in code) responsible for integrating with the external SMOWL proctoring solution. It likely handles API calls to SMOWL and parses their responses.",
      "interactions": {
        "interaction_0": "Instantiated by `Course::Enrollment::Proctoring` and `Quiz::Submission::Proctoring` [Source: app/models/course/enrollment/proctoring.rb, app/models/quiz/submission/proctoring.rb].",
        "interaction_1": "Receives `course` context during initialization [Source: app/models/course/enrollment/proctoring.rb, app/models/quiz/submission/proctoring.rb].",
        "interaction_2": "Processes `vendor_data` from quiz submissions to extract proctoring results [Source: app/models/quiz/submission/proctoring.rb].",
        "interaction_3": "Relies on SMOWL API credentials configured in `secrets.yml` ."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/course/enrollment/proctoring.rb",
          "app/models/quiz/submission/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "::Proctoring::CourseContext": {
      "type": "Service Object (Implied)",
      "description": "A service object (referenced but not provided in code) likely responsible for determining if a proctoring 'upgrade' (e.g., from non-proctored to proctored status) is possible for a given course and enrollment.",
      "interactions": {
        "interaction_0": "Instantiated by `Voucher::ProductTypes::Proctoring` with `course` and `enrollment` objects [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_1": "Provides `upgrade_possible?` method to check eligibility [Source: app/models/voucher/product_types/proctoring.rb]."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/voucher/product_types/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "::Proctoring (Module)": {
      "type": "Configuration Module (Implied)",
      "description": "A module (referenced but not provided in code) that likely holds global configuration and utility methods for the proctoring feature, such as checking if the feature is enabled and providing the store URL.",
      "interactions": {
        "interaction_0": "Provides `enabled?` method to check if proctoring is globally active [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_1": "Provides `store_url` method to retrieve the external shop URL [Source: app/models/voucher/product_types/proctoring.rb].",
        "interaction_2": "Relies on `xikolo.yml` for configuration ."
      },
      "techDebt": [
        "Part of a deprecated feature ."
      ],
      "provenance": {
        "sources": [
          "app/models/voucher/product_types/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    "Delayed::Worker": {
      "type": "Background Job Processor",
      "description": "The worker process responsible for executing ActiveJob tasks configured to use the `delayed` backend. It manages job attempts, run times, and queue assignments.",
      "interactions": {
        "interaction_0": "Processes jobs from ActiveJob.",
        "interaction_1": "Reports job metrics (run, error, failure) to `Xikolo.metrics`.",
        "interaction_2": "Processes ApplicationJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_3": "Processes LongRunningApplicationJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_4": "Processes Lti::PublishGradeJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_5": "Processes Proctoring::StoreSubmissionResultsJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_6": "Processes Proctoring::UploadCertificateImageJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_7": "Processes RefreshSitemapJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_8": "Processes S3FileDeletionJob instances. [Source: config/initializers/delayed.rb]",
        "interaction_9": "Is the worker for Delayed (Delayed Job). [Source: config/initializers/delayed.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/delayed.rb",
          "Gemfile",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Gamification": {
      "type": "Service/Consumer",
      "description": "A component responsible for processing events related to user activity (e.g., votes, questions, course results) and awarding experience points (XP) or other gamification elements.",
      "interactions": {
        "interaction_0": "Interacts with GamificationConsumer (Consumer) to process events ",
        "interaction_1": "Receives and processes messages routed by `Msgr` from `xikolo.pinboard` and `xikolo.course` events."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/msgr.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Xikolo::V2::URL": {
      "type": "Singleton Utility",
      "description": "A singleton class providing application-wide URL and asset path generation. It wraps Rails URL helpers and Sprockets helpers, ensuring consistent URL construction and handling default URL options based on `Xikolo.base_url`.",
      "interactions": {
        "interaction_0": "Interacts with Rails.application.routes (Routing Configuration) for URL generation ",
        "interaction_1": "Includes `Sprockets::Rails::Helper` for asset path generation. [Source: api/xikolo/v2/url.rb]",
        "interaction_2": "Delegates methods via `method_missing` to its singleton instance, making its helpers globally accessible. [Source: api/xikolo/v2/url.rb]",
        "interaction_3": "Retrieves host, port, and protocol from `Xikolo.base_url` for `default_url_options`. [Source: api/xikolo/v2/url.rb]",
        "interaction_4": "Used by `M3u8Playlist` to construct internal URLs for transformed HLS playlists and subtitle tracks."
      },
      "techDebt": [
        "The use of `method_missing` and `respond_to_missing?` for delegation, while functional, can sometimes obscure the origin of methods and make debugging more challenging compared to explicit method calls or module inclusions. [Source: api/xikolo/v2/url.rb]"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/v2/url.rb",
          "app/lib/m3u8_playlist.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "WellKnownFile::AppleAppSiteAssociation": {
      "type": "Model/Configuration Generator",
      "description": "Generates the JSON content for the `apple-app-site-association` file, which is crucial for iOS Universal Links. It includes application ID, bundle ID, and paths for deep linking.",
      "interactions": {
        "interaction_0": "Includes `Rails.application.routes.url_helpers` to generate specific paths for app links (e.g., `/`, `auth_path`, `dashboard_path`, `courses_path`, `channels_path`). [Source: app/models/well_known_file/apple_app_site_association.rb]",
        "interaction_1": "Retrieves configuration (`app_id_prefix`, `bundle_id`) from `Xikolo.config.app_links_verification['ios']`. [Source: app/models/well_known_file/apple_app_site_association.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/well_known_file/apple_app_site_association.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "WellKnownFile::GoogleAssetLinks": {
      "type": "Model/Configuration Generator",
      "description": "Generates the JSON content for the `assetlinks.json` file, which is essential for Android Digital Asset Links. It specifies package name and SHA256 certificate fingerprints for app link verification.",
      "interactions": {
        "interaction_0": "Retrieves configuration (`package_name`, `sha256_cert_fingerprints`) from `Xikolo.config.app_links_verification['android']`. [Source: app/models/well_known_file/google_asset_links.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/well_known_file/google_asset_links.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Account::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the Account microservice, managing user authentication, profiles, permissions, and feature flags. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Xikolo Account Service (Microservice) ",
        "interaction_1": "Provides specific endpoints for email management, including suspension. [Source: services/account/config/routes.rb]",
        "interaction_2": "Offers system information endpoints. [Source: services/account/config/routes.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/account/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Course::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the Course microservice, handling course content, user progress, enrollments, and related statistics. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Xikolo Course Service (Microservice) ",
        "interaction_1": "Provides specific endpoints for item visits, grades, and learning evaluation recalculations. [Source: services/course/config/routes.rb]",
        "interaction_2": "Includes a `/api/v2/course` namespace for versioned course API. [Source: services/course/config/routes.rb]",
        "interaction_3": "Offers system information endpoints. [Source: services/course/config/routes.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::News::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the News microservice, managing announcements, messages, and user visits to news items. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Xikolo::NewsService (Microservice) ",
        "interaction_1": "Includes deprecated `news` routes for backward compatibility. [Source: services/news/config/routes.rb]",
        "interaction_2": "Offers system information endpoints. [Source: services/news/config/routes.rb]"
      },
      "techDebt": [
        "The presence of `@deprecated` `news` routes indicates technical debt, which should be removed once usages have been cleaned up. [Source: services/news/config/routes.rb]"
      ],
      "provenance": {
        "sources": [
          "services/news/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Notification::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the Notification microservice, primarily for managing events and mail log statistics. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of NotificationService (Microservice) ",
        "interaction_1": "Provides a singleton resource for `mail_log_stats`. [Source: services/notification/config/routes.rb]",
        "interaction_2": "Offers system information endpoints. [Source: services/notification/config/routes.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Pinboard::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the Pinboard microservice, handling comments, answers, questions, votes, topics, tags, subscriptions, and abuse reports. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Xikolo Pinboard Service (Microservice) ",
        "interaction_1": "Provides specific endpoints for user votes on posts and user statistics. [Source: services/pinboard/config/routes.rb]",
        "interaction_2": "Offers system information endpoints. [Source: services/pinboard/config/routes.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/pinboard/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Quiz::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the Quiz microservice, managing quizzes, questions (various types), answers, and quiz submissions. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Quiz Service (Microservice) ",
        "interaction_1": "Provides endpoints for cloning quizzes and managing user quiz attempts. [Source: services/quiz/config/routes.rb]",
        "interaction_2": "Includes deprecated `quiz_submission_statistics` routes. [Source: services/quiz/config/routes.rb]",
        "interaction_3": "Offers system information endpoints. [Source: services/quiz/config/routes.rb]"
      },
      "techDebt": [
        "The presence of `@deprecated` `quiz_submission_statistics` routes indicates technical debt, which should be removed. [Source: services/quiz/config/routes.rb]"
      ],
      "provenance": {
        "sources": [
          "services/quiz/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::TimeEffort::Application.routes": {
      "type": "Microservice Routing",
      "description": "Defines the API-only routes for the TimeEffort microservice, managing item-specific time effort data. All routes default to JSON format.",
      "interactions": {
        "interaction_0": "Part of Xikolo::TimeEffort Microservice (Client Proxy) ",
        "interaction_1": "Provides specific endpoints to overwrite and clear item time effort. [Source: services/timeeffort/config/routes.rb]",
        "interaction_2": "Offers system information endpoints. [Source: services/timeeffort/config/routes.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/timeeffort/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    "Admin::DocumentLocalizationsController": {
      "type": "Controller",
      "description": "Manages administrative CRUD operations for localized versions of documents. It interacts with the Xikolo Course microservice API to fetch and update document localization data. It relies on `DocumentHelper` for file upload preparation and enforces authorization via `authorize!`. This controller is gated by a beta feature flag.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo.api(:course)` to manage `DocumentLocalization` records. [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_1": "Uses `DocumentHelper` for file upload related functionalities. [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_2": "Enforces authorization using `authorize! 'course.document.manage'`. [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_3": "Responds to JSON requests. [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_4": "Communicates with the `course` microservice via `Xikolo.api(:course)` for document localization data.",
        "interaction_5": "Requires `Xikolo.config.beta_features['documents']` to be enabled."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/document_localizations_controller.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Admin::DocumentsController": {
      "type": "Controller",
      "description": "Manages administrative CRUD operations for documents. It orchestrates data retrieval from the Xikolo Course microservice and uses `DocumentsListPresenter` for display. It relies on `DocumentHelper` for file upload preparation and enforces authorization. This controller is also gated by a beta feature flag.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo.api(:course)` to manage `Document` records, fetch courses, and document tags. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_1": "Uses `DocumentsListPresenter` to build the document list for display. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_2": "Uses `DocumentHelper` for file upload related functionalities. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_3": "Enforces authorization using `authorize! 'course.document.manage'`. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_4": "Responds to JSON requests. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_5": "Communicates with the `course` microservice via `Xikolo.api(:course)` for document, course, and tag data.",
        "interaction_6": "Requires `Xikolo.config.beta_features['documents']` to be enabled."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/documents_controller.rb",
          "app/presenters/documents_list_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Document": {
      "type": "Model (Course Microservice)",
      "description": "Represents a core document within the Xikolo Course microservice. It manages associations with courses, items, and localizations, handles soft deletion, and publishes lifecycle events to the message bus.",
      "interactions": {
        "interaction_0": "Used by DocumentsListPresenter (Presenter) for document data ",
        "interaction_1": "Used by DocumentsListPresenter::DocumentPresenter (Presenter) for document details ",
        "interaction_2": "Used by Course::DocumentsController (Controller) to fetch documents ",
        "interaction_3": "Updates associated courses based on items. [Source: services/course/app/models/document.rb]",
        "interaction_4": "Interacts with `Course` (has_and_belongs_to_many).",
        "interaction_5": "Interacts with `Item` via `DocumentsItem` (has_many through).",
        "interaction_6": "Manages `DocumentLocalization` records (has_many).",
        "interaction_7": "Publishes events to RabbitMQ via `Msgr` on create, update, and destroy.",
        "interaction_8": "Uses `ApplicationRecord` for common scopes like `not_deleted`.",
        "interaction_9": "Accessed and manipulated by `DocumentsController`."
      },
      "techDebt": [
        "The `update_courses` callback dynamically associates documents with courses of their items, which might be complex to manage and debug if not explicitly documented or controlled."
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/document.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "DocumentLocalization": {
      "type": "Model (Course Microservice)",
      "description": "Represents a localized version of a document, associated with a `Document`. It manages file references using the `FileReference` concern and `xikolo-s3` gem, handles soft deletion, and publishes lifecycle events.",
      "interactions": {
        "interaction_0": "Used by Course::DocumentsController (Controller) to fetch localized documents ",
        "interaction_1": "Uses `FileReference` concern for S3 file management, defining S3 key, ACL, content type, etc. [Source: services/course/app/models/document_localization.rb]",
        "interaction_2": "Publishes `xikolo.course.document_localization.create`, `update`, and `destroy` events via `Msgr`. [Source: services/course/app/models/document_localization.rb]",
        "interaction_3": "Uses `has_paper_trail` for versioning. [Source: services/course/app/models/document_localization.rb]",
        "interaction_4": "Belongs to `Document`.",
        "interaction_5": "Includes `FileReference` concern for S3 file management.",
        "interaction_6": "Uses `Xikolo::S3` for storing and retrieving files.",
        "interaction_7": "Uses `PaperTrail` for versioning.",
        "interaction_8": "Publishes events to RabbitMQ via `Msgr` on create, update, and destroy.",
        "interaction_9": "Accessed and manipulated by `DocumentLocalizationsController`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/document_localization.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::DocumentsPresenter": {
      "type": "Presenter",
      "description": "A presenter focused on documents related to a specific course and user, particularly for certificate-related documents like Confirmation of Participation (COP), Record of Achievement (ROA), and Transcript of Records (TOR). It determines document availability and download eligibility.",
      "interactions": {
        "interaction_0": "Initializes with `user_id`, `course`, and `current_user`. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_1": "Delegates to `DocumentsPresenter` (the other one) to retrieve actual document data based on enrollment. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_2": "Presents information about certificate availability and requirements. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_3": "Finds `Xikolo::Course::Enrollment` to check learning evaluation status. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_4": "Delegates to `::DocumentsPresenter.create` for core document/certificate logic. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_5": "Checks `Xikolo.config.certificate['transcript_of_records']` for TOR availability. [Source: app/presenters/course/documents_presenter.rb]",
        "interaction_6": "Uses `BasicCoursePresenter` to wrap course data. [Source: app/presenters/course/documents_presenter.rb]"
      },
      "techDebt": [
        "The name `Course::DocumentsPresenter` and `DocumentsPresenter` are very similar and could lead to confusion. Clarification of their distinct roles might be beneficial."
      ],
      "provenance": {
        "sources": [
          "app/presenters/course/documents_presenter.rb",
          "app/presenters/documents_presenter.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Xikolo::S3::Markup": {
      "type": "ActiveModel::Type::Value",
      "description": "A custom attribute type used by the `Page` model for its `text` attribute. It encapsulates the logic for handling text content that may contain embedded references to S3-managed files, ensuring proper serialization and deserialization.",
      "interactions": {
        "interaction_0": "Casts values to `Field` objects. [Source: gems/xikolo-s3/lib/xikolo/s3/markup.rb]",
        "interaction_1": "Uses `Xikolo::S3.extract_file_refs` and `Xikolo::S3.media_refs` to process markup. [Source: gems/xikolo-s3/lib/xikolo/s3/markup.rb]",
        "interaction_2": "Uses `Xikolo::S3.externalize_file_refs` to convert internal S3 URIs to external URLs. [Source: gems/xikolo-s3/lib/xikolo/s3/markup.rb]",
        "interaction_3": "Used by the `Page` model to define the behavior of its `text` attribute.",
        "interaction_4": "Interacts implicitly with `Xikolo::S3::TextWithUploadsProcessor` during content updates.",
        "interaction_5": "Used by Page model. [Source: app/models/page.rb]",
        "interaction_6": "Used by Course::Richtext model. [Source: app/models/course/richtext.rb]",
        "interaction_7": "Works with Xikolo::S3::TextWithUploadsProcessor. [Source: app/models/page.rb]"
      },
      "techDebt": [
        "As a custom implementation, it carries a maintenance burden; comprehensive tests and clear documentation are crucial."
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-s3/lib/xikolo/s3/markup.rb",
          "app/models/page.rb",
          "app/models/course/richtext.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Xikolo::S3::SingleFileUpload": {
      "type": "Utility (S3)",
      "description": "A helper class for processing and validating single file uploads to a temporary S3 bucket. It checks for 'accepted' state and 'purpose' metadata before returning the uploaded file object. This is an older approach to file uploads.",
      "interactions": {
        "interaction_0": "Interacts with `Xikolo::S3.bucket_for(:uploads)` to access the temporary upload bucket. [Source: gems/xikolo-s3/lib/xikolo/s3/single_file_upload.rb]",
        "interaction_1": "Checks S3 object metadata (`xikolo-state`, `xikolo-purpose`) for validity. [Source: gems/xikolo-s3/lib/xikolo/s3/single_file_upload.rb]",
        "interaction_2": "Used by `Video::Store` for processing reading material, slides, transcripts, and subtitles uploads. [Source: app/operations/video/store.rb]"
      },
      "techDebt": [
        "The `README.md` for `xikolo-s3` explicitly states this approach has drawbacks and recommends `UploadByUri` for new implementations. This indicates potential technical debt or a legacy component. "
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-s3/lib/xikolo/s3/single_file_upload.rb",
          "app/operations/video/store.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Xikolo::S3::UploadByUri": {
      "type": "Utility (S3)",
      "description": "A helper class for handling file uploads referenced by a URI (e.g., `upload://UUID/filename`). It validates the upload's state and purpose, and facilitates copying the file from a temporary upload bucket to its final S3 destination.",
      "interactions": {
        "interaction_0": "Parses `upload://` URIs to locate files in the temporary upload bucket. [Source: gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb]",
        "interaction_1": "Interacts with `Xikolo::S3.bucket_for(:uploads)` and other specified buckets. [Source: gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb]",
        "interaction_2": "Checks S3 object metadata (`xikolo-state`, `xikolo-purpose`) for validity. [Source: gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb]",
        "interaction_3": "Copies files between S3 locations. [Source: gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb]",
        "interaction_4": "Handles S3 service errors. [Source: gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb]",
        "interaction_5": "Used by `Video::Store` for processing attachments uploaded via URI. [Source: app/operations/video/store.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb",
          "app/operations/video/store.rb",
          "cluster:12_LEARN_VideoStreaming",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming",
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::CoursesController": {
      "type": "Controller",
      "description": "Handles the display of the main course overview page, including fetching course details, teacher information, sections, and featured items. Manages user authorization and redirects for course access.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo::Course::Course to fetch course details [Source: app/controllers/course/courses_controller.rb]",
        "interaction_1": "Uses Course::TeacherListPresenter to format teacher data [Source: app/controllers/course/courses_controller.rb]",
        "interaction_2": "Uses FeaturedItemPresenter to format featured items [Source: app/controllers/course/courses_controller.rb]",
        "interaction_3": "Uses CourseLargePreviewPresenter and Course::CourseDetailsPresenter for course overview data [Source: app/controllers/course/courses_controller.rb]",
        "interaction_4": "Redirects to dashboard_path or course_path based on authorization and course availability [Source: app/controllers/course/courses_controller.rb]",
        "interaction_5": "Interacts with Xikolo::Course::Item to find the current item for resuming a course [Source: app/controllers/course/courses_controller.rb]",
        "interaction_6": "Leverages CourseContextHelper for course context and eligibility checks [Source: app/controllers/course/courses_controller.rb]"
      },
      "techDebt": [
        "The `check_course_eligibility` method has a TODO for improving checks [Source: app/helpers/course_context_helper.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/courses_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Navigation::TableOfContents": {
      "type": "Service/ViewComponent",
      "description": "A component responsible for building the hierarchical navigation structure (table of contents) for a course, including sections and items, considering user context and current position.",
      "interactions": {
        "interaction_0": "Receives course, sections, current_section, and current_item as input [Source: app/helpers/course_context_helper.rb]",
        "interaction_1": "Used by `CourseContextHelper#load_section_nav` [Source: app/helpers/course_context_helper.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Xikolo::Course::SectionChoice": {
      "type": "ACFS Resource",
      "description": "Records a user's choice for an alternative section.",
      "interactions": {
        "interaction_0": "Created by `SectionsController#choose_alternative_section` [Source: app/controllers/sections_controller.rb]",
        "interaction_1": "Fetched by `SectionPresenter#fetch_section_choices` [Source: app/presenters/section_presenter.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/sections_controller.rb",
          "app/presenters/section_presenter.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    "Account::AccountsController": {
      "type": "Controller",
      "description": "Handles user registration, displaying the registration form, processing new account submissions, and managing initial consent collection. It also includes GeoIP blocking functionality.",
      "interactions": {
        "interaction_0": "Interacts with `Account::AccountForm` for form validation and data encapsulation. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_1": "Delegates registration logic to `Account::Register` operation. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_2": "Fetches `treatments` (consents) from `Xikolo.api(:account)` to display on the registration form. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_3": "Generates confirmation URLs using `Account::ConfirmationsController.verifier`. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_4": "Redirects to `verify_account_url` or `dashboard_path` on successful registration/login. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_5": "Renders `new` template on registration failure. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_6": "Uses `GeoIP::Lookup` to block users from specific countries. [Source: app/controllers/account/accounts_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/accounts_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::ConfirmationsController": {
      "type": "Controller",
      "description": "Manages the email confirmation process for user accounts, including displaying confirmation status, verifying tokens, and resending confirmation emails.",
      "interactions": {
        "interaction_0": "Verifies signed payloads using `Rails.application.message_verifier('account.confirmations')`. [Source: app/controllers/account/confirmations_controller.rb]",
        "interaction_1": "Fetches email details from `Xikolo.api(:account).rel(:email)`. [Source: app/controllers/account/confirmations_controller.rb]",
        "interaction_2": "Publishes `xikolo.account.email.confirm` messages via `Msgr` to trigger email confirmation notifications. [Source: app/controllers/account/confirmations_controller.rb]",
        "interaction_3": "Updates email status (`confirmed`, `primary`) via `Xikolo.api(:account)`. [Source: app/controllers/account/confirmations_controller.rb]",
        "interaction_4": "Handles `Restify::NotFound` and `ActiveSupport::MessageVerifier::InvalidSignature` exceptions. [Source: app/controllers/account/confirmations_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/confirmations_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::ConnectController": {
      "type": "Controller",
      "description": "Handles the process of connecting an external authorization (e.g., SSO) to an existing user account.",
      "interactions": {
        "interaction_0": "Finds `Account::Authorization` records based on parameters. [Source: app/controllers/account/connect_controller.rb]",
        "interaction_1": "Requires the current user to be anonymous to proceed. [Source: app/controllers/account/connect_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/connect_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::ConsentsController": {
      "type": "Controller",
      "description": "Manages updates to user consent settings via AJAX requests.",
      "interactions": {
        "interaction_0": "Requires user to be logged in (`ensure_logged_in`). [Source: app/controllers/account/consents_controller.rb]",
        "interaction_1": "Fetches `treatments` from `Xikolo.api(:account)` to determine valid consent names. [Source: app/controllers/account/consents_controller.rb]",
        "interaction_2": "Retrieves current user details from `Xikolo.api(:account)`. [Source: app/controllers/account/consents_controller.rb]",
        "interaction_3": "Patches user consents via `user.rel(:consents).patch` on the `Account` microservice. [Source: app/controllers/account/consents_controller.rb]",
        "interaction_4": "Renders updated `ConsentPresenter` objects as JSON. [Source: app/controllers/account/consents_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/consents_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PasswordResetsController": {
      "type": "Controller",
      "description": "Handles the entire password reset workflow, from requesting a reset to setting a new password.",
      "interactions": {
        "interaction_0": "Uses `Account::PasswordRequestForm` for password reset requests. [Source: app/controllers/account/password_resets_controller.rb]",
        "interaction_1": "Uses `Account::PasswordResetForm` for setting new passwords. [Source: app/controllers/account/password_resets_controller.rb]",
        "interaction_2": "Interacts with `Xikolo.api(:account).rel(:password_resets)` to create password reset tokens. [Source: app/controllers/account/password_resets_controller.rb]",
        "interaction_3": "Publishes `xikolo.account.password_reset.notify` messages via `Msgr` to send reset emails. [Source: app/controllers/account/password_resets_controller.rb]",
        "interaction_4": "Retrieves and updates password reset resources via `Xikolo.api(:account).rel(:password_reset)`. [Source: app/controllers/account/password_resets_controller.rb]",
        "interaction_5": "Handles `Restify::NotFound` and `Restify::UnprocessableEntity` errors. [Source: app/controllers/account/password_resets_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/password_resets_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PoliciesController": {
      "type": "Controller",
      "description": "Manages the display and acceptance of platform policies.",
      "interactions": {
        "interaction_0": "Requires user to be logged in (`ensure_logged_in`). [Source: app/controllers/account/policies_controller.rb]",
        "interaction_1": "Fetches policies from `Xikolo.api(:account).rel(:policies)`. [Source: app/controllers/account/policies_controller.rb]",
        "interaction_2": "Uses `Account::PolicyPresenter` to format policy data for display. [Source: app/controllers/account/policies_controller.rb, app/presenters/account/policy_presenter.rb]",
        "interaction_3": "Updates the user's `accepted_policy_version` via `user.rel(:self).patch` on the `Account` microservice. [Source: app/controllers/account/policies_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/account/policies_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PreferencesController": {
      "type": "Controller",
      "description": "Handles HTTP requests for displaying and updating user preferences in the `web` application. It acts as an intermediary, fetching data from and sending updates to the `account` microservice.",
      "interactions": {
        "interaction_0": "Requires user to be logged in (`ensure_logged_in`). [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_1": "Retrieves user preferences using `Preferences.find` (an ACFS resource). [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_2": "Uses `Account::PreferencesPresenter` to prepare preferences for display. [Source: app/controllers/account/preferences_controller.rb, app/presenters/account/preferences_presenter.rb]",
        "interaction_3": "Updates preferences directly on the `Preferences` ACFS resource. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_4": "Fetches pinboard subscriptions from `Xikolo.api(:pinboard)`. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_5": "Receives requests from preferences.ts. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_6": "Uses Xikolo::Account::Preferences. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_7": "Uses Account::PreferencesPresenter. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_8": "Updates preferences via `Xikolo::Account::Preferences`.",
        "interaction_9": "Fetches user preferences via `Xikolo::Account::Preferences` (ACFS client).",
        "interaction_10": "Uses `Account::PreferencesPresenter` to prepare data for views.",
        "interaction_11": "Validates incoming preference names and values."
      },
      "techDebt": [
        "The `update` action directly modifies preferences via `preferences.set` and `preferences.save!`, with a `!TODO` comment indicating this should ideally be handled via a patch update in the `Account` service for better microservice adherence. [Source: app/controllers/account/preferences_controller.rb]",
        "The controller currently fetches the entire preferences object, modifies a single key, and saves it. A `PATCH` update mechanism at the service level is suggested for optimization. [Source: app/controllers/account/preferences_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/preferences_controller.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::ProfilesController": {
      "type": "Controller",
      "description": "Manages user profile details, including personal information, email addresses, linked authorizations, and avatar uploads.",
      "interactions": {
        "interaction_0": "Requires user to be logged in (`ensure_logged_in`). [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_1": "Retrieves user data using `User.find` (an ACFS resource). [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_2": "Uses `Account::ProfilePresenter` to format profile data. [Source: app/controllers/account/profiles_controller.rb, app/presenters/account/profile_presenter.rb]",
        "interaction_3": "Updates user attributes (`full_name`, `display_name`, `born_at`) via `user.update_attributes!`. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_4": "Creates new `Email` records and publishes `xikolo.account.email.confirm` via `Msgr` for email confirmation. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_5": "Manages `Authorization` records (delete) and `Email` records (delete, change primary, unsuspend) via ACFS resources and `Xikolo.api(:account)`. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_6": "Updates custom profile fields via `Profile.find` (an ACFS resource). [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_7": "Handles avatar uploads to `Xikolo::S3`. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_8": "Delegates password change requests to `Account::ChangePassword` operation. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_9": "Captures exceptions with `Mnemosyne` and `Sentry` for error reporting. [Source: app/controllers/account/profiles_controller.rb]"
      },
      "techDebt": [
        "The `update` action has multiple `if/elsif` branches, making it less cohesive and potentially harder to maintain. [Source: app/controllers/account/profiles_controller.rb]",
        "Direct manipulation of `Email` and `Authorization` ACFS resources could be further encapsulated in dedicated service objects or operations for better separation of concerns. [Source: app/controllers/account/profiles_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/profiles_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::SessionsController": {
      "type": "Controller",
      "description": "Manages user login, logout, and authentication callbacks for both native and SSO (OmniAuth) authentication methods.",
      "interactions": {
        "interaction_0": "Uses `AuthenticationHandler` (external) to process login attempts and manage session state. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_1": "Handles `omniauth.auth` callbacks for SSO authentication. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_2": "Assigns session IDs and manages user sessions. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_3": "Interacts with `Xikolo::Account::Authorization` (ACFS resource) to connect SSO accounts. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_4": "Generates API tokens for mobile applications via `Xikolo.api(:account).rel(:tokens)`. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_5": "Uses `Rack::Attack` to count and ban failed login attempts. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_6": "Handles redirection logic, including `redirect_url` and `cookie_url`. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_7": "Restricts native login based on feature flags. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_8": "Formats error messages for various authentication failures. [Source: app/controllers/account/sessions_controller.rb]",
        "interaction_9": "Preserves SAML session information across login flows. [Source: app/controllers/account/sessions_controller.rb]"
      },
      "techDebt": [
        "The `handle_authenticated!` method is quite large and complex, indicated by the `rubocop:enable all` comment, suggesting it could benefit from refactoring into smaller, more focused methods. [Source: app/controllers/account/sessions_controller.rb]",
        "The `handle_unverified_request` override might be a point of maintenance if Rails' default CSRF handling changes. [Source: app/controllers/account/sessions_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/sessions_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::AccountForm": {
      "type": "Form Object",
      "description": "A form object for encapsulating and validating user registration data.",
      "interactions": {
        "interaction_0": "Used by `Account::AccountsController` to collect and validate registration input. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_1": "Provides `to_resource` method for converting form data to a format suitable for the `Account` microservice. [Source: app/operations/account/register.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/account/account_form.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PasswordRequestForm": {
      "type": "Form Object",
      "description": "A form object for encapsulating and validating email input for password reset requests.",
      "interactions": {
        "interaction_0": "Used by `Account::PasswordResetsController` to handle password reset requests. [Source: app/controllers/account/password_resets_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/account/password_request_form.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PasswordResetForm": {
      "type": "Form Object",
      "description": "A form object for encapsulating and validating new password input during a password reset.",
      "interactions": {
        "interaction_0": "Used by `Account::PasswordResetsController` to handle setting new passwords. [Source: app/controllers/account/password_resets_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/forms/account/password_reset_form.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::Authorization": {
      "type": "Model",
      "description": "Stores details about external authentication providers (e.g., SAML, OpenID Connect) linked to a user account.",
      "interactions": {
        "interaction_0": "Belongs to `Account::User`. [Source: app/models/account/authorization.rb]",
        "interaction_1": "Managed by `Account::ProfilesController` (delete) and `Account::SessionsController` (connect). [Source: app/controllers/account/profiles_controller.rb, app/controllers/account/sessions_controller.rb]",
        "interaction_2": "Used by `Account::ProfilePresenter` to display linked providers. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_3": "Belongs to Account::User."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/account/authorization.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::Consent": {
      "type": "Model",
      "description": "Records a user's explicit permission (or refusal) for a specific data 'treatment'. It automatically manages user group memberships based on consent status.",
      "interactions": {
        "interaction_0": "Belongs to `Account::User` and `Account::Treatment`. [Source: app/models/account/consent.rb]",
        "interaction_1": "Validates `value` to be true or false. [Source: app/models/account/consent.rb]",
        "interaction_2": "Triggers `Account::Membership` creation or destruction `after_save_commit` and `after_destroy` based on consent `value`. [Source: app/models/account/consent.rb]",
        "interaction_3": "Managed by `Account::ConsentsController` and `Account::Register` operation. [Source: app/controllers/account/consents_controller.rb, app/operations/account/register.rb]",
        "interaction_4": "Belongs to Account::User.",
        "interaction_5": "Belongs to Account::Treatment.",
        "interaction_6": "Manages Account::Membership records (creation/destruction) based on consent value."
      },
      "techDebt": [
        "The `after_save_commit` and `after_destroy` callbacks directly manipulate `Account::Membership` records, tightly coupling `Consent` with `Membership`. This might be better handled by a service layer or an event-driven approach if `Membership` is conceptually separate or resides in a different service. [Source: app/models/account/consent.rb]"
      ],
      "provenance": {
        "sources": [
          "app/models/account/consent.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::Email": {
      "type": "Model",
      "description": "Represents an email address associated with a user, including primary and secondary emails, and confirmation status.",
      "interactions": {
        "interaction_0": "Belongs to `Account::User`. [Source: app/models/account/email.rb]",
        "interaction_1": "Provides a `primary` scope to find the primary email. [Source: app/models/account/email.rb]",
        "interaction_2": "Managed by `Account::ProfilesController` (create, delete, change primary, unsuspend) and `Account::ConfirmationsController` (confirm). [Source: app/controllers/account/profiles_controller.rb, app/controllers/account/confirmations_controller.rb]",
        "interaction_3": "Used by `Account::ProfilePresenter` to display email information. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_4": "Belongs to Account::User."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/account/email.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::Session": {
      "type": "Model",
      "description": "Manages user login sessions within the application.",
      "interactions": {
        "interaction_0": "Belongs to `Account::User`. [Source: app/models/account/session.rb]",
        "interaction_1": "Managed by `Account::SessionsController` (creation, assignment) and `Account::ChangePassword` (deletion of other sessions). [Source: app/controllers/account/sessions_controller.rb, app/operations/account/change_password.rb]",
        "interaction_2": "Belongs to Account::User."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/account/session.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::Treatment": {
      "type": "Model",
      "description": "Defines different categories or types of user data treatments (e.g., for research, marketing). Each treatment can be associated with a specific user group.",
      "interactions": {
        "interaction_0": "Has many `Account::Consents`. [Source: app/models/account/treatment.rb]",
        "interaction_1": "Can be looked up by `id` or `name`. [Source: app/models/account/treatment.rb]",
        "interaction_2": "Associated with an `Account::Group` for membership management. [Source: app/models/account/treatment.rb]",
        "interaction_3": "Fetched by `Account::AccountsController` and `Account::ConsentsController` from the `Account` microservice. [Source: app/controllers/account/accounts_controller.rb, app/controllers/account/consents_controller.rb]",
        "interaction_4": "Has many Account::Consent records.",
        "interaction_5": "Finds associated Account::Group records based on its name."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/account/treatment.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::User": {
      "type": "Model",
      "description": "The central ActiveRecord model representing a user in the system. It aggregates various user-related data and associations for authentication, profile information, gamification, course progress, and certificates.",
      "interactions": {
        "interaction_0": "Has many `authorizations`, `gamification_scores`, `gamification_badges`, `memberships`, `emails`, `item_results`, `item_visits`, `certificate_records`. [Source: app/models/account/user.rb]",
        "interaction_1": "Has one `primary_email`. [Source: app/models/account/user.rb]",
        "interaction_2": "Provides `with_authorization` scope to find users by authorization UID. [Source: app/models/account/user.rb]",
        "interaction_3": "Provides `email` method to access the primary email address. [Source: app/models/account/user.rb]",
        "interaction_4": "Central model for `Account::ProfilesController`, `Account::SessionsController`, `Account::Register` and `Account::ChangePassword` operations. [Source: app/controllers/account/profiles_controller.rb, app/controllers/account/sessions_controller.rb, app/operations/account/register.rb, app/operations/account/change_password.rb]",
        "interaction_5": "Has many Account::Authorization records for external authentication details.",
        "interaction_6": "Has many Account::Email records, including a primary email.",
        "interaction_7": "Has many Account::Consent records for data treatment permissions.",
        "interaction_8": "Has many Account::Membership records, linking users to groups based on consents.",
        "interaction_9": "Has many Gamification::Score and Gamification::Badge records.",
        "interaction_10": "Has many Course::Result and Course::Visit records for learning progress.",
        "interaction_11": "Has many Certificate::Record records."
      },
      "techDebt": [
        "The `primary_email` association uses `inverse_of: false` and `rubocop:disable Rails/HasManyOrHasOneDependent`, which might indicate a potential issue with ActiveRecord's ability to infer the inverse association or a deliberate choice to avoid `dependent` behavior for primary email. [Source: app/models/account/user.rb]"
      ],
      "provenance": {
        "sources": [
          "app/models/account/user.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::ChangePassword": {
      "type": "Operation",
      "description": "Encapsulates the business logic for changing a user's password.",
      "interactions": {
        "interaction_0": "Called by `Account::ProfilesController`. [Source: app/controllers/account/profiles_controller.rb]",
        "interaction_1": "Uses `AuthenticationHandler` (external) to verify the old password. [Source: app/operations/account/change_password.rb]",
        "interaction_2": "Patches the new password via `Xikolo.api(:account).rel(:user)`. [Source: app/operations/account/change_password.rb]",
        "interaction_3": "Optionally deletes all other user sessions if the `password_change.remove_sessions` feature is enabled. [Source: app/operations/account/change_password.rb]",
        "interaction_4": "Handles `Restify::UnprocessableEntity` and `Restify::NotFound` errors. [Source: app/operations/account/change_password.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/operations/account/change_password.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::Register": {
      "type": "Operation",
      "description": "Encapsulates the business logic for registering a new user account.",
      "interactions": {
        "interaction_0": "Called by `Account::AccountsController`. [Source: app/controllers/account/accounts_controller.rb]",
        "interaction_1": "Validates input using `Account::AccountForm`. [Source: app/operations/account/register.rb]",
        "interaction_2": "Posts new user data to `Xikolo.api(:account).rel(:users)`. [Source: app/operations/account/register.rb]",
        "interaction_3": "Fetches policies from `Xikolo.api(:account).rel(:policies)` and accepts the latest policy. [Source: app/operations/account/register.rb]",
        "interaction_4": "Patches user consents via `user.rel(:consents)`. [Source: app/operations/account/register.rb]",
        "interaction_5": "Publishes `xikolo.web.account.sign_up` messages via `Msgr` to trigger welcome emails. [Source: app/operations/account/register.rb]",
        "interaction_6": "Handles `Restify::ResponseError` and attempts to silently log in if the email is already taken. [Source: app/operations/account/register.rb]"
      },
      "techDebt": [
        "The `handle_error` method includes logic to `try_authenticate` and silently log in a user if their email is already registered. While intended to improve UX, this behavior might be unexpected for a registration form and could potentially mask issues or lead to confusion. [Source: app/operations/account/register.rb]"
      ],
      "provenance": {
        "sources": [
          "app/operations/account/register.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PolicyPresenter": {
      "type": "Presenter",
      "description": "Formats policy data for display in the UI.",
      "interactions": {
        "interaction_0": "Initialized with a policy resource. [Source: app/presenters/account/policy_presenter.rb]",
        "interaction_1": "Provides `version` and `url` (localized) attributes. [Source: app/presenters/account/policy_presenter.rb]",
        "interaction_2": "Used by `Account::PoliciesController`. [Source: app/controllers/account/policies_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/account/policy_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Account::PreferencesPresenter": {
      "type": "Presenter",
      "description": "Formats and structures user preference data for display in the `web` application's views. It defines helper classes for individual preference and notification items.",
      "interactions": {
        "interaction_0": "Initialized with a preferences object (ACFS resource). [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_1": "Provides methods to check if notifications are enabled and to retrieve specific preferences. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_2": "Manages `PreferencePresenter` and `NotificationPresenter` subclasses for rendering individual preference switches. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_3": "Used by `Account::PreferencesController`. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_4": "Receives Xikolo::Account::Preferences object. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_5": "Delegates to Account::PreferencesPresenter::PreferencePresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_6": "Delegates to Account::PreferencesPresenter::NotificationPresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_7": "Used by Account::PreferencesController. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_8": "Receives `Xikolo::Account::Preferences` object during initialization.",
        "interaction_9": "Provides methods to check global notification status and retrieve specific preference values.",
        "interaction_10": "Delegates rendering of individual preferences to `PreferencePresenter` and `NotificationPresenter`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/account/preferences_presenter.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::ProfilePresenter": {
      "type": "Presenter",
      "description": "Formats comprehensive user profile data, including personal details, emails, authorizations, and custom fields, for display.",
      "interactions": {
        "interaction_0": "Initialized with a user object and options. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_1": "Fetches `Email` and `Authorization` records associated with the user. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_2": "Retrieves `Profile` (ACFS resource) for custom fields. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_3": "Provides methods to access user attributes (`full_name`, `email`, `born_at`), unconfirmed/secondary emails, and custom profile fields. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_4": "Manages `FieldPresenter` subclass for rendering individual profile fields. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_5": "Fetches `consents` from `user.rel(:consents)` or `Restify`. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_6": "Determines if authorizations can be deleted based on `native_login` feature and authorization count. [Source: app/presenters/account/profile_presenter.rb]",
        "interaction_7": "Used by `Account::ProfilesController`. [Source: app/controllers/account/profiles_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/account/profile_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "account-profile.js": {
      "type": "Frontend Asset",
      "description": "A legacy JavaScript file responsible for handling dynamic user profile editing on the frontend, including inline updates, password changes, and avatar uploads.",
      "interactions": {
        "interaction_0": "Initializes `bootstrap-editable` for various profile fields (`display_name`, `full_name`, `email`, `born_at`). [Source: app/assets/legacy/account-profile.js]",
        "interaction_1": "Sends AJAX requests to the `ajaxurl` (derived from `data-ajaxurl` attribute) for updates. [Source: app/assets/legacy/account-profile.js]",
        "interaction_2": "Handles success and error responses, including specific error messages for email already taken. [Source: app/assets/legacy/account-profile.js]",
        "interaction_3": "Manages UI elements for password change form visibility and secondary email list toggling. [Source: app/assets/legacy/account-profile.js]",
        "interaction_4": "Triggers avatar upload form submission. [Source: app/assets/legacy/account-profile.js]",
        "interaction_5": "Uses `I18n` for localized messages and `util/loading` for loading indicators. [Source: app/assets/legacy/account-profile.js]",
        "interaction_6": "Utilizes the `bootstrap-editable` jQuery plugin for inline editing UI.",
        "interaction_7": "Interacts with `I18n` for internationalization of messages and date formats.",
        "interaction_8": "Sends AJAX `POST` requests to the backend API (implied by `ajaxurl`) to update user data.",
        "interaction_9": "Manipulates DOM elements to show/hide forms and update displayed user information.",
        "interaction_10": "Uses `showLoading` and `hideLoading` utilities for UI feedback."
      },
      "techDebt": [
        "Uses `jQuery` and `bootstrap-editable`, which are older frontend technologies. [Source: app/assets/legacy/account-profile.js]",
        "The `doAjaxRequest` function uses `async: false` for AJAX requests, which is a blocking call and can lead to a frozen UI, considered bad practice in modern web development. [Source: app/assets/legacy/account-profile.js]",
        "Relies on `$` being globally available, indicating a legacy module structure. [Source: app/assets/legacy/account-profile.js]",
        "Uses `eslint-disable no-undef` and relies on a global `$` (jQuery), indicating a legacy frontend architecture.",
        "The `doAjaxRequest` function uses `async: false` for AJAX calls, which blocks the main thread and can lead to a poor user experience. This should be refactored to use asynchronous patterns."
      ],
      "provenance": {
        "sources": [
          "app/assets/legacy/account-profile.js",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "consents.ts": {
      "type": "Frontend Asset",
      "description": "TypeScript module for handling client-side updates to user consents.",
      "interactions": {
        "interaction_0": "Listens for `change` events on forms with `data-profile-consent` attribute. [Source: app/assets/user/profile/consents.ts]",
        "interaction_1": "Sends `PUT` requests with `FormData` to the form's `data-url` using a custom `fetch` utility. [Source: app/assets/user/profile/consents.ts]",
        "interaction_2": "Updates the UI with `consented_at_msg` from the server response. [Source: app/assets/user/profile/consents.ts]",
        "interaction_3": "Uses `util/ready` for DOM readiness and `util/error` for error handling. [Source: app/assets/user/profile/consents.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/user/profile/consents.ts"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "preferences.ts": {
      "type": "Frontend Asset",
      "description": "Client-side JavaScript/TypeScript module responsible for handling user interactions with preference switches, sending updates to the backend, and dynamically adjusting UI elements based on preference states.",
      "interactions": {
        "interaction_0": "Listens for `change` events on elements with `data-behavior='preferences-switch'` attribute. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_1": "Sends `PUT` requests to `/preferences` with `FormData` containing the preference `name` and `value`. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_2": "Toggles the visibility of notification preferences based on the global email preference. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_3": "Uses `util/ready` for DOM readiness and `fetch` for AJAX requests. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_4": "Sends requests to Account::PreferencesController. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_5": "Interacts with the DOM. [Source: app/assets/user/settings/preferences.ts]",
        "interaction_6": "Sends PUT requests to `/preferences` endpoint on the `web` application.",
        "interaction_7": "Reads and updates DOM elements related to preference switches and notification preference visibility."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/user/settings/preferences.ts",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "ApplicationComponent": {
      "type": "ViewComponent Base",
      "description": "The base class for all ViewComponents in the application, inheriting from `ViewComponent::Base`. It serves as a foundational element for building reusable UI components.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/application_component.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "application.js": {
      "type": "JavaScript Asset (Sprockets)",
      "description": "A legacy Sprockets manifest file that compiles into the `application.js` bundle. It includes jQuery, Bootstrap-Sprockets, and a custom `xfn/ready` script. It's explicitly noted as a temporary measure during the migration to Webpack.",
      "interactions": {
        "interaction_0": "Requires `xfn/ready` for document ready events. [Source: app/assets/javascripts/application.js]",
        "interaction_1": "Requires `jquery2` for DOM manipulation and AJAX. [Source: app/assets/javascripts/application.js]",
        "interaction_2": "Requires `bootstrap-sprockets.js` for Bootstrap 3 JavaScript functionalities. [Source: app/assets/javascripts/application.js]"
      },
      "techDebt": [
        "Part of a deprecated Sprockets-based asset pipeline, being phased out in favor of Webpack. [Source: app/assets/javascripts/application.js]"
      ],
      "provenance": {
        "sources": [
          "app/assets/javascripts/application.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "main.js": {
      "type": "JavaScript Asset (Webpack)",
      "description": "The main Webpack entry point for modern JavaScript in the application. It includes polyfills, initializes Rails UJS, and imports a wide range of global UI components and form-related actions, adhering to a component-based JavaScript architecture.",
      "interactions": {
        "interaction_0": "Imports `form-request-submit-polyfill` for browser compatibility. [Source: app/assets/main.js]",
        "interaction_1": "Initializes `@rails/ujs` for unobtrusive JavaScript features. [Source: app/assets/main.js]",
        "interaction_2": "Imports various global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`) and form actions (e.g., `autosubmit`, `hide-on-submit`). [Source: app/assets/main.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/main.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "main.scss": {
      "type": "SCSS Entry Point",
      "description": "The primary entry point for all application styles. It orchestrates the loading of the theme-specific styles before the global styles, ensuring proper cascading and customization.",
      "interactions": {
        "interaction_0": "Imports `stylesheets/theme` to load theme-specific variables and styles first. ",
        "interaction_1": "Imports `stylesheets/global` to load general application styles. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/main.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_theme.scss": {
      "type": "SCSS Module",
      "description": "Defines the core visual theme of the Xikolo application. It imports color schemas, common variables, helper mixins, and design patterns, setting the foundational look and feel.",
      "interactions": {
        "interaction_0": "Imports `theme/color_schema` for color definitions. ",
        "interaction_1": "Imports `theme/common/variables` for shared SCSS variables. ",
        "interaction_2": "Imports `theme/common/helpers` for SASS mixins and functions. ",
        "interaction_3": "Imports `theme/design` for common design parts. "
      },
      "techDebt": [
        "The `_design.scss` file needs to be copied even if no changes are made, which is an inconvenient aspect of the current branding architecture. "
      ],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_theme.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_global.scss": {
      "type": "SCSS Module",
      "description": "A global import list for general application styles. It integrates Bootstrap variables, external libraries, legacy controller-specific styles, partials, and modern components, forming the comprehensive stylesheet.",
      "interactions": {
        "interaction_0": "Imports `bs-variables` for Bootstrap 3 variable overrides. [Source: app/assets/stylesheets/_global.scss]",
        "interaction_1": "Imports `libs` for external library styles. [Source: app/assets/stylesheets/_global.scss]",
        "interaction_2": "Imports `controllers/sections` and `controllers/account` (legacy controller-specific styles). [Source: app/assets/stylesheets/_global.scss]",
        "interaction_3": "Imports `partials` for legacy UI component styles. [Source: app/assets/stylesheets/_global.scss]",
        "interaction_4": "Imports `components` for modern UI component styles. [Source: app/assets/stylesheets/_global.scss]",
        "interaction_5": "Imports `util/swal` for SweetAlert styles. [Source: app/assets/stylesheets/_global.scss]"
      },
      "techDebt": [
        "Includes `controllers/sections` and `controllers/account` which are marked as `TODO: we don't want controller specific stuff`, indicating a need for refactoring into a component-based approach. [Source: app/assets/stylesheets/_global.scss]"
      ],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_global.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_bs-variables.scss": {
      "type": "SCSS Module",
      "description": "Contains variables extracted from Bootstrap 3.4.1 CSS. This file allows for customization of Bootstrap's default styling parameters (colors, typography, spacing, component dimensions) and is crucial for the phased migration away from Bootstrap.",
      "interactions": {
        "interaction_0": "Defines and overrides Bootstrap 3.4.1 variables, influencing the styling of elements that still rely on Bootstrap. [Source: app/assets/stylesheets/_bs-variables.scss]",
        "interaction_1": "Uses `sass:color` and `sass:math` functions for color adjustments and calculations. [Source: app/assets/stylesheets/_bs-variables.scss]"
      },
      "techDebt": [
        "Represents a dependency on Bootstrap 3.4.1, which is outdated and unmaintained, contributing to technical debt. "
      ],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_bs-variables.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_components.scss": {
      "type": "SCSS Module",
      "description": "An import list for styles specifically scoped to modern UI components. This module is considered 'clean' and does not depend on Bootstrap, representing the target architecture for new UI development.",
      "interactions": {
        "interaction_0": "Imports styles for various global components (e.g., `accordion`, `tooltip`, `cookie_consent_banner`). [Source: app/assets/stylesheets/_components.scss]",
        "interaction_1": "Imports styles for navigation components (e.g., `navigation_bar`, `navigation_tabs`). [Source: app/assets/stylesheets/_components.scss]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_components.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_partials.scss": {
      "type": "SCSS Module (Legacy)",
      "description": "An import list for styles related to older, non-component-based UI elements. This module is considered legacy code and still contains a significant amount of Bootstrap-dependent styles, slated for future refactoring.",
      "interactions": {
        "interaction_0": "Imports styles for various legacy UI elements (e.g., `grid`, `typography`, `forms`, `navigation`, `quiz`, `dashboard`). [Source: app/assets/stylesheets/_partials.scss]",
        "interaction_1": "Imports styles for XUI components (`upload`, `mdupload`, `imageupload`). [Source: app/assets/stylesheets/_partials.scss]"
      },
      "techDebt": [
        "Contains a lot of Bootstrap code and is considered legacy, requiring future migration to the component-based architecture. "
      ],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_partials.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_grid-settings.scss": {
      "type": "SCSS Module",
      "description": "Defines the application's responsive grid system, including column and gutter widths, maximum content width, and various media query breakpoints. It also exports CSS variables for JavaScript access.",
      "interactions": {
        "interaction_0": "Defines `$column`, `$gutter`, `$grid-columns`, `$max-width` for the grid system. [Source: app/assets/stylesheets/_grid-settings.scss]",
        "interaction_1": "Defines various breakpoints (`$xs-to-sm`, `$sm-to-md`, `$md-to-lg`, `$breakpoint-s`, etc.) and corresponding mixins (`@mixin small`, `@mixin medium`, `@mixin large`). [Source: app/assets/stylesheets/_grid-settings.scss]",
        "interaction_2": "Exports breakpoint values as CSS variables (`--breakpoint-s`, `--breakpoint-sm`) for JavaScript access. [Source: app/assets/stylesheets/_grid-settings.scss]"
      },
      "techDebt": [
        "Contains `@deprecated Old breakpoints` mixins (`tiny`, `xs`, `sm`) that should be refactored to align with the mobile-first approach. [Source: app/assets/stylesheets/_grid-settings.scss]"
      ],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/_grid-settings.scss",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "application.html.slim": {
      "type": "Layout",
      "description": "The primary and most comprehensive application layout. It includes all core meta tags, asset links (CSS, JavaScript), navigation, flash messages, browser warnings, and dynamic content areas. It also integrates various global UI components and tracking scripts.",
      "interactions": {
        "interaction_0": "Uses `ApplicationHelper#sentry_meta_tags` for Sentry integration. [Source: app/views/layouts/application.html.slim]",
        "interaction_1": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/application.html.slim]",
        "interaction_2": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/application.html.slim]",
        "interaction_3": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/application.html.slim]",
        "interaction_4": "Renders `Global::CustomHeadSnippets` for custom head content. [Source: app/views/layouts/application.html.slim]",
        "interaction_5": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/application.html.slim]",
        "interaction_6": "Renders `Navigation::Bar` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
        "interaction_7": "Checks `ApplicationHelper#browser_support` and `ApplicationHelper#hide_browser_warning?` to display browser warnings. [Source: app/views/layouts/application.html.slim]",
        "interaction_8": "Renders `Footer::Main` and `Global::HelpdeskButton` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
        "interaction_9": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/application.html.slim]",
        "interaction_10": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/application.html.slim]"
      },
      "techDebt": [
        "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/application.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/views/layouts/application.html.slim",
          "app/helpers/application_helper.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "simple.html.slim": {
      "type": "Layout",
      "description": "A simplified application layout used for specific pages that require a less complex UI structure than the main `application.html.slim`. It includes core assets and navigation but wraps content in a `.layout-simple__container`.",
      "interactions": {
        "interaction_0": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/simple.html.slim]",
        "interaction_1": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/simple.html.slim]",
        "interaction_2": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/simple.html.slim]",
        "interaction_3": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/simple.html.slim]",
        "interaction_4": "Renders `Navigation::Bar`. [Source: app/views/layouts/simple.html.slim]",
        "interaction_5": "Renders `Footer::Main` and `Global::HelpdeskButton`. [Source: app/views/layouts/simple.html.slim]",
        "interaction_6": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/simple.html.slim]",
        "interaction_7": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/simple.html.slim]"
      },
      "techDebt": [
        "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/simple.html.slim]"
      ],
      "provenance": {
        "sources": [
          "app/views/layouts/simple.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "plain.html.slim": {
      "type": "Layout",
      "description": "A minimal application layout designed for very basic pages, typically without any default assets or complex UI components. It provides a clean slate for content rendering.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/views/layouts/plain.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ClassifierAdministrationUI": {
      "type": "Admin UI Feature",
      "description": "Provides a web interface for platform administrators to manage course classifiers and their clusters. This includes defining new clusters, and creating, editing, or deleting classifiers within those clusters. The specific implementation details (e.g., controllers, views) are not available in the provided code snippets but are inferred from documentation. ",
      "interactions": {
        "interaction_0": "Interacts with the `Xikolo::CourseService` to persist classifier and cluster definitions.",
        "interaction_1": "Affects course display logic on the frontend, including filtering and tagging."
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "VoucherAdministrationUI": {
      "type": "Admin UI Feature",
      "description": "Offers a self-service web interface for platform administrators to create and manage vouchers. These vouchers are used to activate paid course features like proctoring or course reactivation. The specific implementation details (e.g., controllers, views) are not available in the provided code snippets but are inferred from documentation. ",
      "interactions": {
        "interaction_0": "Interacts with the `ShopBridgeAPI` for voucher creation and management.",
        "interaction_1": "Relies on the `voucher` feature configuration (`xikolo.yml`) to be enabled."
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "ReportingRoleManagementConsole": {
      "type": "Console Utility",
      "description": "A set of Ruby console commands and scripts used by administrators to manually grant or revoke the `lanalytics.report.admin` role to users within the `xi-account` service. This role provides access to sensitive reporting data and lacks a dedicated web UI for management due to policy considerations. ",
      "interactions": {
        "interaction_0": "Directly manipulates `Role`, `Context`, `Grant`, and `User` models within the `xi-account` service's database."
      },
      "techDebt": [
        "The lack of a dedicated web UI for managing this sensitive role is a deliberate policy choice, but could be considered a user experience debt if policies were to change in the future."
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Gamification Badge Configuration": {
      "type": "Configuration",
      "description": "A YAML file (`badge_types.yml`) that defines all available gamification badges. It specifies the rules (events) that contribute to each badge and the score thresholds required to achieve different levels of a badge.",
      "interactions": {
        "interaction_0": "Informs the gamification system about the criteria for awarding and leveling up badges.",
        "interaction_1": "Implicitly guides the implementation of `Gamification::Rules` by listing contributing events.",
        "interaction_2": "Establishes naming conventions for badge image assets."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification User Level Configuration": {
      "type": "Configuration",
      "description": "A YAML file (`user_levels.yml`) that defines the progression of user levels within the gamification system. Each level is associated with a minimum experience point (XP) requirement, a title, and an image file.",
      "interactions": {
        "interaction_0": "Used by the gamification system to determine a user's current level based on their accumulated XP.",
        "interaction_1": "Establishes naming conventions for user level image assets."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification (Presenter/Decorator)": {
      "type": "Presenter/Decorator",
      "description": "An inferred object (likely a presenter or decorator) responsible for aggregating and preparing gamification data, such as a user's earned badges and scores, for display in the `dashboard/achievements.html.slim` view.",
      "interactions": {
        "interaction_0": "Provides collections of `badges` and `scores` to the `achievements.html.slim` view.",
        "interaction_1": "Encapsulates logic for retrieving and structuring gamification data relevant to a user."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/views/dashboard/achievements.html.slim",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification::Badge": {
      "type": "Model/Entity",
      "description": "An inferred model or entity representing a specific gamification badge earned by a user. It holds attributes like the badge's name, its current level, and its persistence status (whether it has been gained).",
      "interactions": {
        "interaction_0": "Passed as a parameter to `Dashboard::GamificationBadge` for rendering.",
        "interaction_1": "Its attributes (`name`, `level`, `persisted?`) are accessed by the ViewComponent to determine display logic.",
        "interaction_2": "Defined by Gamification Configuration (YAML). ",
        "interaction_3": "Its state (`persisted?`, `name`, `level`) determines the visual representation [Source: app/components/dashboard/gamification_badge.rb]",
        "interaction_4": "Defined by `app/models/gamification/badge_types.yml` "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/dashboard/gamification_badge.rb",
          "spec/factories/gamification.rb",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "State::Empty": {
      "type": "ViewComponent",
      "description": "A generic ViewComponent used to display a message indicating that there is no content or data available, specifically used here when a user has no gamification scores.",
      "interactions": {
        "interaction_0": "Rendered conditionally in `achievements.html.slim` when `@gamification.scores` is empty."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/views/dashboard/achievements.html.slim",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "ChromecastController": {
      "type": "Controller",
      "description": "Handles requests for Chromecast Styled Media Receiver (SMR) stylesheets, allowing custom branding for the casting experience.",
      "interactions": {
        "interaction_0": "Reads configuration from the `Chromecast` module to determine styling parameters.",
        "interaction_1": "Renders a CSS stylesheet dynamically based on configured values.",
        "interaction_2": "Checks `Chromecast.configured?` for feature enablement. [Source: app/controllers/chromecast_controller.rb]",
        "interaction_3": "Retrieves styling parameters (background, logo, progress color) from `Chromecast` configuration. [Source: app/controllers/chromecast_controller.rb]"
      },
      "techDebt": [
        "Raising `AbstractController::ActionNotFound` in a `before_action` is an unconventional way to prevent rendering; a `head :not_found` or redirect might be more appropriate for clearer HTTP semantics."
      ],
      "provenance": {
        "sources": [
          "app/controllers/chromecast_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Chromecast": {
      "type": "Utility Module",
      "description": "Provides an interface to retrieve Chromecast configuration settings (background URL, logo URL, progress color) from the global `Xikolo.config`.",
      "interactions": {
        "interaction_0": "Used by `ChromecastController` to access styling configurations."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/lib/chromecast.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Transpipe": {
      "type": "Integration Module",
      "description": "Provides an interface to an external 'Transpipe' service, primarily for generating URLs to course and video resources within that service. It includes a mechanism to check if the integration is enabled.",
      "interactions": {
        "interaction_0": "Reads configuration from `Xikolo.config` to determine if the service is enabled and to retrieve URL templates.",
        "interaction_1": "Uses `Transpipe::URL` to construct specific URLs.",
        "interaction_2": "Reads configuration from `Xikolo.config.transpipe`. [Source: app/lib/transpipe.rb]",
        "interaction_3": "Uses `Addressable::Template` to expand URL templates. [Source: app/lib/transpipe.rb]"
      },
      "techDebt": [
        "The `rescue TypeError` for template parsing is broad and could be more specific. [Source: app/lib/transpipe.rb]"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb",
          "spec/lib/transpipe_spec.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::VideoPlayer": {
      "type": "External Component Wrapper",
      "description": "Represents the client-side video player. It's an external JavaScript-based component (`@openhpi/xikolo-video-player` npm package) integrated into the Rails application, responsible for rendering and controlling video playback.",
      "interactions": {
        "interaction_0": "Initialized by `VideoPresenter` with video, user, and thumbnail loading options.",
        "interaction_1": "Likely consumes HLS playlists and VTT subtitle files provided by `Video::PlaylistsController` and `SubtitlesController`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/video_presenter.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::Subtitle": {
      "type": "Model",
      "description": "Represents a subtitle track associated with a video. It stores the subtitle content, typically in a format convertible to WebVTT, and its language.",
      "interactions": {
        "interaction_0": "Accessed by `SubtitlesController` for serving VTT files.",
        "interaction_1": "Accessed by `M3u8Playlist` to embed Xikolo's subtitles into HLS master playlists or generate standalone subtitle playlists.",
        "interaction_2": "Managed by `SubtitlesController`. [Source: app/controllers/subtitles_controller.rb]",
        "interaction_3": "Created and processed by `Video::Store`. [Source: app/operations/video/store.rb]",
        "interaction_4": "Provides `to_vtt` method to render subtitle content. [Source: app/controllers/subtitles_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/subtitles_controller.rb",
          "app/lib/m3u8_playlist.rb",
          "app/operations/video/store.rb",
          "spec/operations/video/store_spec.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::Stream": {
      "type": "Model",
      "description": "Represents a specific video stream, likely containing the base HLS URL and potentially direct download URLs for different qualities (e.g., HD, SD).",
      "interactions": {
        "interaction_0": "Accessed by `Video::PlaylistsController` to retrieve the HLS URL for playlist processing.",
        "interaction_1": "Accessed by `M3u8Playlist` to fetch external HLS content.",
        "interaction_2": "Accessed by `VideoPresenter` to provide download URLs for various qualities.",
        "interaction_3": "Queried and destroyed by `Admin::VideosController`. [Source: app/controllers/admin/videos_controller.rb]",
        "interaction_4": "Includes association to `Video::Provider`. [Source: app/controllers/admin/videos_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/video/playlists_controller.rb",
          "app/lib/m3u8_playlist.rb",
          "app/presenters/video_presenter.rb",
          "app/controllers/admin/videos_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Versioning::Version": {
      "type": "Value Object",
      "description": "Represents a specific API version, encapsulating its major and minor numbers. Used by `Xikolo::API` to manage and list supported versions.",
      "interactions": {
        "interaction_0": "Instantiated and managed by `Xikolo::API` for version tracking."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/VERSIONING.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Xikolo::Versioning::Middleware": {
      "type": "Middleware",
      "description": "An HTTP middleware responsible for negotiating the API version based on the `Accept` header in incoming requests. It ensures that clients receive responses compatible with their requested version and can add `Sunset` headers for deprecated versions.",
      "interactions": {
        "interaction_0": "Used by `Xikolo::API` to process incoming requests.",
        "interaction_1": "Interacts with API clients by interpreting `Accept` headers and potentially adding `Sunset` headers to responses."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/VERSIONING.md",
          "docs/portalapi/docs/negotiation.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Auth::Helpers": {
      "type": "Helper Module",
      "description": "Provides authentication-related utility methods that can be included in Grape API endpoints to assist with authorization and user context.",
      "interactions": {
        "interaction_0": "Included as helpers within `Xikolo::API` and its mounted endpoints."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Model::Helpers": {
      "type": "Helper Module",
      "description": "Provides utility methods for interacting with backend models or services within Grape API endpoints.",
      "interactions": {
        "interaction_0": "Included as helpers within `Xikolo::API` and its mounted endpoints."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Auth::Middleware::LegacyToken": {
      "type": "Middleware",
      "description": "An HTTP middleware responsible for authenticating API requests using a legacy token mechanism. It processes `Authorization` headers to validate access.",
      "interactions": {
        "interaction_0": "Used by `Xikolo::API` to authenticate incoming requests.",
        "interaction_1": "Interacts with API clients by processing `Authorization` headers."
      },
      "techDebt": [
        "The 'Legacy' in its name suggests it might be a candidate for deprecation or replacement with a more modern authentication standard."
      ],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "docs/portalapi/docs/authentication.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Auth::Middleware::Session": {
      "type": "Middleware",
      "description": "An HTTP middleware responsible for authenticating API requests using session-based mechanisms, likely for web-based clients or specific internal integrations.",
      "interactions": {
        "interaction_0": "Used by `Xikolo::API` to authenticate incoming requests.",
        "interaction_1": "Interacts with API clients by processing session information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "docs/portalapi/docs/authentication.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Error::Base": {
      "type": "Exception Class",
      "description": "A base exception class for API-specific errors. It allows for standardized error handling within the API, converting custom exceptions into appropriate HTTP status codes and problem details.",
      "interactions": {
        "interaction_0": "Inherited by specific API error classes.",
        "interaction_1": "Caught by `Xikolo::API`'s `rescue_from` block to generate standardized error responses."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "docs/portalapi/docs/errors.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "V2::Base": {
      "type": "API Version Module",
      "description": "A Grape API module that serves as the base for all endpoints belonging to version 2 of the API. It encapsulates the specific routes and logic for this API version.",
      "interactions": {
        "interaction_0": "Mounted by `Xikolo::API` to make its endpoints accessible.",
        "interaction_1": "Used by `Xikolo::Docs::Generator` for documentation generation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Xikolo::Docs::Generator": {
      "type": "Documentation Tool",
      "description": "A utility class responsible for generating API documentation, likely in a format like OpenAPI/Swagger, from the Grape API definitions.",
      "interactions": {
        "interaction_0": "Called by `Xikolo::API.make_docs!` to generate documentation for `V2::Base`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/README.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Format::PrettyJSON": {
      "type": "Formatter",
      "description": "A custom formatter for JSON responses, ensuring that the output is pretty-printed for readability.",
      "interactions": {
        "interaction_0": "Used by `Xikolo::API` as the formatter for `json` content type."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Grape::Parser::Json": {
      "type": "Parser",
      "description": "A standard Grape parser for incoming JSON request bodies, used to deserialize JSON data into Ruby objects.",
      "interactions": {
        "interaction_0": "Used by `Xikolo::API` as the parser for `json_api` content type."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Xikolo::Account Service": {
      "type": "Microservice",
      "description": "An API-only Ruby on Rails microservice dedicated to managing user accounts and the platform's comprehensive permissions system. It defines and manages global roles, groups, and grants, and provides API endpoints for user administration.",
      "interactions": {
        "interaction_0": "Interacts with the Xikolo::Web application for user authentication and authorization requests .",
        "interaction_1": "Manages persistence of permissions, roles, groups, and grants in a PostgreSQL database .",
        "interaction_2": "Consumes configuration from Xikolo::Web's `app/xikolo.yml` for course-specific permissions and `global_permission_groups` ."
      },
      "techDebt": [
        "The `README.md` for the service is marked as a 'TODO: Write a better README', indicating a lack of comprehensive internal documentation ."
      ],
      "provenance": {
        "sources": [
          "services/account/config/services.yml",
          "services/account/README.md",
          "services/account/lib/tasks/permissions/account.yml",
          "docs/app/features/permissions/index.md",
          "docs/app/features/permissions/regranting_permissions.md",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Permission (Concept)": {
      "type": "Domain Concept",
      "description": "A granular authorization unit within the Xikolo system, defining specific actions a user can perform (e.g., `account.user.index`, `account.user.create`). Permissions are bundled into Roles.",
      "interactions": {
        "interaction_0": "Bundled into Roles .",
        "interaction_1": "Defined in YAML files within the Xikolo::Account service ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Role (Concept)": {
      "type": "Domain Concept",
      "description": "A collection of Permissions that can be assigned to Groups. Examples include `account.admin`, `account.permissions.admin`, and `account.support`.",
      "interactions": {
        "interaction_0": "Comprises multiple Permissions .",
        "interaction_1": "Granted to Groups within a specific context ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Group (Concept)": {
      "type": "Domain Concept",
      "description": "An entity to which Roles are granted, defining a set of capabilities for its members. Global groups like `xikolo.gdpr_admins`, `xikolo.helpdesk`, `xikolo.reviewers`, and `xikolo.stakeholders` are defined.",
      "interactions": {
        "interaction_0": "Receives Grants of Roles .",
        "interaction_1": "Global groups are defined in `lib/tasks/permissions/*.yml` in `xi-account` and `global_permission_groups` in `xi-web` ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "permissions:load Rake Task": {
      "type": "Rake Task",
      "description": "A Rake task within the Xikolo::Account service responsible for loading and applying permission, role, and group definitions from YAML files (`lib/tasks/permissions/*.yml`) into the database. It is executed automatically in CI/CD pipelines.",
      "interactions": {
        "interaction_0": "Reads permission definitions from YAML files .",
        "interaction_1": "Updates the database with new or modified permissions, roles, and grants .",
        "interaction_2": "Does not delete existing entries, requiring manual or script-based regranting for removals ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Chatbot Bridge API": {
      "type": "External API Endpoint",
      "description": "A dedicated API for external chatbot systems to interact with the Xikolo platform. It enables user authentication, retrieval of user and course information, and management of course enrollments and quizzes on behalf of authenticated users.",
      "interactions": {
        "interaction_0": "Authenticates external chatbot systems using a shared secret (Bearer token) for initial access to the authentication endpoint. ",
        "interaction_1": "Issues user-specific authentication tokens based on a provided SAML `uid` (NameID). ",
        "interaction_2": "Provides endpoints for retrieving user data (internal ID), course listings, user-specific enrolled courses, and course achievement details. ",
        "interaction_3": "Supports actions such as enrolling and unenrolling users from courses. ",
        "interaction_4": "Offers access to quiz information for specific courses. ",
        "interaction_5": "Consumed by chatbot services to interact with user data and learning progress.",
        "interaction_6": "Provides endpoints for user authentication, course enrollment/unenrollment, achievement lookup, and quiz information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "MOOChub Bridge API": {
      "type": "External API Endpoint",
      "description": "An API endpoint designed for integration with the MOOChub platform, primarily for facilitating the exchange or synchronization of course-related data.",
      "interactions": {
        "interaction_0": "Exposes course data via the `/bridges/moochub/courses` endpoint. ",
        "interaction_1": "Expected to interact with MOOChub for data exchange, with specific details documented externally. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Shop Bridge API": {
      "type": "External API Endpoint",
      "description": "An API for external e-commerce shops to manage the creation and listing of digital vouchers for various Xikolo platform products, such as course reactivation or proctoring services.",
      "interactions": {
        "interaction_0": "Authenticates external shop systems using a shared secret provided as a Bearer token. ",
        "interaction_1": "Allows for the bulk creation of vouchers with specified quantities, product types, countries, and tags via a POST request to `/vouchers`. ",
        "interaction_2": "Provides a mechanism to list existing vouchers, including their claim status and claimant details, via a GET request to `/vouchers`. ",
        "interaction_3": "Used by internal shop systems or related services.",
        "interaction_4": "Manages voucher data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "TransPipe Bridge API": {
      "type": "External API Endpoint",
      "description": "An API designed for the translation pipeline project (TransPipe) to access and manage video-related information, including course structure, video streams, and subtitles.",
      "interactions": {
        "interaction_0": "Authenticates external systems using a Bearer token. ",
        "interaction_1": "Provides paginated lists of courses and detailed course information, including sections, videos within sections, and teacher details. ",
        "interaction_2": "Offers detailed video information, including stream URLs (HD, SD, HLS for lecturer, PiP, and slides) and available subtitle languages. ",
        "interaction_3": "Enables retrieval (GET) and updating (PATCH) of video subtitles in WEBVTT format for specific languages. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "ItemGradeController": {
      "type": "Controller",
      "description": "API endpoint to retrieve a user's grade for a specific learning item.",
      "interactions": {
        "interaction_0": "Interacts with Item model to find the item.",
        "interaction_1": "Calls Item#user_grade to retrieve the grade.",
        "interaction_2": "Uses ItemGradeDecorator for presentation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/item_grade_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ItemResultsController": {
      "type": "Controller",
      "description": "API endpoint to retrieve results for a specific learning item, with options to filter by user or get the best result per user.",
      "interactions": {
        "interaction_0": "Interacts with Item model to find the item.",
        "interaction_1": "Queries Result model for item results, supporting 'best_per_user' scope."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/item_results_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ItemStatisticsController": {
      "type": "Controller",
      "description": "API endpoint to retrieve statistics for a specific learning item, supporting embedding specific statistics like 'submissions_over_time'.",
      "interactions": {
        "interaction_0": "Interacts with Item model to find the item.",
        "interaction_1": "Calls Item#stats to retrieve statistics.",
        "interaction_2": "Uses decoration_context for embed and only parameters."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/item_statistics_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "LastVisitsController": {
      "type": "Controller",
      "description": "API endpoint to retrieve the last visit record for a specific user within a given course.",
      "interactions": {
        "interaction_0": "Interacts with Enrollment model to find the enrollment.",
        "interaction_1": "Calls Enrollment#last_visit to get the visit.",
        "interaction_2": "Uses LastVisitDecorator for presentation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/last_visits_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "LearningEvaluation::RecalculationsController": {
      "type": "Controller",
      "description": "API endpoint to trigger asynchronous recalculation of learning evaluation for a specific course if it needs_recalculation? and recalculation_allowed?.",
      "interactions": {
        "interaction_0": "Interacts with Course model.",
        "interaction_1": "Enqueues LearningEvaluation::PersistForCourseWorker for background processing."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/learning_evaluation/recalculations_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "PersistRankingTasksController": {
      "type": "Controller",
      "description": "API endpoint to trigger asynchronous persistence of course rankings.",
      "interactions": {
        "interaction_0": "Interacts with Course model.",
        "interaction_1": "Enqueues PersistRankingWorker for background processing."
      },
      "techDebt": [
        "Commented out responders line, indicating potential incomplete feature or refactoring."
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/persist_ranking_tasks_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ResultsController": {
      "type": "Controller",
      "description": "API endpoint for CRUD operations on Result records, including parsing points and handling potential RecordNotFound for PUT requests by creating a new record.",
      "interactions": {
        "interaction_0": "Interacts with Result model.",
        "interaction_1": "Uses PointsProcessor concern for point parsing.",
        "interaction_2": "Triggers Msgr events and various Sidekiq workers (EnrollmentCompletionWorker, NextDate::ItemSubmissionPublishingCreateWorker, LearningEvaluation::UpdateSectionProgressWorker) via Result model callbacks."
      },
      "techDebt": [
        "The rescue ActiveRecord::RecordNotFound block for PUT to create is an unusual pattern and might hide issues or make debugging harder."
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/results_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "StatisticsController": {
      "type": "Controller",
      "description": "API endpoint to retrieve various course-level statistics (enrollment counts) and enrollment statistics filtered by date range and classifier.",
      "interactions": {
        "interaction_0": "Interacts with Course and Enrollment models.",
        "interaction_1": "Uses rfc6570_params for enrollment_stats method."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/statistics_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "StatsController": {
      "type": "Controller",
      "description": "API endpoint to retrieve simple, cached course statistics based on a key parameter (e.g., 'enrollments').",
      "interactions": {
        "interaction_0": "Interacts with Stat service object.",
        "interaction_1": "Uses Rails.cache for caching statistics.",
        "interaction_2": "Uses StatDecorator for presentation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/stats_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "VisitsController": {
      "type": "Controller",
      "description": "API endpoint to manage user visits to learning items, using UPSERT to efficiently record or update visit timestamps.",
      "interactions": {
        "interaction_0": "Interacts with Visit model.",
        "interaction_1": "Triggers Msgr events and various Sidekiq workers (EnrollmentCompletionWorker, LearningEvaluation::UpdateSectionProgressWorker) via Visit model callbacks."
      },
      "techDebt": [
        "rubocop:disable Rails/SkipsModelValidations comment indicates skipping validations for Visit.upsert, which might be a performance optimization but should be carefully managed."
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/visits_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseProgress": {
      "type": "Model",
      "description": "Persists a user's aggregated progress within a course, including visits, points, and percentages. It calculates these values based on section progress and handles alternative sections. [Source: services/course/app/models/course_progress.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Course`. [Source: services/course/app/models/course_progress.rb]",
        "interaction_1": "Has one `FixedLearningEvaluation`. [Source: services/course/app/models/course_progress.rb]",
        "interaction_2": "Interacts with `SectionProgress` to sum up individual section progresses. [Source: services/course/app/models/course_progress.rb]",
        "interaction_3": "Uses `AlternativeSectionProgress` to determine the best alternative section for calculation. [Source: services/course/app/models/course_progress.rb]",
        "interaction_4": "Belongs to Course.",
        "interaction_5": "Has one FixedLearningEvaluation.",
        "interaction_6": "Aggregates data from SectionProgress records."
      },
      "techDebt": [
        "Fixed-point arithmetic (_fpoints) adds complexity to calculations and requires careful handling."
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/course_progress.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "FixedLearningEvaluation": {
      "type": "Model",
      "description": "Stores legacy learning evaluation data, typically from older platforms, and is considered read-only.",
      "interactions": {
        "interaction_0": "Belongs to Course."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/fixed_learning_evaluation.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ItemStatistics": {
      "type": "Service",
      "description": "A decorator-enabled service object that calculates various statistics for a given Item, such as total submissions, perfect submissions, max points, average points, and submissions over time.",
      "interactions": {
        "interaction_0": "Initializes with an Item.",
        "interaction_1": "Queries Result records associated with the item."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/item_statistics.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "LearningEvaluation (Module)": {
      "type": "Module/Strategy Pattern",
      "description": "Provides a strategy pattern for selecting the appropriate learning evaluation implementation (Dynamic, Persisted, SoftLaunch, Null) based on request parameters and configuration.",
      "interactions": {
        "interaction_0": "Uses Xikolo.config for configuration.",
        "interaction_1": "SoftLaunch uses Scientist gem for A/B testing/comparison of implementations.",
        "interaction_2": "Delegates to Dynamic, Persisted, or Null classes."
      },
      "techDebt": [
        "The SoftLaunch#ignore block contains specific logic to ignore mismatches in legacy courses or due to off-by-one visit counts, which might require careful maintenance."
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/learning_evaluation.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Result": {
      "type": "Model",
      "description": "Stores a user's result (dpoints) for a specific learning item. Manages callbacks for publishing events and updating progress.",
      "interactions": {
        "interaction_0": "Belongs to Item.",
        "interaction_1": "Publishes Msgr events.",
        "interaction_2": "Triggers EnrollmentCompletionWorker, NextDate::ItemSubmissionPublishingCreateWorker, LearningEvaluation::UpdateSectionProgressWorker."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/result.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "SectionProgress": {
      "type": "Model",
      "description": "Stores and calculates a user's progress within a course section, including visits, points, and exercise counts. Handles logic for alternative sections and proctored enrollments.",
      "interactions": {
        "interaction_0": "Belongs to Section.",
        "interaction_1": "Triggers LearningEvaluation::UpdateCourseProgressWorker on destroy.",
        "interaction_2": "Queries Result and Visit models.",
        "interaction_3": "Uses Structure::UserItemsSelector and AlternativeSectionProgress."
      },
      "techDebt": [
        "The sum_dpoints_for method includes complex SQL for ordering results based on proctoring status."
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/section_progress.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Stat": {
      "type": "Service",
      "description": "A plain Ruby object that aggregates various course-level and global statistics (enrollments, shows/no-shows, progress, certificates) based on a key parameter.",
      "interactions": {
        "interaction_0": "Initializes with attributes including course_id and key.",
        "interaction_1": "Queries Course, Enrollment, Visit, Result, FixedLearningEvaluation models."
      },
      "techDebt": [
        "The initialize method uses a large case statement to delegate to different private methods, which could be refactored using a more explicit strategy pattern or separate service objects for each 'key'.",
        "The global_stats method performs Enrollment.count and Course.count without specific scopes, potentially leading to performance issues or unintended global counts."
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/stat.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Visit": {
      "type": "Model",
      "description": "Records a user's visit to a specific learning item, primarily tracking the updated_at timestamp for the last visit.",
      "interactions": {
        "interaction_0": "Belongs to Item.",
        "interaction_1": "Publishes Msgr events on touch/create.",
        "interaction_2": "Triggers EnrollmentCompletionWorker, LearningEvaluation::UpdateSectionProgressWorker."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/visit.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseProgress::Calculate": {
      "type": "Operation",
      "description": "An operation to calculate and persist a user's `CourseProgress` for a specific course. It handles race conditions during creation. [Source: services/course/app/operations/course_progress/calculate.rb]",
      "interactions": {
        "interaction_0": "Finds or creates a `CourseProgress` record. [Source: services/course/app/operations/course_progress/calculate.rb]",
        "interaction_1": "Calls `calculate!` on the `CourseProgress` instance. [Source: services/course/app/operations/course_progress/calculate.rb]",
        "interaction_2": "Interacts with CourseProgress model."
      },
      "techDebt": [
        "The rescue ActiveRecord::RecordNotUnique with retry is a common pattern for race conditions but should be monitored for excessive retries."
      ],
      "provenance": {
        "sources": [
          "services/course/app/operations/course_progress/calculate.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "SectionProgress::Calculate": {
      "type": "Operation",
      "description": "Encapsulates the logic for finding or creating a SectionProgress record and triggering its calculate! method. Includes an optimization to skip recalculation if the record is not stale. Triggers LearningEvaluation::UpdateCourseProgressWorker.",
      "interactions": {
        "interaction_0": "Interacts with SectionProgress model.",
        "interaction_1": "Triggers LearningEvaluation::UpdateCourseProgressWorker."
      },
      "techDebt": [
        "The rescue ActiveRecord::RecordNotUnique with retry is a common pattern for race conditions but should be monitored for excessive retries."
      ],
      "provenance": {
        "sources": [
          "services/course/app/operations/section_progress/calculate.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "learning_evaluation.rake:compare": {
      "type": "Rake Task",
      "description": "A development/debugging task to compare the output of the Dynamic and Persisted learning evaluation implementations for a given enrollment.",
      "interactions": {
        "interaction_0": "Uses Enrollment model.",
        "interaction_1": "Uses LearningEvaluation module (Dynamic and Persisted implementations)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/lib/tasks/learning_evaluation.rake",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "stats.rake:no_shows": {
      "type": "Rake Task",
      "description": "Generates a CSV-like output of 'no show' statistics for courses, calculating enrollments and visits within different timeframes relative to course start/end dates.",
      "interactions": {
        "interaction_0": "Queries Course, Enrollment, and Visit models."
      },
      "techDebt": [
        "The rubocop:disable comments indicate bypassed style rules, suggesting potentially long or complex lines of code.",
        "The output format is simple CSV to stdout, which might be less flexible than a dedicated reporting mechanism."
      ],
      "provenance": {
        "sources": [
          "services/course/lib/tasks/stats.rake",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseConsumer": {
      "type": "Consumer",
      "description": "A RabbitMQ consumer responsible for handling course-related messages, specifically for cloning courses. It acknowledges messages to prevent multiple nodes from processing the same job. [Source: services/course/app/consumers/course_consumer.rb]",
      "interactions": {
        "interaction_0": "Processes `clone` messages from RabbitMQ. [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_1": "Delegates course cloning logic to `Course::Clone`. [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_2": "Inherits from Msgr::Consumer. [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_3": "Receives messages from RabbitMQ (via Msgr). [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_4": "Invokes Course::Clone (service object). [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_5": "Receives `clone` messages from RabbitMQ with `old_course_id` and `new_course_code` in the payload. [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_6": "Invokes `Course::Clone.call` with the provided course IDs. [Source: services/course/app/consumers/course_consumer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/consumers/course_consumer.rb",
          "cluster:03_CORE_CourseService",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "03_CORE_CourseService",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "AchievementsController": {
      "type": "Controller",
      "description": "Handles API requests related to user achievements within a course. It uses `Responders` for API formatting, decoration, and HTTP caching. [Source: services/course/app/controllers/achievements_controller.rb]",
      "interactions": {
        "interaction_0": "Responds to `GET /achievements` to list achievements for a given course and user. [Source: services/course/app/controllers/achievements_controller.rb]",
        "interaction_1": "Sets locale based on `http_accept_language`. [Source: services/course/app/controllers/achievements_controller.rb]",
        "interaction_2": "Interacts with `Achievements` (model not provided in chunk) to retrieve data. [Source: services/course/app/controllers/achievements_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/achievements_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ChannelsController": {
      "type": "Controller",
      "description": "Manages `Channel` resources, providing API endpoints for listing, viewing, creating, updating, and destroying channels. It supports filtering channels by public status, highlight status, and code. [Source: services/course/app/controllers/channels_controller.rb]",
      "interactions": {
        "interaction_0": "Manages CRUD operations for `Channel` models. [Source: services/course/app/controllers/channels_controller.rb]",
        "interaction_1": "Uses `UUID4` for generating new channel IDs. [Source: services/course/app/controllers/channels_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/channels_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ClassifiersController": {
      "type": "Controller",
      "description": "Handles API requests for `Classifier` resources, allowing listing and viewing of individual classifiers. It supports filtering by cluster ID and a search query. [Source: services/course/app/controllers/classifiers_controller.rb]",
      "interactions": {
        "interaction_0": "Retrieves `Classifier` records based on various filters. [Source: services/course/app/controllers/classifiers_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/classifiers_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CoursesController": {
      "type": "Controller",
      "description": "The primary controller for managing `Course` resources. It provides extensive filtering capabilities for listing courses, as well as endpoints for showing, creating, updating, and destroying courses. [Source: services/course/app/controllers/courses_controller.rb] It integrates with `Enrollment` for user-specific course listings and `Classifier` for categorization. [Source: services/course/app/controllers/courses_controller.rb, docs/app/features/courses/classifiers.md]",
      "interactions": {
        "interaction_0": "Manages CRUD operations for `Course` models. [Source: services/course/app/controllers/courses_controller.rb]",
        "interaction_1": "Filters courses by `cat_id` (classifier), `user_id` (enrollment status), `status`, `lang`, `course_code`, `channel_id`, `document_id`, `upcoming`, `current`, `finished`, `public`, `hidden`, `only_hidden`, `exclude_external`, `latest_first`, `alphabetic`, `promoted_for`, `not_enrolled`, `autocomplete`, `active_after`, and `sort` parameters. [Source: services/course/app/controllers/courses_controller.rb]",
        "interaction_2": "Delegates course creation to `Course::Create.call` and updates to `Course::Update.call`. [Source: services/course/app/controllers/courses_controller.rb]",
        "interaction_3": "Delegates course destruction to `Course::Destroy.call`. [Source: services/course/app/controllers/courses_controller.rb]",
        "interaction_4": "Interacts with `Enrollment` to filter courses based on user enrollment status. [Source: services/course/app/controllers/courses_controller.rb]",
        "interaction_5": "Interacts with `Cluster` to validate classifier parameters. [Source: services/course/app/controllers/courses_controller.rb]"
      },
      "techDebt": [
        "The `index` method contains a very large number of conditional filters, which could be refactored into a more modular query object pattern for better readability and maintainability. [Source: services/course/app/controllers/courses_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/courses_controller.rb",
          "docs/app/features/courses/classifiers.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "EnrollmentsController": {
      "type": "Controller",
      "description": "Manages `Enrollment` resources, providing API endpoints for listing, viewing, creating, updating, and destroying enrollments. It supports filtering enrollments by course, user, and completion status. [Source: services/course/app/controllers/enrollments_controller.rb]",
      "interactions": {
        "interaction_0": "Manages CRUD operations for `Enrollment` models. [Source: services/course/app/controllers/enrollments_controller.rb]",
        "interaction_1": "Filters enrollments by `course_id`, `user_id`, `learning_evaluation`, `deleted`, `current_course`, and `proctored`. [Source: services/course/app/controllers/enrollments_controller.rb]",
        "interaction_2": "Delegates enrollment creation to `Enrollment::Create.call`, updates to `Enrollment::Update.call`, and deletion to `Enrollment::Delete.call`. [Source: services/course/app/controllers/enrollments_controller.rb]",
        "interaction_3": "Interacts with `Course` to find the relevant course for an enrollment. [Source: services/course/app/controllers/enrollments_controller.rb]",
        "interaction_4": "Uses `LearningEvaluation.by_params` for filtering. [Source: services/course/app/controllers/enrollments_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/enrollments_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "NextDatesController": {
      "type": "Controller",
      "description": "Manages `NextDate` resources, providing an API endpoint to list upcoming dates relevant to a user or course. It supports filtering by resource type and date type. [Source: services/course/app/controllers/next_dates_controller.rb]",
      "interactions": {
        "interaction_0": "Retrieves `NextDate` records, filtering by `user_id`, `course_id`, `resource_type`, and `type`. [Source: services/course/app/controllers/next_dates_controller.rb]",
        "interaction_1": "Interacts with `Enrollment` and `Course` to determine the course filter for a user. [Source: services/course/app/controllers/next_dates_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/next_dates_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "PrerequisiteStatusController": {
      "type": "Controller",
      "description": "Provides an API endpoint to check the fulfillment status of course prerequisites for a given user. If prerequisites are met, it triggers a background job to create group memberships. [Source: services/course/app/controllers/prerequisite_status_controller.rb, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Responds to `GET /prerequisite_status` with the fulfillment status. [Source: services/course/app/controllers/prerequisite_status_controller.rb]",
        "interaction_1": "Interacts with `Course` to retrieve prerequisites. [Source: services/course/app/controllers/prerequisite_status_controller.rb]",
        "interaction_2": "Uses `Prerequisites` to determine the status for a user. [Source: services/course/app/controllers/prerequisite_status_controller.rb]",
        "interaction_3": "Triggers `EnrollmentGroupWorker.perform_async` if prerequisites are fulfilled. [Source: services/course/app/controllers/prerequisite_status_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/prerequisite_status_controller.rb",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ProgressesController": {
      "type": "Controller",
      "description": "Calculates and returns the progress of a user within a course, including section-level and overall course progress. It aggregates data from items, results, and visits. [Source: services/course/app/controllers/progresses_controller.rb]",
      "interactions": {
        "interaction_0": "Responds to `GET /progresses` with detailed progress information. [Source: services/course/app/controllers/progresses_controller.rb]",
        "interaction_1": "Interacts with `Course`, `Section`, `Item`, `Result`, and `SectionChoice` models. [Source: services/course/app/controllers/progresses_controller.rb]",
        "interaction_2": "Uses `Structure::UserItemsSelector` for courses with content trees. [Source: services/course/app/controllers/progresses_controller.rb]",
        "interaction_3": "Constructs `Progress` objects for decoration. [Source: services/course/app/controllers/progresses_controller.rb]"
      },
      "techDebt": [
        "The `index` method contains complex SQL queries and Ruby logic for aggregating progress, which could be challenging to maintain and optimize. [Source: services/course/app/controllers/progresses_controller.rb]",
        "The `alternatives_rating` method is marked with `rubocop:enable all` and `rubocop:disable all`, indicating a known area of complex or potentially non-standard code. [Source: services/course/app/controllers/progresses_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/progresses_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ReactivationsController": {
      "type": "Controller",
      "description": "Handles the creation of course reactivations for enrollments. It prevents reactivation if an enrollment is already active, unless explicitly extending. [Source: services/course/app/controllers/reactivations_controller.rb, docs/app/features/reactivation.md]",
      "interactions": {
        "interaction_0": "Responds to `POST /reactivations` to reactivate an enrollment. [Source: services/course/app/controllers/reactivations_controller.rb]",
        "interaction_1": "Interacts with `Enrollment` to find the target enrollment. [Source: services/course/app/controllers/reactivations_controller.rb]",
        "interaction_2": "Delegates reactivation logic to `Enrollment::Reactivate.call`. [Source: services/course/app/controllers/reactivations_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/reactivations_controller.rb",
          "docs/app/features/reactivation.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "RepetitionSuggestionsController": {
      "type": "Controller",
      "description": "Provides API endpoints for suggesting items for repetition based on user results and performance. It filters items where the user's score is below a certain percentage. [Source: services/course/app/controllers/repetition_suggestions_controller.rb]",
      "interactions": {
        "interaction_0": "Responds to `GET /repetition_suggestions` with a list of suggested items. [Source: services/course/app/controllers/repetition_suggestions_controller.rb]",
        "interaction_1": "Queries `Result` and `Item` models to identify repetition candidates. [Source: services/course/app/controllers/repetition_suggestions_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/repetition_suggestions_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "SectionChoicesController": {
      "type": "Controller",
      "description": "Manages `SectionChoice` resources, allowing users to select alternative sections within a course. [Source: services/course/app/controllers/section_choices_controller.rb]",
      "interactions": {
        "interaction_0": "Responds to `GET /section_choices` to list choices for a user/section. [Source: services/course/app/controllers/section_choices_controller.rb]",
        "interaction_1": "Responds to `POST /section_choices` to create or update a user's section choice. [Source: services/course/app/controllers/section_choices_controller.rb]",
        "interaction_2": "Interacts with `SectionChoice` model. [Source: services/course/app/controllers/section_choices_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/section_choices_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "TeachersController": {
      "type": "Controller",
      "description": "Manages `Teacher` resources, providing API endpoints for listing, viewing, creating, and updating teacher profiles. It supports associating teachers with courses and handling picture uploads. [Source: services/course/app/controllers/teachers_controller.rb]",
      "interactions": {
        "interaction_0": "Manages CRUD operations for `Teacher` models. [Source: services/course/app/controllers/teachers_controller.rb]",
        "interaction_1": "Filters teachers by `course`, `user_id`, and `query`. [Source: services/course/app/controllers/teachers_controller.rb]",
        "interaction_2": "Handles picture uploads via URI or ID, interacting with `Xikolo::S3` and `FileDeletionWorker`. [Source: services/course/app/controllers/teachers_controller.rb]"
      },
      "techDebt": [
        "The `upload_via_uri` and `upload_via_id` methods contain significant logic for S3 interactions and error handling, which could potentially be extracted into a dedicated service object for cleaner controller code. [Source: services/course/app/controllers/teachers_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/teachers_controller.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "AlternativeSectionProgress": {
      "type": "Model/Service",
      "description": "Calculates and sets the 'best alternative' section for a user within a parent section that offers multiple alternative child sections. This is used for course progress calculation. [Source: services/course/app/models/alternative_section_progress.rb]",
      "interactions": {
        "interaction_0": "Interacts with `SectionProgress` to find and update progress records. [Source: services/course/app/models/alternative_section_progress.rb]",
        "interaction_1": "Interacts with `Section` to get children and their goals. [Source: services/course/app/models/alternative_section_progress.rb]"
      },
      "techDebt": [
        "The `best_alternative` method's ranking logic is calculated in memory, which is noted as 'fine for the limited number of alternative sections' but could become a performance concern with many alternatives. [Source: services/course/app/models/alternative_section_progress.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/alternative_section_progress.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Branch": {
      "type": "Model",
      "description": "Represents a specific branch within a content test, linking to a `Duplicated::Group` and a `Fork`. It automatically attaches a `Structure::Branch` node on creation. [Source: services/course/app/models/branch.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Duplicated::Group` and `Fork`. [Source: services/course/app/models/branch.rb]",
        "interaction_1": "Has one `Structure::Branch` node, which is destroyed on deletion. [Source: services/course/app/models/branch.rb]",
        "interaction_2": "Creates a `Structure::Branch` node after creation. [Source: services/course/app/models/branch.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/branch.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Channel": {
      "type": "Model",
      "description": "Represents a categorization or 'channel' for courses. It includes file references for logos and visuals, and handles their deletion from S3. [Source: services/course/app/models/channel.rb]",
      "interactions": {
        "interaction_0": "Has many `Course`s. [Source: services/course/app/models/channel.rb]",
        "interaction_1": "Uses `FileReference` concern for S3 integration. [Source: services/course/app/models/channel.rb]",
        "interaction_2": "Interacts with `Xikolo::S3` to manage associated files. [Source: services/course/app/models/channel.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/channel.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Classifier": {
      "type": "Model",
      "description": "Used to annotate courses for organization and discoverability, grouped into `Cluster`s. It has a title, belongs to a cluster, and can be translated. [Source: services/course/app/models/classifier.rb, docs/app/features/courses/classifiers.md]",
      "interactions": {
        "interaction_0": "Has and belongs to many `Course`s. [Source: services/course/app/models/classifier.rb]",
        "interaction_1": "Belongs to `Cluster`. [Source: services/course/app/models/classifier.rb]",
        "interaction_2": "Triggers `UpdateCourseSearchIndexWorker` on update or destroy to keep course search data current. [Source: services/course/app/models/classifier.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/classifier.rb",
          "docs/app/features/courses/classifiers.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Cluster": {
      "type": "Model",
      "description": "Groups `Classifier`s, allowing courses to be tagged along multiple dimensions (e.g., 'level of difficulty', 'topic'). Clusters can be visible or hidden. [Source: services/course/app/models/cluster.rb, docs/app/features/courses/classifiers.md]",
      "interactions": {
        "interaction_0": "Has many `Classifier`s. [Source: services/course/app/models/cluster.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/cluster.rb",
          "docs/app/features/courses/classifiers.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "ContentTest": {
      "type": "Model",
      "description": "Manages A/B tests for course content. It defines groups for users and assigns them in a round-robin fashion to ensure even distribution. [Source: services/course/app/models/content_test.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Course`. [Source: services/course/app/models/content_test.rb]",
        "interaction_1": "Has many `Fork`s. [Source: services/course/app/models/content_test.rb]",
        "interaction_2": "Interacts with `Duplicated::Group` and `Duplicated::Membership` to manage user groups and assignments. [Source: services/course/app/models/content_test.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/content_test.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseGoals": {
      "type": "Model/Service",
      "description": "Calculates the maximum achievable visits and points for a given course, considering only published and mandatory items within non-alternative sections. [Source: services/course/app/models/course_goals.rb]",
      "interactions": {
        "interaction_0": "Interacts with `Course`, `Section`, and `Item` models to aggregate data. [Source: services/course/app/models/course_goals.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/course_goals.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseProvider": {
      "type": "Model",
      "description": "Manages external course providers, including their configuration and synchronization status. It triggers background jobs to sync courses with enabled providers. [Source: services/course/app/models/course_provider.rb]",
      "interactions": {
        "interaction_0": "Triggers `CourseProviderWorker` to perform synchronization for enabled providers. [Source: services/course/app/models/course_provider.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/course_provider.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseSet": {
      "type": "Model",
      "description": "A simple data structure to group courses, identified by a name. Used in conjunction with `CourseSetRelation` to define course tracks and prerequisites. [Source: services/course/app/models/course_set.rb, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Has many `CourseSetEntry`s and `Course`s (through entries). [Source: services/course/app/models/course_set.rb]",
        "interaction_1": "Has many `CourseSetRelation`s (as source sets) and `linked_sets` (as target sets). [Source: services/course/app/models/course_set.rb]",
        "interaction_2": "Holds `Course` instances as `course set entries`. ",
        "interaction_3": "Used as source or target in `CourseSetRelation`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/course_set.rb",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseSetEntry": {
      "type": "Model",
      "description": "A join table that links `CourseSet`s to `Course`s, forming the entries within a course set. [Source: services/course/app/models/course_set_entry.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Course` and `CourseSet`. [Source: services/course/app/models/course_set_entry.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/course_set_entry.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseSetRelation": {
      "type": "Model",
      "description": "Defines directed connections between `CourseSet`s, specifying a source set, a target set, and a 'kind' (e.g., `requires_roa`, `requires_cop`). [Source: services/course/app/models/course_set_relation.rb, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Belongs to `source_set` and `target_set` (both `CourseSet`s). [Source: services/course/app/models/course_set_relation.rb]",
        "interaction_1": "Has many `target_courses` through the target set. [Source: services/course/app/models/course_set_relation.rb]",
        "interaction_2": "Connects a `source_set` to a `target_set`. ",
        "interaction_3": "Specifies the `kind` of relation (e.g., `requires_cop`, `requires_roa`). "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/course_set_relation.rb",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Fork": {
      "type": "Model",
      "description": "Represents a content fork within a `ContentTest`, linking a `Section` to a specific test. It automatically creates `Branch`es for each group defined in the content test. [Source: services/course/app/models/fork.rb]",
      "interactions": {
        "interaction_0": "Belongs to `ContentTest` and `Section`. [Source: services/course/app/models/fork.rb]",
        "interaction_1": "Has many `Branch`es. [Source: services/course/app/models/fork.rb]",
        "interaction_2": "Has one `Structure::Fork` node. [Source: services/course/app/models/fork.rb]",
        "interaction_3": "Creates a `Structure::Fork` node and `Branch`es after creation. [Source: services/course/app/models/fork.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/fork.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Item": {
      "type": "Model",
      "description": "Represents an individual learning content unit within a `Section`. It includes attributes for title, content type, dates, publication status, and exercise-specific details. It supports 'open mode' for video content. [Source: services/course/app/models/item.rb, docs/app/features/courses/open_mode.md]",
      "interactions": {
        "interaction_0": "Belongs to `Section`. [Source: services/course/app/models/item.rb]",
        "interaction_1": "Has one `Structure::Item` node. [Source: services/course/app/models/item.rb]",
        "interaction_2": "Has many `Result`s (user_results) and `Visit`s (user_visits). [Source: services/course/app/models/item.rb]",
        "interaction_3": "Has many `Document`s (through `documents_items`). [Source: services/course/app/models/item.rb]",
        "interaction_4": "Uses `paper_trail` for versioning. [Source: services/course/app/models/item.rb]",
        "interaction_5": "Publishes `xikolo.course.item.create`, `xikolo.course.item.update`, `xikolo.course.item.destroy` events via `Msgr`. [Source: services/course/app/models/item.rb]",
        "interaction_6": "Triggers `NextDate::ItemSubmissionDeadlineSyncWorker` and `NextDate::ItemSubmissionPublishingSyncWorker` on commit. [Source: services/course/app/models/item.rb]",
        "interaction_7": "Marks its `Section` and `Course` for recalculation on relevant changes. [Source: services/course/app/models/item.rb]"
      },
      "techDebt": [
        "The `mark_for_recalculation!` method contains `rubocop:disable Rails/SkipsModelValidations` comments, indicating direct attribute updates without full validation. [Source: services/course/app/models/item.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/item.rb",
          "docs/app/features/courses/open_mode.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "NextDate": {
      "type": "Model",
      "description": "Manages scheduled dates related to courses, sections, and items. It supports general and user-specific dates, and provides logic for filtering active and relevant dates. [Source: services/course/app/models/next_date.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Course`. [Source: services/course/app/models/next_date.rb]",
        "interaction_1": "Referenced by `resource_type` and `resource_id` to link to courses, sections, or items. ",
        "interaction_2": "Visibility controlled by `user_id` (general vs. user-specific) and `visible_after`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/next_date.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Prerequisites": {
      "type": "Model/Service",
      "description": "Encapsulates the logic for determining if a user has fulfilled the prerequisites for a course. It evaluates `CourseSetRelation`s of kind `requires_roa` or `requires_cop`. [Source: services/course/app/models/prerequisites.rb, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Interacts with `CourseSetRelation` to retrieve prerequisite relations. [Source: services/course/app/models/prerequisites.rb]",
        "interaction_1": "Uses nested `UserStatus`, `CopStatus`, and `RoaStatus` classes to evaluate fulfillment. [Source: services/course/app/models/prerequisites.rb]",
        "interaction_2": "Interacts with `Enrollment` and `LearningEvaluation` to check user's progress in target courses. [Source: services/course/app/models/prerequisites.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/prerequisites.rb",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Progress": {
      "type": "Transient Object",
      "description": "A transient object used to represent and decorate the progress for a `Section` or `Course`. It aggregates visited items and results. [Source: services/course/app/models/progress.rb]",
      "interactions": {
        "interaction_0": "Initialized with a resource (Course or Section), items, and results. [Source: services/course/app/models/progress.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/progress.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Relation": {
      "type": "Model",
      "description": "An alias for `CourseSetRelation`, used to define connections between course sets for prerequisite tracking. [Source: services/course/app/models/relation.rb, docs/app/features/courses/relations.md]",
      "interactions": {
        "interaction_0": "Inherits from `CourseSetRelation`. [Source: services/course/app/models/relation.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/relation.rb",
          "docs/app/features/courses/relations.md",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Section": {
      "type": "Model",
      "description": "Organizes `Item`s within a `Course`. Sections can be published, available, optional, mandatory, and can be part of an alternative section structure (parent/child). [Source: services/course/app/models/section.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Course`. [Source: services/course/app/models/section.rb]",
        "interaction_1": "Has one `Structure::Section` node. [Source: services/course/app/models/section.rb]",
        "interaction_2": "Has many `Item`s and `Fork`s. [Source: services/course/app/models/section.rb]",
        "interaction_3": "Has many `SectionProgress`es. [Source: services/course/app/models/section.rb]",
        "interaction_4": "Can have `parent` and `children` sections for alternative content. [Source: services/course/app/models/section.rb]",
        "interaction_5": "Triggers `NextDate::SectionStartSyncWorker`, `NextDate::ItemSubmissionDeadlineSyncWorker`, and `NextDate::ItemSubmissionPublishingSyncWorker` on commit. [Source: services/course/app/models/section.rb]",
        "interaction_6": "Marks itself and its `Course` for recalculation on relevant changes. [Source: services/course/app/models/section.rb]"
      },
      "techDebt": [
        "The `mark_for_recalculation!` method contains `rubocop:disable Rails/SkipsModelValidations` comments, indicating direct attribute updates without full validation. [Source: services/course/app/models/section.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/section.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "SectionChoice": {
      "type": "Model",
      "description": "Records a user's selection of alternative sections within a course. It stores an array of chosen section IDs. [Source: services/course/app/models/section_choice.rb]",
      "interactions": {
        "interaction_0": "Belongs to `Section`. [Source: services/course/app/models/section_choice.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/section_choice.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "SectionGoals": {
      "type": "Model/Service",
      "description": "Calculates the maximum achievable visits and points for a given section, considering only published and mandatory items relevant to a specific user (especially for courses with a content tree). [Source: services/course/app/models/section_goals.rb]",
      "interactions": {
        "interaction_0": "Interacts with `Section` and `Item` models. [Source: services/course/app/models/section_goals.rb]",
        "interaction_1": "Uses `Structure::UserItemsSelector` for courses with content trees. [Source: services/course/app/models/section_goals.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/section_goals.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Teacher": {
      "type": "Model",
      "description": "Represents a teacher or instructor associated with courses. It includes name, description, and handles picture uploads to S3. [Source: services/course/app/models/teacher.rb]",
      "interactions": {
        "interaction_0": "Has many `Course`s (via `teacher_ids` array column on Course). [Source: services/course/app/models/teacher.rb]",
        "interaction_1": "Interacts with `Xikolo::S3` for picture uploads and `FileDeletionWorker` for cleanup. [Source: services/course/app/models/teacher.rb]",
        "interaction_2": "Triggers `UpdateCourseSearchIndexWorker` on name changes to update associated courses. [Source: services/course/app/models/teacher.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/teacher.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Section::Destroy": {
      "type": "Operation",
      "description": "An operation to destroy a `Section`. If the section is a 'parent' alternative section, it recursively destroys all its 'child' alternative sections first. [Source: services/course/app/operations/section/destroy.rb]",
      "interactions": {
        "interaction_0": "Recursively calls itself to destroy child sections if the target section is a parent. [Source: services/course/app/operations/section/destroy.rb]",
        "interaction_1": "Calls `destroy` on the `Section` instance within a transaction. [Source: services/course/app/operations/section/destroy.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/operations/section/destroy.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "CourseProviderWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job that synchronizes course data with external course providers. It dynamically loads the appropriate adapter based on the provider type. [Source: services/course/app/workers/course_provider_worker.rb]",
      "interactions": {
        "interaction_0": "Finds the `Course` by ID. [Source: services/course/app/workers/course_provider_worker.rb]",
        "interaction_1": "Instantiates and calls `sync` on a `#{type}::Adapter` (e.g., `Lti::Adapter`). [Source: services/course/app/workers/course_provider_worker.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/workers/course_provider_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "EnrollmentCompletionWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job that processes enrollments for a given course (or a specific user within a course) to determine if they are completed and publishes an `xikolo.course.enrollment.completed` event. [Source: services/course/app/workers/enrollment_completion_worker.rb]",
      "interactions": {
        "interaction_0": "Finds the `Course` and relevant `Enrollment`s. [Source: services/course/app/workers/enrollment_completion_worker.rb]",
        "interaction_1": "Uses `Enrollment.with_learning_evaluation` to get completion data. [Source: services/course/app/workers/enrollment_completion_worker.rb]",
        "interaction_2": "Publishes `xikolo.course.enrollment.completed` event via `Msgr`. [Source: services/course/app/workers/enrollment_completion_worker.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/workers/enrollment_completion_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "EnrollmentGroupWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job that creates a membership for a user in the course's student group, typically triggered when prerequisites are fulfilled. [Source: services/course/app/workers/enrollment_group_worker.rb]",
      "interactions": {
        "interaction_0": "Finds the `Enrollment` by course and user ID. [Source: services/course/app/workers/enrollment_group_worker.rb]",
        "interaction_1": "Calls `create_membership!` on the enrollment, which interacts with the `account` service. [Source: services/course/app/workers/enrollment_group_worker.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/workers/enrollment_group_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "PersistRankingWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job that calculates and persists the quantile (ranking) and quantiled user dpoints for enrollments within a course. It only ranks users who meet the course's RoA threshold percentage. [Source: services/course/app/workers/persist_ranking_worker.rb]",
      "interactions": {
        "interaction_0": "Updates `Enrollment` records, clearing previous quantiles. [Source: services/course/app/workers/persist_ranking_worker.rb]",
        "interaction_1": "Uses `Enrollment.with_learning_evaluation` to get current scores. [Source: services/course/app/workers/persist_ranking_worker.rb]",
        "interaction_2": "Calculates quantiles using SQL window functions. [Source: services/course/app/workers/persist_ranking_worker.rb]",
        "interaction_3": "Interacts with `Course` to get `roa_threshold_percentage`. [Source: services/course/app/workers/persist_ranking_worker.rb]"
      },
      "techDebt": [
        "The worker uses `rubocop:disable Rails/SkipsModelValidations` for `update_all`, which bypasses ActiveRecord callbacks and validations. [Source: services/course/app/workers/persist_ranking_worker.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/workers/persist_ranking_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "Structure::CreateCourseContentTreeWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job to create the course content tree (`Structure` nodes) for courses that do not yet have them. This is intended to ease migration from legacy course structures. [Source: services/course/app/workers/structure/create_course_content_tree_worker.rb]",
      "interactions": {
        "interaction_0": "Finds the `Course` by identifier. [Source: services/course/app/workers/structure/create_course_content_tree_worker.rb]",
        "interaction_1": "Creates `Structure::Root` node for the course. [Source: services/course/app/workers/structure/create_course_content_tree_worker.rb]",
        "interaction_2": "Iterates through `Section`s and `Item`s to create corresponding `Structure::Section` and `Structure::Item` nodes. [Source: services/course/app/workers/structure/create_course_content_tree_worker.rb]"
      },
      "techDebt": [
        "The worker raises exceptions if the course is not found or if the content tree already exists, which might indicate a need for more robust error handling or idempotent design. [Source: services/course/app/workers/structure/create_course_content_tree_worker.rb]"
      ],
      "provenance": {
        "sources": [
          "services/course/app/workers/structure/create_course_content_tree_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "UpdateCourseSearchIndexWorker": {
      "type": "Sidekiq Worker",
      "description": "A background job that updates the text search index for a specific course. [Source: services/course/app/workers/update_course_search_index_worker.rb]",
      "interactions": {
        "interaction_0": "Finds the `Course` by ID. [Source: services/course/app/workers/update_course_search_index_worker.rb]",
        "interaction_1": "Calls `update_search_index` on the `Course` instance. [Source: services/course/app/workers/update_course_search_index_worker.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/workers/update_course_search_index_worker.rb",
          "cluster:03_CORE_CourseService"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "03_CORE_CourseService"
        ]
      }
    },
    "DocumentsItem": {
      "type": "Model",
      "description": "A join table model connecting `Document` and `Item` records, defining a many-to-many relationship.",
      "interactions": {
        "interaction_0": "Belongs to `Document`.",
        "interaction_1": "Belongs to `Item`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/documents_item.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "DocumentsController": {
      "type": "Controller",
      "description": "API controller for managing `Document` resources. Provides CRUD operations and supports filtering documents by course, item, language, and tags.",
      "interactions": {
        "interaction_0": "Interacts with `Document` model for data access and manipulation.",
        "interaction_1": "Uses `ApplicationController` as its base.",
        "interaction_2": "Utilizes `Responders::ApiResponder`, `Responders::DecorateResponder`, `Responders::HttpCacheResponder`, `Responders::PaginateResponder` for API response formatting."
      },
      "techDebt": [
        "The `embed:` parameter in `respond_with` calls is present but empty, suggesting an incomplete or placeholder feature for embedding related resources."
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/documents_controller.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "DocumentLocalizationsController": {
      "type": "Controller",
      "description": "API controller for managing `DocumentLocalization` resources. Provides CRUD operations and supports filtering localizations by document.",
      "interactions": {
        "interaction_0": "Interacts with `DocumentLocalization` model for data access and manipulation.",
        "interaction_1": "Uses `ApplicationController` as its base.",
        "interaction_2": "Utilizes `Responders::ApiResponder`, `Responders::DecorateResponder`, `Responders::HttpCacheResponder`, `Responders::PaginateResponder` for API response formatting."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/document_localizations_controller.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "DocumentsTagsController": {
      "type": "Controller",
      "description": "API controller for retrieving all unique tags associated with documents.",
      "interactions": {
        "interaction_0": "Interacts with `Document.all_tags` to fetch tag data.",
        "interaction_1": "Uses `ApplicationController` as its base."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/controllers/documents_tags_controller.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Duplicated::Visual": {
      "type": "Model",
      "description": "Represents a visual asset (image or video) associated with a course, used primarily in the context of cloning or duplication. It maps to the `course_visuals` table.",
      "interactions": {
        "interaction_0": "Belongs to `Course`.",
        "interaction_1": "Optionally belongs to `Duplicated::Video`.",
        "interaction_2": "Interacts with `Xikolo::S3` to generate public URLs for images.",
        "interaction_3": "Used by `Course::Visual::Clone` operation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/duplicated/visual.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::Visual::Clone": {
      "type": "Operation",
      "description": "An application operation responsible for cloning visual assets (images, videos, and subtitles) from one course's visual to another. It handles S3 file copying and database record creation.",
      "interactions": {
        "interaction_0": "Takes `Duplicated::Visual` and `Course` objects as input.",
        "interaction_1": "Interacts with `Xikolo::S3` to copy image files.",
        "interaction_2": "Creates/updates `Course::Visual` and `Course::Video` records.",
        "interaction_3": "Clones `Subtitle` records associated with videos.",
        "interaction_4": "Handles `ActiveRecord::RecordInvalid` and `ActiveRecord::RecordNotUnique` errors during cloning."
      },
      "techDebt": [
        "Silent `noop` error handling for `ActiveRecord::RecordInvalid` during image and video cloning can lead to incomplete visual data without explicit logging or user feedback."
      ],
      "provenance": {
        "sources": [
          "services/course/app/operations/course/visual/clone.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "FileDeletionWorker": {
      "type": "Worker",
      "description": "A Sidekiq background job responsible for asynchronously deleting files from S3 based on a provided URI.",
      "interactions": {
        "interaction_0": "Includes `Sidekiq::Job` module.",
        "interaction_1": "Interacts with `Xikolo::S3` to perform file deletion."
      },
      "techDebt": [
        "Catches `URI::InvalidURIError` but does not log or report it, potentially masking issues with invalid URIs being passed for deletion."
      ],
      "provenance": {
        "sources": [
          "services/course/app/workers/file_deletion_worker.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "FileReference": {
      "type": "Concern/Module",
      "description": "A module included in models that need to manage file references, typically integrating with S3 for storage.",
      "interactions": {
        "interaction_0": "Included in `DocumentLocalization` to handle file uploads and S3 key generation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/document_localization.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "PaperTrail": {
      "type": "Gem/Library",
      "description": "A gem used for versioning ActiveRecord models, tracking changes to records.",
      "interactions": {
        "interaction_0": "Included in `DocumentLocalization` to track changes."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/models/document_localization.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "PinboardService": {
      "type": "Microservice",
      "description": "An API-only Ruby on Rails microservice responsible for managing the core logic of the discussion board or pinboard feature. It provides API endpoints for creating, reading, updating, and deleting pinboard content, and handles interactions related to user discussions within the Xikolo platform.",
      "interactions": {
        "interaction_0": "Communicates with AccountService to retrieve user-related data .",
        "interaction_1": "Interacts with CourseService to link pinboard content to specific courses or learning contexts .",
        "interaction_2": "Sends requests to NotificationService to trigger notifications for pinboard activities (e.g., new posts, replies) .",
        "interaction_3": "Exposes an API for the main Xikolo::Web application or other clients ."
      },
      "techDebt": [
        "Lack of detailed code for analysis prevents identification of specific internal technical debt. General architectural debt might include tight coupling if direct HTTP calls are overused instead of asynchronous messaging for certain interactions ."
      ],
      "provenance": {
        "sources": [
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Xikolo::NotificationService": {
      "type": "Microservice",
      "description": "A dedicated Ruby on Rails API-only microservice responsible for processing notification events and sending emails across the Xikolo ecosystem. It acts as a central hub for all outgoing email communications.",
      "interactions": {
        "interaction_0": "Receives notification events from other Xikolo microservices (e.g., Account, Course, News, Pinboard) via RabbitMQ/Msgr. [Source: services/notification/README.md, services/notification/config/services.yml]",
        "interaction_1": "Sends email notifications to users based on processed events. [Source: services/notification/README.md]",
        "interaction_2": "Configured to know the endpoints of other services for potential resource linking or data fetching. [Source: services/notification/config/services.yml]"
      },
      "techDebt": [
        "Ensuring HTML emails render consistently across all email clients, especially Microsoft Outlook, is a known challenge requiring specific tooling and practices. [Source: services/notification/README.md]"
      ],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "services/notification/config/services.yml",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Notification Consumers": {
      "type": "Message Consumer",
      "description": "Classes within the NotificationService responsible for processing specific incoming Msgr messages. They parse event data and initiate the creation of notifications and subsequent email generation.",
      "interactions": {
        "interaction_0": "Receive messages from Msgr based on defined routes in `config/msgr.rb`. [Source: services/notification/README.md]",
        "interaction_1": "Create notification records and trigger email rendering processes. [Source: services/notification/README.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Notification Mail Templates": {
      "type": "View",
      "description": "Templates (located in `app/views/{de|en}`) used to render the content of email notifications. These templates are designed with specific styling considerations for email clients.",
      "interactions": {
        "interaction_0": "Rendered by the NotificationService when an email needs to be sent. [Source: services/notification/README.md]",
        "interaction_1": "Can be customized per brand using `assets/views/layouts` within brand-specific folders. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Premailer": {
      "type": "Gem/Library",
      "description": "A Ruby gem used to inline CSS styles into HTML email templates, a crucial step for ensuring consistent rendering across various email clients.",
      "interactions": {
        "interaction_0": "Processes rendered HTML email content to embed CSS directly into `style` attributes. [Source: services/notification/README.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Inky": {
      "type": "Gem/Library",
      "description": "A templating language and Ruby gem that translates simple HTML-like syntax into complex, table-based HTML structures optimized for email clients.",
      "interactions": {
        "interaction_0": "Used within mail templates to define email layouts and components. [Source: services/notification/README.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Foundation for Emails": {
      "type": "CSS Framework",
      "description": "A responsive email framework that provides a set of pre-built components and styling guidelines to create robust and visually appealing HTML emails.",
      "interactions": {
        "interaction_0": "Provides the underlying CSS and structural conventions used in conjunction with Inky for email templating. [Source: services/notification/README.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/notification/README.md",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "News (Data Entity)": {
      "type": "Model",
      "description": "Represents a news or announcement item, which can be either global (visible to all users) or specific to a particular course. This entity is persisted in PostgreSQL and managed by the `Xikolo::NewsService`. ",
      "interactions": {
        "interaction_0": "Created, read, updated, and deleted via the `Xikolo::NewsService` API. ",
        "interaction_1": "Potentially associated with `Course` entities from `Xikolo::CourseService`. ",
        "interaction_2": "Can trigger email notifications upon creation or update. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Email Notification Component": {
      "type": "Service Component",
      "description": "A component within the `Xikolo::NewsService` responsible for generating and sending email notifications related to news and announcements. It supports brand-specific customization of email layouts and stylesheets. ",
      "interactions": {
        "interaction_0": "Receives news content and recipient information from other parts of `Xikolo::NewsService`.",
        "interaction_1": "Utilizes custom templates and stylesheets located in `services/news/brand/<name>/assets/views/layouts` and `services/news/brand/<name>/assets/stylesheets` for branding. ",
        "interaction_2": "Likely uses `xikolo-sidekiq` for asynchronous email delivery. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "TimeEffortService": {
      "type": "Microservice",
      "description": "A dedicated microservice responsible for calculating and managing the estimated time effort associated with various course items. It aggregates data from other services to perform its core function.",
      "interactions": {
        "interaction_0": "Interacts with CourseService to retrieve course item details and structure. [Source: services/timeeffort/config/services.yml]",
        "interaction_1": "Interacts with QuizService to retrieve quiz-specific data relevant to time effort calculation. [Source: services/timeeffort/config/services.yml]",
        "interaction_2": "Interacts with MsgrConsumer. ",
        "interaction_3": "Interacts with TimeEffortAPI. ",
        "interaction_4": "Interacts with TimeEffortWorker. ",
        "interaction_5": "Interacts with Course Microservice (CourseService). ",
        "interaction_6": "Interacts with Quiz Service (QuizService). ",
        "interaction_7": "Stores data in PostgreSQL Database. "
      },
      "techDebt": [
        "The internal implementation details (e.g., specific API endpoints, data models, calculation logic) are not available for analysis, limiting a deeper understanding of its operational specifics. [Source: services/timeeffort/app/, services/timeeffort/config/]",
        "Specific calculation algorithms and data models are not visible, making it hard to assess efficiency or potential for improvement."
      ],
      "provenance": {
        "sources": [
          "services/timeeffort/config/services.yml",
          "services/timeeffort/README.rdoc",
          "services/timeeffort/app/",
          "services/timeeffort/config/",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "CourseService": {
      "type": "External Microservice",
      "description": "An external microservice that provides course-related data, such as course structure, items, and their attributes, which are consumed by the TimeEffortService.",
      "interactions": {
        "interaction_0": "Provides course item data to TimeEffortService for effort calculation. [Source: services/timeeffort/config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/timeeffort/config/services.yml",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "QuizService": {
      "type": "External Microservice",
      "description": "An external microservice that provides quiz-related data, such as quiz details or estimated completion times, which are consumed by the TimeEffortService.",
      "interactions": {
        "interaction_0": "Provides quiz data to TimeEffortService for effort calculation. [Source: services/timeeffort/config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/timeeffort/config/services.yml",
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Regrading Rake Tasks": {
      "type": "Operational Toolset",
      "description": "A collection of `rake` tasks providing administrative capabilities to modify quiz submission data and recalculate scores. These tasks are essential for correcting quiz results after changes to questions or answers.",
      "interactions": {
        "interaction_0": "Directly manipulates internal data models of the Quiz Service (e.g., questions, answers, submissions). ",
        "interaction_1": "Triggers updates to course results, likely through an interaction with the Course Service, via the `regrading:just_update_course` task. "
      },
      "techDebt": [
        "Manual execution via shell commands increases the risk of human error and requires direct access to the production environment. ",
        "Lack of an integrated UI for these operations could hinder usability and auditability for non-technical administrators. "
      ],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Xikolo::Common": {
      "type": "Gem",
      "description": "A foundational Ruby gem providing common utilities, shared libraries, and configurations for all Ruby-based services. It integrates Restify for inter-service communication and offers helpers for pagination and authentication. It also provides a mechanism for sending custom application metrics to Telegraf.",
      "interactions": {
        "interaction_0": "Installs and configures common libraries like Restify for HTTP communication between services. ",
        "interaction_1": "Sends custom application metrics to Telegraf via the `Xikolo.metrics` object for monitoring in Grafana. ",
        "interaction_2": "Provides authentication helpers for interacting with the Account service. ",
        "interaction_3": "Integrates `Restify` for HTTP communication with other services. ",
        "interaction_4": "Provides `Xikolo.metrics` object to send data to Telegraf for monitoring. ",
        "interaction_5": "Offers helpers for authentication with the account service. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "gems/xikolo-common/README.md",
          "cluster:40_INFRA_SystemCore",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "Xikolo::Config": {
      "type": "Gem",
      "description": "A Ruby gem acting as a simple key-value store for site-specific configuration. It reads values from YAML files, allowing environment-specific overrides for settings like brand, base URL, mail sender, and locales. It supports a hierarchical loading order for configuration files.",
      "interactions": {
        "interaction_0": "Reads configuration values from various YAML files (e.g., `config/xikolo.yml`, `/etc/xikolo.yml`) based on a defined merge order. ",
        "interaction_1": "Provides configuration settings (e.g., `Xikolo.brand`, `Xikolo.base_url`, `mailsender`) to other Xikolo components and services. ",
        "interaction_2": "Reads configuration from `xikolo.yml` files, respecting Rails environments. ",
        "interaction_3": "Provides `Xikolo.base_url` as an `Addressable::URI` object for URL generation. ",
        "interaction_4": "Integrates with Salt for managing instance-specific values in production. "
      },
      "techDebt": [
        "New configuration values should not be added without explicit team decision to maintain consistency and prevent sprawl. ",
        "Explicit instruction: 'Do not add new config values in this gem, unless explicitly decided by the team!' to prevent uncontrolled growth. "
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-config/README.md",
          "gems/xikolo-config/lib/xikolo/config.yml",
          "gems/xikolo-config/lib/xikolo/config.development.yml",
          "cluster:40_INFRA_SystemCore",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "Xikolo::Sidekiq": {
      "type": "Gem",
      "description": "A Ruby gem responsible for setting up Sidekiq in Rails projects, including Redis connection configuration and integration with ActiveJob. It also facilitates the scheduling of cron jobs via `sidekiq-cron` by parsing a dedicated `cron.yml` file.",
      "interactions": {
        "interaction_0": "Configures the Sidekiq Redis connection using `config/sidekiq_redis.yml` for environment-specific settings. ",
        "interaction_1": "Integrates Sidekiq with ActiveJob for consistent background job enqueueing. ",
        "interaction_2": "Loads and parses `config/cron.yml` to schedule periodic background jobs via `sidekiq-cron`. ",
        "interaction_3": "Manages the execution of background workers for various services. ",
        "interaction_4": "Configures Sidekiq Redis connection using `config/sidekiq_redis.yml`. ",
        "interaction_5": "Loads and parses `config/cron.yml` for `sidekiq-cron` job definitions. ",
        "interaction_6": "Integrates Sidekiq with ActiveJob. ",
        "interaction_7": "Configures Sidekiq to use Redis, with connection details from `config/sidekiq_redis.yml`. ",
        "interaction_8": "Integrates with ActiveJob for background processing. ",
        "interaction_9": "Loads cron job schedules from `config/cron.yml` for `sidekiq-cron`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "gems/xikolo-sidekiq/README.md",
          "Gemfile",
          "cluster:40_INFRA_SystemCore",
          "cluster:42_INFRA_BackgroundJobs",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "42_INFRA_BackgroundJobs",
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "RabbitMQ": {
      "type": "Message Broker",
      "description": "Provides asynchronous messaging capabilities for inter-service communication and background job queuing. Configured with health checks in Docker Compose.",
      "interactions": {
        "interaction_0": "Receives trace data from Mnemosyne instances across all applications and microservices. ",
        "interaction_1": "Configured via `XIKOLO_RABBITMQ_URL` environment variable. [Source: config/mnemosyne.yml]",
        "interaction_2": "Provides reliable message queuing for background processing and event-driven architectures. ",
        "interaction_3": "Used by `web-msgr` and `*-msgr` services for message processing.",
        "interaction_4": "Accessed by `DockerComposeWeb` and all `DockerComposeService` instances for message publishing/consuming.",
        "interaction_5": "Receives messages published by various Xikolo services and the main application. ",
        "interaction_6": "Routes and delivers messages to subscribing services and applications based on routing keys and queue configurations. [Source: config/msgr.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/msgr.rb",
          "config/mnemosyne.yml",
          "cluster:40_INFRA_SystemCore",
          "cluster:43_INFRA_ServiceCommunication",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "43_INFRA_ServiceCommunication",
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "GamificationController": {
      "type": "Controller/Handler",
      "description": "A component within the main Xikolo application responsible for processing gamification-related events received via RabbitMQ, such as user activity on pinboards or course results, to award experience points.",
      "interactions": {
        "interaction_0": "Subscribes to RabbitMQ messages with routing keys like `xikolo.pinboard.*` and `xikolo.course.result.create`. [Source: config/msgr.rb]",
        "interaction_1": "Processes specific events (e.g., `vote_create`, `question_create`, `answer_accepted`, `result_create`, `visit_create`) to trigger gamification logic. [Source: config/msgr.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/msgr.rb",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    "Database Schema": {
      "type": "Data Structure",
      "description": "Defines the structure of the PostgreSQL database, including tables, columns, data types, indexes, and constraints. It extensively leverages PostgreSQL-specific features like UUIDs, `jsonb`, `hstore`, custom enums, and a custom UUID generation function. Includes a denormalized view for courses.",
      "interactions": {
        "interaction_0": "Active Record ORM: Provides the Ruby interface for interacting with the database tables and views.",
        "interaction_1": "PostgreSQL Database: Implements the defined schema, extensions, enums, and functions.",
        "interaction_2": "Migration System: Applies and manages changes to the schema over time.",
        "interaction_3": "Custom UUID Generator (uuid_generate_v7ms): Utilizes this function for default primary key generation.",
        "interaction_4": "embed_courses View: Provides a denormalized view for efficient querying of course-related data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Migration System (Active Record Migrations)": {
      "type": "Framework Component",
      "description": "Manages incremental changes to the database schema and data. Adheres to best practices for data migrations, including multi-step processes for attribute refactoring, performance optimizations (e.g., bulk operations, batch processing), and ensuring reversibility where possible.",
      "interactions": {
        "interaction_0": "Database Schema: Applies structural and data changes to the database.",
        "interaction_1": "Rails Application: Executes migrations during deployment and development cycles.",
        "interaction_2": "Models: Migrations may interact with (mocked) Active Record models for data transformations."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Seed Data Loader": {
      "type": "Utility",
      "description": "Facilitates loading initial or development data into the database. It supports environment-specific seeding by loading files from `db/seeds/all` and then `db/seeds/<env>`, ensuring a consistent load order through alphabetical file processing.",
      "interactions": {
        "interaction_0": "Rails Environment: Determines which environment-specific seed files to load.",
        "interaction_1": "Database: Inserts initial data based on the loaded seed files."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/seeds.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Custom UUID Generator (uuid_generate_v7ms)": {
      "type": "Database Function",
      "description": "A custom PostgreSQL function that generates UUIDs following the v7 specification with millisecond precision. This function is extensively used as the default primary key generator for most tables in the Xikolo database.",
      "interactions": {
        "interaction_0": "Database Schema: Set as the default value for `id` columns in many tables.",
        "interaction_1": "Active Record: Automatically invoked when new records are created without an explicit UUID."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Babel": {
      "type": "Transpiler",
      "description": "Transpiles modern JavaScript (ES6+) and TypeScript into backward-compatible JavaScript, ensuring broader browser compatibility.",
      "interactions": {
        "interaction_0": "Integrated into Webpack via `babel-loader`.",
        "interaction_1": "Uses `@babel/preset-env` for environment-specific transformations and `@babel/preset-typescript` for TypeScript support.",
        "interaction_2": "Used by Webpack via `babel-loader`.",
        "interaction_3": "Applies `@babel/preset-env` and `@babel/plugin-transform-runtime`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Sass (sass-embedded)": {
      "type": "CSS Preprocessor",
      "description": "Compiles SCSS files into standard CSS, supporting features like variables, nesting, and mixins. The project mandates `.scss` syntax.",
      "interactions": {
        "interaction_0": "Integrated into Webpack via `sass-loader`.",
        "interaction_1": "Output is further processed by PostCSS.",
        "interaction_2": "Adheres to a strict CSS styleguide including BEM notation and mobile-first approach. "
      },
      "techDebt": [
        "Older CSS files are ignored by Stylelint, indicating a backlog for refactoring to meet current style guidelines. "
      ],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Sprockets": {
      "type": "Asset Pipeline",
      "description": "Rails' native asset pipeline, still used for linking some JavaScript files (e.g., `application.js`, `moment.js`) and images, indicating a hybrid asset management approach.",
      "interactions": {
        "interaction_0": "Coexists with Webpack for asset management."
      },
      "techDebt": [
        "The hybrid approach with Webpack can lead to complexity and potential confusion for developers regarding asset management. "
      ],
      "provenance": {
        "sources": [
          "app/assets/config/manifest.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "jQuery": {
      "type": "Frontend Library",
      "description": "A fast, small, and feature-rich JavaScript library. While still a dependency, its use for new Webpack assets is deprecated in favor of vanilla JavaScript.",
      "interactions": {
        "interaction_0": "Can still be used for existing jQuery plugins, but new code should avoid it."
      },
      "techDebt": [
        "Its deprecation for new code while remaining available for plugins can lead to inconsistent code styles and difficulty in enforcing modern practices. "
      ],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "gon": {
      "type": "Global Variable",
      "description": "A global JavaScript object used to pass data from Rails backend to the frontend. Its structure is defined in `app/assets/global.d.ts`.",
      "interactions": {
        "interaction_0": "Receives data from the Rails backend.",
        "interaction_1": "Accessed by frontend JavaScript/TypeScript code.",
        "interaction_2": "Receives data from Rails controllers/views.",
        "interaction_3": "Provides `user_id`, `in_app`, `env`, `build_version`, `item_id`, `section_id`, `course_id` to frontend JavaScript."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/global.d.ts",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Husky & lint-staged": {
      "type": "Developer Tooling",
      "description": "Git hooks (`husky`) combined with a file-based linter runner (`lint-staged`) to enforce code quality standards (formatting, linting) before commits.",
      "interactions": {
        "interaction_0": "Runs Prettier for formatting.",
        "interaction_1": "Executes ESLint for JavaScript/TypeScript.",
        "interaction_2": "Executes Stylelint for CSS/SCSS.",
        "interaction_3": "Executes Markdownlint for Markdown files.",
        "interaction_4": "Integrates with Ruby linters like Rubocop and Slim-lint."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Dockerignore": {
      "type": "Configuration",
      "description": "Specifies files and directories to be excluded from the Docker build context, optimizing image size and build times by only including necessary application components. It's configured to include specific application and service directories while excluding others.",
      "interactions": {
        "interaction_0": "Interacts with Docker build processes to filter context."
      },
      "techDebt": [
        "Extensive use of '!' include rules can make the file complex and potentially error-prone to maintain. A more explicit `COPY` strategy in Dockerfiles might be clearer."
      ],
      "provenance": {
        "sources": [
          ".dockerignore",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "EnvFile": {
      "type": "Configuration",
      "description": "Manages environment variables for local development (`.env`) and Dockerized environments (`.env.docker`), defining settings like application ports and database connection strings.",
      "interactions": {
        "interaction_0": "Provides environment variables to `Procfile` for local execution.",
        "interaction_1": "Provides environment variables to Docker Compose services for container configuration."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          ".env",
          ".env.docker",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Procfile": {
      "type": "Process Manager Configuration",
      "description": "Defines processes for local development, allowing `overmind` (or similar tools) to start multiple services concurrently, including the main web application, microservices, asset compilation, message queue listeners, and background job processors.",
      "interactions": {
        "interaction_0": "Starts `bin/rails server` for the web application.",
        "interaction_1": "Starts `yarn start` for web assets compilation.",
        "interaction_2": "Starts `bundle exec msgr` for message queue listening.",
        "interaction_3": "Starts `bundle exec sidekiq` for Sidekiq background jobs.",
        "interaction_4": "Starts `bin/rake delayed:work` for Delayed Job background jobs.",
        "interaction_5": "Starts microservices (e.g., `account`, `course`) via `overmind start`.",
        "interaction_6": "Starts the `web` Rails server [Source: Procfile]",
        "interaction_7": "Initiates `yarn start` for frontend asset compilation in development [Source: Procfile]",
        "interaction_8": "Runs `bundle exec msgr` for RabbitMQ message consumption [Source: Procfile]",
        "interaction_9": "Launches individual microservices (e.g., `account`, `course`, `news`) via `overmind start` commands [Source: Procfile]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Procfile",
          "Procfile.web",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "PumaConfiguration": {
      "type": "Web Server Configuration",
      "description": "Configures the Puma web server for both development (`config/puma.rb`) and production (`config/puma.production.rb`) environments. It manages thread and worker counts, port binding, application preloading (`preload_app!`), and graceful handling of database and message queue connections during worker forks.",
      "interactions": {
        "interaction_0": "Serves the Rails application (web and microservices).",
        "interaction_1": "Disconnects from `ActiveRecord::Base` and `Msgr.client` before forking workers.",
        "interaction_2": "Re-establishes `ActiveRecord::Base` connection after worker boot."
      },
      "techDebt": [
        "The presence of both Puma and Unicorn configurations might indicate a legacy setup or a need to consolidate on a single application server for consistency and reduced maintenance overhead."
      ],
      "provenance": {
        "sources": [
          "config/puma.rb",
          "config/puma.production.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "UnicornConfiguration": {
      "type": "Web Server Configuration",
      "description": "Configures the Unicorn web server, specifying worker processes, logging, application preloading, and connection handling during forks. It also includes logic for graceful restarts by killing old processes.",
      "interactions": {
        "interaction_0": "Serves the Rails application.",
        "interaction_1": "Disconnects from `ActiveRecord::Base` before forking workers.",
        "interaction_2": "Re-establishes `ActiveRecord::Base` connection after worker boot.",
        "interaction_3": "Manages graceful restarts by signaling old Unicorn processes."
      },
      "techDebt": [
        "The presence of both Puma and Unicorn configurations might indicate a legacy setup or a need to consolidate on a single application server for consistency and reduced maintenance overhead."
      ],
      "provenance": {
        "sources": [
          "config/unicorn.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerBakeHCL": {
      "type": "Docker Build Definition",
      "description": "An HCL file used with `docker buildx bake` to define multi-platform Docker image builds for base images like `ruby-base`, `ruby-base-node`, and `ruby-base-chrome`, facilitating a consistent and efficient base layer for all services.",
      "interactions": {
        "interaction_0": "Defines base images used by service-specific Dockerfiles (e.g., `account.Dockerfile`, `web.Dockerfile`).",
        "interaction_1": "Utilizes `CI_REGISTRY_IMAGE` and `TAG` variables for image naming and versioning."
      },
      "techDebt": [
        "The actual Dockerfiles for services are not provided, making it difficult to fully assess the build process and dependencies."
      ],
      "provenance": {
        "sources": [
          "docker-bake.hcl",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeBackground": {
      "type": "Docker Compose Service Definition",
      "description": "Defines shared infrastructure services required by the Xikolo platform, including PostgreSQL, RabbitMQ, Redis (for cache and Sidekiq), Minio (S3-compatible storage), and Mailpit (email testing). Each service includes health checks and network configurations.",
      "interactions": {
        "interaction_0": "Provides database services to all application components.",
        "interaction_1": "Provides message queuing for inter-service communication and background jobs.",
        "interaction_2": "Provides caching and job queue storage for Redis-dependent services.",
        "interaction_3": "Provides S3-compatible object storage.",
        "interaction_4": "Provides an email testing server for development."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeInit": {
      "type": "Docker Compose Service Definition",
      "description": "Defines initialization services that run once during deployment, specifically for database migrations (`init-database`) and loading initial permissions (`init-permissions`). These services ensure the application's foundational data is set up correctly before other services start.",
      "interactions": {
        "interaction_0": "Depends on `PostgreSQL`, `RabbitMQ`, `RedisCache`, `RedisSidekiq` being healthy.",
        "interaction_1": "Runs database migrations for the `xikolo-web` application.",
        "interaction_2": "Loads permissions for the `xikolo-account` service.",
        "interaction_3": "Ensures `init-database` completes successfully before `init-permissions` starts."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeService": {
      "type": "Docker Compose Service Definition",
      "description": "A generic representation for Docker Compose definitions of individual microservices (e.g., Account, Course, News, Notification, Pinboard, Quiz, TimeEffort). Each service typically includes a server, Sidekiq worker, and sometimes a message queue listener, mounting service-specific configuration files and exposing ports.",
      "interactions": {
        "interaction_0": "Builds images from service-specific Dockerfiles.",
        "interaction_1": "Uses environment variables from `.env`.",
        "interaction_2": "Connects to `PostgreSQL`, `RabbitMQ`, `RedisCache`, `RedisSidekiq`.",
        "interaction_3": "Mounts `xikolo.yml` and service-specific configuration files.",
        "interaction_4": "Exposes ports for API access (e.g., `3100:80` for account-server)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeWeb": {
      "type": "Docker Compose Service Definition",
      "description": "Defines the Docker Compose services for the main `Xikolo::Web` application, including the web server, Delayed Job worker, message queue listener, and Sidekiq worker. It builds from a specific Dockerfile, mounts configuration, and exposes the primary application port.",
      "interactions": {
        "interaction_0": "Builds image from `docker/files/web.Dockerfile`.",
        "interaction_1": "Uses environment variables from `.env`.",
        "interaction_2": "Connects to `PostgreSQL`, `RabbitMQ`, `RedisCache`, `RedisSidekiq`.",
        "interaction_3": "Mounts `xikolo.yml` and `xikolo/web.yml` configuration files.",
        "interaction_4": "Exposes port `3000:80` for the web server."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeNginx": {
      "type": "Docker Compose Service Definition",
      "description": "Defines the Nginx reverse proxy service, which routes incoming requests to the appropriate backend web and microservices. It uses a specific Nginx image and mounts a configuration template.",
      "interactions": {
        "interaction_0": "Routes traffic to `DockerComposeWeb` and `DockerComposeService` instances.",
        "interaction_1": "Exposes ports `8000:80` and `8443:443` for external access."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "DockerComposeMain": {
      "type": "Docker Compose Orchestrator",
      "description": "The top-level Docker Compose file that orchestrates the entire Xikolo platform by including all background, initialization, web, microservice, and Nginx compose definitions. It creates a unified deployment of the distributed system.",
      "interactions": {
        "interaction_0": "Includes `DockerComposeBackground`, `DockerComposeInit`, `DockerComposeWeb`, `DockerComposeService` (for all microservices), and `DockerComposeNginx`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "PostgreSQL": {
      "type": "Database Service",
      "description": "The primary relational database used for data persistence across all Xikolo applications and services. Configured with health checks and persistent volumes in Docker Compose.",
      "interactions": {
        "interaction_0": "Accessed by `DockerComposeWeb` and all `DockerComposeService` instances.",
        "interaction_1": "Initialized by `init-database` service."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "RedisCache": {
      "type": "Caching Service",
      "description": "A Redis instance dedicated to application caching, improving performance by storing frequently accessed data. Configured with health checks in Docker Compose.",
      "interactions": {
        "interaction_0": "Accessed by `DockerComposeWeb` and all `DockerComposeService` instances for caching operations."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "RedisSidekiq": {
      "type": "Job Queue Service",
      "description": "A Redis instance specifically used by Sidekiq for managing background job queues. Configured with health checks in Docker Compose.",
      "interactions": {
        "interaction_0": "Accessed by `web-sidekiq` and `*-sidekiq` services for job queuing and processing."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Minio": {
      "type": "Object Storage Service",
      "description": "A local S3-compatible object storage server that provides a local S3 API, which is a prerequisite for running end-to-end tests.",
      "interactions": {
        "interaction_0": "Automatically launched and configured by the E2E test setup.",
        "interaction_1": "Serves as a local mock for S3 storage operations during E2E tests.",
        "interaction_2": "Provides file storage capabilities to application services that require S3-compatible storage."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore",
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Mailpit": {
      "type": "Email Testing Service",
      "description": "A local SMTP server and web interface for capturing and inspecting emails during development, preventing actual emails from being sent.",
      "interactions": {
        "interaction_0": "Receives emails sent by application services for testing purposes."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Nginx": {
      "type": "Reverse Proxy / Load Balancer",
      "description": "Serves as the entry point for external traffic, routing requests to the appropriate backend web and microservices. It's configured with a custom template and exposes HTTP/HTTPS ports.",
      "interactions": {
        "interaction_0": "Receives incoming HTTP/HTTPS requests.",
        "interaction_1": "Forwards requests to `web-server` and `*-server` services based on routing rules."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "ActiveSupport::ParameterFilter": {
      "type": "Utility",
      "description": "A Rails utility used to filter sensitive parameters from logs and monitoring events, enhancing data privacy and security.",
      "interactions": {
        "interaction_0": "Configured in Sentry's `before_send` callback to sanitize event data. [Source: config/initializers/sentry.rb]",
        "interaction_1": "Filters parameters based on `Rails.application.config.filter_parameters`. [Source: config/initializers/sentry.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Xikolo.config (app/xikolo.yml)": {
      "type": "Configuration Store",
      "description": "A centralized YAML-based configuration file providing a wide range of settings for global options, platform features, course behavior, certificates, helpdesk, video, authentication, products, statistics, assets, layout, SEO, mobile apps, social media, and various integrations. It supports environment-specific overrides.",
      "interactions": {
        "interaction_0": "Provides `locales` settings for I18n. [Source: app/xikolo.yml]",
        "interaction_1": "Defines `email.smtp` server for outgoing emails. [Source: app/xikolo.yml]",
        "interaction_2": "Enables/disables `beta_features`, `gamification`, `voucher`, `open_mode`, `recaptcha`, `moochub_api`, `portal_api`, `transpipe`, `open_badges`, and `persisted_learning_evaluation`. [Source: app/xikolo.yml]",
        "interaction_3": "Configures `asset_host` and `csp` headers. [Source: app/xikolo.yml]",
        "interaction_4": "Specifies `imgproxy_url` for image processing. [Source: app/xikolo.yml]",
        "interaction_5": "Controls `header`, `footer`, and `profile` menu content and visibility. [Source: app/xikolo.yml]",
        "interaction_6": "Defines `proctoring_smowl_options` thresholds. [Source: app/xikolo.yml]",
        "interaction_7": "Used by `ActionController::Base` to set `asset_host` during application initialization. [Source: config/application.rb]",
        "interaction_8": "Can be overridden by `config/xikolo.test.yml` for specific environments. ",
        "interaction_9": "Can be overridden by local development files (`~/.xikolo.development.yml` or `config/xikolo.development.yml`). "
      },
      "techDebt": [
        "Extensive single YAML file for all configurations might become unwieldy for very large applications, though it's well-structured with comments. [Source: app/xikolo.yml]"
      ],
      "provenance": {
        "sources": [
          "app/xikolo.yml",
          "config/xikolo.test.yml",
          "config/application.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Secrets (config/secrets.yml)": {
      "type": "Configuration Store (Sensitive)",
      "description": "Manages sensitive application secrets, including `secret_key_base` for cookie integrity, credentials for external services (e.g., imgproxy, Smowl), and shared secrets for various bridge APIs (lanalytics, shop, transpipe, portal_api, chatbot).",
      "interactions": {
        "interaction_0": "Provides `secret_key_base` for Rails cookie signing. [Source: config/secrets.yml]",
        "interaction_1": "Supplies `imgproxy_key` and `imgproxy_salt` for signing image processing URLs. [Source: config/secrets.yml]",
        "interaction_2": "Stores `smowl_entity`, `smowl_license_key`, `smowl_password` for proctoring integration. [Source: config/secrets.yml]",
        "interaction_3": "Contains `chatbot_bridge_private_key` and `chatbot_bridge_shared_secret` for chatbot integration. [Source: config/secrets.yml]",
        "interaction_4": "Holds shared secrets for `bridge_lanalytics`, `bridge_shop`, `bridge_transpipe`, and `portal_api` authentication. [Source: config/secrets.yml]",
        "interaction_5": "Manages `open_badge_private_key` for Open Badge signing. [Source: config/secrets.yml]",
        "interaction_6": "Stores `jwt_hmac_secret` for external booking systems. [Source: config/secrets.yml]",
        "interaction_7": "Provides `recaptcha_v3` and `recaptcha_v2` keys for reCAPTCHA integration. [Source: config/secrets.yml]"
      },
      "techDebt": [
        "Development and test environments contain hardcoded private keys and secrets, which are explicitly marked as 'NOT meant to be used in production'. This is acceptable for non-production but highlights the need for secure environment variable management in production. [Source: config/secrets.yml]"
      ],
      "provenance": {
        "sources": [
          "config/secrets.yml",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Service Endpoints (config/services.yml)": {
      "type": "Configuration Store (Microservices)",
      "description": "Defines the URLs for various microservices that the main web application interacts with, such as account, course, news, notification, quiz, etc. These can be configured via environment variables or default to localhost for development.",
      "interactions": {
        "interaction_0": "Provides endpoint URLs for `account`, `course`, `learnanalytics`, `news`, `notification`, `pinboard`, `quiz`, `quizimporter`, and `timeeffort` services. [Source: config/services.yml]",
        "interaction_1": "Allows environment variables (`ENV['XIKOLO_SERVICE_ACCOUNT']`, etc.) to override default `localhost` URLs. [Source: config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/services.yml",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Redis Configuration (Cache & Sidekiq)": {
      "type": "Configuration Store (External Service)",
      "description": "Separate YAML files (`config/cache_redis.yml`, `config/sidekiq_redis.yml`) define connection parameters for Redis instances used for caching and Sidekiq background jobs. This includes URL, database index, and connection timeouts.",
      "interactions": {
        "interaction_0": "Configures Redis `url` and `db` for caching. [Source: config/cache_redis.yml]",
        "interaction_1": "Configures Redis `url`, `db`, `pool_timeout`, and `network_timeout` for Sidekiq. [Source: config/sidekiq_redis.yml]",
        "interaction_2": "Utilizes `ENV.fetch(\"CACHE_REDIS_URL\", nil)` and `ENV.fetch(\"SIDEKIQ_REDIS_URL\", nil)` for dynamic URL configuration. [Source: config/cache_redis.yml, config/sidekiq_redis.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/cache_redis.yml",
          "config/sidekiq_redis.yml",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Rake Tasks": {
      "type": "Utility/Maintenance",
      "description": "A collection of Rake tasks defined in `Rakefile` for various development, CI, and maintenance operations, including database setup, API documentation generation, asset management, and internationalization checks.",
      "interactions": {
        "interaction_0": "Loads `Xikolo::Web::Application.load_tasks` to make application-specific tasks available. [Source: Rakefile]",
        "interaction_1": "`ci:setup` interacts with the database (`db:drop:all`, `db:create:all`, `db:schema:load`) and asset pipeline (`assets:i18n:export`). [Source: Rakefile]",
        "interaction_2": "`api:docs` calls `Xikolo::API.make_docs!` to generate API documentation. [Source: Rakefile]",
        "interaction_3": "`assets:brand:check` validates the existence of brand-specific asset directories based on `ENV['BRAND']`. [Source: Rakefile]",
        "interaction_4": "`assets:i18n:export` uses `i18n-js` gem to export translations. [Source: Rakefile]",
        "interaction_5": "`i18n:missing_keys` inspects `I18n.backend` for translation completeness. [Source: Rakefile]"
      },
      "techDebt": [
        "The `i18n:missing_keys` task directly accesses `I18n.backend.send(:init_translations)` and `I18n.backend.send(:translations)`, which relies on internal implementation details of the `i18n` gem and might be brittle to future updates. [Source: Rakefile]"
      ],
      "provenance": {
        "sources": [
          "Rakefile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Rack::Cors": {
      "type": "Middleware",
      "description": "A Rack middleware that enables Cross-Origin Resource Sharing (CORS) for the application, allowing controlled access from different domains. It's configured to permit specific origins and HTTP methods for certain resources.",
      "interactions": {
        "interaction_0": "Allows POST requests from `*.openhpi.de`. [Source: config/application.rb]",
        "interaction_1": "Allows GET requests from any origin (`*`) to `/playlists/*` for external video players. [Source: config/application.rb]",
        "interaction_2": "Inserted into the Rails middleware stack in `config/application.rb` [Source: config/application.rb]",
        "interaction_3": "Configured to allow specific origins (e.g., `*.openhpi.de`) and methods for resources [Source: config/application.rb]",
        "interaction_4": "Specifically allows access to `/playlists/*` for external video players [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/application.rb",
          "Gemfile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "I18n (Rails Gem)": {
      "type": "Framework Component",
      "description": "The core Ruby on Rails internationalization library, responsible for managing translations, locales, and pluralization rules. It is configured to enforce available locales and dynamically load translation files.",
      "interactions": {
        "interaction_0": "Configured by `config/initializers/i18n.rb` to load locale files.",
        "interaction_1": "Utilized by `Translations` class to determine the current locale for dynamic content selection.",
        "interaction_2": "Extended by `ActionView::Helpers::TranslationHelper` for custom translation logic in views.",
        "interaction_3": "Provides translation data to `i18n-js` for frontend localization."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/i18n.rb",
          "config/initializers/i18n_translate.rb",
          "app/lib/translations.rb",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "Translations": {
      "type": "Utility Class",
      "description": "A custom utility class designed to select the most appropriate localized text from a hash of language-specific strings. It prioritizes a provided locale preference, then the current `I18n.locale`, default Xikolo locale, and finally English.",
      "interactions": {
        "interaction_0": "Initializes with a hash of localized strings and an optional locale preference.",
        "interaction_1": "Interacts with `I18n.locale` and `Xikolo.config` to determine the best locale for text selection.",
        "interaction_2": "Interacts with I18n. [Source: app/lib/translations.rb]",
        "interaction_3": "Accesses Xikolo.config. [Source: app/lib/translations.rb]"
      },
      "techDebt": [
        "The hardcoded fallback order within `best_locale` could be made more configurable for greater flexibility."
      ],
      "provenance": {
        "sources": [
          "app/lib/translations.rb",
          "spec/lib/translations_spec.rb",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "ActionView::Helpers::TranslationHelper (Extended)": {
      "type": "Framework Extension",
      "description": "The standard Rails translation helper, customized to enhance security and provide additional context for translations. It automatically HTML-escapes interpolation values and injects brand-specific information.",
      "interactions": {
        "interaction_0": "Overrides the default `translate` method to add custom logic.",
        "interaction_1": "Interacts with `I18n` for actual translation lookup.",
        "interaction_2": "Uses `ERB::Util.html_escape` for security.",
        "interaction_3": "Accesses `Xikolo.config` for brand and site name information."
      },
      "techDebt": [
        "The use of `alias orig_translate translate` and redefinition might be considered less idiomatic than a decorator pattern for extending Rails helpers, potentially leading to conflicts with future Rails updates.",
        "The `rubocop:disable Rails/OutputSafety` comment indicates a potential XSS vulnerability if raw translation strings from locale files are not properly handled, requiring careful auditing of locale content."
      ],
      "provenance": {
        "sources": [
          "config/initializers/i18n_translate.rb",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "i18n-js": {
      "type": "Gem/Frontend Tool",
      "description": "A Ruby gem that exports Rails I18n translations to JavaScript, enabling frontend applications (e.g., React, jQuery) to use the same translation keys and values as the backend. It generates JSON files for different locales.",
      "interactions": {
        "interaction_0": "Configured via `config/i18n.yml` to specify export paths and patterns.",
        "interaction_1": "Listens for changes in locale files in development to generate translations on-the-fly.",
        "interaction_2": "Consumes `I18n` translation data from the backend."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/i18n.rb",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "PagePresenter": {
      "type": "Presenter",
      "description": "Prepares `Page` model data for display in views. It renders the page's `text` content (which is of type `Xikolo::S3::Markup`) into HTML using Markdown, and provides methods to list existing and potential new translations.",
      "interactions": {
        "interaction_0": "Receives a `Page` object and its translations for presentation.",
        "interaction_1": "Utilizes `MarkdownHelper` to convert Markdown text to HTML.",
        "interaction_2": "Accesses `Xikolo.config.locales['available']` to determine available locales for new translations."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/page_presenter.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Gurke": {
      "type": "E2E Test Runner",
      "description": "The test runner used for executing end-to-end scenarios. It supports both one-off test runs and a DRb server mode for faster iterative testing against running application services.",
      "interactions": {
        "interaction_0": "Orchestrates the execution of E2E tests defined in `integration/features`.",
        "interaction_1": "Drives a browser via Capybara to simulate user interactions.",
        "interaction_2": "Manages the lifecycle of application services during E2E test execution.",
        "interaction_3": "Configurable for different browsers and debugging modes (headless, slow-motion)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Capybara": {
      "type": "Web Automation Tool",
      "description": "A library used by Gurke and RSpec feature specs to simulate user interactions in a web browser. It enables testing of real, interactive UI behavior.",
      "interactions": {
        "interaction_0": "Drives web browsers (e.g., Chrome, Firefox) to execute user scenarios.",
        "interaction_1": "Used by Gurke for E2E tests and by RSpec for feature tests.",
        "interaction_2": "Supports headless and non-headless modes, and slow-motion for debugging.",
        "interaction_3": "Requires specific environment variables (e.g., `SNAP=1`) for certain browser setups."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Stubbing Utilities (xikolo-common/rspec/stub.rb)": {
      "type": "Testing Utility",
      "description": "Custom helper methods designed to facilitate stubbing of external service requests and microservice interactions within RSpec tests, crucial for isolating components in a distributed architecture.",
      "interactions": {
        "interaction_0": "Provides methods like `stub_user_request`, `Stub.service()`, `Stub.request()` to mock HTTP responses from microservices.",
        "interaction_1": "Used to stub external dependencies such as S3 calls.",
        "interaction_2": "Integrated within RSpec `before` blocks to set up test environments."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:61_DEVOPS_Testing"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "61_DEVOPS_Testing"
        ]
      }
    },
    "Voucher::Stats": {
      "type": "Utility/Service",
      "description": "A component responsible for aggregating and providing statistical data related to vouchers. [Source: app/controllers/admin/vouchers_controller.rb]",
      "interactions": {
        "interaction_0": "Used by `Admin::VouchersController` to display voucher statistics [Source: app/controllers/admin/vouchers_controller.rb].",
        "interaction_1": "Queries Voucher::Voucher model. [Source: app/models/voucher/stats.rb]",
        "interaction_2": "Queries Course::Course model. [Source: app/models/voucher/stats.rb]",
        "interaction_3": "Queries `Voucher::Voucher` and `Course::Course` models directly from the database. [Source: app/models/voucher/stats.rb]",
        "interaction_4": "Instantiated and used by `Admin::VouchersController` to display voucher statistics. [Source: app/controllers/admin/vouchers_controller.rb]",
        "interaction_5": "Likely queries the `Voucher::Voucher` model to gather data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "app/models/voucher/stats.rb",
          "cluster:31_ADMIN_Analytics",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics",
          "34_ADMIN_Vouchers"
        ]
      }
    },
    "PollsController": {
      "type": "Controller",
      "description": "Handles user interactions with polls, including fetching the next available poll, processing votes, and displaying poll archives. It ensures users are logged in and sets no-cache headers.",
      "interactions": {
        "interaction_0": "Inherits from `Abstract::FrontendController`.",
        "interaction_1": "Interacts with `Poll::Poll` model to fetch, find, and process votes.",
        "interaction_2": "Renders `Dashboard::Poll::Widget` to display poll content.",
        "interaction_3": "Uses `Dashboard::Poll::Question` for displaying poll questions and options.",
        "interaction_4": "Uses `Dashboard::Poll::Thanks` for displaying post-vote confirmation.",
        "interaction_5": "Utilizes `PollArchivePresenter` to prepare data for the poll archive view.",
        "interaction_6": "Relies on `current_user` for user context.",
        "interaction_7": "Interacts with `Poll::Poll` model to retrieve polls, check for upcoming polls, and record votes.",
        "interaction_8": "Uses `PollArchivePresenter` for formatting archived polls.",
        "interaction_9": "Renders `Dashboard::Poll::Widget` and its content components (e.g., `Dashboard::Poll::Question`, `Dashboard::Poll::Thanks`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "PollArchivePresenter": {
      "type": "Presenter",
      "description": "Prepares and formats data for displaying polls in the archive view. It encapsulates logic for determining result visibility, user voting status, and provides localized informational messages.",
      "interactions": {
        "interaction_0": "Initializes with a `Poll::Poll` object and `current_user`.",
        "interaction_1": "Delegates `id` and `question` to the `@poll` object.",
        "interaction_2": "Accesses various methods of `@poll` such as `ended?`, `reveal_results?`, `open?`, `stats`, `end_at`, `response_for`.",
        "interaction_3": "Uses `Global::Callout` for displaying informational messages.",
        "interaction_4": "Renders `Dashboard::Poll::Question.results` for displaying poll results."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "app/views/dashboard/_polls.html.slim": {
      "type": "View Partial (Frontend Integration)",
      "description": "This Slim partial is responsible for the initial loading of the poll widget on the dashboard. It uses JavaScript (jQuery) to make an AJAX request to fetch the next available poll and dynamically updates the DOM.",
      "interactions": {
        "interaction_0": "Makes an AJAX `GET` request to `next_poll_path`.",
        "interaction_1": "Updates the `#polls` HTML element with the data received from the server."
      },
      "techDebt": [
        "Uses direct jQuery `$.get` and DOM manipulation, which could be refactored into a more modern ViewComponent or a React component for better consistency with other frontend architecture patterns in the project."
      ],
      "provenance": {
        "sources": [
          "app/views/dashboard/_polls.html.slim",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Poll::Poll": {
      "type": "Model (ActiveRecord)",
      "description": "Represents a poll or survey. This model manages poll questions, options, user responses, and statistical data. It includes business logic for determining upcoming polls, processing votes, and controlling result visibility.",
      "interactions": {
        "interaction_0": "Has many `Poll::Option`s.",
        "interaction_1": "Has many `Poll::Response`s.",
        "interaction_2": "Interacts with `User` to track votes and responses.",
        "interaction_3": "Provides class methods like `upcoming_for_user`, `started`, `latest_first`.",
        "interaction_4": "Provides instance methods like `vote!`, `response_for`, `stats`, `reveal_results?`, `ended?`, `open?`, `show_intermediate_results?`, `enough_participants?`, `end_at`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Poll::Option": {
      "type": "Model (ActiveRecord)",
      "description": "Represents an individual answer option for a poll question. It is associated with a `Poll::Poll`.",
      "interactions": {
        "interaction_0": "Belongs to `Poll::Poll`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Poll::Response": {
      "type": "Model (ActiveRecord)",
      "description": "Records a user's vote(s) for a specific poll. It links a user to their chosen options for a given poll.",
      "interactions": {
        "interaction_0": "Belongs to `Poll::Poll`.",
        "interaction_1": "Belongs to `User` (implicitly via `user_id`).",
        "interaction_2": "Stores the `choices` made by the user."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Dashboard::Poll::Widget": {
      "type": "ViewComponent",
      "description": "The main container ViewComponent for rendering a poll on the dashboard. It acts as a wrapper for other poll-related ViewComponents.",
      "interactions": {
        "interaction_0": "Receives a `Poll::Poll` object.",
        "interaction_1": "Uses `with_content` to embed other ViewComponents like `Dashboard::Poll::Question` or `Dashboard::Poll::Thanks`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Dashboard::Poll::Question": {
      "type": "ViewComponent",
      "description": "Renders the poll question and its available options. It can be used both for presenting options for voting and for displaying poll results.",
      "interactions": {
        "interaction_0": "Receives a `Poll::Poll` object.",
        "interaction_1": "Can receive `stats` and `choices` parameters when displaying results."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Dashboard::Poll::Thanks": {
      "type": "ViewComponent",
      "description": "Renders a confirmation or thank you message after a user has voted on a poll. It can optionally display poll results and indicate if another poll is available.",
      "interactions": {
        "interaction_0": "Receives a `Poll::Poll` object.",
        "interaction_1": "Receives `choices` (user's selections), `stats` (if results are revealed), and `next_poll` status."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Abstract::FrontendController": {
      "type": "Controller (Base Class)",
      "description": "A foundational controller for frontend-facing actions, providing common functionalities such as ensuring user authentication and setting cache control headers for responses.",
      "interactions": {
        "interaction_0": "Parent class for `PollsController`.",
        "interaction_1": "Provides `ensure_logged_in` and `set_no_cache_headers` before actions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    "Banner": {
      "type": "Model",
      "description": "Manages promotional banners displayed on the course list. It handles banner metadata, S3 file management, and publication/expiry scheduling.",
      "interactions": {
        "interaction_0": "Is queried by `Global::CourseListBanner` to fetch the current active banner.",
        "interaction_1": "Interacts with `Xikolo::S3` for uploading and generating public URLs for banner images.",
        "interaction_2": "Schedules `S3FileDeletionJob` to remove S3 objects asynchronously upon record destruction.",
        "interaction_3": "Used by CourseListBanner. [Source: app/components/global/course_list_banner.rb]",
        "interaction_4": "Interacts with Xikolo::S3. [Source: app/models/banner.rb]",
        "interaction_5": "Enqueues S3FileDeletionJob. [Source: app/models/banner.rb]",
        "interaction_6": "Created/updated by banner:create Rake task. [Source: lib/tasks/create_banner.rake]",
        "interaction_7": "Interacts with `Xikolo::S3` for uploading banner images and generating public URLs [Source: app/models/banner.rb].",
        "interaction_8": "Enqueues `S3FileDeletionJob` to asynchronously delete the corresponding S3 object after a banner record is destroyed, with a delay for cache expiration [Source: app/models/banner.rb]."
      },
      "techDebt": [
        "The `current` scope uses `order(publish_at: :asc).take` [Source: app/models/banner.rb]. If multiple active banners have the exact same `publish_at` timestamp, the `take` method does not guarantee a deterministic choice without a secondary ordering criterion (e.g., `id`)."
      ],
      "provenance": {
        "sources": [
          "app/models/banner.rb",
          "spec/models/banner_spec.rb"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Navigation::SystemAlerts": {
      "type": "ViewComponent",
      "description": "Displays system-wide alerts in a navigation component. It manages alert visibility based on user cookies and caches alert data per language.",
      "interactions": {
        "interaction_0": "Queries `Alert` model for published alerts, caching the results.",
        "interaction_1": "Reads and implicitly expects JavaScript to write the `seen_alerts` cookie to track user interaction.",
        "interaction_2": "Uses `I18n.locale` to fetch language-specific alerts."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/navigation/system_alerts.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::UI::Form": {
      "type": "Internal Gem",
      "description": "A custom internal Ruby gem for UI form functionalities. Specific details are not available in the provided context.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "check-gem-versions": {
      "type": "Utility Script",
      "description": "A Ruby script that parses `Gemfile.lock` files across the main application and all microservices to identify and report inconsistencies in gem versions. It supports various options for reporting, exclusion, and exit codes.",
      "interactions": {
        "interaction_0": "Reads `Gemfile.lock` files from the `web` application and all `services/*` directories. [Source: scripts/check-gem-versions]",
        "interaction_1": "Outputs reports in console or CSV format. [Source: scripts/check-gem-versions]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "scripts/check-gem-versions",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Rails Asset Pipeline": {
      "type": "Asset Management System",
      "description": "Manages legacy JavaScript, images, and other static assets. It uses `//= link_tree` directives to include assets and works in conjunction with Webpack for modern assets.",
      "interactions": {
        "interaction_0": "Links image directories (`../images`).",
        "interaction_1": "Includes legacy JavaScript files like `application.js`, `m.e.i.n.e.l.js`, `moment.js`.",
        "interaction_2": "Coexists with Webpack, handling assets not managed by Webpack."
      },
      "techDebt": [
        "Contains legacy JavaScript in `app/assets/javascripts` that is ignored by modern tooling (ESLint, TypeScript)."
      ],
      "provenance": {
        "sources": [
          "app/assets/config/manifest.js",
          "eslint.config.mjs",
          "tsconfig.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Husky": {
      "type": "Git Hooks Manager",
      "description": "Manages Git hooks, specifically the `pre-commit` hook, to automate code quality checks before commits are finalized.",
      "interactions": {
        "interaction_0": "Triggers `lint-staged` and `tsc --skipLibCheck --noEmit` on `pre-commit`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "lint-staged": {
      "type": "Git Hook Utility",
      "description": "Runs linters and formatters only on files staged for commit, improving performance and ensuring only relevant changes are checked.",
      "interactions": {
        "interaction_0": "Receives staged files from Husky.",
        "interaction_1": "Executes `prettier`, `editorconfig-checker`, `rubocop`, `slim-lint`, `eslint`, `stylelint`, and `markdownlint` on respective file types."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "TypeScript Compiler (tsc)": {
      "type": "Compiler/Type Checker",
      "description": "Performs static type checking for TypeScript files to catch errors early in the development cycle.",
      "interactions": {
        "interaction_0": "Executed with `--skipLibCheck --noEmit` during the pre-commit hook to ensure type correctness without generating output files."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "tsconfig.json",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Sass (dartsass-sprockets)": {
      "type": "CSS Preprocessor",
      "description": "Compiles Sass (`.scss`) files into CSS. `dartsass-sprockets` integrates Dart Sass with the Rails asset pipeline.",
      "interactions": {
        "interaction_0": "Processes `.scss` files, including imports from `stylesheets/theme` and `stylesheets/global`.",
        "interaction_1": "Used for both Webpack and potentially Rails Asset Pipeline managed styles."
      },
      "techDebt": [
        "The `.stylelintrc.js` indicates that the `ruby-sass` compiler (libsass) is still in use for some parts, which lacks support for modern CSS Color Level 4 syntax, necessitating custom Stylelint rules. This suggests a mixed or incomplete migration to Dart Sass."
      ],
      "provenance": {
        "sources": [
          "app/assets/main.scss",
          ".stylelintrc.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Node.js": {
      "type": "Runtime Environment",
      "description": "The runtime environment for executing JavaScript outside the browser, essential for Webpack, Yarn, and various build scripts.",
      "interactions": {
        "interaction_0": "Executes Webpack build and dev server commands.",
        "interaction_1": "Runs Yarn for dependency management.",
        "interaction_2": "Executes linting and formatting scripts."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Markdownlint": {
      "type": "Linter",
      "description": "Enforces style and best practices for Markdown files.",
      "interactions": {
        "interaction_0": "Analyzes `**/*.{md,md.erb}` files.",
        "interaction_1": "Integrated into the pre-commit hook via `lint-staged`.",
        "interaction_2": "Configured to disable line length checks and allow specific HTML tags."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "package.json",
          ".husky/pre-commit",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ApplicationJob": {
      "type": "ActiveJob Base Class",
      "description": "The base class for all background jobs in the application, configured to use the 'default' queue and defining a maximum run time. It also provides a custom error class for explicit retries.",
      "interactions": {
        "interaction_0": "Inherited by specific job classes to define asynchronous tasks.",
        "interaction_1": "Interacts with the underlying queuing backend (Delayed Job in this context). [Source: Gemfile, config/initializers/delayed.rb]",
        "interaction_2": "Provides `ExpectedRetry` error for explicit job retries that are ignored by Sentry [Source: app/jobs/application_job.rb]",
        "interaction_3": "Sets the default queue for jobs to 'default' [Source: app/jobs/application_job.rb]",
        "interaction_4": "Defines a `max_run_time` of 20 minutes for jobs [Source: app/jobs/application_job.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/jobs/application_job.rb",
          "app/jobs/long_running_application_job.rb",
          "app/jobs/lti/publish_grade_job.rb",
          "app/jobs/proctoring/store_submission_results_job.rb",
          "app/jobs/proctoring/upload_certificate_image_job.rb",
          "app/jobs/refresh_sitemap_job.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "ApplicationRecord": {
      "type": "ActiveRecord Base Class",
      "description": "The abstract base class for all ActiveRecord models, ensuring common configurations and behaviors across the application's data models.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/application_record.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Makefile": {
      "type": "Build System",
      "description": "Manages the build process for frontend assets (Webpack and Sprockets) and internationalization files. It supports brand-specific compilation and is used for both development and packaging the application.",
      "interactions": {
        "interaction_0": "Orchestrates `webpack` and `sprockets` targets for asset compilation [Source: Makefile]",
        "interaction_1": "Invokes `bundle exec rake assets:i18n:export` for i18n file generation [Source: Makefile]",
        "interaction_2": "Uses `corepack yarn run build` for Webpack compilation [Source: Makefile]",
        "interaction_3": "Uses `bundle exec rake assets:precompile` for Sprockets asset compilation [Source: Makefile]",
        "interaction_4": "Supports `BRAND` environment variable for brand-specific builds [Source: Makefile]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Makefile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "bin/entrypoint": {
      "type": "Docker Entrypoint Script",
      "description": "A Bash script serving as the entrypoint for Docker containers, handling various commands such as starting the application server, running database migrations, or initiating background job processors. It sets environment variables for concurrency.",
      "interactions": {
        "interaction_0": "Executes database migrations via `bundle exec rake db:prepare` [Source: bin/entrypoint]",
        "interaction_1": "Starts Delayed Job workers via `bundle exec rake delayed:work` [Source: bin/entrypoint]",
        "interaction_2": "Starts `msgr` AMQP consumer via `bundle exec msgr` [Source: bin/entrypoint]",
        "interaction_3": "Starts `sidekiq` workers via `bundle exec sidekiq` [Source: bin/entrypoint]",
        "interaction_4": "Starts the Puma application server via `/app/bin/thrust puma` [Source: bin/entrypoint]",
        "interaction_5": "Sets `WORKERS`, `CONCURRENCY`, and `RAILS_MAX_THREADS` environment variables [Source: bin/entrypoint]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "bin/entrypoint",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo (Global Config/Namespace)": {
      "type": "Global Configuration Module",
      "description": "A global module or namespace that holds application-wide configuration, secrets, and provides access to microservice clients. It is crucial for centralizing environment-specific settings and inter-service communication.",
      "interactions": {
        "interaction_0": "Sets the application `brand` based on `ENV['BRAND']` [Source: config/application.rb]",
        "interaction_1": "Includes `Xikolo::Common::Secrets` for accessing sensitive configuration [Source: config/application.rb]",
        "interaction_2": "Includes `Xikolo::Common::Nomad` for Nomad-related configurations [Source: config/application.rb]",
        "interaction_3": "Provides access to microservice APIs (e.g., `Xikolo.api(:account)`) [Source: app/controllers/application_controller.rb]",
        "interaction_4": "Used by `ActionMailer` to determine default URL options [Source: config/application.rb]",
        "interaction_5": "Used by `ActionController::Base` to set the asset host [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/application.rb",
          "app/controllers/application_controller.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo::Common::Auth::Middleware": {
      "type": "Authentication Middleware",
      "description": "A Rack middleware responsible for handling the authentication flow, potentially integrating with OmniAuth strategies. It processes authentication requests and manages user sessions.",
      "interactions": {
        "interaction_0": "Called by `ApplicationController#auth_middleware` during `around_action` [Source: app/controllers/application_controller.rb]",
        "interaction_1": "Processes `RelayState` from SAML/OpenID Connect for session management [Source: app/controllers/application_controller.rb]",
        "interaction_2": "Sets `xikolo_context` in the request environment [Source: app/controllers/application_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo::Common::Auth::CurrentUser": {
      "type": "User Abstraction",
      "description": "An abstraction for the current user, providing methods to determine login status, permissions, and feature flag access. It can be initialized from session data.",
      "interactions": {
        "interaction_0": "Used by `ApplicationController#current_user` to represent the authenticated user [Source: app/controllers/application_controller.rb]",
        "interaction_1": "Provides `logged_in?`, `anonymous?`, `allowed?`, `allowed_any?`, `feature?` methods [Source: app/controllers/application_controller.rb]",
        "interaction_2": "Sets Sentry user context with the user's ID [Source: app/controllers/application_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "I18n": {
      "type": "Internationalization Framework",
      "description": "Ruby on Rails' core internationalization module, responsible for loading, managing, and retrieving localized strings from YAML files. It provides methods to set and get the current locale and translate keys.",
      "interactions": {
        "interaction_0": "Used by the `Locale` concern to set the active locale. [Source: app/controllers/concerns/locale.rb]",
        "interaction_1": "Used by the `Translations` class to determine the current locale. [Source: app/lib/translations.rb]",
        "interaction_2": "Loads translation data from YAML files (e.g., `config/locales/de.yml`). ",
        "interaction_3": "Configured in `config/application.rb` with `available_locales` (`de`, `en`), `default_locale` (`en`), and `fallbacks` (`en`) [Source: config/application.rb]",
        "interaction_4": "Used by `Rakefile` tasks (`assets:i18n:export`, `i18n:missing_keys`) for managing translation files [Source: Rakefile]",
        "interaction_5": "Integrated with `i18n-js` gem to export translations to JSON for frontend use "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/application.rb",
          "Rakefile",
          "Gemfile",
          "app/controllers/concerns/locale.rb",
          "app/lib/translations.rb",
          "spec/support/locale.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "RubyVM::YJIT": {
      "type": "Ruby JIT Compiler",
      "description": "Ruby's Just-In-Time (JIT) compiler, automatically enabled for Ruby 3.3 and newer versions to provide significant performance improvements.",
      "interactions": {
        "interaction_0": "Enabled in an `after_initialize` block if `RubyVM::YJIT.enable` is defined (Ruby 3.3+) [Source: config/initializers/enable_yjit.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/enable_yjit.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Lookbook": {
      "type": "ViewComponent Documentation Tool",
      "description": "A tool for documenting and previewing ViewComponents, integrated into the Rails application to streamline UI development and maintain component libraries.",
      "interactions": {
        "interaction_0": "Configured in `config/application.rb` to show previews, define preview layouts, listen paths, and page paths [Source: config/application.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Imagecrop": {
      "type": "Image Transformation Helper",
      "description": "A helper module that facilitates image transformations, likely by generating URLs for an external image proxy service like imgproxy.",
      "interactions": {
        "interaction_0": "Used by `ApplicationHelper#imagecrop` to transform image URLs [Source: app/helpers/application_helper.rb]",
        "interaction_1": "Relies on `imgproxy` gem [Source: Gemfile]",
        "interaction_2": "Configuration for imgproxy URL and secrets are in `xikolo.yml` and `secrets.yml` "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/helpers/application_helper.rb",
          "Gemfile",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "BrowserSupport": {
      "type": "Browser Compatibility Helper",
      "description": "Ruby class that determines the support status of a given browser (unsupported or old) based on predefined version thresholds and specific browser conditions. [Source: lib/browser_support.rb]",
      "interactions": {
        "interaction_0": "Instantiated by `ApplicationHelper#browser_support` to provide browser-specific information [Source: app/helpers/application_helper.rb]",
        "interaction_1": "Used to determine whether to hide browser warnings based on cookies [Source: app/helpers/application_helper.rb]",
        "interaction_2": "Receives a `browser` object (likely from the `browser` gem) upon initialization and queries its properties (e.g., `bot?`, `ie?`, `edge?`, `version`, `platform.mac?`, `webkit?`, `firefox?`) to perform compatibility checks. [Source: lib/browser_support.rb]"
      },
      "techDebt": [
        "The `firefox_on_ipad?` method includes a specific workaround for `browser` gem detection issues on iOS 13 iPads, which might indicate a fragility in browser detection or a dependency on specific gem behavior that could change. [Source: lib/browser_support.rb]",
        "The `VERSIONS_CONSIDERED_MODERN` hash hardcodes browser version thresholds. While functional, this could be externalized to a configuration file or database if these thresholds are expected to change frequently or require dynamic updates without code deployment. [Source: lib/browser_support.rb]"
      ],
      "provenance": {
        "sources": [
          "app/helpers/application_helper.rb",
          "cluster:40_INFRA_SystemCore",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore",
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Acfs": {
      "type": "Microservice Client (Legacy)",
      "description": "A library used for concurrent execution of API calls, improving performance by fetching data from multiple sources in parallel.",
      "interactions": {
        "interaction_0": "Used by `DashboardController` for loading dashboard content (enrollments, promoted courses, next dates, documents, preferences).",
        "interaction_1": "Used for promise-compatible interfaces in `ApplicationController` [Source: app/controllers/application_controller.rb]",
        "interaction_2": "Exceptions (`Acfs::BadGateway`, `Acfs::ServiceUnavailable`, `Acfs::GatewayTimeout`) are mapped to HTTP status codes [Source: config/application.rb]",
        "interaction_3": "Queue is cleared `before_action` in `ApplicationController` [Source: app/controllers/application_controller.rb]"
      },
      "techDebt": [
        "Migration from `Acfs` to `Restify` is ongoing. "
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "app/controllers/application_controller.rb",
          "config/application.rb",
          "app/controllers/dashboard_controller.rb",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Delayed (Delayed Job)": {
      "type": "Background Job Processor",
      "description": "A background job processing system used for asynchronous tasks. It is configured as the default queue adapter for ActiveJob.",
      "interactions": {
        "interaction_0": "Configured as `config.active_job.queue_adapter = :delayed` in `config/application.rb` [Source: config/application.rb]",
        "interaction_1": "Workers are started via `bin/rake delayed:work` in `Procfile` and `bin/entrypoint` [Source: Procfile, bin/entrypoint]",
        "interaction_2": "Integrated via `delayed` gem [Source: Gemfile]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "Procfile",
          "bin/entrypoint",
          "cluster:40_INFRA_SystemCore"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "40_INFRA_SystemCore"
        ]
      }
    },
    "Xikolo::Endpoint::CollectionEndpoint": {
      "type": "API Endpoint Definition Base Class",
      "description": "A base class for defining API resources in a declarative manner. It encapsulates the structure, representation, filters, and service call logic for both collection and member resources, handling JSON-API serialization/deserialization and relationship management.",
      "interactions": {
        "interaction_0": "Extended by specific API endpoint classes (e.g., `Users` in documentation example) to define resource-specific logic.",
        "interaction_1": "Utilized by the `Xikolo::API` to process incoming requests and generate responses.",
        "interaction_2": "Interacts with backend services to load and store data for the defined resources."
      },
      "techDebt": [
        "Complexity in managing `reading` and `writing` transformations for attributes, requiring careful implementation for reversibility and consistency. ",
        "Ensuring that `alias_for` and `map` configurations correctly handle data mapping between API and service representations. "
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "API Gateway (Rails Routes)": {
      "type": "API Gateway",
      "description": "The `config/routes.rb` file in the main Rails application acts as a central API gateway. It routes requests to the primary Grape API (`/api`) and also defines several specialized 'bridge' APIs for internal and external integrations, such as `portalapi-beta`, `transpipe`, `lanalytics`, `moochub`, `chatbot`, and `shop`.",
      "interactions": {
        "interaction_0": "Receives all incoming API requests to the main application.",
        "interaction_1": "Routes requests to the `Xikolo::API` for general mobile app consumption.",
        "interaction_2": "Routes requests to specific 'bridge' API modules for specialized internal or external integrations.",
        "interaction_3": "Includes a private `/api/tracking-events` endpoint for frontend-only use."
      },
      "techDebt": [
        "Managing a growing number of distinct API entry points and ensuring consistent security, logging, and performance monitoring across all of them. [Source: config/routes.rb]",
        "Potential for route conflicts or overlapping responsibilities if not carefully managed. [Source: config/routes.rb]"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Portal API": {
      "type": "API (External Bridge)",
      "description": "A public API specifically designed for customer portals, providing endpoints for managing courses, users, and enrollments. It is exposed under the `/portalapi-beta` path.",
      "interactions": {
        "interaction_0": "Consumed by external customer portal applications.",
        "interaction_1": "Interacts with underlying services to manage course, user, and enrollment data."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Transpipe Bridge API": {
      "type": "API (Internal Bridge)",
      "description": "An internal API bridge focused on video processing, including endpoints for retrieving and updating subtitles for videos. It is exposed under `/bridges/transpipe`.",
      "interactions": {
        "interaction_0": "Used by internal services requiring video and subtitle manipulation.",
        "interaction_1": "Interacts with video storage and processing components."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Lanalytics Bridge API": {
      "type": "API (Internal Bridge)",
      "description": "An internal API bridge dedicated to learning analytics, providing statistics related to courses (ticket stats, open badge stats) and videos. It is exposed under `/bridges/lanalytics` and defaults to JSON format.",
      "interactions": {
        "interaction_0": "Consumed by internal analytics and reporting tools.",
        "interaction_1": "Aggregates and exposes statistical data from various learning components."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Moochub Bridge API": {
      "type": "API (Internal Bridge)",
      "description": "An internal API bridge for MOOC hub integration, primarily used for listing courses. It is exposed under `/bridges/moochub`.",
      "interactions": {
        "interaction_0": "Interacts with external MOOC hub platforms or internal components related to MOOCs.",
        "interaction_1": "Provides course listings."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "API Changelog": {
      "type": "Documentation/Process",
      "description": "A markdown document (`api/CHANGELOG.md`) that tracks all notable API endpoint changes, especially breaking ones, following the 'Keep a Changelog' format. It details additions, deprecations, and removals across different API versions.",
      "interactions": {
        "interaction_0": "Informs API consumers (e.g., mobile app developers, internal service developers) about changes to the API.",
        "interaction_1": "Supports the API versioning strategy by documenting specific changes per version."
      },
      "techDebt": [
        "Ensuring the changelog is consistently updated and accurately reflects all API modifications. [Source: api/CHANGELOG.md]"
      ],
      "provenance": {
        "sources": [
          "api/CHANGELOG.md",
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "PostgreSQL Database": {
      "type": "Data Store",
      "description": "The primary relational database system for the application, extensively configured with custom extensions and functions.",
      "interactions": {
        "interaction_0": "ActiveRecord interacts with PostgreSQL for all data operations.",
        "interaction_1": "Fx gem interacts with PostgreSQL to manage functions.",
        "interaction_2": "Scenic gem interacts with PostgreSQL to manage views."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "ActiveRecord": {
      "type": "ORM",
      "description": "Ruby on Rails' Object-Relational Mapping layer, responsible for defining the application's data models and interacting with the PostgreSQL database.",
      "interactions": {
        "interaction_0": "Manages schema migrations and definitions.",
        "interaction_1": "Interacts with PostgreSQL for CRUD operations.",
        "interaction_2": "Utilizes Fx and Scenic for advanced database features."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Fx Gem": {
      "type": "Library",
      "description": "A Ruby gem used to manage database functions, ensuring they are dumped at the beginning of the schema file for correct dependency resolution.",
      "interactions": {
        "interaction_0": "Configures schema dumping behavior for PostgreSQL functions.",
        "interaction_1": "Integrates with ActiveRecord's migration process."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/fx.rb",
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Scenic Gem": {
      "type": "Library",
      "description": "A Ruby gem used to manage database views, allowing them to be versioned and managed like migrations.",
      "interactions": {
        "interaction_0": "Defines and manages the `embed_courses` view.",
        "interaction_1": "Integrates with ActiveRecord's migration process."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "uuid_generate_v7ms Function": {
      "type": "Database Function",
      "description": "A custom PostgreSQL function written in `plpgsql` to generate UUID v7, used as the default primary key for most tables.",
      "interactions": {
        "interaction_0": "Called by ActiveRecord during record creation to assign primary keys."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Custom Enum Types": {
      "type": "Database Feature",
      "description": "PostgreSQL enum types (`link_target`, `node_type`, `offer_category`, `payment_frequency`, `sort_mode`) used to enforce specific sets of values for columns, improving data integrity and readability.",
      "interactions": {
        "interaction_0": "Enforce data constraints on various table columns."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "embed_courses View": {
      "type": "Database View",
      "description": "A PostgreSQL view that denormalizes course-related data, combining information from multiple tables for simplified and efficient querying, particularly for frontend display.",
      "interactions": {
        "interaction_0": "Provides a consolidated data source for course information.",
        "interaction_1": "Used by application logic to retrieve complex course details."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Database Seeding Mechanism": {
      "type": "Process",
      "description": "The system for populating the database with initial or sample data, supporting environment-specific seed files.",
      "interactions": {
        "interaction_0": "Loads seed data into the PostgreSQL database via ActiveRecord."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "db/seeds.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "PaperTrail Gem": {
      "type": "Library",
      "description": "A Ruby gem used for auditing changes to ActiveRecord models, indicated by the presence of the `versions` table.",
      "interactions": {
        "interaction_0": "Records changes to tracked models in the `versions` table."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "DelayedJob Gem": {
      "type": "Library",
      "description": "A Ruby gem for handling background jobs, indicated by the `delayed_jobs` table in the schema.",
      "interactions": {
        "interaction_0": "Stores and manages asynchronous tasks for background processing."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "db/schema.rb",
          "cluster:41_INFRA_Database"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "41_INFRA_Database"
        ]
      }
    },
    "Sentry Configuration (Web)": {
      "type": "Configuration",
      "description": "Initializes and configures the Sentry error tracking client for the main `web` application. It defines in-app stack trace patterns, excludes common exceptions, sanitizes event data, sets sampling rates for traces and profiles, ignores health check requests, and sets global tags.",
      "interactions": {
        "interaction_0": "Reports exceptions to the Sentry service.",
        "interaction_1": "Filters sensitive parameters using `ActiveSupport::ParameterFilter`.",
        "interaction_2": "Integrates with `Mnemosyne::Instrumenter` via `AnnotateSentryErrorsForMnemosyne` middleware to attach trace IDs.",
        "interaction_3": "Excludes specific exceptions like `Acfs::BadGateway`, `Restify::ServiceUnavailable`, and `Redis::CannotConnectError`."
      },
      "techDebt": [
        "Duplicated configuration logic across multiple services, leading to maintenance overhead."
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Sentry Configuration (Microservice)": {
      "type": "Configuration",
      "description": "Initializes and configures the Sentry error tracking client for individual microservices. It defines excluded exceptions, sanitizes event data, sets sampling rates for traces and profiles, ignores health check requests, and sets global tags. Largely identical across services.",
      "interactions": {
        "interaction_0": "Reports exceptions to the Sentry service.",
        "interaction_1": "Filters sensitive parameters using `ActiveSupport::ParameterFilter`.",
        "interaction_2": "Excludes specific exceptions like `ApplicationJob::Retry` (in 'account' service), `Redis::CannotConnectError`."
      },
      "techDebt": [
        "Duplicated configuration logic across multiple services, leading to maintenance overhead."
      ],
      "provenance": {
        "sources": [
          "services/account/config/initializers/sentry.rb",
          "services/course/config/initializers/sentry.rb",
          "services/news/config/initializers/sentry.rb",
          "services/notification/config/initializers/sentry.rb",
          "services/pinboard/config/initializers/sentry.rb",
          "services/quiz/config/initializers/sentry.rb",
          "services/timeeffort/config/initializers/sentry.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Mnemosyne Configuration": {
      "type": "Configuration",
      "description": "Configures the Mnemosyne APM client for each application (main `web` and microservices). It specifies the RabbitMQ server endpoint and the application name for tracing purposes.",
      "interactions": {
        "interaction_0": "Connects to RabbitMQ via `XIKOLO_RABBITMQ_URL` to send trace data.",
        "interaction_1": "Identifies the originating application (e.g., 'web', 'account') for traces."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/mnemosyne.yml",
          "services/account/config/mnemosyne.yml",
          "services/course/config/mnemosyne.yml",
          "services/news/config/mnemosyne.yml",
          "services/notification/config/mnemosyne.yml",
          "services/pinboard/config/mnemosyne.yml",
          "services/quiz/config/mnemosyne.yml",
          "services/timeeffort/config/mnemosyne.yml",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "MsgrSentryIntegration": {
      "type": "Module",
      "description": "A Ruby module prepended to `Msgr::Consumer` classes in several microservices. Its purpose is to wrap the `dispatch` method to capture any unhandled exceptions that occur during RabbitMQ message processing and report them to Sentry, while ensuring the exception is re-raised.",
      "interactions": {
        "interaction_0": "Captures `Exception` instances within `Msgr::Consumer` dispatch logic.",
        "interaction_1": "Reports captured exceptions to Sentry using `Sentry.capture_exception`.",
        "interaction_2": "Re-raises exceptions after capture to maintain original error flow.",
        "interaction_3": "Explicitly avoids capturing `Sentry::Error` to prevent infinite loops."
      },
      "techDebt": [
        "The `rubocop:disable Lint/RescueException` comment indicates a suppressed code quality warning, suggesting a broad `rescue Exception` which should be carefully justified.",
        "Missing in `account` and `quiz` services, indicating a gap in error monitoring for their RabbitMQ consumers."
      ],
      "provenance": {
        "sources": [
          "services/course/config/initializers/sentry_msgr.rb",
          "services/news/config/initializers/sentry_msgr.rb",
          "services/notification/config/initializers/sentry_msgr.rb",
          "services/pinboard/config/initializers/sentry_msgr.rb",
          "services/timeeffort/config/initializers/sentry_msgr.rb",
          "services/account/config/initializers/sentry_msgr.rb",
          "services/quiz/config/initializers/sentry_msgr.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "Xikolo.site/Xikolo.brand": {
      "type": "Configuration Values",
      "description": "Global configuration values representing the current site and brand, used to tag Sentry events for better categorization and filtering.",
      "interactions": {
        "interaction_0": "Provides contextual tags to Sentry events."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "cluster:60_DEVOPS_Monitoring"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "60_DEVOPS_Monitoring"
        ]
      }
    },
    "OmniAuth::Builder": {
      "type": "Configuration/Middleware",
      "description": "The Rack middleware responsible for configuring and integrating various third-party authentication strategies (e.g., SAML, OpenID Connect) into the Rails application.",
      "interactions": {
        "interaction_0": "Reads authentication provider configurations from `config/omniauth.yml`.",
        "interaction_1": "Interacts with external Identity Providers (IdPs).",
        "interaction_2": "Facilitates the creation or lookup of Account::User and Account::Authorization records upon successful authentication."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "config/initializers/omniauth.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "bootstrap-editable": {
      "type": "Frontend Library",
      "description": "A jQuery plugin used to provide inline editing functionality for various HTML elements on the user profile page.",
      "interactions": {
        "interaction_0": "Integrated and configured by `account-profile.js`.",
        "interaction_1": "Renders editable UI components and triggers update events."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/legacy/account-profile.js",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "I18n (JS)": {
      "type": "Frontend Library",
      "description": "A JavaScript module providing internationalization capabilities for frontend messages, labels, and date formats.",
      "interactions": {
        "interaction_0": "Used by `account-profile.js` to retrieve localized strings for error messages, placeholders, and date formatting."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/legacy/account-profile.js",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Course::Channel": {
      "type": "Model",
      "description": "Represents a channel that can host multiple courses. It provides methods for querying channels and filtering courses for display on a stage.",
      "interactions": {
        "interaction_0": "Has many `Course::Course` instances. [Source: app/models/course/channel.rb]",
        "interaction_1": "Retrieves logo URLs from `Xikolo::S3`. [Source: app/models/course/channel.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/channel.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Classifier": {
      "type": "Model",
      "description": "Represents a tag or category used to annotate courses for organization and discoverability. Classifiers belong to a `Course::Cluster`.",
      "interactions": {
        "interaction_0": "Belongs to a `Course::Cluster`. [Source: app/models/course/classifier.rb]",
        "interaction_1": "Has many `Course::Course` instances through `ClassifierAssignment`. [Source: app/models/course/classifier.rb]",
        "interaction_2": "Uses `Translations` for localized titles. [Source: app/models/course/classifier.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/classifier.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Cluster": {
      "type": "Model",
      "description": "Groups `Course::Classifier` instances, defining a dimension for course categorization (e.g., 'level of difficulty'). Clusters can be visible or hidden and define sorting modes for their classifiers.",
      "interactions": {
        "interaction_0": "Has many `Course::Classifier` instances. [Source: app/models/course/cluster.rb]",
        "interaction_1": "Uses `Translations` for localized titles. [Source: app/models/course/cluster.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/cluster.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Enrollment": {
      "type": "Model",
      "description": "Represents a user's enrollment in a course, providing methods for filtering active or completed enrollments and accessing associated certificates.",
      "interactions": {
        "interaction_0": "Queried by `DashboardController` to get user's active and completed enrollments.",
        "interaction_1": "Used by `DashboardController#documents` to find enrollments with certificates.",
        "interaction_2": "Belongs to `Course`.",
        "interaction_3": "Provides a scope `active` to filter non-deleted enrollments.",
        "interaction_4": "Checks `forced_submission_date` to determine if an enrollment is `reactivated?`.",
        "interaction_5": "Instantiates a `Proctoring` service if the enrollment is proctored.",
        "interaction_6": "Used by `DashboardController` to fetch active and completed enrollments.",
        "interaction_7": "Used by `Course::EnrollmentsStatistics` for counting enrollments."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/enrollment.rb",
          "app/controllers/dashboard_controller.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::Metadata": {
      "type": "Model",
      "description": "Stores structured metadata (e.g., skills, educational alignment, license) for courses, validated against predefined JSON schemas.",
      "interactions": {
        "interaction_0": "Belongs to a `Course::Course`. [Source: app/models/course/metadata.rb]",
        "interaction_1": "Uses `JSON::Validator.validate!` for data integrity. [Source: app/models/course/metadata.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/metadata.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Offer": {
      "type": "Model",
      "description": "Manages pricing, currencies, categories, and payment frequencies for courses. A course can have multiple offers.",
      "interactions": {
        "interaction_0": "Belongs to a `Course::Course`. [Source: app/models/course/offer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/offer.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Section": {
      "type": "Model",
      "description": "Represents a section within a course, containing learning items and forks. It manages its own availability and fulfillment status.",
      "interactions": {
        "interaction_0": "Belongs to a `Course::Course`. [Source: app/models/course/section.rb]",
        "interaction_1": "Has one `Course::Structure::Section` (node). [Source: app/models/course/section.rb]",
        "interaction_2": "Has many `Course::Item` and `forks`. [Source: app/models/course/section.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/section.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::Visual": {
      "type": "Model",
      "description": "Manages visual assets (images, videos) associated with a course, including S3 integration and asynchronous deletion of old assets.",
      "interactions": {
        "interaction_0": "Belongs to a `Course::Course`. [Source: app/models/course/visual.rb]",
        "interaction_1": "Optionally belongs to a `Video::Video`. [Source: app/models/course/visual.rb]",
        "interaction_2": "Interacts with `Xikolo::S3` for public URLs. [Source: app/models/course/visual.rb]",
        "interaction_3": "Schedules `S3FileDeletionJob` for asynchronous cleanup. [Source: app/models/course/visual.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/models/course/visual.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "app/assets/legacy/course.js": {
      "type": "Frontend Asset (Legacy JS)",
      "description": "A legacy JavaScript entry point that imports other modules related to course statistics, dashboards, and quiz import functionality.",
      "interactions": {
        "interaction_0": "Imports `./statistics/course`. [Source: app/assets/legacy/course.js]",
        "interaction_1": "Imports `./dashboards/course`. [Source: app/assets/legacy/course.js]",
        "interaction_2": "Imports `./course/quiz-import`. [Source: app/assets/legacy/course.js]"
      },
      "techDebt": [
        "The 'legacy' path suggests these modules might be older and could benefit from modernization or refactoring into a more current frontend framework/pattern. [Source: app/assets/legacy/course.js]"
      ],
      "provenance": {
        "sources": [
          "app/assets/legacy/course.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "form.ts": {
      "type": "Frontend Asset (TypeScript)",
      "description": "Manages the dynamic behavior of the course item creation/editing form, toggling visibility of inputs and custom content based on the selected content type.",
      "interactions": {
        "interaction_0": "Interacts with `app/views/items/_form.html.slim` to dynamically display content-specific inputs. ",
        "interaction_1": "Selects and appends templates from `app/views/items/_form_wrapper.html.slim` to `#custom-form`. ",
        "interaction_2": "Attaches event listeners to `exercise_type` and `open_mode` inputs. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Account Service": {
      "type": "Microservice",
      "description": "The dedicated microservice responsible for managing all user-related data, authentication, authorization, and profile information. It exposes an API for these functionalities and handles background jobs related to user management.",
      "interactions": {
        "interaction_0": "Interacts with PostgreSQL for data persistence. ",
        "interaction_1": "Communicates with other services (e.g., Course Service) via RabbitMQ. ",
        "interaction_2": "Utilizes Redis for caching and Sidekiq background job processing. ",
        "interaction_3": "Exposes API endpoints consumed by the main `web` application and other internal services. [Source: config/routes.rb (foundational context)]",
        "interaction_4": "Integrates with S3 for avatar and upload storage. "
      },
      "techDebt": [
        "The service's README is marked as a 'TODO' for improvement. "
      ],
      "provenance": {
        "sources": [
          "docker/compose.account.yml",
          "docker/config/xikolo/account.yml",
          "services/account/config/database.yml",
          "services/account/config/rabbitmq.yml",
          "services/account/config/services.yml",
          "services/account/README.md",
          "config/routes.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Permissions Manager": {
      "type": "Service Component",
      "description": "Manages the definition, loading, and granting of permissions and roles within the Xikolo platform. It ensures that user access is controlled based on assigned roles and groups, adhering to a privacy-by-design principle.",
      "interactions": {
        "interaction_0": "Stores permission, role, and group definitions and assignments in the database. ",
        "interaction_1": "Provides mechanisms (Rake tasks) to load and update permission configurations. ",
        "interaction_2": "Enforces access control for user actions and resource access across the platform, consumed by other services. "
      },
      "techDebt": [
        "Changes to grant mappings for new courses are not automatically applied to existing courses, requiring a separate 'regranting permissions' process. "
      ],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Custom Profile Fields Manager": {
      "type": "Service Component",
      "description": "Provides functionality to define and manage custom profile fields for users, allowing platforms to collect specific demographic or organizational data. It supports various field types and mandatory field enforcement.",
      "interactions": {
        "interaction_0": "Stores custom field definitions and user-provided values in the database. ",
        "interaction_1": "Affects user profile pages and potentially reporting/analytics features by collecting structured user data. ",
        "interaction_2": "Triggers 'interrupt' pages for existing users when new mandatory fields are introduced. "
      },
      "techDebt": [
        "Configuring and updating custom fields is currently only possible from the `xi-account` Rails console, lacking a UI for management. ",
        "Updates to existing select/multi-select fields, especially renaming or removing values, require careful consideration due to potential data integrity issues. "
      ],
      "provenance": {
        "sources": [
          "docs/app/features/profile/custom_fields.md",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "User Management API": {
      "type": "API Endpoint/Service",
      "description": "Provides a set of API endpoints exposed by the Account Service for comprehensive management of user accounts. This includes operations like user creation, retrieval, deletion, password changes, masquerading, and manual account confirmation.",
      "interactions": {
        "interaction_0": "Exposed by the Account Service for consumption by the main `web` application and other authorized internal services. [Source: config/routes.rb (foundational context)]",
        "interaction_1": "Interacts directly with the underlying database to perform CRUD operations on user data. ",
        "interaction_2": "Leverages the Permissions Manager to enforce administrative access controls for sensitive user operations. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/account/lib/tasks/permissions/account.yml",
          "config/routes.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Quiz": {
      "type": "Model/Entity",
      "description": "Represents a single quiz instance, encapsulating its metadata such as name, instructions, attempt limits, time limits, due dates, and publishing status. It can be associated with courses and sections.",
      "interactions": {
        "interaction_0": "Contains multiple 'Question' entities.",
        "interaction_1": "Associated with 'QuizSubmission' entities for user attempts.",
        "interaction_2": "Linked to 'Course' and 'Section' entities (via Course Service)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Question": {
      "type": "Model/Entity",
      "description": "Represents a question within a quiz, including its text, explanation, point value, and type (e.g., MultipleChoice, FreeText).",
      "interactions": {
        "interaction_0": "Belongs to a 'Quiz'.",
        "interaction_1": "Contains multiple 'Answer' entities."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Answer": {
      "type": "Model/Entity",
      "description": "Represents a possible answer option for a 'Question', including its text, explanation, and a flag indicating if it's correct. Supports different answer types.",
      "interactions": {
        "interaction_0": "Belongs to a 'Question'."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizSubmission": {
      "type": "Model/Entity",
      "description": "Represents a user's attempt and submitted responses for a specific quiz. This entity tracks the state and results of a user's interaction with a quiz.",
      "interactions": {
        "interaction_0": "Associated with a 'Quiz'.",
        "interaction_1": "Associated with a 'User' (from Account Service)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizImporter": {
      "type": "Service/Utility",
      "description": "A conceptual component responsible for parsing and processing XML files that conform to the `quiz_import_schema.xml` to create or update 'Quiz', 'Question', and 'Answer' entities within the system.",
      "interactions": {
        "interaction_0": "Reads and validates XML data.",
        "interaction_1": "Creates/updates 'Quiz' entities.",
        "interaction_2": "Creates/updates 'Question' entities.",
        "interaction_3": "Creates/updates 'Answer' entities."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "QuizSubmissionNavigator": {
      "type": "Frontend Script",
      "description": "A client-side JavaScript module responsible for handling navigation to different quiz submissions. It listens for changes in a dropdown (`[data-behavior='navigate-to-submission']`) and redirects the browser to the selected submission's URL.",
      "interactions": {
        "interaction_0": "Interacts with the DOM to find the submission selection element.",
        "interaction_1": "Modifies `window.location.replace` to navigate the user."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/course/items/quiz.ts",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "ACFS Client Models (e.g., Xikolo::Quiz::Question)": {
      "type": "ACFS Client Model",
      "description": "Client-side representations of resources managed by the `quiz` and `submission` microservices. These models provide an ActiveRecord-like interface for the frontend application to interact with the microservices' APIs, abstracting away direct HTTP calls.",
      "interactions": {
        "interaction_0": "Perform `find`, `where`, `new`, `save!`, `update_attributes`, `delete!` operations, which translate into API calls to the respective microservices.",
        "interaction_1": "Enqueue further ACFS requests for associated resources (e.g., questions enqueue answers) to facilitate concurrent data fetching."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Microservice API Clients (Xikolo.api(:quiz), Xikolo.api(:course))": {
      "type": "API Client",
      "description": "Instances of `Restify` clients used for direct, low-level interaction with the `quiz` and `course` microservices. They allow making specific HTTP requests (`get`, `post`, `patch`, `delete`) to defined relations (`rel`) within the microservices' APIs.",
      "interactions": {
        "interaction_0": "Send HTTP requests to the `quiz` and `course` microservices for data retrieval and manipulation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_answers_controller.rb",
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_recap_controller.rb",
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Proctoring::ItemContext": {
      "type": "Service/Context Object",
      "description": "Encapsulates logic and context specific to proctoring for a given quiz item. It determines if proctoring is enabled and available for the item and course.",
      "interactions": {
        "interaction_0": "Receives `course`, `item`, and `enrollment` objects to establish proctoring context.",
        "interaction_1": "Interacts with `Proctoring::SmowlAdapter` to check service availability."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "cluster:10_LEARN_QuizAssessment"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "10_LEARN_QuizAssessment"
        ]
      }
    },
    "Course Microservice": {
      "type": "Microservice",
      "description": "A dedicated service for managing course content, metadata, and user enrollments. It exposes a public API and interacts with other services via RabbitMQ for asynchronous communication and `restify` for synchronous HTTP calls.",
      "interactions": {
        "interaction_0": "Interacts with PostgreSQL for data storage. [Source: docker/compose.course.yml, services/course/config/database.yml]",
        "interaction_1": "Communicates with RabbitMQ for event-driven interactions. [Source: docker/compose.course.yml, services/course/config/rabbitmq.yml]",
        "interaction_2": "Utilizes Redis for caching and Sidekiq job queuing. [Source: docker/compose.course.yml]",
        "interaction_3": "Integrates with S3 for file storage (e.g., course images). [Source: docker/config/xikolo/course.yml]",
        "interaction_4": "Interacts with Account Service for user and role information. [Source: services/course/config/services.yml]",
        "interaction_5": "Interacts with Notification Service for sending notifications. [Source: services/course/config/services.yml]",
        "interaction_6": "Interacts with Quiz Service for graded assignments and points. [Source: services/course/config/services.yml]",
        "interaction_7": "Interacts with Pinboard Service for course discussions. [Source: services/course/config/services.yml]",
        "interaction_8": "Interacts with Submission Service for handling submissions. [Source: services/course/config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.course.yml",
          "services/course/README.md",
          "services/course/config/services.yml",
          "services/course/config/database.yml",
          "services/course/config/rabbitmq.yml",
          "docker/config/xikolo/course.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course (Model/Entity)": {
      "type": "Model/Entity",
      "description": "Represents a learning course with attributes like unique identifiers (`id`, `course_code`), descriptive information (`name`, `abstract`, `description`), organizational details (`teachers`, `channel`, `classifiers`), and lifecycle status (`state`, `start_date`, `end_date`).",
      "interactions": {
        "interaction_0": "Associated with multiple Enrollments. [Source: services/course/README.md]",
        "interaction_1": "Exposed and managed via the CourseServiceAPI. [Source: services/course/README.md]",
        "interaction_2": "References S3Integration for `image_url`. [Source: services/course/README.md, docker/config/xikolo/course.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/README.md",
          "db/schema.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Enrollment (Model/Entity)": {
      "type": "Model/Entity",
      "description": "Represents a user's participation in a specific course, tracking progress metrics (`visits`, `points`), and completion status (`completed`, `confirmed`).",
      "interactions": {
        "interaction_0": "Belongs to a Course. [Source: services/course/README.md]",
        "interaction_1": "Associated with a User (managed by Account Service). [Source: services/course/README.md, services/course/config/services.yml]",
        "interaction_2": "Managed and updated via the CourseServiceAPI. [Source: services/course/README.md]",
        "interaction_3": "Influences CertificateLogic for achievement calculations. [Source: services/course/app/xikolo.yml]"
      },
      "techDebt": [
        "The `visits` field description is marked as `TODO`. [Source: services/course/README.md]",
        "The `points` field description is marked as `TODO`. [Source: services/course/README.md]"
      ],
      "provenance": {
        "sources": [
          "services/course/README.md",
          "db/schema.rb",
          "services/course/app/xikolo.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "CourseServiceAPI": {
      "type": "API Endpoint",
      "description": "Provides RESTful endpoints for interacting with course and enrollment data. It allows clients to list courses, retrieve specific course details, and manage user enrollments (create, update, delete).",
      "interactions": {
        "interaction_0": "Reads and writes Course data. [Source: services/course/README.md]",
        "interaction_1": "Reads and writes Enrollment data. [Source: services/course/README.md]",
        "interaction_2": "Relies on authentication/authorization from the Account Service. [Source: services/course/config/services.yml]",
        "interaction_3": "Used by `restify` clients for internal service communication."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/README.md",
          "config/routes.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Msgr (RabbitMQ Client)": {
      "type": "Messaging Component",
      "description": "Handles asynchronous communication with other microservices using RabbitMQ. It acts as both a consumer and publisher of messages, facilitating event-driven interactions across the system.",
      "interactions": {
        "interaction_0": "Connects to RabbitMQ for message exchange. [Source: docker/compose.course.yml, services/course/config/rabbitmq.yml]",
        "interaction_1": "Exchanges messages with Account Service, Notification Service, Quiz Service, and TimeEffort Service. [Source: services/course/config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.course.yml",
          "services/course/config/rabbitmq.yml",
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Sidekiq (Background Processor)": {
      "type": "Background Processor",
      "description": "Processes asynchronous tasks, such as complex calculations for progress and achievements, certificate generation, or data synchronization, to offload work from the main API server.",
      "interactions": {
        "interaction_0": "Uses Redis as a job queue. [Source: docker/compose.course.yml]",
        "interaction_1": "Executes tasks related to CertificateLogic and Enrollment updates. [Source: docker/compose.course.yml, services/course/app/xikolo.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.course.yml",
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "XikoloConfig (Configuration Management)": {
      "type": "Configuration Service",
      "description": "Manages application-specific settings for the Course service, including S3 bucket names, achievement thresholds, open mode settings, and definitions for course-specific roles and permissions.",
      "interactions": {
        "interaction_0": "Configures S3Integration with bucket names. [Source: docker/config/xikolo/course.yml]",
        "interaction_1": "Defines parameters for CertificateLogic (e.g., `cop_threshold_percentage`). [Source: services/course/app/xikolo.yml]",
        "interaction_2": "Specifies settings for RoleManagement (e.g., `course_groups` and grants). [Source: services/course/app/xikolo.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/config/xikolo/course.yml",
          "services/course/app/xikolo.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "S3Integration": {
      "type": "External Service Integration",
      "description": "Handles storage and retrieval of files, such as course images and LTI-related assets, using S3-compatible object storage. Configured with specific bucket names for different asset types.",
      "interactions": {
        "interaction_0": "Stores and retrieves course images referenced by the Course model. [Source: services/course/README.md, docker/config/xikolo/course.yml]",
        "interaction_1": "Interacts with AWS S3 or a compatible object storage service. [Source: docker/config/xikolo/course.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/config/xikolo/course.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "CertificateLogic": {
      "type": "Business Logic",
      "description": "Implements the rules and calculations for users to achieve 'Confirmation of Participation' and 'Record of Achievement' certificates based on their progress and points within a course.",
      "interactions": {
        "interaction_0": "Evaluates Enrollment data against configured thresholds. [Source: services/course/app/xikolo.yml]",
        "interaction_1": "Requires progress data (e.g., visits from TimeEffort Service) and points data (from Quiz Service). [Source: services/course/app/xikolo.yml, services/course/config/locales/en.yml]",
        "interaction_2": "May trigger Sidekiq jobs for certificate generation. [Source: docker/compose.course.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/xikolo.yml",
          "services/course/config/locales/de.yml",
          "services/course/config/locales/en.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "RoleManagement": {
      "type": "Authorization Logic",
      "description": "Defines and manages user groups and their associated roles within the context of a course (e.g., students, admins, moderators, teachers), granting specific permissions across various domains.",
      "interactions": {
        "interaction_0": "Configured via XikoloConfig (`course_groups`). [Source: services/course/app/xikolo.yml]",
        "interaction_1": "Interacts with the Account Service to manage actual user groups and role assignments. [Source: services/course/app/xikolo.yml, services/course/config/services.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/course/app/xikolo.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Pinboard Microservice": {
      "type": "Microservice",
      "description": "The core service responsible for managing all discussion forum functionalities, including questions, answers, comments, votes, tags, subscriptions, and abuse reports. It acts as a central hub for user-generated discussion content.",
      "interactions": {
        "interaction_0": "Communicates with PostgreSQL for data persistence. ",
        "interaction_1": "Exposes an HTTP API for client-side and internal service interactions. ",
        "interaction_2": "Sends and receives messages via RabbitMQ using `msgr` for asynchronous operations and inter-service communication. ",
        "interaction_3": "Interacts with Redis for caching and Sidekiq job management. ",
        "interaction_4": "Utilizes S3 for storing associated files or assets. ",
        "interaction_5": "Calls the Account service for user-related information. ",
        "interaction_6": "Calls the Course service for course-related context. ",
        "interaction_7": "Sends notifications to the Notification service. "
      },
      "techDebt": [
        "The `services/pinboard/README.md` is empty, indicating a lack of specific service-level documentation. "
      ],
      "provenance": {
        "sources": [
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Pinboard API Server": {
      "type": "API Endpoint",
      "description": "The HTTP server component of the Pinboard microservice, responsible for exposing the discussion forum API endpoints to clients and other services. It handles synchronous requests for creating, retrieving, updating, and deleting discussion content.",
      "interactions": {
        "interaction_0": "Receives HTTP requests from the main `web` application or other services.",
        "interaction_1": "Interacts with the PostgreSQL database via ActiveRecord. ",
        "interaction_2": "May publish messages to RabbitMQ for asynchronous processing. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Pinboard Msgr Consumer": {
      "type": "Message Consumer",
      "description": "A dedicated process within the Pinboard microservice that consumes messages from RabbitMQ. It handles asynchronous tasks and events originating from other services or internal processes, ensuring decoupled communication.",
      "interactions": {
        "interaction_0": "Connects to RabbitMQ to subscribe to and process messages. ",
        "interaction_1": "May interact with the PostgreSQL database based on message content. ",
        "interaction_2": "May trigger Sidekiq jobs for further background processing. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Pinboard Sidekiq Worker": {
      "type": "Background Job Processor",
      "description": "The component responsible for executing background jobs within the Pinboard microservice. These jobs handle tasks that are too time-consuming or resource-intensive for synchronous processing, such as sending notifications, processing sentiment analysis, or data maintenance.",
      "interactions": {
        "interaction_0": "Pulls jobs from Redis-backed Sidekiq queues. ",
        "interaction_1": "Interacts with the PostgreSQL database. ",
        "interaction_2": "May interact with S3 for file operations. ",
        "interaction_3": "May publish messages to RabbitMQ. ",
        "interaction_4": "May call external services like Notification. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "",
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "Sentiment Analysis Module": {
      "type": "Module/Feature",
      "description": "A module within the Pinboard service dedicated to analyzing the sentiment of discussion posts. It likely uses predefined dictionaries to classify the emotional tone of user-generated content.",
      "interactions": {
        "interaction_0": "Processes text content from discussion posts (questions, answers, comments). ",
        "interaction_1": "May store sentiment results in the PostgreSQL database. ",
        "interaction_2": "Likely integrated into background jobs (Sidekiq) for asynchronous processing. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:11_LEARN_Discussion"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "11_LEARN_Discussion"
        ]
      }
    },
    "announcements.scss": {
      "type": "Stylesheet",
      "description": "Provides styling for the administrative announcement forms and email status displays.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/admin/announcements/announcements.scss",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "Notification Service": {
      "type": "Microservice",
      "description": "The central service responsible for generating, styling, and sending all email-based notifications across the Xikolo platform. It acts as an event consumer and email dispatcher.",
      "interactions": {
        "interaction_0": "Receives events from other microservices (e.g., account, course, news, pinboard) via RabbitMQ. ",
        "interaction_1": "Sends emails to users. ",
        "interaction_2": "Interacts with PostgreSQL for data storage. ",
        "interaction_3": "Interacts with Redis for Sidekiq job queues. "
      },
      "techDebt": [
        "The `notification-server` component's purpose is unclear; it's marked \"only for debugging\" but is part of the standard deployment. Its role should be clarified or removed if unused in production. "
      ],
      "provenance": {
        "sources": [
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Msgr Consumer": {
      "type": "Message Consumer",
      "description": "A component within the Notification Service responsible for subscribing to and processing messages from RabbitMQ. It parses incoming event data and initiates the notification generation process.",
      "interactions": {
        "interaction_0": "Receives messages from RabbitMQ. ",
        "interaction_1": "Invokes `Consumer` and `ConsumerHelper` methods to handle specific event types. ",
        "interaction_2": "Triggers email generation and queues jobs for `Sidekiq Worker`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Mailer": {
      "type": "Email Sender",
      "description": "Responsible for constructing the actual email content, applying styling, and dispatching emails. It uses localized templates and integrates with email styling libraries.",
      "interactions": {
        "interaction_0": "Receives data from `Msgr Consumer` or `Sidekiq Worker`. ",
        "interaction_1": "Uses locale files (`de.yml`, `en.yml`) for subject and body text. ",
        "interaction_2": "Utilizes `premailer`, `inky`, and `foundation` for email styling. ",
        "interaction_3": "Sends emails (likely via an external SMTP service, not detailed in provided context)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "Sidekiq Worker": {
      "type": "Background Job Processor",
      "description": "Handles asynchronous tasks, primarily the actual sending of emails, to avoid blocking the main message consumption process.",
      "interactions": {
        "interaction_0": "Receives jobs from `Msgr Consumer` or other parts of the `Notification Service`. ",
        "interaction_1": "Interacts with Redis for job queuing. ",
        "interaction_2": "Invokes `Mailer` to send emails. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Foundational Context: Background Jobs",
          "cluster:21_COMM_Notifications"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "21_COMM_Notifications"
        ]
      }
    },
    "News Service (Microservice)": {
      "type": "Microservice",
      "description": "The core service responsible for managing global and course-specific news and announcements. It handles the storage, retrieval, and distribution of news items, including sending notifications and managing related assets.",
      "interactions": {
        "interaction_0": "Interacts with PostgreSQL for data persistence. [Source: services/news/config/database.yml]",
        "interaction_1": "Communicates with RabbitMQ for asynchronous messaging (both consuming and publishing). [Source: docker/compose.news.yml, services/news/config/rabbitmq.yml]",
        "interaction_2": "Interacts with Redis for caching and Sidekiq job management. [Source: docker/compose.news.yml]",
        "interaction_3": "Communicates with the Account service (e.g., for user details, notification preferences). [Source: services/news/config/services.yml, services/news/config/locales/en.yml]",
        "interaction_4": "Communicates with the Course service (e.g., for course context for course news). [Source: services/news/config/services.yml]",
        "interaction_5": "Integrates with S3 for storing news-related assets in 'news' and 'uploads' buckets. [Source: docker/config/xikolo/news.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/news/README.md",
          "docker/compose.news.yml",
          "docker/config/xikolo/news.yml",
          "services/news/config/database.yml",
          "services/news/config/locales/en.yml",
          "services/news/config/rabbitmq.yml",
          "services/news/config/services.yml",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "News Msgr Consumer": {
      "type": "Message Consumer",
      "description": "A component of the News Service that listens to and processes messages from RabbitMQ. It is responsible for reacting to events related to news creation, updates, or triggers for sending notifications.",
      "interactions": {
        "interaction_0": "Consumes messages from RabbitMQ. [Source: docker/compose.news.yml, services/news/config/rabbitmq.yml]",
        "interaction_1": "Interacts with the News Service's PostgreSQL database for data operations.",
        "interaction_2": "May trigger Sidekiq jobs for background processing."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.news.yml",
          "services/news/config/rabbitmq.yml",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "News API Server": {
      "type": "API Server",
      "description": "Provides RESTful API endpoints for external and internal clients to interact with the News Service. This includes operations for creating, retrieving, updating, and deleting news items.",
      "interactions": {
        "interaction_0": "Exposes an HTTP API (debug port 4300). [Source: docker/compose.news.yml]",
        "interaction_1": "Interacts with the News Service's PostgreSQL database for data operations.",
        "interaction_2": "May publish messages to RabbitMQ (e.g., 'news created' events)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.news.yml",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "News Sidekiq Worker": {
      "type": "Background Worker",
      "description": "Handles asynchronous tasks for the News Service, such as sending email notifications, processing S3 uploads, or other long-running operations related to news distribution and asset management.",
      "interactions": {
        "interaction_0": "Processes jobs from the Redis-backed Sidekiq queue. [Source: docker/compose.news.yml]",
        "interaction_1": "Interacts with the News Service's PostgreSQL database.",
        "interaction_2": "Sends emails for notifications (implied by locale files). [Source: services/news/config/locales/en.yml]",
        "interaction_3": "Interacts with S3 for file storage and retrieval. [Source: docker/config/xikolo/news.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docker/compose.news.yml",
          "services/news/config/locales/en.yml",
          "docker/config/xikolo/news.yml",
          "cluster:20_COMM_Announcements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "20_COMM_Announcements"
        ]
      }
    },
    "VideoPlayerFrontendLogic": {
      "type": "Frontend Logic",
      "description": "Handles client-side interactions for video playback, including seeking to timestamps, creating discussion topics with video timestamps, and forwarding keyboard shortcuts to the video player. It interacts with a custom `xm-player` web component.",
      "interactions": {
        "interaction_0": "Interacts with `xm-player` (custom web component) to control video playback and retrieve progress. [Source: app/assets/course/items/video.js]",
        "interaction_1": "Sends POST requests to the backend API for creating new discussion topics. [Source: app/assets/course/items/video.js]",
        "interaction_2": "Uses `I18n` for internationalization of timestamp text. [Source: app/assets/course/items/video.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/course/items/video.js",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "VideoStreamAutocompletion": {
      "type": "Frontend Logic",
      "description": "Provides auto-completion functionality for selecting lecturer and slides video streams based on a chosen Picture-in-Picture (PIP) stream. It fetches stream data from an admin API endpoint.",
      "interactions": {
        "interaction_0": "Makes an AJAX GET request to `/admin/streams` to fetch stream data. [Source: app/assets/teacher/items/video-streams.ts]",
        "interaction_1": "Updates `TomInput` select elements for lecturer and slides streams. [Source: app/assets/teacher/items/video-streams.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/video-streams.ts",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "VideoItemFormHandler": {
      "type": "Frontend Logic",
      "description": "Manages the visibility of form elements for video items, specifically the public description based on an 'open mode' checkbox. It integrates the `VideoStreamAutocompletion` logic.",
      "interactions": {
        "interaction_0": "Calls `setVisibility` and `hideAndUncheckSwitch` from `form-helpers` to manage UI elements. [Source: app/assets/teacher/items/video.ts]",
        "interaction_1": "Invokes `videoStreamsAutocompletion` to enable stream auto-selection. [Source: app/assets/teacher/items/video.ts]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/video.ts",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "Video::Provider": {
      "type": "Model",
      "description": "Represents a video provider (e.g., Vimeo, Azure). Stores configuration and credentials for external video services.",
      "interactions": {
        "interaction_0": "Managed by `Admin::VideoProvidersController`. [Source: app/controllers/admin/video_providers_controller.rb]",
        "interaction_1": "Used by `Admin::VideoProviderSyncController` to initiate syncs. [Source: app/controllers/admin/video_provider_sync_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/video_providers_controller.rb",
          "app/controllers/admin/video_provider_sync_controller.rb",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "xm-player": {
      "type": "Web Component (External)",
      "description": "An external custom web component for video playback, developed in a separate GitHub repository. It provides a public API for controlling playback, seeking, and retrieving progress.",
      "interactions": {
        "interaction_0": "Used by `VideoPlayerFrontendLogic` for video control and progress retrieval. [Source: app/assets/course/items/video.js]",
        "interaction_1": "Receives keyboard events forwarded from the document body. [Source: app/assets/course/items/video.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/course/items/video.js",
          "cluster:12_LEARN_VideoStreaming"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "12_LEARN_VideoStreaming"
        ]
      }
    },
    "OpenBadgeBakery": {
      "type": "Library",
      "description": "Responsible for 'baking' Open Badge assertions into PNG image files. This involves embedding a signed JSON Web Token (JWT) assertion as an iTXt chunk within the image.",
      "interactions": {
        "interaction_0": "Takes an assertion (hash), image URL, and private key as input. [Source: spec/lib/open_badge_bakery_spec.rb]",
        "interaction_1": "Fetches the badge image from the provided `image_url`. [Source: spec/lib/open_badge_bakery_spec.rb]",
        "interaction_2": "Uses `ChunkyPNG` for manipulating PNG image chunks. [Source: spec/lib/open_badge_bakery_spec.rb]",
        "interaction_3": "Uses `JWT` gem for signing the assertion with the `RS256` algorithm. [Source: spec/lib/open_badge_bakery_spec.rb, spec/support/badge_support.rb]",
        "interaction_4": "Uses `OpenSSL::PKey::RSA` for key management. [Source: spec/support/badge_support.rb]",
        "interaction_5": "Reads `open_badge_private_key` from `Rails.application.secrets` for signing. [Source: spec/lib/open_badge_bakery_spec.rb]",
        "interaction_6": "Reads `public_key` from `Xikolo.config.open_badges` for assertion verification (in tests). [Source: spec/lib/open_badge_bakery_spec.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "spec/lib/open_badge_bakery_spec.rb",
          "spec/support/badge_support.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::RecordOfAchievement": {
      "type": "Model",
      "description": "Represents an issued PDF certificate (Record of Achievement) for a specific user in a course, linked to a `Certificate::Template`.",
      "interactions": {
        "interaction_0": "Linked to `Certificate::Template`. ",
        "interaction_1": "Can be rendered into a PDF via `Certificate::Record::Render`. [Source: app/operations/certificate/record/render.rb]",
        "interaction_2": "Can have associated `Certificate::V2::OpenBadge` instances. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::V2::OpenBadge": {
      "type": "Model",
      "description": "Represents an issued Open Badge, linked to a `Certificate::RecordOfAchievement` and a `Certificate::OpenBadgeTemplate`.",
      "interactions": {
        "interaction_0": "Linked to `Certificate::RecordOfAchievement` and `Certificate::OpenBadgeTemplate`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "FileUpload": {
      "type": "Model",
      "description": "An inferred Ruby class (likely part of `xikolo-s3` or `xikolo-common`) responsible for generating S3 pre-signed URLs, S3 fields (e.g., `key`, `content_type`), and validation parameters (max size, allowed extensions) for file uploads.",
      "interactions": {
        "interaction_0": "Instantiated by `ImageUploadInput` and `UploadInput` to prepare S3 upload data. [Source: app/inputs/image_upload_input.rb, Source: app/inputs/upload_input.rb]",
        "interaction_1": "Provides `url`, `id`, `fields`, `prefix`, `content_type`, `size`, `extension_filter` methods. [Source: app/inputs/image_upload_input.rb, Source: app/inputs/upload_input.rb]",
        "interaction_2": "Likely interacts with `Xikolo::S3` for actual file storage. ",
        "interaction_3": "Initialized by `ImageUploadInput` and `UploadInput` with upload-specific parameters.",
        "interaction_4": "Interacts with `Xikolo::S3.bucket_for(:uploads)` to obtain an S3 bucket instance.",
        "interaction_5": "Generates an `Aws::S3::PresignedPost` with configured `key_starts_with`, `acl`, `signature_expiration`, and metadata (`xikolo-purpose`, `xikolo-state`, `image-target-height/width`).",
        "interaction_6": "Provides `url` and `fields` methods for frontend consumption.",
        "interaction_7": "Maps MIME types to file extensions for validation via `extension_filter`.",
        "interaction_8": "Used by `Course::Admin::CertificateTemplatesController` for PDF uploads. [Source: app/controllers/course/admin/certificate_templates_controller.rb]",
        "interaction_9": "Used by `Course::Admin::OpenBadgeTemplatesController` for PNG uploads. [Source: app/controllers/course/admin/open_badge_templates_controller.rb]"
      },
      "techDebt": [
        "The current implementation aligns with the 'Upload by id (SingleFileUpload)' approach described in `xikolo-s3` documentation, which is noted to have 'drawbacks' and `UploadByUri` is preferred for new implementations. This indicates a potential for future refactoring or migration. "
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "app/controllers/course/admin/open_badge_templates_controller.rb",
          "app/inputs/image_upload_input.rb",
          "app/inputs/upload_input.rb",
          "cluster:13_LEARN_FileManagement",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement",
          "14_LEARN_Achievements"
        ]
      }
    },
    "Certificate::RenderDataPresenter": {
      "type": "Presenter",
      "description": "A presenter object (inferred from specs) that aggregates and formats all necessary data for `Certificate::RecordRenderer` to generate a PDF certificate. This includes template path, dynamic content, QR code details, proctoring image, and transcript of records.",
      "interactions": {
        "interaction_0": "Provides data to `Certificate::RecordRenderer`. [Source: spec/lib/certificate/record_renderer_spec.rb]",
        "interaction_1": "Likely instantiated by a `Certificate::Record` object via a `render_data` method. [Source: app/operations/certificate/record/render.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "spec/lib/certificate/record_renderer_spec.rb",
          "app/operations/certificate/record/render.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Course::CertificateTemplatePresenter": {
      "type": "Presenter",
      "description": "A presenter object used to decorate `Certificate::Template` instances for display in the admin index view, providing a cleaner interface for view logic.",
      "interactions": {
        "interaction_0": "Instantiated by `Course::Admin::CertificateTemplatesController` for each `Certificate::Template` in the index action. [Source: app/controllers/course/admin/certificate_templates_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "cluster:14_LEARN_Achievements"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "14_LEARN_Achievements"
        ]
      }
    },
    "Admin::BansController": {
      "type": "Controller",
      "description": "Manages user banning functionality. Prevents a user from banning themselves.",
      "interactions": {
        "interaction_0": "Communicates with the `account` microservice via `Xikolo.api(:account)` to post user ban requests."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/bans_controller.rb",
          "spec/requests/admin/bans/create_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::BaseController": {
      "type": "Controller",
      "description": "Base controller for all administrative frontend controllers, inheriting from `Abstract::FrontendController`.",
      "interactions": {
        "interaction_0": "Inherits common functionalities from ApplicationController. [Source: app/controllers/admin/base_controller.rb]",
        "interaction_1": "Uses Xikolo::Common::Auth::CurrentUser for permission checks. [Source: app/controllers/admin/base_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/base_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ChannelsController": {
      "type": "Controller",
      "description": "Provides CRUD operations for course channels. Uses `Admin::ChannelEditPresenter` for data presentation and `Admin::ChannelForm` for form handling.",
      "interactions": {
        "interaction_0": "Renders views using Admin::ChannelEditPresenter. [Source: app/controllers/admin/channels_controller.rb]",
        "interaction_1": "Uses `Admin::ChannelEditPresenter` to prepare channel data for views.",
        "interaction_2": "Uses `Admin::ChannelForm` for form validation and resource conversion.",
        "interaction_3": "Communicates with the `course` microservice via `Xikolo.api(:course)` for channel data management."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/channels_controller.rb",
          "app/presenters/admin/channel_edit_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ChannelsOrderController": {
      "type": "Controller",
      "description": "Manages the display order of course channels. Uses `Admin::ChannelOrderPresenter` to prepare data for ordering view.",
      "interactions": {
        "interaction_0": "Communicates with the `course` microservice via `Xikolo.api(:course)` to update channel positions.",
        "interaction_1": "Uses `Admin::ChannelOrderPresenter` to prepare channel data for ordering."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/channels_order_controller.rb",
          "app/presenters/admin/channel_order_presenter.rb",
          "spec/requests/admin/channels_order/update_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::Classifier::CoursesOrderController": {
      "type": "Controller",
      "description": "Manages the ordering of courses within a specific classifier. It performs a destructive update by deleting all existing assignments and recreating them with new positions.",
      "interactions": {
        "interaction_0": "Renders views using Admin::Classifier::CoursesOrderPresenter. [Source: app/controllers/admin/classifier/courses_order_controller.rb]",
        "interaction_1": "Interacts with `Course::Course` to validate course IDs.",
        "interaction_2": "Uses `Admin::Classifier::CoursesOrderPresenter` for view data.",
        "interaction_3": "Interacts with `Course::Classifier` and `Course::ClassifierAssignment` models to manage course ordering."
      },
      "techDebt": [
        "The destruction and recreation of `classifier_assignments` is a workaround for `acts_as_list` limitations on join tables."
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/classifier/courses_order_controller.rb",
          "app/presenters/admin/classifier/courses_order_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ClassifiersController": {
      "type": "Controller",
      "description": "Provides CRUD operations for course classifiers, which are associated with clusters. Manages classifier titles, translations, and descriptions.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Classifier` and `Course::Cluster` models for data persistence."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/classifiers_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::Cluster::ClassifiersOrderController": {
      "type": "Controller",
      "description": "Manages the display order of classifiers within a specific cluster. Updates positions and sets the cluster's sort mode to 'manual'.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Cluster` and `Course::Classifier` models to update ordering."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/cluster/classifiers_order_controller.rb",
          "app/presenters/admin/cluster_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ClustersController": {
      "type": "Controller",
      "description": "Manages course clusters, including listing, showing details, editing, and updating visibility and translations. Uses `Admin::ClusterPresenter` for view data.",
      "interactions": {
        "interaction_0": "Renders views using Admin::ClusterPresenter. [Source: app/controllers/admin/clusters_controller.rb]",
        "interaction_1": "Uses `Admin::ClusterPresenter` to prepare cluster data for views.",
        "interaction_2": "Interacts with `Course::Cluster` model for data persistence."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/clusters_controller.rb",
          "app/presenters/admin/cluster_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::CourseManagementController": {
      "type": "Controller",
      "description": "A controller handling various course-related administrative tasks such as statistics, quiz submissions, quiz import/preview, and ranking generation. It's identified as a candidate for refactoring.",
      "interactions": {
        "interaction_0": "Interacts with Course Microservice via Xikolo.api(:course). [Source: app/controllers/admin/course_management_controller.rb]",
        "interaction_1": "Interacts with Quiz Service via Xikolo.api(:quiz). [Source: app/controllers/admin/course_management_controller.rb]",
        "interaction_2": "Communicates with QuizImporter service via Restify. [Source: app/controllers/admin/course_management_controller.rb]",
        "interaction_3": "Uses Acfs for concurrent API calls. [Source: app/controllers/admin/course_management_controller.rb]",
        "interaction_4": "Uses `Acfs.run` for asynchronous data fetching.",
        "interaction_5": "Communicates with `course` microservice via `Xikolo.api(:course)` for course, section, item, and statistics data.",
        "interaction_6": "Communicates with `quiz` microservice via `Xikolo.api(:quiz)` for quiz, submission, and statistics data.",
        "interaction_7": "Communicates with `quizimporter` service via `Restify` for spreadsheet-based quiz imports.",
        "interaction_8": "Interacts with `Xikolo::Course::Stat`, `Xikolo::Account::User`, `Quiz::Submission`, `Course::Item`, `Xikolo::Quiz::Quiz`, `Xikolo::Course::Section` models/wrappers."
      },
      "techDebt": [
        "\"TODO: refactor with callback\" - `Acfs.run` usage.",
        "\"TODO: decide how to handle deleted items\" - in `submissions` action.",
        "\"this is totally ruff, but is a blueprint for our analytics master thesis (jr)\" - general comment on `submission_statistics` action.",
        "\"A controller that holds actions loosely related to a course Should be extracted to proper resource-based controllers\" - general comment on the controller itself."
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/course_management_controller.rb",
          "spec/controllers/admin/course_management_controller_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::CoursesController": {
      "type": "Controller",
      "description": "Manages the lifecycle of courses (listing, creating, editing, cloning, deleting). Uses `Admin::CourseEditPresenter` and `Admin::CourseListPresenter` for views and `Admin::CourseForm` for form handling. Course cloning is an asynchronous operation.",
      "interactions": {
        "interaction_0": "Renders views using Admin::CourseEditPresenter. [Source: app/controllers/admin/courses_controller.rb]",
        "interaction_1": "Renders views using Admin::CourseListPresenter. [Source: app/controllers/admin/courses_controller.rb]",
        "interaction_2": "Publishes messages to Msgr (RabbitMQ) for course cloning. [Source: app/controllers/admin/courses_controller.rb]",
        "interaction_3": "Uses `Admin::CourseListPresenter` for course index listing.",
        "interaction_4": "Uses `Admin::CourseForm` for form validation and resource conversion.",
        "interaction_5": "Communicates with the `course` microservice via `Xikolo.api(:course)` for all course data and operations.",
        "interaction_6": "Initiates course cloning via `Msgr.publish` to the `xikolo.course.clone` topic.",
        "interaction_7": "Uses `Admin::CourseEditPresenter` for course creation/editing forms."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/courses_controller.rb",
          "app/presenters/admin/course_edit_presenter.rb",
          "app/presenters/admin/course_list_presenter.rb",
          "spec/controllers/admin/courses_controller_spec.rb",
          "spec/requests/admin/courses/list_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::DashboardController": {
      "type": "Controller",
      "description": "Displays the main administrative dashboard, presenting a navigation menu tailored to the current user's permissions.",
      "interactions": {
        "interaction_0": "Inherits from Admin::BaseController. [Source: app/controllers/admin/dashboard_controller.rb]",
        "interaction_1": "Uses `PlatformDashboardNav` to determine navigation items based on user permissions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/dashboard_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ManualConfirmationsController": {
      "type": "Controller",
      "description": "Allows administrators to manually confirm a user's email address.",
      "interactions": {
        "interaction_0": "Communicates with the `account` microservice via `Xikolo.api(:account)` to fetch user and email data, then patch the email confirmation status."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/manual_confirmations_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::MasqueradesController": {
      "type": "Controller",
      "description": "Enables administrators to masquerade as other users for debugging or support purposes. Manages session and CSRF tokens during masquerading.",
      "interactions": {
        "interaction_0": "Communicates with the `account` microservice via `Xikolo.api(:account)` to manage user sessions and masquerade status."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/masquerades_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::PermissionsController": {
      "type": "Controller",
      "description": "Manages user permissions by adding or removing users from specific groups. The group names are prefixed with 'xikolo.'.",
      "interactions": {
        "interaction_0": "Communicates with the `account` microservice via `Xikolo.api(:account)` to manage user group memberships."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/permissions_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::PollOptionsController": {
      "type": "Controller",
      "description": "Manages poll options for administrators. Provides endpoints for creating and destroying options for a specific poll. Requires 'helpdesk.polls.manage' permission.",
      "interactions": {
        "interaction_0": "Interacts with the local `Poll::Poll` model to add/remove options.",
        "interaction_1": "Interacts with `Poll::Poll` model to find polls and add/delete options.",
        "interaction_2": "Renders the `admin/polls/options_form` partial to update the options list."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/poll_options_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::PollsController": {
      "type": "Controller",
      "description": "Provides CRUD operations for polls within the admin interface. Allows administrators to list, create, edit, update, and delete polls. Requires 'helpdesk.polls.manage' permission.",
      "interactions": {
        "interaction_0": "Interacts with the local `Poll::Poll` model for data persistence.",
        "interaction_1": "Interacts with `Poll::Poll` model for all CRUD operations.",
        "interaction_2": "Uses `add_flash_message` for user feedback on operations.",
        "interaction_3": "Redirects to `edit_admin_poll_path` or `admin_polls_path` after actions."
      },
      "techDebt": [
        "TODO: Implement pagination - in `index` action.",
        "TODO: Implement pagination for the poll listing [Source: app/controllers/admin/polls_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/polls_controller.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::TeachersController": {
      "type": "Controller",
      "description": "Manages teacher profiles, including listing, showing details, creating, and editing. Uses `Admin::TeacherForm` for form handling and `Course::TeacherListPresenter` for listing.",
      "interactions": {
        "interaction_0": "Communicates with the `course` microservice via `Xikolo.api(:course)` for teacher data.",
        "interaction_1": "Communicates with the `account` microservice via `Xikolo.api(:account)` to fetch user details for new teacher creation.",
        "interaction_2": "Uses `Admin::TeacherForm` for form validation and resource conversion.",
        "interaction_3": "Uses `Course::TeacherListPresenter` to present teacher lists."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/admin/teachers_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::UsersController": {
      "type": "Controller",
      "description": "Manages user accounts, including listing, searching by UID, and creating new users. Uses `UserListPresenter` for listing and `Admin::UserForm` for creation.",
      "interactions": {
        "interaction_0": "Communicates with the `account` microservice via `Xikolo.api(:account)` to fetch and create user data.",
        "interaction_1": "Uses `UserListPresenter` to present user lists.",
        "interaction_2": "Uses `Admin::UserForm` for form validation and resource conversion."
      },
      "techDebt": [
        "\"TODO: Do this global for all paging support controllers?\" - in `index` action regarding pagination."
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/users_controller.rb",
          "spec/controllers/admin/users_controller_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ChannelEditPresenter": {
      "type": "Presenter",
      "description": "Prepares data for the channel creation and edit forms, encapsulating logic for displaying channel attributes and associated form object.",
      "interactions": {
        "interaction_0": "Wraps `Admin::ChannelForm` and channel data (hash)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/channel_edit_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ChannelOrderPresenter": {
      "type": "Presenter",
      "description": "Prepares channel data for the channel ordering interface, specifically for select/drag-and-drop components.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/channel_order_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::Classifier::CoursesOrderPresenter": {
      "type": "Presenter",
      "description": "Prepares data for the course ordering interface within a specific classifier, providing classifier details and a list of associated courses.",
      "interactions": {
        "interaction_0": "Delegates to `Course::Classifier` for title, courses, and cluster information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/classifier/courses_order_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::ClusterPresenter": {
      "type": "Presenter",
      "description": "Prepares data for cluster display and ordering, including cluster details, localized titles, and associated classifiers.",
      "interactions": {
        "interaction_0": "Delegates to `Course::Cluster` for id, title, translations, and classifiers.",
        "interaction_1": "Uses `I18n` for localized sort mode display."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/cluster_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::CourseEditPresenter": {
      "type": "Presenter",
      "description": "Prepares data for course creation and edit forms. Aggregates information from various sources including channels, teachers, and statistics, and handles feature flag checks.",
      "interactions": {
        "interaction_0": "Interacts with Course::Visual model. [Source: app/presenters/admin/course_edit_presenter.rb]",
        "interaction_1": "Interacts with Video::Stream model. [Source: app/presenters/admin/course_edit_presenter.rb]",
        "interaction_2": "Accesses Xikolo.config for various settings and feature flags. [Source: app/presenters/admin/course_edit_presenter.rb]",
        "interaction_3": "Interacts with `Course::Visual` and `Video::Stream` for course visual information.",
        "interaction_4": "Checks `Xikolo.config.course_languages`, `Xikolo.config.access_groups`, and feature flags (`user.feature?`, `Proctoring.enabled?`, `CourseReactivation.enabled?`).",
        "interaction_5": "Delegates to `Admin::CourseForm` for form-related attributes.",
        "interaction_6": "Delegates to `BasicCoursePresenter` for core course attributes.",
        "interaction_7": "Communicates with the `course` microservice via `Xikolo.api(:course)` to fetch channels, teacher details, and course statistics."
      },
      "techDebt": [
        "Rubocop disables Naming/MemoizedInstanceVariableName for `with_teachers!` and `with_statistic_dates!` methods."
      ],
      "provenance": {
        "sources": [
          "app/presenters/admin/course_edit_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::CourseListPresenter": {
      "type": "Presenter",
      "description": "Prepares course data for the administrative course index page, including categorization and pagination.",
      "interactions": {
        "interaction_0": "Wraps a collection of courses.",
        "interaction_1": "Uses `RestifyPaginationCollection` for pagination.",
        "interaction_2": "Uses `Rails.application.routes.url_helpers` for URL generation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/course_list_presenter.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "Admin::SubscriptionListPresenter": {
      "type": "Presenter",
      "description": "A generic presenter for paginated lists of subscriptions. Not directly used in the provided cluster but part of the Admin namespace.",
      "interactions": {
        "interaction_0": "Uses `RestifyPaginationCollection` for pagination.",
        "interaction_1": "Wraps a collection of subscriptions (likely `Xikolo::Pinboard::Subscription` resources)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/admin/subscription_list_presenter.rb",
          "cluster:02_CORE_CourseContent",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent",
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    "PrivacyAlert": {
      "type": "Frontend JavaScript Module",
      "description": "Client-side logic for LTI Provider privacy setting. Displays a confirmation dialog when 'unprotected' privacy is selected to inform the user about data sharing implications.",
      "interactions": {
        "interaction_0": "Interacts with the DOM to find privacy radio buttons.",
        "interaction_1": "Uses `swal` (SweetAlert2) to display a confirmation dialog.",
        "interaction_2": "Utilizes `I18n` for localized messages in the dialog."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/admin/lti_providers/privacy-alert.js",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "LtiProvidersIndex": {
      "type": "Frontend JavaScript Module",
      "description": "Client-side logic for managing LTI Providers on the teacher/admin index page. Handles showing and hiding forms for adding and editing LTI providers.",
      "interactions": {
        "interaction_0": "Interacts with the DOM to toggle visibility of 'add new provider' and 'edit provider' forms.",
        "interaction_1": "Attaches event listeners to buttons and links for form manipulation."
      },
      "techDebt": [
        "Direct DOM manipulation could be refactored using a more declarative UI framework (e.g., React, ViewComponents) for improved maintainability and robustness."
      ],
      "provenance": {
        "sources": [
          "app/assets/teacher/lti-providers/index.js",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "Course::LtiLaunchPresenter": {
      "type": "Presenter",
      "description": "Prepares data for rendering the LTI tool launch form. It determines the target URL, presentation mode, and the data hash to be sent to the LTI tool.",
      "interactions": {
        "interaction_0": "Interacts with Course::Item. [Source: app/presenters/course/lti_launch_presenter.rb]",
        "interaction_1": "Interacts with User (from Account Service). [Source: app/presenters/course/lti_launch_presenter.rb]",
        "interaction_2": "Determines the HTML form `target` attribute (`_blank` or `_self`) based on the LTI provider's `presentation_mode`.",
        "interaction_3": "Provides localized messages for the launch page.",
        "interaction_4": "Initializes with a `Course::Item` and `User`.",
        "interaction_5": "Delegates to `item.content.launch_for(user)` to retrieve LTI launch details."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course/lti_launch_presenter.rb",
          "spec/controllers/lti_controller_spec.rb",
          "cluster:17_LEARN_LTIIntegration"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "17_LEARN_LTIIntegration"
        ]
      }
    },
    "MsgrConsumer": {
      "type": "Message Consumer",
      "description": "The component within the TimeEffortService responsible for listening to and processing messages from RabbitMQ. These messages likely trigger time effort calculations or updates. ",
      "interactions": {
        "interaction_0": "Receives messages from RabbitMQ. ",
        "interaction_1": "Interacts with TimeEffortService. ",
        "interaction_2": "Triggers TimeEffortService logic (e.g., calculations, data updates). "
      },
      "techDebt": [
        "Specific message formats and handling logic are unknown."
      ],
      "provenance": {
        "sources": [
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "TimeEffortAPI": {
      "type": "API Endpoint",
      "description": "The HTTP API component of the TimeEffortService, exposed for other services or the frontend to query or update time effort data. It runs in `server` mode. ",
      "interactions": {
        "interaction_0": "Interacts with TimeEffortService. ",
        "interaction_1": "Interacts with TimeEffortService core logic and database. ",
        "interaction_2": "Receives HTTP requests (e.g., GET for effort, POST for updates). "
      },
      "techDebt": [
        "Specific API routes, request/response schemas, and authentication/authorization mechanisms are not detailed."
      ],
      "provenance": {
        "sources": [
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "TimeEffortWorker": {
      "type": "Background Job Processor",
      "description": "The Sidekiq worker component of the TimeEffortService, responsible for executing long-running or asynchronous tasks, such as recalculating time efforts for a large set of items, or performing periodic maintenance. ",
      "interactions": {
        "interaction_0": "Interacts with TimeEffortService. ",
        "interaction_1": "Interacts with PostgreSQL Database. ",
        "interaction_2": "Processed by Sidekiq. ",
        "interaction_3": "Pulls jobs from Redis-backed Sidekiq queue. ",
        "interaction_4": "Executes TimeEffortService logic. ",
        "interaction_5": "Interacts with PostgreSQL. "
      },
      "techDebt": [
        "Specific job types, scheduling, and error handling for background tasks are not visible."
      ],
      "provenance": {
        "sources": [
          "cluster:45_INFRA_TimeEffort"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "45_INFRA_TimeEffort"
        ]
      }
    },
    "Gamification::Score": {
      "type": "Model",
      "description": "Represents a single gamification score earned by a user for a specific action. It includes details about the user, course, the rule that triggered the score, points awarded, and event-specific data. A checksum is used to ensure uniqueness for each event.",
      "interactions": {
        "interaction_0": "Used by Gamification Configuration (YAML) for level and badge progression. ",
        "interaction_1": "Used in calculations for user levels and badge progression [Inferred from ]",
        "interaction_2": "Created by `Gamification::Rules::*` classes [Inferred from app/consumers/gamification_consumer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "spec/factories/gamification.rb",
          "spec/events/xikolo.course.result.create_spec.rb",
          "spec/events/xikolo.course.visit.create_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Gamification Configuration (YAML)": {
      "type": "Configuration",
      "description": "YAML files defining the structure and rules for gamification elements. `badge_types.yml` specifies badge names, contributing rules, and level thresholds. `user_levels.yml` defines user experience point (XP) levels, their titles, and associated images.",
      "interactions": {
        "interaction_0": "Defines rules for Gamification::Badge. ",
        "interaction_1": "Defines thresholds for Gamification::Score to progress user levels. ",
        "interaction_2": "Provides image paths for badges and user levels ",
        "interaction_3": "Defines the rules for `Gamification::Badge` progression ",
        "interaction_4": "Defines the thresholds and metadata for user levels "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Xikolo.config.gamification": {
      "type": "Configuration",
      "description": "A global configuration object used to enable or disable the entire gamification system. It acts as a feature flag.",
      "interactions": {
        "interaction_0": "Part of Xikolo (Global Config/Namespace). [Source: app/consumers/gamification_consumer.rb]",
        "interaction_1": "Configured in test environments to enable/disable gamification for specific tests [Source: spec/events/xikolo.course.result.create_spec.rb]",
        "interaction_2": "Checked by `GamificationConsumer` to determine if event processing should occur [Source: app/consumers/gamification_consumer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb",
          "spec/events/xikolo.course.result.create_spec.rb",
          "spec/events/xikolo.course.visit.create_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "integration/features/xikolo/global/gamification/user_score.feature",
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Open Badges Configuration": {
      "type": "Configuration",
      "description": "Configuration settings for integrating with the Open Badges standard, including public and private RSA keys. This suggests the capability to issue verifiable digital badges.",
      "interactions": {
        "interaction_0": "Used by OpenBadgeBakery for badge signing. [Source: spec/lib/open_badge_bakery_spec.rb]",
        "interaction_1": "Provides cryptographic keys for badge signing ",
        "interaction_2": "Enables/disables Open Badges functionality "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:15_LEARN_Gamification"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "15_LEARN_Gamification"
        ]
      }
    },
    "Chatbot API (Controller/Service Layer)": {
      "type": "API Gateway/Service",
      "description": "The API layer responsible for handling requests from external chatbot systems. It provides endpoints for user authentication, retrieving user and course information, and managing course enrollments. Its functionality is inferred from the OpenAPI specification as direct code was not provided. ",
      "interactions": {
        "interaction_0": "Inherits from Abstract::BridgeAPIController. ",
        "interaction_1": "Includes Xi::Controllers::RequireBearerToken for authentication. ",
        "interaction_2": "Interacts with Account Service for user data. ",
        "interaction_3": "Interacts with Course Microservice for course and enrollment data. ",
        "interaction_4": "Interacts with `TokenSigning` for issuing and verifying user-specific Paseto tokens.",
        "interaction_5": "Likely interacts with the 'Account' microservice for user data and 'Course' microservice for course and enrollment data.",
        "interaction_6": "Communicates with external chatbot systems."
      },
      "techDebt": [
        "Specific implementation details and potential technical debt cannot be assessed due to the absence of direct code for controllers and services."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "MOOChub API (Controller/Service Layer)": {
      "type": "API Gateway/Service",
      "description": "The API layer for integrating with the MOOChub Schema repository, primarily for course synchronization or data exchange. Its functionality is inferred from documentation as direct code was not provided. ",
      "interactions": {
        "interaction_0": "Inherits from Abstract::BridgeAPIController. ",
        "interaction_1": "Includes Xi::Controllers::RequireBearerToken for authentication. ",
        "interaction_2": "Interacts with Course Microservice for course data. ",
        "interaction_3": "Likely interacts with the 'Course' microservice for course data.",
        "interaction_4": "Communicates with external MOOChub systems."
      },
      "techDebt": [
        "Specific implementation details and potential technical debt cannot be assessed due to the absence of direct code for controllers and services."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Shop API (Controller/Service Layer)": {
      "type": "API Gateway/Service",
      "description": "The API layer dedicated to managing vouchers for external shops, allowing for bulk creation and listing of vouchers. Its functionality is inferred from the OpenAPI specification as direct code was not provided. ",
      "interactions": {
        "interaction_0": "Inherits from Abstract::BridgeAPIController. ",
        "interaction_1": "Includes Xi::Controllers::RequireBearerToken for authentication. ",
        "interaction_2": "Interacts with Voucher::Voucher model. ",
        "interaction_3": "Likely interacts with a 'Voucher' or 'Payment' domain within the application to manage voucher lifecycle.",
        "interaction_4": "Communicates with external shop systems."
      },
      "techDebt": [
        "Specific implementation details and potential technical debt cannot be assessed due to the absence of direct code for controllers and services."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "TransPipe API (Controller/Service Layer)": {
      "type": "API Gateway/Service",
      "description": "The API layer supporting the translation pipeline project by providing access to course and video information, including the ability to retrieve and update video subtitles. Its functionality is inferred from the OpenAPI specification as direct code was not provided. ",
      "interactions": {
        "interaction_0": "Inherits from Abstract::BridgeAPIController. ",
        "interaction_1": "Includes Xi::Controllers::RequireBearerToken for authentication. ",
        "interaction_2": "Interacts with Course Microservice for course data. ",
        "interaction_3": "Interacts with Video::Stream and Video::Subtitle models/services. ",
        "interaction_4": "Likely interacts with 'Course' and 'Video' models/services to fetch and update data.",
        "interaction_5": "Communicates with external translation pipeline systems."
      },
      "techDebt": [
        "Specific implementation details and potential technical debt cannot be assessed due to the absence of direct code for controllers and services."
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "DashboardController": {
      "type": "Controller",
      "description": "Serves the main user dashboard, displaying categorized courses (current, upcoming, completed), upcoming dates, promoted courses, gamification achievements, and user documents/certificates.",
      "interactions": {
        "interaction_0": "Interacts with Xikolo.api(:account). [Source: app/controllers/dashboard_controller.rb]",
        "interaction_1": "Interacts with Xikolo.api(:course). [Source: app/controllers/dashboard_controller.rb]",
        "interaction_2": "Queries Catalog::Course. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_3": "Queries Xikolo::Account::Authorization. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_4": "Queries Xikolo::Account::Preferences. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_5": "Queries Xikolo::Course::Course. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_6": "Queries Xikolo::Course::Enrollment. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_7": "Uses Acfs for concurrent API calls. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_8": "Redirects `index` action to `dashboard`.",
        "interaction_9": "Fetches `Xikolo::Account::Authorization` if an authorization parameter is present (e.g., after SSO signup).",
        "interaction_10": "Loads sidebar content, including promoted courses and next dates, using `Xikolo.api(:course)`.",
        "interaction_11": "Retrieves user enrollments from `Course::Enrollment.active` and categorizes `Catalog::Course.released` courses.",
        "interaction_12": "Renders `Home::CourseCard` components for courses.",
        "interaction_13": "For achievements, uses `Gamification::DashboardPresenter` with `Account::User` data.",
        "interaction_14": "For documents, iterates `Xikolo::Course::Enrollment` to find certificates and uses `DocumentsPresenter` and `Xikolo::Account::Preferences`.",
        "interaction_15": "Utilizes `Acfs.run` for concurrent API calls.",
        "interaction_16": "Requires the 'gamification' feature for achievements."
      },
      "techDebt": [
        "TODO: Show some fancy notice to set a password when a user signs up with SSO and a new user account is created on-the-fly. [Source: app/controllers/dashboard_controller.rb]",
        "TODO: Show some fancy notice to set a password when a new user account is created on-the-fly via SSO. [Source: app/controllers/dashboard_controller.rb]",
        "A commented-out line for filtering `next_dates` by date range suggests a potential incomplete feature or a change in requirements. [Source: app/controllers/dashboard_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb",
          "spec/controllers/dashboard_controller_spec.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Category (Struct)": {
      "type": "Helper",
      "description": "A private Ruby struct used within `DashboardController` to define the structure for course categories (title, courses, empty message, completed button status) for display on the user dashboard.",
      "interactions": {
        "interaction_0": "Used by DashboardController. [Source: app/controllers/dashboard_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Home::Category": {
      "type": "UI Component",
      "description": "A reusable component for rendering course categories on the homepage. It requires objects that respond to `title`, `url`, and `courses` methods.",
      "interactions": {
        "interaction_0": "Used by Home::HomeController (via config). [Source: docs/app/development/branding/homepage.md]",
        "interaction_1": "Interacts with Catalog::Category::Channel. [Source: docs/app/development/branding/homepage.md]",
        "interaction_2": "Interacts with Catalog::Category::Classifier. [Source: docs/app/development/branding/homepage.md]",
        "interaction_3": "Interacts with Catalog::Category::CurrentAndUpcoming. [Source: docs/app/development/branding/homepage.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/development/branding/homepage.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Catalog::Category::Channel": {
      "type": "Service/Logic",
      "description": "A built-in category loader that provides publicly visible courses from a specified channel for homepage display.",
      "interactions": {
        "interaction_0": "Used by Home::Category. [Source: docs/app/development/branding/homepage.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/development/branding/homepage.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Catalog::Category::Classifier": {
      "type": "Service/Logic",
      "description": "A built-in category loader that provides publicly visible courses tagged with a given classifier for homepage display.",
      "interactions": {
        "interaction_0": "Used by Home::Category. [Source: docs/app/development/branding/homepage.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/development/branding/homepage.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Catalog::Category::CurrentAndUpcoming": {
      "type": "Service/Logic",
      "description": "A built-in category loader that provides courses currently running or starting soon, ordered by start date, for homepage display.",
      "interactions": {
        "interaction_0": "Used by Home::Category. [Source: docs/app/development/branding/homepage.md]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "docs/app/development/branding/homepage.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Gamification::DashboardPresenter": {
      "type": "Presenter",
      "description": "Formats gamification-related data for display on the user dashboard's achievements section.",
      "interactions": {
        "interaction_0": "Created by DashboardController. [Source: app/controllers/dashboard_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Course::NextDatePresenter": {
      "type": "Presenter",
      "description": "Formats upcoming course dates for display on the user dashboard.",
      "interactions": {
        "interaction_0": "Created by DashboardController. [Source: app/controllers/dashboard_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo.api": {
      "type": "API Client",
      "description": "A client for interacting with various microservices (e.g., `account`, `course`, `news`) within the Xikolo ecosystem.",
      "interactions": {
        "interaction_0": "Used by Admin::Ajax::PlatformStatisticsController. [Source: app/controllers/admin/ajax/platform_statistics_controller.rb]",
        "interaction_1": "Used by Admin::Ajax::UsersController. [Source: app/controllers/admin/ajax/users_controller.rb]",
        "interaction_2": "Used by Admin::BansController. [Source: app/controllers/admin/bans_controller.rb]",
        "interaction_3": "Used by Admin::ChannelsController. [Source: app/controllers/admin/channels_controller.rb]",
        "interaction_4": "Used by Admin::ChannelsOrderController. [Source: app/controllers/admin/channels_order_controller.rb]",
        "interaction_5": "Used by Admin::CourseManagementController. [Source: app/controllers/admin/course_management_controller.rb]",
        "interaction_6": "Used by Admin::CoursesController. [Source: app/controllers/admin/courses_controller.rb]",
        "interaction_7": "Used by Admin::DocumentLocalizationsController. [Source: app/controllers/admin/document_localizations_controller.rb]",
        "interaction_8": "Used by Admin::DocumentsController. [Source: app/controllers/admin/documents_controller.rb]",
        "interaction_9": "Used by Admin::ManualConfirmationsController. [Source: app/controllers/admin/manual_confirmations_controller.rb]",
        "interaction_10": "Used by Admin::MasqueradesController. [Source: app/controllers/admin/masquerades_controller.rb]",
        "interaction_11": "Used by Admin::PermissionsController. [Source: app/controllers/admin/permissions_controller.rb]",
        "interaction_12": "Used by Admin::TeachersController. [Source: app/controllers/admin/teachers_controller.rb]",
        "interaction_13": "Used by Admin::UsersController. [Source: app/controllers/admin/users_controller.rb]",
        "interaction_14": "Used by Admin::CourseEditPresenter. [Source: app/presenters/admin/course_edit_presenter.rb]",
        "interaction_15": "Used by Admin::ReportsController. [Source: app/controllers/admin/reports_controller.rb]",
        "interaction_16": "Used by Course::Statistics. [Source: app/models/course/statistics.rb]",
        "interaction_17": "Used by VoucherPresenter. [Source: app/presenters/voucher_presenter.rb]",
        "interaction_18": "Used by Locale concern. [Source: app/controllers/concerns/locale.rb]",
        "interaction_19": "Acts as a client for Account Service. ",
        "interaction_20": "Acts as a client for Course Microservice. ",
        "interaction_21": "Acts as a client for News Service (Microservice). ",
        "interaction_22": "Acts as a client for Quiz Service. ",
        "interaction_23": "Acts as a client for Lanalytics Bridge API. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb",
          "app/controllers/home/home_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Catalog::Course": {
      "type": "Model (Microservice)",
      "description": "Represents a course in the catalog, providing scopes for filtering by release status and for specific user enrollment states (active, upcoming, completed).",
      "interactions": {
        "interaction_0": "Queried by DashboardController. [Source: app/controllers/dashboard_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Account::Authorization": {
      "type": "Model (Microservice)",
      "description": "Represents an authorization record, typically used for tracking user sign-ins, especially from external SSO providers.",
      "interactions": {
        "interaction_0": "Queried by DashboardController. [Source: app/controllers/dashboard_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Xikolo::Account::Preferences": {
      "type": "Model (Microservice)",
      "description": "An ActiveResource-like client for the `web` application to interact with the `account` microservice's preferences API. It provides a convenient interface for fetching and updating user preferences.",
      "interactions": {
        "interaction_0": "Used by DashboardController. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_1": "Used by Account::PreferencesController. [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_2": "Used by Account::PreferencesPresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_3": "Used by Account::PreferencesPresenter::PreferencePresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_4": "Used by Account::PreferencesPresenter::NotificationPresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_5": "Communicates with Account Service (specifically API::PreferencesController). [Source: app/controllers/account/preferences_controller.rb]",
        "interaction_6": "Communicates with the `account` service at `/users/:user_id/preferences` via HTTP (REST).",
        "interaction_7": "Provides `get`, `get_bool`, `get_int`, `set`, and `update` methods to manipulate preference properties."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb",
          "clients/xikolo-account/lib/xikolo/account/preferences.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Xikolo::Course::Enrollment": {
      "type": "Model (Microservice)",
      "description": "Represents a user's enrollment in a course, used for iterating through items and checking for certificates.",
      "interactions": {
        "interaction_0": "Used by DashboardController. [Source: app/controllers/dashboard_controller.rb]",
        "interaction_1": "Used by `DashboardController#fetch_promoted_courses` to retrieve enrollments for promoted courses."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Account::PreferencesPresenter::PreferencePresenter": {
      "type": "Rails Presenter Helper",
      "description": "A nested class within `Account::PreferencesPresenter` responsible for rendering a single user preference, including its label and a toggle switch.",
      "interactions": {
        "interaction_0": "Receives Xikolo::Account::Preferences object. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_1": "Used by Account::PreferencesPresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_2": "Receives a preference key and options, and the `Xikolo::Account::Preferences` object.",
        "interaction_3": "Uses `ActionView::Base` helpers to generate HTML for labels and checkboxes."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/account/preferences_presenter.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Account::PreferencesPresenter::NotificationPresenter": {
      "type": "Rails Presenter Helper",
      "description": "A specialized nested class for rendering notification preferences, extending `PreferencePresenter` to handle platform-specific notification settings.",
      "interactions": {
        "interaction_0": "Receives Xikolo::Account::Preferences object. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_1": "Used by Account::PreferencesPresenter. [Source: app/presenters/account/preferences_presenter.rb]",
        "interaction_2": "Receives a notification name and options, and the `Xikolo::Account::Preferences` object.",
        "interaction_3": "Overrides `value` and `render_switch` to support platform-specific notification keys."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/account/preferences_presenter.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "API::PreferencesController": {
      "type": "Account Service API Controller",
      "description": "The API controller within the `account` microservice responsible for handling requests related to user preferences. It exposes endpoints for retrieving and updating preferences.",
      "interactions": {
        "interaction_0": "Retrieves User model. [Source: services/account/app/controllers/api/preferences_controller.rb]",
        "interaction_1": "Updates User model. [Source: services/account/app/controllers/api/preferences_controller.rb]",
        "interaction_2": "Uses PreferencesDecorator. [Source: services/account/app/controllers/api/preferences_controller.rb]",
        "interaction_3": "Publishes messages via Msgr (RabbitMQ). [Source: services/account/app/controllers/api/preferences_controller.rb]",
        "interaction_4": "Receives requests from Xikolo::Account::Preferences. [Source: clients/xikolo-account/lib/xikolo/account/preferences.rb]",
        "interaction_5": "Retrieves `User` objects from the database.",
        "interaction_6": "Updates the `preferences` attribute of the `User` model.",
        "interaction_7": "Uses `PreferencesDecorator` to format API responses.",
        "interaction_8": "Publishes `xikolo.account.user.preferences.updated` messages to RabbitMQ via `Msgr` after updates."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/account/app/controllers/api/preferences_controller.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "PreferencesDecorator": {
      "type": "Draper Decorator",
      "description": "A decorator used in the `account` service to format the `User` model's preferences attribute into a standardized JSON structure for API responses.",
      "interactions": {
        "interaction_0": "Decorates User model. [Source: services/account/app/decorators/preferences_decorator.rb]",
        "interaction_1": "Used by API::PreferencesController. [Source: services/account/app/controllers/api/preferences_controller.rb]",
        "interaction_2": "Decorates `User` model instances to expose `user_id` and `properties` (the preferences hash)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/account/app/decorators/preferences_decorator.rb",
          "cluster:01_CORE_UserAuthentication"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "01_CORE_UserAuthentication"
        ]
      }
    },
    "Msgr::Consumer": {
      "type": "Framework Component",
      "description": "Base class for message consumers that subscribe to RabbitMQ queues to process events and messages from other services. It provides the core mechanism for receiving and acknowledging messages.",
      "interactions": {
        "interaction_0": "Inherited by GamificationConsumer. [Source: app/consumers/gamification_consumer.rb]",
        "interaction_1": "Inherited by CourseConsumer. [Source: services/course/app/consumers/course_consumer.rb]",
        "interaction_2": "Inherited by NewsConsumer. [Source: services/news/app/consumers/news_consumer.rb]",
        "interaction_3": "Receives messages from RabbitMQ. [Source: Gemfile]",
        "interaction_4": "Receives messages from RabbitMQ queues.",
        "interaction_5": "Dispatches message payloads to specific consumer methods.",
        "interaction_6": "Acknowledges messages to RabbitMQ."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "Gemfile",
          "app/consumers/gamification_consumer.rb",
          "services/course/app/consumers/course_consumer.rb",
          "services/news/app/consumers/news_consumer.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "NewsConsumer": {
      "type": "Message Consumer",
      "description": "Processes messages to update the state and recipient numbers of news items, typically from the notification service.",
      "interactions": {
        "interaction_0": "Inherits from Msgr::Consumer. [Source: services/news/app/consumers/news_consumer.rb]",
        "interaction_1": "Receives messages from RabbitMQ (via Msgr). [Source: services/news/app/consumers/news_consumer.rb]",
        "interaction_2": "Interacts with News model. [Source: services/news/app/consumers/news_consumer.rb]",
        "interaction_3": "Receives `update_state` messages from RabbitMQ with `news_id` and other update attributes. [Source: services/news/app/consumers/news_consumer.rb]",
        "interaction_4": "Interacts with the `News` model to find and update a news record. [Source: services/news/app/consumers/news_consumer.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/news/app/consumers/news_consumer.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "LongRunningApplicationJob": {
      "type": "Delayed Job",
      "description": "A specialized base class for `ApplicationJob` instances that are expected to have longer execution times. It configures a dedicated queue and extended run time limits.",
      "interactions": {
        "interaction_0": "Inherits from ApplicationJob. [Source: app/jobs/long_running_application_job.rb]",
        "interaction_1": "Processed by Delayed (Delayed Job). [Source: app/jobs/long_running_application_job.rb]",
        "interaction_2": "Sets `queue_as` to 'long_running'. [Source: app/jobs/long_running_application_job.rb]",
        "interaction_3": "Overrides `max_run_time` to 10 hours and `max_attempts` to 5. [Source: app/jobs/long_running_application_job.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/jobs/long_running_application_job.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Proctoring::StoreSubmissionResultsJob": {
      "type": "Delayed Job",
      "description": "Asynchronously fetches proctoring results for a quiz submission from an external proctoring vendor and stores them locally to reduce external communication.",
      "interactions": {
        "interaction_0": "Inherits from ApplicationJob. [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_1": "Processed by Delayed (Delayed Job). [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_2": "Interacts with Proctoring service (external). [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_3": "Interacts with Submission model (from Quiz Service). [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_4": "Queued on the `default` queue with `eventual` priority. [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_5": "Includes retry logic for `Proctoring::ServiceError` and `ExpectedRetry` with exponential backoff and fixed waits. [Source: app/jobs/proctoring/store_submission_results_job.rb]",
        "interaction_6": "Expected to interact with a `Proctoring` service to fetch results and a `Submission` model to store them (implementation not shown). [Source: app/jobs/proctoring/store_submission_results_job.rb]"
      },
      "techDebt": [
        "The `perform` method is empty, suggesting the core logic for fetching and storing results is either missing or handled elsewhere (e.g., in a callback or a service object not provided). This could lead to confusion or incomplete functionality. [Source: app/jobs/proctoring/store_submission_results_job.rb]"
      ],
      "provenance": {
        "sources": [
          "app/jobs/proctoring/store_submission_results_job.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "RefreshSitemapJob": {
      "type": "Delayed Job",
      "description": "A deprecated background job that previously refreshed the sitemap. It now performs no action but is retained to allow any scheduled instances to complete without error.",
      "interactions": {
        "interaction_0": "Inherits from ApplicationJob. [Source: app/jobs/refresh_sitemap_job.rb]",
        "interaction_1": "Processed by Delayed (Delayed Job). [Source: app/jobs/refresh_sitemap_job.rb]",
        "interaction_2": "Queued on the `default` queue with `reporting` priority. [Source: app/jobs/refresh_sitemap_job.rb]",
        "interaction_3": "The `perform` method is empty. [Source: app/jobs/refresh_sitemap_job.rb]"
      },
      "techDebt": [
        "The job is deprecated but still exists in the codebase. It should ideally be removed or clearly marked for removal to avoid confusion and unnecessary processing overhead if still scheduled. [Source: app/jobs/refresh_sitemap_job.rb]"
      ],
      "provenance": {
        "sources": [
          "app/jobs/refresh_sitemap_job.rb",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "UnconfirmedAccountsDeletionWorker": {
      "type": "Sidekiq Worker",
      "description": "A scheduled Sidekiq worker in the Account service responsible for deleting old, unconfirmed user accounts.",
      "interactions": {
        "interaction_0": "Processed by Sidekiq. [Source: services/account/config/cron.yml]",
        "interaction_1": "Interacts with Account Service database (PostgreSQL). [Source: services/account/config/cron.yml]",
        "interaction_2": "Interacts with User model. [Source: services/account/config/cron.yml]",
        "interaction_3": "Scheduled to run daily at 3 a.m. via `sidekiq-cron`. [Source: services/account/config/cron.yml]",
        "interaction_4": "Processes jobs on the `default` queue. [Source: services/account/config/cron.yml]",
        "interaction_5": "Interacts with the Account service's database to identify and delete unconfirmed accounts (implementation not shown). [Source: services/account/config/cron.yml]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "services/account/config/cron.yml",
          "cluster:42_INFRA_BackgroundJobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "42_INFRA_BackgroundJobs"
        ]
      }
    },
    "Accordion (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that provides collapsible content sections. It expands one item on button click and collapses all other elements within the same `data-controller='accordion'` container. It uses `aria-expanded` attributes for accessibility.",
      "interactions": {
        "interaction_0": "Controls Accordion (Ruby ViewComponent) rendered output. [Source: app/assets/components/global/accordion.js]",
        "interaction_1": "Automatically collapses other expanded sections when a new one is opened.",
        "interaction_2": "User clicks a button (`data-accordion-target='toggle-button'`) to toggle the expanded state of a section."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/accordion.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Accordion (Ruby ViewComponent)": {
      "type": "ViewComponent",
      "description": "Server-side component for rendering a collapsible accordion UI. It accepts a headline and renders multiple `AccordionSection` sub-components. The `AccordionSection` handles the individual collapsible items.",
      "interactions": {
        "interaction_0": "Controlled by Accordion (JS). [Source: app/components/global/accordion.rb]",
        "interaction_1": "Renders `AccordionSection` components, which are then controlled by the client-side `Accordion (JS)`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/accordion.rb",
          "app/components/global/accordion.html.slim",
          "app/components/global/accordion_section.rb",
          "app/components/global/accordion_section.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ActionsDropdown": {
      "type": "ViewComponent",
      "description": "Renders a dropdown menu for various actions. It supports custom button text, left/right menu alignment, and visually distinguishes 'destructive' actions. Client-side `dropdown.js` provides the interactive behavior.",
      "interactions": {
        "interaction_0": "Renders elements for Dropdown (JS). [Source: app/components/global/actions_dropdown.rb]",
        "interaction_1": "Accepts `actions` and `destructive_actions` as blocks for menu items.",
        "interaction_2": "Renders a button that, when clicked, triggers the client-side `Dropdown (JS)` to show/hide the menu."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/actions_dropdown.rb",
          "app/components/global/actions_dropdown.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "BasicTooltip": {
      "type": "ViewComponent",
      "description": "Renders a simple tooltip, typically associated with a question mark icon. It displays provided text on hover.",
      "interactions": {
        "interaction_0": "Used by HeadlineTooltip. [Source: app/components/global/basic_tooltip.rb]",
        "interaction_1": "Used by `HeadlineTooltip` to display contextual information."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/basic_tooltip.rb",
          "app/components/global/basic_tooltip.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Browser Warning": {
      "type": "UI Component",
      "description": "Client-side JavaScript component to dismiss a browser warning banner. Upon clicking a dismiss button, it sets a `_browser_warning` cookie to 'hide' and adds a 'hidden' class to the alert element.",
      "interactions": {
        "interaction_0": "Interacts with js-cookie (external library). [Source: app/assets/components/global/browser-warning.js]",
        "interaction_1": "Interacts with `js-cookie` library to set a cookie.",
        "interaction_2": "User clicks a button (`data-browser-warning=\"dismiss\"`) to hide the alert."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/browser-warning.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Callout": {
      "type": "ViewComponent",
      "description": "Renders a styled message box to draw user attention. It supports different types (default, warning, error, success) which dictate border and icon colors. It can include a title and custom icon, and accepts additional content via a slot.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/callout.rb",
          "app/components/global/callout.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Clear Button": {
      "type": "UI Component",
      "description": "Client-side JavaScript component for a button that clears the value of a target input field and then submits the closest form. Primarily used in filter bars for text searches.",
      "interactions": {
        "interaction_0": "Used by FilterBar::Search. [Source: app/components/global/filter_bar/search.rb]",
        "interaction_1": "Resets the value of the input specified by `data-clear-target`.",
        "interaction_2": "Submits the closest form to the target input.",
        "interaction_3": "User clicks a button (`data-id='clear-button'`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/clear-button.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Cookie Consent Banner (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component to manage the visibility of the cookie consent banner. It hides the banner when the close button (`data-behavior='hide'`) is clicked.",
      "interactions": {
        "interaction_0": "Controls Cookie Consent Banner (Ruby ViewComponent) rendered output. [Source: app/assets/components/global/cookie-consent-banner.js]",
        "interaction_1": "User clicks the close button to hide the banner."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/cookie-consent-banner.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Cookie Consent Banner (Ruby ViewComponent)": {
      "type": "ViewComponent",
      "description": "Server-side component for rendering the cookie consent banner. It retrieves the current consent details from `ConsentCookie` and displays the relevant text and action buttons. It only renders if a consent is active.",
      "interactions": {
        "interaction_0": "Controlled by Cookie Consent Banner (JS). [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_1": "Interacts with ConsentCookie (service object). [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_2": "Interacts with `ConsentCookie` to determine if a banner should be shown and what text to display.",
        "interaction_3": "Renders a form for accepting or declining cookies."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/cookie_consent_banner.rb",
          "app/components/global/cookie_consent_banner.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Copy to Clipboard (JS)": {
      "type": "UI Component",
      "description": "Client-side TypeScript component that copies text from an element's `data-text` attribute to the user's clipboard. It provides visual feedback (e.g., changing tooltip/label text) upon successful copy.",
      "interactions": {
        "interaction_0": "Interacts with Copy to Clipboard (Ruby ViewComponent) rendered output. [Source: app/assets/components/global/copy-to-clipboard.ts]",
        "interaction_1": "Interacts with LabeledCopyButton rendered output. [Source: app/components/global/labeled_copy_button.rb]",
        "interaction_2": "Updates `data-behavior='clipboard-tooltip'` or `data-behavior='clipboard-label'` with a success message temporarily.",
        "interaction_3": "User clicks an element (`data-behavior='copy-to-clipboard'`).",
        "interaction_4": "Accesses `navigator.clipboard.writeText()` to copy content."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/copy-to-clipboard.ts",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Copy to Clipboard (Ruby ViewComponent)": {
      "type": "ViewComponent",
      "description": "Server-side component for rendering a button or icon that, when clicked, copies specified text to the clipboard. It supports different visual types (icon or button) and optional labels/tooltips.",
      "interactions": {
        "interaction_0": "Interacted with by Copy to Clipboard (JS). [Source: app/components/global/copy_to_clipboard.rb]",
        "interaction_1": "Renders HTML elements with `data-behavior='copy-to-clipboard'` for client-side interaction."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/copy_to_clipboard.rb",
          "app/components/global/copy_to_clipboard.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "CourseListBanner": {
      "type": "ViewComponent",
      "description": "Renders a banner for course listing pages. It fetches the current banner data from the `Banner` model (cached for performance) and handles image display and link targeting (e.g., `_blank`).",
      "interactions": {
        "interaction_0": "Fetches data from Banner model. [Source: app/components/global/course_list_banner.rb]",
        "interaction_1": "Styled by _banners.scss. [Source: app/assets/stylesheets/partials/_banners.scss]",
        "interaction_2": "Fetches banner data from `Banner.current` (cached)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/course_list_banner.rb",
          "app/components/global/course_list_banner.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "CustomHeadSnippets": {
      "type": "ViewComponent",
      "description": "Injects custom HTML snippets into the `<head>` section of the document. Snippets are retrieved from `Xikolo.config.custom_html` and rendered only if their defined `requirements` (e.g., `cookie_consent`) are fulfilled.",
      "interactions": {
        "interaction_0": "Reads configuration from Xikolo.config. [Source: app/components/global/custom_head_snippets.rb]",
        "interaction_1": "Evaluates ConsentCookie (service object). [Source: app/components/global/custom_head_snippets.rb]",
        "interaction_2": "Reads configuration from `Xikolo.config.custom_html`.",
        "interaction_3": "Evaluates `Requirements` (e.g., `ConsentCookie`) to determine if a snippet should be rendered."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/custom_head_snippets.rb",
          "app/components/global/custom_head_snippets.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Custom Select (TomSelect)": {
      "type": "UI Component",
      "description": "Client-side TypeScript component that initializes `TomSelect` instances for enhanced dropdown functionality. It supports various configurations like remote data loading, preloading, creating new options, and prefilling. It integrates with specific settings for classifiers and item statistics.",
      "interactions": {
        "interaction_0": "Used by FilterBar::Filter for enhanced multi-select. [Source: app/components/global/filter_bar/filter.rb]",
        "interaction_1": "Interacts with TomSelect (external library). [Source: app/assets/components/global/custom-select.ts]",
        "interaction_2": "Loads data from Admin::Ajax::ClassifiersController (via /admin/find_classifiers). [Source: app/assets/components/global/custom-select/classifiers-select.js]",
        "interaction_3": "Interacts with `settings.js` for common and advanced TomSelect configurations.",
        "interaction_4": "Initializes `TomSelect` on elements with `data-behavior='custom-select'`.",
        "interaction_5": "Uses `classifiers-select.js` to load classifier data from `/admin/find_classifiers`.",
        "interaction_6": "Uses `item-stats-select.js` to redirect to a URL on item selection."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/custom-select.ts",
          "app/assets/components/global/custom-select/classifiers-select.js",
          "app/assets/components/global/custom-select/item-stats-select.js",
          "app/assets/components/global/custom-select/settings.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "DisclosureWidget": {
      "type": "ViewComponent",
      "description": "Renders a collapsible content area using the HTML `<details>` element. It supports customizable summary labels for both collapsed and expanded states, different visual variants (default, light), and custom icons for toggling.",
      "interactions": {
        "interaction_0": "Toggles content visibility based on user interaction with the summary element."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/disclosure_widget.rb",
          "app/components/global/disclosure_widget.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "DownloadButton": {
      "type": "ViewComponent",
      "description": "Renders a button or link for downloading files. It supports optional icons (e.g., 'download'), disabled states, and custom CSS classes. The `type` parameter can be used to influence the default icon.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/download_button.rb",
          "app/components/global/download_button.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Dropdown (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that manages the expansion and collapse of dropdown menus. It ensures that only one dropdown is open at a time (unless nested) and closes dropdowns when the user clicks outside of them.",
      "interactions": {
        "interaction_0": "Controls ActionsDropdown rendered output. [Source: app/components/global/actions_dropdown.rb]",
        "interaction_1": "Closes other dropdowns when a new one is opened, unless it's a nested parent.",
        "interaction_2": "Closes all dropdowns when a click occurs outside any dropdown.",
        "interaction_3": "User clicks an element (`data-behaviour='dropdown'`) to toggle its `aria-expanded` state."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/dropdown.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Expand Course Card": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that enables a 'hover-to-expand' behavior for course cards. When a user hovers over a card, a cloned, expanded version appears to display more information. It handles responsiveness and interactions with dialogs.",
      "interactions": {
        "interaction_0": "Interacts with the DOM. [Source: app/assets/components/global/expand-course-card.js]",
        "interaction_1": "Clones the card and adds `course-card--expanded` class to display extended information.",
        "interaction_2": "Initializes dialogs for buttons within the cloned card.",
        "interaction_3": "Resets placeholder content on slider scroll or window resize.",
        "interaction_4": "Listens for `load-more:course-cards` event to apply behavior to newly added cards.",
        "interaction_5": "User hovers over a course card (`data-behavior='expandable'`)."
      },
      "techDebt": [
        "The cloning of the card and absolute positioning for expansion might lead to complex DOM management and potential performance issues with many cards or frequent interactions."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/expand-course-card.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FaIcon": {
      "type": "ViewComponent",
      "description": "Renders Font Awesome icons. It supports different icon styles (e.g., regular, solid) and can combine two icons into a stacked format (e.g., 'lightbulb-on+circle-star'), where the second icon appears in the top-right corner.",
      "interactions": {
        "interaction_0": "Used by Navigation::SystemAlerts (View Component Template). [Source: app/components/navigation/system_alerts.html.slim]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/fa_icon.rb",
          "app/components/global/fa_icon.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FilterBar::Controls": {
      "type": "ViewComponent",
      "description": "Renders the control section of a filter bar, including a 'Reset' button and an optional overview of currently applied filters. It can also implement a 'fixed' behavior using the client-side `Fixed Bar` component.",
      "interactions": {
        "interaction_0": "Renders elements for Hide/Show on Click. [Source: app/components/global/filter_bar/controls.rb]",
        "interaction_1": "Renders elements for Fixed Bar. [Source: app/components/global/filter_bar/controls.rb]",
        "interaction_2": "Renders a 'Reset' link that, when clicked, triggers client-side `hide-on-click` and `show-on-click` to manage content visibility.",
        "interaction_3": "Can be configured to use `data-behavior='fixed'` for sticky positioning."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/controls.rb",
          "app/components/global/filter_bar/controls.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FilterBar::Filter": {
      "type": "ViewComponent",
      "description": "Renders a single filter element within a filter bar, typically a `select` tag. It supports options for blank selection, pre-selected values, and can be configured for multi-select using `custom-select` behavior.",
      "interactions": {
        "interaction_0": "Integrates with Custom Select (TomSelect). [Source: app/components/global/filter_bar/filter.rb]",
        "interaction_1": "Can integrate with client-side `Custom Select (TomSelect)` for enhanced multi-select functionality.",
        "interaction_2": "Renders a `select_tag` that, when changed, triggers a form submission (via `data-change='submit'`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/filter.rb",
          "app/components/global/filter_bar/filter.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FilterBar::Search": {
      "type": "ViewComponent",
      "description": "Renders the search input field within a filter bar. It includes a text input and a search button, along with a 'Clear' button that utilizes the client-side `Clear Button` component.",
      "interactions": {
        "interaction_0": "Includes a button that interacts with Clear Button. [Source: app/components/global/filter_bar/search.rb]",
        "interaction_1": "Includes a button (`data-id='clear-button'`) that interacts with the client-side `Clear Button` to clear the input and submit the form.",
        "interaction_2": "Renders a `text_field_tag` for search input."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/filter_bar/search.rb",
          "app/components/global/filter_bar/search.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Fixed Bar": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that makes an element 'stick' to the top of the viewport when the user scrolls past it. It uses an `IntersectionObserver` to detect when the element enters/exits the viewport.",
      "interactions": {
        "interaction_0": "Controls FilterBar::Controls behavior. [Source: app/components/global/filter_bar/controls.rb]",
        "interaction_1": "Uses IntersectionObserver (browser API). [Source: app/assets/components/global/fixed-bar.js]",
        "interaction_2": "Observes an element's intersection with the viewport using `IntersectionObserver`.",
        "interaction_3": "Clones the element and appends it to the body with `js-fixed` class when the original element is no longer intersecting at the top threshold."
      },
      "techDebt": [
        "Cloning the element might lead to duplicate IDs if not carefully managed, although `fixedElement.remove()` helps mitigate this. Potential for layout shifts if not styled correctly."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/fixed-bar.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Flatpickr (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that initializes `flatpickr` date/time pickers. It provides custom date parsing and formatting using `luxon`, handles timezone offsets, and integrates a custom plugin for 'Clear' and 'Today' buttons.",
      "interactions": {
        "interaction_0": "Initializes flatpickr (external library). [Source: app/assets/components/global/flatpickr.js]",
        "interaction_1": "Uses luxon (external library). [Source: app/assets/components/global/flatpickr.js]",
        "interaction_2": "Integrates `CustomButtonsPlugin` to add 'Clear' and 'Today' buttons to the picker.",
        "interaction_3": "Initializes `flatpickr` on elements with `data-behaviour~=datepicker`.",
        "interaction_4": "Uses `luxon` for ISO date parsing and formatting."
      },
      "techDebt": [
        "Relies on a specific bug fix for `flatpickr`'s 'Z' dateFormat, which might be fragile if `flatpickr` updates its behavior. The use of `luxon` adds another dependency for date manipulation."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/flatpickr.js",
          "app/assets/components/global/flatpickr/customButtonsPlugin.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FlashBlock": {
      "type": "ViewComponent",
      "description": "Orchestrates the rendering of various flash messages and layers (e.g., `SweetAlert2` dialogs). It iterates through different flash types (`error`, `success`, `notice`, `alert`, `success_layer`, `info_layer`, `error_layer`) and renders the appropriate sub-components.",
      "interactions": {
        "interaction_0": "Renders FlashMessage. [Source: app/components/global/flash_block.rb]",
        "interaction_1": "Renders FlashLayer. [Source: app/components/global/flash_block.rb]",
        "interaction_2": "Renders `FlashMessage` for standard flash messages.",
        "interaction_3": "Renders `FlashLayer` for messages displayed as `SweetAlert2` dialogs."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/flash_block.rb",
          "app/components/global/flash_block.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FlashLayer": {
      "type": "ViewComponent",
      "description": "Renders a flash message as a `SweetAlert2` dialog. It parses the message text to extract a title and body, then generates JavaScript to trigger the `SweetAlert2` modal on DOM ready.",
      "interactions": {
        "interaction_0": "Used by FlashBlock. [Source: app/components/global/flash_block.rb]",
        "interaction_1": "Generates JavaScript to interact with SweetAlert2 (external library). [Source: app/components/global/flash_layer.rb]",
        "interaction_2": "Generates JavaScript to call `xuiSwal.fire()` on the client-side."
      },
      "techDebt": [
        "Relies on global `xuiSwal` object, which couples it to the SweetAlert2 library and its global availability."
      ],
      "provenance": {
        "sources": [
          "app/components/global/flash_layer.rb",
          "app/components/global/flash_layer.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "FlashMessage": {
      "type": "ViewComponent",
      "description": "Renders a standard dismissible flash message banner. It displays an icon corresponding to the message type (success, error, alert, notice) and includes a button to hide the message using client-side JavaScript.",
      "interactions": {
        "interaction_0": "Used by FlashBlock. [Source: app/components/global/flash_block.rb]",
        "interaction_1": "Renders elements for Hide/Show on Click. [Source: app/components/global/flash_message.rb]",
        "interaction_2": "Renders a button with `data-hide-on-click` attribute to hide the message via client-side JavaScript."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/flash_message.rb",
          "app/components/global/flash_message.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "HeadlineTooltip": {
      "type": "ViewComponent",
      "description": "Combines a headline (`h1` to `h6`) with a `BasicTooltip` component. It renders the headline and then embeds the tooltip next to it, providing contextual information on hover.",
      "interactions": {
        "interaction_0": "Renders BasicTooltip. [Source: app/components/global/headline_tooltip.rb]",
        "interaction_1": "Renders `Global::BasicTooltip`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/headline_tooltip.rb",
          "app/components/global/headline_tooltip.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Helpdesk Button (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that adjusts the position of the helpdesk button to prevent it from overlapping with the footer's copyright element. It uses an `IntersectionObserver` to detect when the footer is in view.",
      "interactions": {
        "interaction_0": "Controls Helpdesk Button (Ruby ViewComponent) rendered output. [Source: app/assets/components/global/helpdesk-button.js]",
        "interaction_1": "Uses IntersectionObserver (browser API). [Source: app/assets/components/global/helpdesk-button.js]",
        "interaction_2": "Observes the footer copyright element (`data-id=\"footer-copyright\"`) using `IntersectionObserver`.",
        "interaction_3": "Adds/removes `helpdesk-button--bottom-reached` class to the helpdesk button based on intersection state."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/helpdesk-button.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Helpdesk Button (Ruby ViewComponent)": {
      "type": "ViewComponent",
      "description": "Renders the helpdesk button and its associated panel. The button's icon dynamically changes based on active chatbot feature flags for the current user. The panel contains a close button and slots for chatbot features or default content.",
      "interactions": {
        "interaction_0": "Controlled by Helpdesk Button (JS). [Source: app/components/global/helpdesk_button.rb]",
        "interaction_1": "Checks user feature flags via Xikolo::Common::Auth::CurrentUser. [Source: app/components/global/helpdesk_button.rb]",
        "interaction_2": "Renders a close button that interacts with client-side JavaScript to hide the panel.",
        "interaction_3": "Checks user feature flags (`@user.feature?`) to determine the appropriate chatbot version and icon.",
        "interaction_4": "Renders a button that, when clicked, likely toggles the visibility of the helpdesk panel (client-side interaction)."
      },
      "techDebt": [
        "The `CHATBOT_VERSION` hash defines a hardcoded order of feature flipper names, which might be less flexible for dynamic feature flag management. The `data_feature` attribute is used to pass the chatbot version, implying client-side logic to load the correct chatbot UI."
      ],
      "provenance": {
        "sources": [
          "app/components/global/helpdesk_button.rb",
          "app/components/global/helpdesk_button.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Hide/Show on Click": {
      "type": "UI Component",
      "description": "Client-side JavaScript components (`hide-on-click.js` and `show-on-click.js`) that toggle the `hidden` attribute of a target DOM element when a specified trigger element is clicked. The target is identified by the value of `data-hide-on-click` or `data-show-on-click`.",
      "interactions": {
        "interaction_0": "Controls FilterBar::Controls behavior. [Source: app/components/global/filter_bar/controls.rb]",
        "interaction_1": "Controls FlashMessage behavior. [Source: app/components/global/flash_message.rb]",
        "interaction_2": "User clicks an element with `data-hide-on-click` or `data-show-on-click`.",
        "interaction_3": "Sets the `hidden` attribute of the target element to `true` or `false`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/hide-on-click.js",
          "app/assets/components/global/show-on-click.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ItemStatus": {
      "type": "ViewComponent",
      "description": "Displays a status item with an icon, title, text, and an optional tooltip. It supports various color schemes (success, error, link) and 'connected' types (default, filled, dashed, disabled) which visually link items with vertical lines and modify icon appearance.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/item_status.rb",
          "app/components/global/item_status.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "LabeledCopyButton": {
      "type": "ViewComponent",
      "description": "Renders a button with a label and a value, designed for copying the value to the clipboard. It integrates with the client-side `Copy to Clipboard (JS)` component.",
      "interactions": {
        "interaction_0": "Renders elements for Copy to Clipboard (JS). [Source: app/components/global/labeled_copy_button.rb]",
        "interaction_1": "Renders a button with `data-behavior='copy-to-clipboard'` and `data-text` attributes for client-side copy functionality."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/labeled_copy_button.rb",
          "app/components/global/labeled_copy_button.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "LinkItem": {
      "type": "ViewComponent",
      "description": "Renders a list item containing a link. It supports options for active state, title, target attribute (e.g., `_blank`), and an optional Font Awesome icon.",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/link_item.rb",
          "app/components/global/link_item.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Meter": {
      "type": "ViewComponent",
      "description": "Renders an HTML `<meter>` element to display a scalar measurement within a known range. It supports a value, optional label, and styling variants (e.g., `info` type, `white` background).",
      "interactions": {},
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/meter.rb",
          "app/components/global/meter.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "PageHeader": {
      "type": "ViewComponent",
      "description": "Renders a page header with a main title, optional subtitle, and a slot for a `Pill` component. It supports a 'slim' variant for a more compact appearance and allows additional custom content.",
      "interactions": {
        "interaction_0": "Can render Pill. [Source: app/components/global/page_header.rb]",
        "interaction_1": "Can render a `Global::Pill` component within its structure."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/page_header.rb",
          "app/components/global/page_header.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Pill": {
      "type": "ViewComponent",
      "description": "Renders a small, styled text label (a 'pill') with various size (default, small) and color options (note, success, information, error). It's used for displaying short, categorized information.",
      "interactions": {
        "interaction_0": "Used by PageHeader. [Source: app/components/global/page_header.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/pill.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Slider (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that controls horizontal scrolling for content sliders. It provides 'scroll left' and 'scroll right' buttons and dynamically hides/shows them based on whether the first/last items are fully visible, using `IntersectionObserver`.",
      "interactions": {
        "interaction_0": "Controls Slider (Ruby ViewComponent) rendered output. [Source: app/assets/components/global/slider.js]",
        "interaction_1": "Uses IntersectionObserver (browser API). [Source: app/assets/components/global/slider.js]",
        "interaction_2": "Dynamically hides/shows scroll buttons based on intersection state.",
        "interaction_3": "User clicks scroll buttons (`data-slider-target='scroll-button-left/right'`) to scroll content.",
        "interaction_4": "Uses `IntersectionObserver` to monitor visibility of `intersector-left/right` elements within the slider content."
      },
      "techDebt": [
        "The `getScrollDistance` function has a fallback for `content.clientWidth` being null, which might indicate a race condition or rendering issue that could be addressed more robustly. The `rootMargin` for the `IntersectionObserver` is set to '100% 0% 100% 0%', which might be overly broad if the intention is only to observe the x-axis, potentially leading to unexpected behavior in complex layouts."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/slider.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Slider (Ruby ViewComponent)": {
      "type": "ViewComponent",
      "description": "Renders a horizontal content slider with navigation buttons. It accepts multiple `item` blocks to populate the slider and supports different visual `variant`s (light, dark, custom). The client-side `Slider (JS)` component provides the interactive scrolling behavior.",
      "interactions": {
        "interaction_0": "Controlled by Slider (JS). [Source: app/components/global/slider.rb]",
        "interaction_1": "Renders HTML elements with `data-controller='slider'` and `data-slider-target` attributes for client-side control."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/slider.rb",
          "app/components/global/slider.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "SvgIcon": {
      "type": "ViewComponent",
      "description": "Renders an SVG file inline within a `<span>` tag. The path to the SVG file is provided, and a `wrapping_class` can be applied to the `<span>` for styling.",
      "interactions": {
        "interaction_0": "Reads SVG content directly from the file system."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/svg_icon.rb",
          "app/components/global/svg_icon.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "System Alerts": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that manages the display and dismissal of system alerts. It toggles the `aria-expanded` attribute of a toggle button and sets a `seen_alerts` cookie when the close button is clicked, marking all current alerts as seen.",
      "interactions": {
        "interaction_0": "Controls Navigation::SystemAlerts (View Component Template) rendered output. [Source: app/assets/components/global/system-alerts.js]",
        "interaction_1": "Interacts with js-cookie (external library). [Source: app/assets/components/global/system-alerts.js]",
        "interaction_2": "Sets a `seen_alerts` cookie using `js-cookie`.",
        "interaction_3": "User clicks the alerts container to expand the toggle button (`aria-expanded=true`).",
        "interaction_4": "User clicks the close button (`data-id='system-alerts__close-btn'`) to collapse the toggle button (`aria-expanded=false`)."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/system-alerts.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Table": {
      "type": "ViewComponent",
      "description": "Renders a responsive HTML table. It takes an array of hashes for `data` (rows), an array of strings for `headers`, and an optional `title`. If no data is provided, it renders an `Empty` state component.",
      "interactions": {
        "interaction_0": "Renders `State::Empty` if `data` is empty."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/global/table.rb",
          "app/components/global/table.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Toggle Menu": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that toggles the `aria-expanded` attribute of elements (`data-behaviour='toggle-menu'`) on click. Optionally, it can adjust the `left` or `right` CSS property of the element to follow the width of the menu it controls.",
      "interactions": {
        "interaction_0": "User clicks an element (`data-behaviour='toggle-menu'`) to toggle its `aria-expanded` state.",
        "interaction_1": "Dynamically sets `style.left` or `style.right` property based on `data-follow-menu` and the controlled menu's `offsetWidth`."
      },
      "techDebt": [
        "Direct manipulation of `element.style.setProperty` can lead to specificity issues if not carefully managed with CSS. The `offsetWidth` calculation might not be accurate in all rendering scenarios or with complex CSS transforms."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/toggle-menu.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Tooltip (JS)": {
      "type": "UI Component",
      "description": "Client-side JavaScript component that dynamically creates and positions tooltips. It parses `data-tooltip` attributes, which can be a simple string or a JSON object for advanced content, and displays the tooltip on `mouseenter`, hiding it on `mouseleave`.",
      "interactions": {
        "interaction_0": "Interacts with the DOM. [Source: app/assets/components/global/tooltip.js]",
        "interaction_1": "Dynamically creates and inserts tooltip content into a container (`data-id='tooltip'`).",
        "interaction_2": "Calculates and sets `top`, `left`, and `--tooltip-arrow-position` CSS properties for accurate positioning.",
        "interaction_3": "User hovers over an element with `data-tooltip` attribute."
      },
      "techDebt": [
        "Direct DOM manipulation (`innerHTML`, `style` properties) can be less performant than using CSS classes for state changes, especially for frequent interactions. The `calculatePosition` logic is complex and might be prone to edge cases with different screen sizes or element layouts."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/tooltip.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Transcript": {
      "type": "UI Component",
      "description": "Client-side JavaScript component providing an interactive transcript for video players. It highlights active cues, scrolls automatically to the current position, and allows users to seek in the video by clicking transcript cues. It supports keyboard navigation.",
      "interactions": {
        "interaction_0": "Receives cues data from a video player (e.g., xm-player). [Source: app/assets/components/global/transcript.js]",
        "interaction_1": "Emits `transcript:seeked` events to a video player (e.g., xm-player). [Source: app/assets/components/global/transcript.js]",
        "interaction_2": "Scrolls the cue list automatically or manually.",
        "interaction_3": "User clicks a cue (`data-start-time`) to emit a `transcript:seeked` event, seeking the video.",
        "interaction_4": "Supports keyboard navigation (ArrowUp, ArrowDown, Enter) within the cue list.",
        "interaction_5": "Receives cues data to `fill()` the transcript.",
        "interaction_6": "Updates active cues (`updateActiveCues()`) based on video playback."
      },
      "techDebt": [
        "The `scrollLogic` function has multiple `scrollingModes` and `userHasScrolled` flags, which could be simplified for better readability and maintainability. The `centerOfCues` calculation might need adjustments for varying cue heights or complex layouts."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/transcript.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "UserAvatar": {
      "type": "ViewComponent",
      "description": "Renders a user's avatar image. It takes a `user_id`, `size` (tiny, small, medium, large, x-large), and an optional `type` (e.g., `rounded`) to apply specific styling. The avatar image URL is generated using a helper.",
      "interactions": {
        "interaction_0": "Generates avatar image URL using `avatar_path` helper."
      },
      "techDebt": [
        "The `SIZE_MAPPING` is duplicated in SCSS and Ruby, which can lead to inconsistencies if not updated in both places. A single source of truth for these values would be beneficial."
      ],
      "provenance": {
        "sources": [
          "app/components/global/user_avatar.rb",
          "app/components/global/user_avatar.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Locale": {
      "type": "Concern",
      "description": "An ActiveSupport concern responsible for dynamically detecting and setting the application's locale for each incoming request. It prioritizes locale sources from query parameters, session, user preferences, browser settings, and finally, the application's default locale. It also persists explicit locale changes for logged-in users to the account service.",
      "interactions": {
        "interaction_0": "Interacts with I18n. [Source: app/controllers/concerns/locale.rb]",
        "interaction_1": "Accesses Xikolo.config. [Source: app/controllers/concerns/locale.rb]",
        "interaction_2": "Calls Xikolo.api(:account). [Source: app/controllers/concerns/locale.rb]",
        "interaction_3": "Reads and writes to `session` for locale persistence across requests. [Source: app/controllers/concerns/locale.rb]",
        "interaction_4": "Calls `Xikolo.api(:account)` to update a logged-in user's preferred language. [Source: app/controllers/concerns/locale.rb]",
        "interaction_5": "Uses `http_accept_language` (implicitly) to detect browser locale preferences. [Source: app/controllers/concerns/locale.rb]",
        "interaction_6": "Interacts with `I18n` to set the global locale. [Source: app/controllers/concerns/locale.rb]",
        "interaction_7": "Accesses `Xikolo.config.locales` to get available and default locales. [Source: app/controllers/concerns/locale.rb]",
        "interaction_8": "Reads `params` for explicit locale changes via query parameters. [Source: app/controllers/concerns/locale.rb]"
      },
      "techDebt": [
        "Direct coupling to the `account` microservice API (`Xikolo.api(:account)`) within a controller concern. This could be refactored into a dedicated service object to reduce coupling and improve testability of the concern in isolation from microservice interactions. [Source: app/controllers/concerns/locale.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/concerns/locale.rb",
          "spec/controllers/concerns/locale_spec.rb",
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "Locale YAML Files": {
      "type": "Data Store (Translations)",
      "description": "YAML files located in `config/locales/` that contain the actual localized strings (key-value pairs) for different languages supported by the application. These files are loaded by the `I18n` framework.",
      "interactions": {
        "interaction_0": "Provide translation data to I18n. ",
        "interaction_1": "Provide translation data to the `I18n` framework. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:62_DEVOPS_Internationalization"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "62_DEVOPS_Internationalization"
        ]
      }
    },
    "Course::Admin::StatisticsController": {
      "type": "Controller",
      "description": "Provides various course-specific statistics dashboards (activity, geo, news, pinboard, social, referrer, item visits, quiz, videos, downloads, rich texts, item details). Requires `course.dashboard.view` or `course.item_stats.show` permissions.",
      "interactions": {
        "interaction_0": "Accesses Xikolo.config for beta features. [Source: app/controllers/course/admin/statistics_controller.rb]",
        "interaction_1": "Requires `course.dashboard.view` or `course.item_stats.show` permissions (via Xikolo::Common::Auth::CurrentUser). [Source: app/controllers/course/admin/statistics_controller.rb]",
        "interaction_2": "Access to pinboard statistics is gated by `teaching_team_pinboard_activity` beta feature. [Source: app/controllers/course/admin/statistics_controller.rb]",
        "interaction_3": "Uses `CourseContextHelper` to establish course context. [Source: app/controllers/course/admin/statistics_controller.rb]",
        "interaction_4": "Uses `Acfs.run` (likely a frontend data fetching mechanism) for each statistics view. [Source: app/controllers/course/admin/statistics_controller.rb]"
      },
      "techDebt": [
        "The repeated `Acfs.run` call in every action suggests a potential for refactoring into a `before_action` or a more generic data loading pattern if `Acfs.run` performs a common setup. [Source: app/controllers/course/admin/statistics_controller.rb]"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/statistics_controller.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "Poll::Stats": {
      "type": "Model",
      "description": "Calculates statistics for a poll, including the number of participants and response counts for each option.",
      "interactions": {
        "interaction_0": "Queries PostgreSQL Database directly. [Source: app/models/poll/stats.rb]",
        "interaction_1": "Directly queries the database (`poll_responses` table) using raw SQL to count responses. [Source: app/models/poll/stats.rb]"
      },
      "techDebt": [
        "Using raw SQL for counting poll responses can be less maintainable than ActiveRecord queries, though it might be optimized for performance. [Source: app/models/poll/stats.rb]"
      ],
      "provenance": {
        "sources": [
          "app/models/poll/stats.rb",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "report-jobs.js": {
      "type": "Frontend Script",
      "description": "Client-side JavaScript for the admin reports page. It asynchronously fetches and updates the list of report jobs and handles error display.",
      "interactions": {
        "interaction_0": "Sends AJAX requests to Admin::ReportsController. [Source: app/assets/admin/reports/report-jobs.js]",
        "interaction_1": "Interacts with the DOM. [Source: app/assets/admin/reports/report-jobs.js]",
        "interaction_2": "Displays error details for failed report jobs in a modal. [Source: app/assets/admin/reports/report-jobs.js]",
        "interaction_3": "Polls the `/reports` endpoint every 10 seconds to update the report jobs table. [Source: app/assets/admin/reports/report-jobs.js]",
        "interaction_4": "Fetches HTML content from `/reports` and injects it into the `[data-id=\"report-jobs\"]` element. [Source: app/assets/admin/reports/report-jobs.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/admin/reports/report-jobs.js",
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "lanalytics.report.admin Role": {
      "type": "Permission Role",
      "description": "A specific role for users who need access to sensitive reporting data. It grants permissions to create and delete reports.",
      "interactions": {
        "interaction_0": "Grants permissions for Admin::ReportsController. ",
        "interaction_1": "Managed by Permissions Manager. ",
        "interaction_2": "Managed manually via Rails console in the `account` service. ",
        "interaction_3": "Includes `lanalytics.report.create` permission. ",
        "interaction_4": "Includes `lanalytics.report.delete` permission. "
      },
      "techDebt": [
        "Manual management of this role via Rails console could be prone to errors and lacks a user-friendly interface for non-technical administrators. "
      ],
      "provenance": {
        "sources": [
          "cluster:31_ADMIN_Analytics"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "31_ADMIN_Analytics"
        ]
      }
    },
    "ImageUploadInput": {
      "type": "SimpleForm Input",
      "description": "A custom SimpleForm input responsible for rendering the HTML structure for image uploads, including the Dropzone area and hidden fields. It generates data attributes containing S3 pre-signed URL details and validation parameters for the frontend JavaScript.",
      "interactions": {
        "interaction_0": "Inherits from SimpleForm Input. [Source: app/inputs/image_upload_input.rb]",
        "interaction_1": "Uses `FileUpload` to obtain S3 upload parameters (URL, fields, content type, size/extension filters). [Source: app/inputs/image_upload_input.rb]",
        "interaction_2": "Communicates existing image URLs to the frontend via a hidden input. [Source: app/inputs/image_upload_input.rb]",
        "interaction_3": "Generates hidden fields (`_upload_id`, `_uri`, `delete_attribute_name`) for backend processing. [Source: app/inputs/image_upload_input.rb]",
        "interaction_4": "Renders HTML for the image upload `Dropzone` and associated hidden fields (`upload_id`, `uri`, `deletion`).",
        "interaction_5": "Populates `data` attributes (`imageupload`, `upload_id`, `s3`, `max-filesize`, `error-size`, `error-type`) for `image-upload.js`.",
        "interaction_6": "Utilizes `FileUpload` to generate S3 presigned post parameters.",
        "interaction_7": "Retrieves existing image URLs from the associated model."
      },
      "techDebt": [
        "Uses both `_upload_id` and `_uri` suffixes for hidden fields for backward compatibility, which could be simplified if `_uri` was consistently used as the primary identifier. [Source: app/inputs/image_upload_input.rb]"
      ],
      "provenance": {
        "sources": [
          "app/inputs/image_upload_input.rb",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "UploadInput": {
      "type": "SimpleForm Input",
      "description": "A custom SimpleForm input for general file uploads, similar to `ImageUploadInput`. It renders the Dropzone area and hidden fields, providing S3 upload parameters to the frontend JavaScript.",
      "interactions": {
        "interaction_0": "Inherits from SimpleForm Input. [Source: app/inputs/upload_input.rb]",
        "interaction_1": "Uses `FileUpload` to obtain S3 upload parameters (URL, fields, content type, size/extension filters). [Source: app/inputs/upload_input.rb]",
        "interaction_2": "Generates a hidden field (`_upload_id`) for backend processing. [Source: app/inputs/upload_input.rb]",
        "interaction_3": "Renders HTML for the general file upload `Dropzone` and a hidden field (`attribute_name_upload_id`).",
        "interaction_4": "Populates `data` attributes (`upload`, `s3`, `max-filesize`, `error-size`, `error-type`) for `upload.js`.",
        "interaction_5": "Utilizes `FileUpload` to generate S3 presigned post parameters."
      },
      "techDebt": [
        "The `field_name` method includes a 'workaround' for adding errors to the form field, suggesting a less-than-ideal solution for form error handling. [Source: app/inputs/upload_input.rb]",
        "The `field_name` method includes a workaround for `_uri` suffix to allow error handling, suggesting an inconsistency in how file references are named in models. [Source: app/inputs/upload_input.rb]"
      ],
      "provenance": {
        "sources": [
          "app/inputs/upload_input.rb",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "image-upload.js": {
      "type": "Frontend JavaScript",
      "description": "Handles client-side image uploads using Dropzone.js. It configures Dropzone with S3 pre-signed URL details, performs client-side validation, manages hidden form fields for backend communication, and handles existing image display and deletion.",
      "interactions": {
        "interaction_0": "Initialized by ImageUploadInput. [Source: app/inputs/image_upload_input.rb]",
        "interaction_1": "Uploads files to Xikolo::S3. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_2": "Interacts with I18n (JS). [Source: app/assets/util/forms/image-upload.js]",
        "interaction_3": "Performs client-side image dimension validation. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_4": "Updates hidden input fields (`upload_id`, `uri`, `deletion`) to reflect upload state for backend processing. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_5": "Sends `DELETE` requests to S3 when a file is removed from the Dropzone. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_6": "Interacts with `I18n` for localized messages. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_7": "Initializes `Dropzone.js` on elements with `data-imageupload`.",
        "interaction_8": "Reads S3 configuration (URL, key, content type, image dimensions) from HTML `data` attributes.",
        "interaction_9": "Updates hidden form fields (`upload_id`, `uri`, `deletion`) to communicate upload status to the Rails backend.",
        "interaction_10": "Uses `util/sanitize` for filenames and `i18n/i18n` for localized messages."
      },
      "techDebt": [
        "Contains a `Todo` comment about `Dropzone` import, indicating a potential build/linter configuration issue. [Source: app/assets/util/forms/image-upload.js]",
        "Uses global `document.getElementById` and `document.getElementsByName` for hidden input fields, which can lead to conflicts if multiple components are on the same page without unique IDs. [Source: app/assets/util/forms/image-upload.js]"
      ],
      "provenance": {
        "sources": [
          "app/assets/util/forms/image-upload.js",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "upload.js": {
      "type": "Frontend JavaScript",
      "description": "Handles client-side general file uploads using Dropzone.js. It configures Dropzone with S3 pre-signed URL details, performs client-side validation, and manages hidden form fields for backend communication.",
      "interactions": {
        "interaction_0": "Initialized by UploadInput. [Source: app/inputs/upload_input.rb]",
        "interaction_1": "Uploads files to Xikolo::S3. [Source: app/assets/util/forms/upload.js]",
        "interaction_2": "Directly uploads files to S3 using pre-signed URLs. [Source: app/assets/util/forms/upload.js]",
        "interaction_3": "Performs client-side image dimension validation (if applicable). [Source: app/assets/util/forms/upload.js]",
        "interaction_4": "Sends `DELETE` requests to S3 when a file is removed from the Dropzone. [Source: app/assets/util/forms/upload.js]",
        "interaction_5": "Initializes `Dropzone.js` on elements with `data-upload`.",
        "interaction_6": "Reads S3 configuration from HTML `data` attributes.",
        "interaction_7": "Updates a hidden form field (`attribute_name_upload_id`) to communicate upload status to the Rails backend.",
        "interaction_8": "Uses `util/sanitize` for filenames."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/util/forms/upload.js",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "Dropzone.js": {
      "type": "External Library",
      "description": "A client-side JavaScript library used for handling drag-and-drop file uploads, displaying file previews, and managing upload progress. It is the foundational UI component for all file upload features.",
      "interactions": {
        "interaction_0": "Configured by image-upload.js. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_1": "Configured by upload.js. [Source: app/assets/util/forms/upload.js]",
        "interaction_2": "Uploads files to Xikolo::S3. [Source: app/assets/util/forms/image-upload.js]",
        "interaction_3": "Initialized by `image-upload.js`, `mdupload.js`, and `upload.js` to attach file upload behavior to HTML elements.",
        "interaction_4": "Sends files directly to S3 using presigned URLs and fields provided by the backend."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/util/forms/image-upload.js",
          "app/assets/util/forms/upload.js",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "Portal API Gateway": {
      "type": "API Gateway",
      "description": "Acts as an API gateway for external applications, providing a standardized and versioned interface to access openHPI course catalog data, manage user profiles, and handle course enrollments. It enforces authentication, content negotiation, and provides structured error responses.",
      "interactions": {
        "interaction_0": "Routes requests to Courses API Resource. ",
        "interaction_1": "Routes requests to Users API Resource. ",
        "interaction_2": "Routes requests to Enrollments API Resource. ",
        "interaction_3": "Routes requests to Course Microservice. ",
        "interaction_4": "Routes requests to Account Service. ",
        "interaction_5": "Receives authenticated HTTP requests from external applications using OAuth 2.0 Bearer Tokens. ",
        "interaction_6": "Responds with JSON data, adhering to the HTTP Problem Details specification for errors. ",
        "interaction_7": "Performs content negotiation based on the `Accept` header for versioning and media type. ",
        "interaction_8": "Routes requests to underlying microservices (e.g., Course Service, Account Service) to fulfill data retrieval and manipulation operations (inferred from foundational context)."
      },
      "techDebt": [
        "Rate limiting mechanism is currently marked as 'TODO'. "
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Courses API Resource": {
      "type": "API Endpoint Group",
      "description": "Provides read-only access to publicly visible course catalog data, allowing external applications to retrieve lists of courses or details of specific courses.",
      "interactions": {
        "interaction_0": "Accessed via Portal API Gateway. ",
        "interaction_1": "Retrieves data from Course Microservice. ",
        "interaction_2": "Requires `Accept` header for versioning (e.g., `application/vnd.openhpi.list+json;v=1.1`). ",
        "interaction_3": "Exposes `GET /courses` to retrieve a paginated list of courses. ",
        "interaction_4": "Exposes `GET /courses/{id}` to retrieve a single course by its unique identifier. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Users API Resource": {
      "type": "API Endpoint Group",
      "description": "Enables external applications to update specific user attributes or initiate the deletion of a user, identified by their SAML 2.0 protocol ID.",
      "interactions": {
        "interaction_0": "Accessed via Portal API Gateway. ",
        "interaction_1": "Updates/deletes data in Account Service. ",
        "interaction_2": "Requires `Accept` header for versioning (e.g., `application/vnd.openhpi.user+json;v=1.0`). ",
        "interaction_3": "Exposes `PATCH /users/{id}` to update user attributes such as email, full_name, display_name, born_at, language, and avatar. ",
        "interaction_4": "Exposes `DELETE /users/{id}` to remove a user account. "
      },
      "techDebt": [
        "The `PATCH /users/{id}` endpoint returns a `200 OK` even if the user resource was not fully updated, requiring the client to explicitly check if changes were applied. "
      ],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "Enrollments API Resource": {
      "type": "API Endpoint Group",
      "description": "Manages user enrollments in courses, allowing external applications to retrieve existing enrollments or create new ones.",
      "interactions": {
        "interaction_0": "Accessed via Portal API Gateway. ",
        "interaction_1": "Retrieves/creates data in Course Microservice. ",
        "interaction_2": "Returns a `409 Conflict` if an enrollment for the given user and course already exists during a `POST` request. ",
        "interaction_3": "Requires `Accept` header for versioning (e.g., `application/vnd.openhpi.enrollments+json;v=1.0`). ",
        "interaction_4": "Exposes `GET /enrollments` to retrieve all enrollments for a given user, with optional filtering by `course_id`. ",
        "interaction_5": "Exposes `POST /enrollments` to create a new enrollment for a user in a specified course, requiring `user_id` and `course_id`. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "cluster:05_CORE_APIGateway"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "05_CORE_APIGateway"
        ]
      }
    },
    "system-alerts.js": {
      "type": "Frontend Script",
      "description": "Handles the interactive behavior of the system alerts navigation component, including expanding/collapsing the alert menu and marking alerts as 'seen' using client-side cookies.",
      "interactions": {
        "interaction_0": "Interacts with js-cookie (external library). [Source: app/assets/components/global/system-alerts.js]",
        "interaction_1": "Sets the `aria-expanded` attribute on the toggle button to control menu visibility [Source: app/assets/components/global/system-alerts.js].",
        "interaction_2": "Reads `data-system-alert-cookie` from the main alerts container to get IDs of current alerts [Source: app/assets/components/global/system-alerts.js].",
        "interaction_3": "Interacts with `js-cookie` library to set the `seen_alerts` cookie, storing a comma-separated list of alert IDs [Source: app/assets/components/global/system-alerts.js]."
      },
      "techDebt": [
        "Relies on client-side `js-cookie` for `seen_alerts` status, which can lead to inconsistencies if users clear cookies or use multiple devices. A server-side, per-user tracking mechanism would be more robust ."
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/system-alerts.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "_system_alerts.scss": {
      "type": "Stylesheet",
      "description": "Defines the visual styles for the system alerts component, including the toggle button, dropdown menu, and individual alert items. It incorporates responsive design and visual cues for new/seen alerts.",
      "interactions": {
        "interaction_0": "Styles Navigation::SystemAlerts (View Component Template). [Source: app/assets/stylesheets/components/_system_alerts.scss]",
        "interaction_1": "Responds to the `aria-expanded` attribute on the toggle to show/hide the alert menu [Source: app/assets/stylesheets/components/_system_alerts.scss].",
        "interaction_2": "Uses a `::before` pseudo-element to display a colored dot (red for new, gray for seen) next to alert titles based on the `role=\"status\"` attribute [Source: app/assets/stylesheets/components/_system_alerts.scss]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/components/_system_alerts.scss"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "_alerts.scss": {
      "type": "Stylesheet",
      "description": "Provides general styling for various alert components, leveraging and extending Twitter Bootstrap's alert styles. It defines custom styles for different alert types (danger, warning, info, success) and variations like border-left alerts.",
      "interactions": {
        "interaction_0": "Imports Bootstrap alert mixins and styles [Source: app/assets/stylesheets/partials/_alerts.scss].",
        "interaction_1": "Applies custom styles to `.alert` classes and `sweet-alert` buttons [Source: app/assets/stylesheets/partials/_alerts.scss]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/partials/_alerts.scss"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "_banners.scss": {
      "type": "Stylesheet",
      "description": "Defines styling for banners, specifically the `course-list-banner`, ensuring it spans full width and centers its content within an outer container.",
      "interactions": {
        "interaction_0": "Styles CourseListBanner. [Source: app/assets/stylesheets/partials/_banners.scss]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/partials/_banners.scss"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Navigation::SystemAlerts (View Component Template)": {
      "type": "View Template",
      "description": "The Slim template for the `Navigation::SystemAlerts` view component, defining the HTML structure for the system alerts navigation element, including the toggle button and the dropdown menu listing individual alerts.",
      "interactions": {
        "interaction_0": "Controlled by system-alerts.js. [Source: app/assets/components/global/system-alerts.js]",
        "interaction_1": "Renders FaIcon. [Source: app/components/navigation/system_alerts.html.slim]",
        "interaction_2": "Receives data from Navigation::SystemAlerts (Ruby View Component). [Source: app/components/navigation/system_alerts.html.slim]",
        "interaction_3": "Styled by _system_alerts.scss. [Source: app/assets/stylesheets/components/_system_alerts.scss]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/navigation/system_alerts.html.slim"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "Navigation::SystemAlerts (Ruby View Component)": {
      "type": "View Component",
      "description": "A Ruby on Rails View Component responsible for fetching, caching, and preparing system alerts for display in the navigation. It determines which alerts are 'new' based on user cookies and handles localization.",
      "interactions": {
        "interaction_0": "Renders Navigation::SystemAlerts (View Component Template). [Source: app/components/navigation/system_alerts.rb]",
        "interaction_1": "Interacts with Alert model. [Source: app/components/navigation/system_alerts.rb]",
        "interaction_2": "Uses Rails.cache (implicit). [Source: app/components/navigation/system_alerts.rb]",
        "interaction_3": "Uses I18n. [Source: app/components/navigation/system_alerts.rb]",
        "interaction_4": "Generates `remember_value` (a comma-separated string of current alert IDs) to be stored in the `seen_alerts` cookie by the frontend [Source: app/components/navigation/system_alerts.rb]."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/navigation/system_alerts.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "banner:create": {
      "type": "Rake Task",
      "description": "An interactive Rake task for creating new banners. It guides the user through providing banner details, downloads the image, uploads it to S3, and creates the corresponding `Banner` record.",
      "interactions": {
        "interaction_0": "Creates Banner records. [Source: lib/tasks/create_banner.rake]",
        "interaction_1": "Uploads files to Xikolo::S3. [Source: lib/tasks/create_banner.rake]",
        "interaction_2": "Enqueues S3FileDeletionJob. [Source: lib/tasks/create_banner.rake]",
        "interaction_3": "Parses date inputs using `DateTime.strptime` and URLs using `Addressable::URI` [Source: lib/tasks/create_banner.rake].",
        "interaction_4": "Calls `Banner.upload!` to store the banner image in S3 [Source: lib/tasks/create_banner.rake].",
        "interaction_5": "Calls `Banner.create!` to persist the banner record in the database [Source: lib/tasks/create_banner.rake].",
        "interaction_6": "Handles potential `Aws::S3::Errors::ServiceError` during S3 upload and `ActiveRecord::RecordInvalid` during record creation, performing cleanup (e.g., deleting uploaded S3 file if record creation fails) [Source: lib/tasks/create_banner.rake].",
        "interaction_7": "Enqueues `S3FileDeletionJob` if record creation fails after S3 upload [Source: lib/tasks/create_banner.rake]."
      },
      "techDebt": [
        "As an interactive Rake task, it is less suitable for automated deployments or CI/CD pipelines. A dedicated admin UI or a more scriptable approach (e.g., taking arguments directly) would be more robust for programmatic banner creation [Source: lib/tasks/create_banner.rake]."
      ],
      "provenance": {
        "sources": [
          "lib/tasks/create_banner.rake"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    "MarkdownInput": {
      "type": "SimpleForm Input",
      "description": "A custom SimpleForm input that renders a rich text editor, optionally including file upload capabilities via a dropzone and hidden fields for S3 file mapping.",
      "interactions": {
        "interaction_0": "Generates S3 upload parameters using FileUpload. [Source: app/inputs/markdown_input.rb]",
        "interaction_1": "Interacts with initializeMarkdownEditor. [Source: app/inputs/markdown_input.rb]",
        "interaction_2": "Inherits from SimpleForm Input. [Source: app/inputs/markdown_input.rb]",
        "interaction_3": "Renders HTML for the rich text editor and file upload dropzone.",
        "interaction_4": "Generates S3 upload parameters using `::FileUpload`.",
        "interaction_5": "Interacts with frontend JavaScript (`initializeMarkdownEditor`) to activate the editor functionality."
      },
      "techDebt": [
        "Directly embeds `I18n.t` calls; for a component-based UI, passing translations as props or data attributes might be cleaner."
      ],
      "provenance": {
        "sources": [
          "app/inputs/markdown_input.rb",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "initializeMarkdownEditor": {
      "type": "JavaScript Function",
      "description": "Initializes the rich text markdown editor component on the frontend.",
      "interactions": {
        "interaction_0": "Interacts with the DOM to render the editor. [Source: app/assets/util/markdown-editor.ts]",
        "interaction_1": "Potentially interacts with upload.js and Dropzone.js for file upload functionality if configured. [Source: app/inputs/markdown_input.rb, app/assets/util/forms/upload.js]",
        "interaction_2": "Called by `initMarkdownEditorOnSelector`.",
        "interaction_3": "Likely initializes `@toast-ui/editor` based on project dependencies."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/util/markdown-editor.ts",
          "",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "initMarkdownEditorOnSelector": {
      "type": "JavaScript Adapter",
      "description": "An adapter function that takes an HTML scope and initializes the legacy markdown editor within that scope.",
      "interactions": {
        "interaction_0": "Interacts with the DOM to find elements within the given HTML scope. [Source: app/assets/util/markdown-editor.ts]",
        "interaction_1": "Is likely invoked by views that use MarkdownInput to render the editor. [Source: app/inputs/markdown_input.rb]",
        "interaction_2": "Calls `initializeMarkdownEditor`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/util/markdown-editor.ts",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "Course::CircularProgress": {
      "type": "ViewComponent",
      "description": "Displays a circular progress indicator with a given value and label. Supports a 'small' size modifier for visual adjustments.",
      "interactions": {
        "interaction_0": "Rendered by other views or components (e.g., `ItemPresenter` or `Course::SectionProgressPresenter`) to visualize user progress."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/course/circular_progress.rb",
          "app/components/course/circular_progress.html.slim",
          "app/components/course/circular_progress_preview.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::EnrollmentPolicyForm": {
      "type": "ViewComponent",
      "description": "Renders a form for users to accept a course's enrollment policy. It retrieves course details like title, course code, and policy URL, and submits enrollment requests.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Course` model to fetch course details using `by_identifier`.",
        "interaction_1": "Submits enrollment data to `Course::EnrollmentsController#create` via `enrollments_path`.",
        "interaction_2": "Uses `Translations` utility for policy URL localization."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/course/enrollment_policy_form.rb",
          "app/components/course/enrollment_policy_form.html.slim",
          "app/components/course/enrollment_policy_form_preview.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::EnrollmentStatistics": {
      "type": "ViewComponent",
      "description": "Displays enrollment statistics for a course, including current, at start, and at end counts. It conditionally shows total enrollment count based on a threshold or user permissions.",
      "interactions": {
        "interaction_0": "Interacts with `Course::Course` to get course details and `Course::EnrollmentsStatistics` to retrieve enrollment counts.",
        "interaction_1": "Checks `user.allowed?('course.enrollment_counter.view')` for permission to display the count.",
        "interaction_2": "Uses `I18n` for localization and `number_with_delimiter` for count formatting."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/course/enrollment_statistics.rb",
          "app/components/course/enrollment_statistics.html.slim",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Dashboard::IcalFeed": {
      "type": "ViewComponent",
      "description": "Renders a widget that provides a user-specific iCal feed URL for upcoming course dates. It only renders if the 'ical_feed' feature is enabled for the user.",
      "interactions": {
        "interaction_0": "Checks `user.feature?('ical_feed')` to determine if it should render.",
        "interaction_1": "Uses `IcalHelper#ical_url` to generate the iCal feed URL.",
        "interaction_2": "Renders `Global::DisclosureWidget` and `Global::CopyToClipboard` for UI presentation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/dashboard/ical_feed.rb",
          "app/components/dashboard/ical_feed.html.slim",
          "app/components/dashboard/ical_feed_preview.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CourseSubscriptionsController": {
      "type": "Controller",
      "description": "Manages user subscriptions to course pinboards. Provides actions for users to subscribe and unsubscribe from a course's pinboard.",
      "interactions": {
        "interaction_0": "Uses `CourseContextHelper` to get the course context.",
        "interaction_1": "Communicates with `Xikolo.api(:pinboard)` to create or delete course subscriptions.",
        "interaction_2": "Redirects back to `course_pinboard_index_path` after actions."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/course_subscriptions_controller.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "User::SubscriptionsController": {
      "type": "Controller",
      "description": "Manages user subscriptions to pinboard questions. Provides an action for users to unsubscribe from a question.",
      "interactions": {
        "interaction_0": "Finds `Xikolo::Pinboard::Subscription` based on `user_id` and `question_id`.",
        "interaction_1": "Deletes the found subscription.",
        "interaction_2": "Redirects to `preferences_path` after the operation."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/user/subscriptions_controller.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "CourseReactivation": {
      "type": "Utility Module",
      "description": "Provides configuration and logic for the course reactivation feature. It checks if reactivation is enabled (dependent on voucher feature) and provides locale-specific store URLs for purchasing reactivation vouchers.",
      "interactions": {
        "interaction_0": "Reads configuration from `Xikolo.config.course_reactivation` and `Xikolo.config.voucher`.",
        "interaction_1": "Used by `Course::FreeReactivationsController` to determine the reactivation period."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/lib/course_reactivation.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::DashboardPresenter": {
      "type": "Presenter",
      "description": "Provides static methods for transforming course dashboard statistics (enrollments, forum activity) into chart-friendly formats and for calculating historic date labels and vertical lines.",
      "interactions": {
        "interaction_0": "Provides data transformation logic for charting.",
        "interaction_1": "Uses `I18n` for localized labels.",
        "interaction_2": "Processes `Course` objects to determine start/end dates for historic lines."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course/dashboard_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::DeadlinesPresenter": {
      "type": "Presenter",
      "description": "Presents upcoming deadlines for a user within a specific course. It fetches `NextDate` resources from the `Xikolo::CourseService` and wraps them in `Deadline` objects, indicating urgency.",
      "interactions": {
        "interaction_0": "Communicates with `Xikolo.api(:course).rel(:next_dates)` to fetch deadline data.",
        "interaction_1": "Uses `ActionView::Helpers::DateHelper` for time formatting.",
        "interaction_2": "Uses `Rails.application.routes.url_helpers` to generate URLs for specific deadlines.",
        "interaction_3": "Relies on the `NextDate` resource structure and visibility rules as described in the RAG documentation. "
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course/deadlines_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::ProgressPresenter": {
      "type": "Presenter",
      "description": "Presents a user's overall and section-level progress within a course. It fetches progress data and delegates to `Course::SectionProgressPresenter` for detailed section information. It also determines if the course is in 'open mode'.",
      "interactions": {
        "interaction_0": "Fetches `Xikolo::Course::Progress` records for the user and course.",
        "interaction_1": "Uses `Acfs.on` for concurrent data fetching.",
        "interaction_2": "Delegates to `Course::SectionProgressPresenter` for rendering section-specific progress.",
        "interaction_3": "Checks `user.allowed_any?` to determine 'open mode' access."
      },
      "techDebt": [
        "The presenter handles two types of user objects (`Xikolo::Common::Auth::CurrentUser` or `Xikolo::Account::User`), requiring `respond_to?` checks for methods like `allowed_any?`, indicating a potential type inconsistency or need for a unified interface. [Source: app/presenters/course/progress_presenter.rb]"
      ],
      "provenance": {
        "sources": [
          "app/presenters/course/progress_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "Course::SectionProgressPresenter": {
      "type": "Presenter",
      "description": "Presents the progress for a specific course section, including its availability, optional status, description, and the items contained within it. It delegates to `ItemPresenter` for individual item details.",
      "interactions": {
        "interaction_0": "Wraps a section object (likely a `Xikolo::Course::Section` resource).",
        "interaction_1": "Iterates through `section.items` and uses `ItemPresenter.for` to present each item.",
        "interaction_2": "Relies on `Xikolo::Course::Item` for item details."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/course/section_progress_presenter.rb",
          "cluster:02_CORE_CourseContent"
        ],
        "runSources": [],
        "enhancedBy": [
          "02_CORE_CourseContent"
        ]
      }
    },
    "mdupload.js": {
      "type": "Frontend Module",
      "description": "Attaches Dropzone.js behavior for file uploads within markdown editors. It dispatches events to the editor to insert links to uploaded files.",
      "interactions": {
        "interaction_0": "Initializes `Dropzone.js` on elements with `data-mdupload`.",
        "interaction_1": "Reads S3 configuration from HTML `data` attributes.",
        "interaction_2": "On successful upload, dispatches a `markdownEditor::addLink` custom event to the markdown editor widget, providing an internal URI for the uploaded file.",
        "interaction_3": "For older markdown editors, updates `textArea.xiUrlMapping` with internal to external URL mappings.",
        "interaction_4": "Uses `util/sanitize` for filenames."
      },
      "techDebt": [
        "Does not explicitly handle file deletion from S3 on `removedfile` event, implying reliance on backend `TextWithUploadsProcessor` for cleanup. This could lead to orphaned files if the backend process fails or is not correctly implemented for all scenarios. "
      ],
      "provenance": {
        "sources": [
          "app/assets/util/forms/mdupload.js",
          "app/assets/stylesheets/xui/mdupload.scss",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "xui/imageupload.scss": {
      "type": "Stylesheet",
      "description": "Provides specific styling for the image upload Dropzone component, including layout, preview dimensions, and clear button positioning.",
      "interactions": {
        "interaction_0": "Applies visual styles to the HTML elements rendered by `ImageUploadInput` and manipulated by `image-upload.js`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/xui/imageupload.scss",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "xui/mdupload.scss": {
      "type": "Stylesheet",
      "description": "Provides styling for the markdown editor upload Dropzone, defining its layout relative to the editor.",
      "interactions": {
        "interaction_0": "Applies visual styles to the HTML elements rendered for markdown uploads and managed by `mdupload.js`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/xui/mdupload.scss",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "xui/upload.scss": {
      "type": "Stylesheet",
      "description": "Provides general styling for Dropzone components, including drag-hover effects, progress bars, and action buttons.",
      "interactions": {
        "interaction_0": "Applies visual styles to the HTML elements rendered by `UploadInput` and manipulated by `upload.js`."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/stylesheets/xui/upload.scss",
          "cluster:13_LEARN_FileManagement"
        ],
        "runSources": [],
        "enhancedBy": [
          "13_LEARN_FileManagement"
        ]
      }
    },
    "TracksReferrers": {
      "type": "Concern",
      "description": "An `ActiveSupport::Concern` responsible for tracking external referrers and associated tracking parameters when users access public-facing pages. It filters out internal referrers, invalid URLs, and specific 'logo' requests, then enriches the data with server-side metadata before publishing it for asynchronous processing.",
      "interactions": {
        "interaction_0": "Includes `ActiveSupport::Concern` for mixin functionality. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_1": "Hooks into the controller lifecycle via `after_action :track_referrer`. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_2": "Interacts with `request.referer` and `request.original_url` to get URL information. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_3": "Accesses `params` for tracking-related query parameters (e.g., `tracking_campaign`, `tracking_id`, `logo`). [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_4": "Uses `URI.parse` and `URI::InvalidURIError` for referrer URL parsing and validation. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_5": "Compares referrer host with `Xikolo.base_url.host` to identify internal referrers. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_6": "Accesses `current_user` to determine the user ID for logged-in users. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_7": "Uses `UUID4.try_convert` to validate and convert `tracking_user` parameter to a UUID. [Source: app/controllers/concerns/tracks_referrers.rb]",
        "interaction_8": "Publishes an enriched JSON payload to the `xikolo.web.referrer` topic via `Msgr` for asynchronous processing by the `lanalytics` service. [Source: app/controllers/concerns/tracks_referrers.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/concerns/tracks_referrers.rb",
          "spec/requests/tracking/referrer_spec.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    "Xikolo.api(:course)": {
      "type": "API Client",
      "description": "An internal API client for the `Xikolo::CourseService` microservice, used to retrieve course and item-related data.",
      "interactions": {
        "interaction_0": "Used by `Home::GoController` to fetch item details (e.g., `course_id`) and course details (e.g., `course_code`) for deep linking. [Source: app/controllers/home/go_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "config/routes.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    "Xikolo.api(:pinboard)": {
      "type": "API Client",
      "description": "An internal API client for the `Xikolo::PinboardService` microservice, used to retrieve pinboard-related data.",
      "interactions": {
        "interaction_0": "Used by `Home::GoController` to fetch implicit tags associated with items for pinboard deep linking. [Source: app/controllers/home/go_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "config/routes.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    "Xikolo::Common::Tracking::ExternalLink": {
      "type": "Utility Class",
      "description": "A utility class, likely from the `xikolo-common` gem, responsible for validating external links, potentially including a checksum for integrity and security.",
      "interactions": {
        "interaction_0": "Used by `Home::GoController#redirect` to validate the target URL and its `checksum` before performing an external redirect. [Source: app/controllers/home/go_controller.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "gems/xikolo-common/Gemfile",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    "Course::Documents::FilterBar": {
      "type": "ViewComponent",
      "description": "A UI component responsible for rendering the document filtering interface, including language and tag filters. It processes a list of documents to extract unique languages and tags for filter options.",
      "interactions": {
        "interaction_0": "Renders a form for filtering documents, submitting to `course_documents_path`.",
        "interaction_1": "Renders `Global::FilterBar::Controls` for filter management.",
        "interaction_2": "Renders `State::Loading` and `State::Empty` components based on content availability.",
        "interaction_3": "Extracts unique languages from `document[:localizations]` for filter options. [Source: app/components/course/documents/filter_bar.rb]",
        "interaction_4": "Extracts unique tags from `document[:tags]` for filter options. [Source: app/components/course/documents/filter_bar.rb]",
        "interaction_5": "Uses `params` to determine selected filter values. [Source: app/components/course/documents/filter_bar.rb]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/components/course/documents/filter_bar.rb",
          "app/components/course/documents/filter_bar.html.slim",
          "cluster:32_ADMIN_ContentManagement"
        ],
        "runSources": [],
        "enhancedBy": [
          "32_ADMIN_ContentManagement"
        ]
      }
    },
    "PrivatePresenter": {
      "type": "Base Class (Presenter)",
      "description": "Extends `Presenter` and introduces a `Preloading` module for efficient batch loading of associated resources for collections of presenters. It initializes a `Preloader` instance and includes `RestifyForwardable` for potential external service interactions.",
      "interactions": {
        "interaction_0": "Inherits from `Presenter`.",
        "interaction_1": "Extends child classes with `Preloading` module.",
        "interaction_2": "Uses `Preloading::Preloader` internally for data loading.",
        "interaction_3": "Inherited by `IconNavigationPresenter` and `CoursePresenter` (via `CourseInfoPresenter`)."
      },
      "techDebt": [
        "The explicit `cls.extend(Preloading)` in `inherited` hook for `build_collection` might indicate a slightly less direct or more verbose pattern for extending class methods compared to direct module inclusion or class-level method definitions."
      ],
      "provenance": {
        "sources": [
          "app/presenters/private_presenter.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "Preloading::Preloader": {
      "type": "Utility (Nested Class)",
      "description": "A utility class nested within `PrivatePresenter` responsible for preloading associated resources for a collection of objects, preventing N+1 queries. It uses an internal cache to store preloaded records.",
      "interactions": {
        "interaction_0": "Used by `PrivatePresenter` and its descendants via the `load` method to fetch associated data efficiently."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/private_presenter.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "IconNavigationPresenter": {
      "type": "Presenter",
      "description": "A specialized presenter for icon-based navigation elements. It exposes an `items` attribute and a `show?` method to determine if there are any items to display, enabling conditional rendering.",
      "interactions": {
        "interaction_0": "Inherits from `PrivatePresenter`.",
        "interaction_1": "Used by views or layouts to render dynamic icon navigation menus."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/presenters/icon_navigation_presenter.rb",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "_piwik.html.slim": {
      "type": "View Partial (Layout Integration)",
      "description": "Integrates Piwik (Matomo) analytics tracking into the application. It dynamically generates JavaScript code based on `Xikolo.config.piwik` settings, enabling or disabling tracking and configuring it.",
      "interactions": {
        "interaction_0": "Reads configuration from `Xikolo.config`.",
        "interaction_1": "Intended to be included in the main application layout for site-wide tracking."
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/views/shared/_piwik.html.slim",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "browser-warning.js": {
      "type": "Frontend Component",
      "description": "Client-side JavaScript module responsible for handling the dismissal of browser compatibility warning messages. It sets a persistent cookie to remember the user's preference and hides the warning element from the DOM. [Source: app/assets/components/global/browser-warning.js]",
      "interactions": {
        "interaction_0": "Interacts with the DOM to find and hide the warning alert element (`[data-browser-warning=\"alert\"]`). [Source: app/assets/components/global/browser-warning.js]",
        "interaction_1": "Uses `js-cookie` to set a cookie (`_browser_warning`) with a 365-day expiration. [Source: app/assets/components/global/browser-warning.js]"
      },
      "techDebt": [],
      "provenance": {
        "sources": [
          "app/assets/components/global/browser-warning.js",
          "cluster:44_INFRA_UIComponents"
        ],
        "runSources": [],
        "enhancedBy": [
          "44_INFRA_UIComponents"
        ]
      }
    },
    "ConsentCookie": {
      "type": "Service Object",
      "description": "Manages the state of cookie consents in the client's browser. It reads, writes, and updates a specific cookie (`cookie_consents`) to store user decisions (accepted or declined) for various configured consents. It also determines which consent, if any, is currently undecided and should be presented to the user.",
      "interactions": {
        "interaction_0": "Accessed by `Global::CookieConsentBanner` to check for current consent and render the banner. [Source: app/components/global/cookie_consent_banner.rb]",
        "interaction_1": "Accessed by `CookieConsentController` to record user decisions (accept/decline) into the cookie. [Source: app/controllers/cookie_consent_controller.rb]",
        "interaction_2": "Relies on `xi_config` for the definition and order of available cookie consents. [Source: spec/lib/consent_cookie_spec.rb, spec/requests/cookie_consent/create_spec.rb]",
        "interaction_3": "Interacts with `ActionDispatch::Cookies::CookieJar` to manipulate client-side cookies. [Source: spec/lib/consent_cookie_spec.rb]"
      },
      "techDebt": [
        "The source file `lib/consent_cookie.rb` was not provided, making a direct code review of its implementation impossible. Its functionality is inferred from its usage and comprehensive test suite. [Source: N/A]"
      ],
      "provenance": {
        "sources": [
          "app/components/global/cookie_consent_banner.rb",
          "app/controllers/cookie_consent_controller.rb",
          "spec/lib/consent_cookie_spec.rb",
          "spec/requests/cookie_consent/create_spec.rb",
          "cluster:50_SEC_CookieConsent"
        ],
        "runSources": [],
        "enhancedBy": [
          "50_SEC_CookieConsent"
        ]
      }
    }
  },
  "workflows": [
    {
      "workflowName": "Quiz Creation and Management",
      "description": "Instructors create and manage quizzes, questions, and answers through a web interface. This involves dynamic form loading, content editing, and persistence to the Quiz Service.",
      "involvedComponents": [
        "app/assets/teacher/items/quiz.ts",
        "app/assets/teacher/items/quiz-item.ts",
        "app/assets/teacher/items/quiz-questions.ts",
        "app/assets/teacher/items/quiz-edit.ts",
        "QuizQuestionsController",
        "QuizAnswersController",
        "Xikolo::Quiz::Quiz",
        "Xikolo::Quiz::Question",
        "Xikolo::Quiz::Answer",
        "Quiz Service"
      ],
      "provenance": {
        "sources": [
          "app/assets/teacher/items/quiz.ts",
          "app/assets/teacher/items/quiz-item.ts",
          "app/assets/teacher/items/quiz-questions.ts",
          "app/assets/teacher/items/quiz-edit.ts",
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_answers_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Submission",
      "description": "Students start, attempt, and submit quizzes. This workflow handles time limits, deadlines, attempts tracking, partial submission saving, and proctoring integration.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizSubmissionSnapshotController",
        "QuizItemPresenter",
        "Xikolo::Quiz::Quiz",
        "Xikolo::Submission::QuizSubmission",
        "Xikolo::Submission::QuizSubmissionSnapshot",
        "Xikolo::Submission::UserQuizAttempts",
        "Quiz Service",
        "Course Service",
        "Submission Service",
        "Quiz::Submission",
        "Quiz::Submission::Proctoring"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "app/presenters/quiz_item_presenter.rb",
          "app/models/quiz/submission.rb",
          "app/models/quiz/submission/proctoring.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Result Viewing",
      "description": "Students view their submitted quiz results, including scores, historical attempts, and proctoring status. This workflow supports navigation between different submissions.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizResultPresenter",
        "QuizSubmissionProctoringPresenter",
        "app/assets/course/items/quiz.ts",
        "Xikolo::Submission::QuizSubmission",
        "Quiz::Submission",
        "Quiz::Submission::Proctoring"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_result_presenter.rb",
          "app/presenters/quiz_submission_proctoring_presenter.rb",
          "app/assets/course/items/quiz.ts",
          "app/models/quiz/submission.rb",
          "app/models/quiz/submission/proctoring.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Recap Viewing",
      "description": "Students can view a detailed recap of quiz questions and their answers, often used for review or learning purposes.",
      "involvedComponents": [
        "QuizRecapController",
        "app/assets/quiz-recap/quiz-recap.ts",
        "Quiz Service",
        "Course Service",
        "Course::QuizRecap"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_recap_controller.rb",
          "app/assets/quiz-recap/quiz-recap.ts",
          "app/components/course/quiz_recap.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Regrading (Admin)",
      "description": "Administrators perform various regrading operations on quizzes, questions, or answers, typically via command-line `rake` tasks on the Quiz Service. This allows for adjustments to scores after quiz content changes or errors.",
      "involvedComponents": [
        "Quiz Service"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Authentication via External Providers",
      "description": "Users log in to the platform using various external identity providers (e.g., SAML, OpenID Connect) configured through OmniAuth. ",
      "involvedComponents": [
        "OmniAuth Configuration",
        "Xikolo Account Service"
      ],
      "provenance": {
        "sources": [
          "config/initializers/omniauth.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Profile Data Management",
      "description": "Users view and update their personal information, including custom fields and consent preferences, on their profile page. ",
      "involvedComponents": [
        "Custom Fields Management",
        "Consent Management",
        "Xikolo Account Service"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Client Authentication",
      "description": "External applications or services authenticate with the Portal API using OAuth 2.0 Bearer Tokens to access platform resources. ",
      "involvedComponents": [
        "Portal API Authentication"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Administrator Permission Management",
      "description": "Administrators define and assign roles and groups to control access and permissions for users within the `Xikolo Account Service` and potentially other parts of the platform. ",
      "involvedComponents": [
        "Authorization System",
        "Xikolo Account Service"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Content Management (Teacher)",
      "description": "Teachers create, edit, organize, and delete course sections and various content items (rich text, video, quiz, LTI exercise). This workflow involves frontend forms, backend controllers, and microservice interactions for data persistence and file management.",
      "involvedComponents": [
        "Admin::CourseForm",
        "SectionsController",
        "ItemsController",
        "Course::Richtext::Store",
        "Course::Visual::Store",
        "Item::Create",
        "handleRichTextType",
        "sections.js",
        "CourseContextHelper",
        "ItemContextHelper",
        "Xikolo::Course::Section",
        "Xikolo::Course::Item",
        "Video::Video",
        "Course::Richtext",
        "Xikolo::Quiz::Quiz",
        "Lti::Exercise"
      ],
      "provenance": {
        "sources": [
          "app/controllers/sections_controller.rb",
          "app/controllers/items_controller.rb",
          "app/forms/admin/course_form.rb",
          "app/operations/course/richtext/store.rb",
          "app/operations/course/visual/store.rb",
          "app/operations/item/create.rb",
          "app/assets/teacher/items/rich-text.ts",
          "app/assets/teacher/sections/sections.js",
          "app/helpers/course_context_helper.rb",
          "app/helpers/item_context_helper.rb",
          "docs/app/development/implementation/course_items_form.md"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Enrollment (Learner)",
      "description": "Learners enroll in courses, potentially through a launch page, and can reactivate past courses. The system handles various enrollment scenarios, including invite-only courses and prerequisite checks, and provides appropriate feedback and redirects.",
      "involvedComponents": [
        "Course::EnrollmentsController",
        "Course::LaunchController",
        "Course::FreeReactivationsController",
        "CourseInfoPresenter",
        "CourseLargePreviewPresenter",
        "CourseContextHelper",
        "Xikolo::Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/enrollments_controller.rb",
          "app/controllers/course/launch_controller.rb",
          "app/controllers/course/free_reactivations_controller.rb",
          "app/presenters/course_info_presenter.rb",
          "app/presenters/course_large_preview_presenter.rb",
          "app/helpers/course_context_helper.rb",
          "services/course/README.md",
          "docs/app/features/reactivation.md"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Progress & Syllabus Viewing (Learner)",
      "description": "Learners view their overall course progress, access the course syllabus, and navigate through individual content items. The system tracks item visits and displays item status (locked, visited, active) and time effort.",
      "involvedComponents": [
        "Course::ProgressController",
        "Course::SyllabusController",
        "ItemsController",
        "CourseContextHelper",
        "ItemContextHelper",
        "ProgressHelper",
        "ItemPresenter",
        "SectionPresenter",
        "CourseNav",
        "DocumentsPresenter",
        "Xikolo::Course::Visit",
        "Xikolo::Course::Item",
        "Xikolo::Course::Section"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/progress_controller.rb",
          "app/controllers/course/syllabus_controller.rb",
          "app/controllers/items_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/helpers/item_context_helper.rb",
          "app/helpers/progress_helper.rb",
          "app/presenters/item_presenter.rb",
          "app/presenters/section_presenter.rb",
          "app/presenters/course_nav.rb",
          "app/presenters/documents_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Document Management",
      "description": "Users can view course documents, while teachers can perform CRUD operations on documents and their localizations. This includes uploading document files to S3 and associating them with courses.",
      "involvedComponents": [
        "Course::DocumentsController",
        "DocumentHelper",
        "DocumentsListPresenter",
        "DocumentsListPresenter::DocumentPresenter",
        "Xikolo::Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/documents_controller.rb",
          "app/helpers/document_helper.rb",
          "app/presenters/documents_list_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Announcement Management",
      "description": "Administrators create, edit, and list general announcements, distinguishing between drafts and published items. This workflow primarily uses the `Admin::AnnouncementsController` and `Admin::AnnouncementForm`.",
      "involvedComponents": [
        "Admin::AnnouncementsController",
        "Admin::AnnouncementForm",
        "Admin::AnnouncementForm::Translation",
        "Admin::AnnouncementForm::TranslationsArray",
        "Admin::AnnouncementPresenter",
        "Admin::AnnouncementsListPresenter",
        "Xikolo::NewsService"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcements_controller.rb",
          "app/forms/admin/announcement_form.rb",
          "app/presenters/admin/announcement_presenter.rb",
          "app/presenters/admin/announcements_list_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Announcement Email Sending",
      "description": "Administrators compose and send announcement emails to selected recipients (users, courses, groups). This involves selecting recipients, defining email content, and triggering the send via the NewsService.",
      "involvedComponents": [
        "Admin::AnnouncementEmailsController",
        "Admin::Announcement::RecipientsController",
        "Admin::AnnouncementEmailForm",
        "Admin::AnnouncementEmailForm::Translation",
        "Admin::AnnouncementEmailForm::RecipientsArray",
        "Admin::AnnouncementEmailForm::TranslationsArray",
        "Admin::AnnouncementEmailPresenter",
        "Xikolo::NewsService",
        "Xikolo::Account",
        "Xikolo::CourseService"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/announcement_emails_controller.rb",
          "app/controllers/admin/announcement/recipients_controller.rb",
          "app/forms/admin/announcement_email_form.rb",
          "app/presenters/admin/announcement_email_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin News Management",
      "description": "Administrators create, edit, and delete news items (homepage announcements), which can include visual media and audience targeting. This workflow also allows sending associated emails.",
      "involvedComponents": [
        "AnnouncementsController",
        "Admin::NewsForm",
        "Admin::NewsForm::Translation",
        "Admin::NewsForm::TranslationsArray",
        "Xikolo::NewsService"
      ],
      "provenance": {
        "sources": [
          "app/controllers/announcements_controller.rb",
          "app/forms/admin/news_form.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Public Announcement Display",
      "description": "Users view published announcements and news items on the application's homepage. Privileged users may also see unpublished drafts.",
      "involvedComponents": [
        "Home::AnnouncementsController",
        "AnnouncementPresenter",
        "Xikolo::NewsService",
        "news microservice"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/announcements_controller.rb",
          "app/presenters/announcement_presenter.rb",
          "spec/requests/announcements/index_spec.rb"
        ],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Announcement Read Tracking",
      "description": "The system tracks when users view announcements, asynchronously notifying the NewsService to mark them as read.",
      "involvedComponents": [
        "Middleware::NewsTracker",
        "Xikolo::NewsService"
      ],
      "provenance": {
        "sources": [
          "lib/middleware/news_tracker.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Discussion Management",
      "description": "Users can browse discussions for a course, filter by sections (including a special 'Technical Issues' section) or tags, and create new questions. Course administrators can manage tags.",
      "involvedComponents": [
        "PinboardController",
        "PinboardPresenter",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::ExplicitTag",
        "Xikolo::Pinboard::ImplicitTag",
        "Xikolo::Course::Section",
        "PinboardRoutesHelper"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Question/Answer/Comment Lifecycle",
      "description": "Users can create, view, edit, and delete questions, answers, and comments. This includes features like upvoting questions/answers, accepting an answer for a question, and subscribing to questions.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "Pinboard::TopicForm",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Answer",
        "Xikolo::Pinboard::Comment",
        "Xikolo::Pinboard::Vote",
        "Xikolo::Pinboard::Subscription",
        "QuestionPresenter",
        "PinboardRoutesHelper"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb",
          "app/forms/pinboard/topic_form.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Pinboard Moderation & Reporting",
      "description": "Users can report questions, answers, or comments for abuse. Authorized moderators can block or unblock any pinboard entity (question, answer, comment) and delete questions or comments. They can also close/reopen questions.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "Xikolo::Pinboard::AbuseReport",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Comment",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Interaction & Gamification",
      "description": "User actions on the pinboard (e.g., posting, answering, commenting) contribute to their gamification scores. These scores are used to display user states/levels next to their posts, if the gamification feature is enabled.",
      "involvedComponents": [
        "PinboardUserStatePresenter",
        "Gamification::Score",
        "Gamification::Level",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/presenters/pinboard_user_state_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "One-Click Email Unsubscribe",
      "description": "Allows users to disable specific email notification types directly from an email link without logging in. This involves validating the request and updating user preferences in the Account service.",
      "involvedComponents": [
        "NotificationUserDisablesController",
        "NotificationUserSettingsHelper",
        "Account Service (conceptual)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/notification_user_disables_controller.rb",
          "app/helpers/notification_user_settings_helper.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Notification Email Delivery",
      "description": "Handles the end-to-end process of sending an email notification, from receiving an event to rendering, styling, tracking, and dispatching the email.",
      "involvedComponents": [
        "Msgr (conceptual)",
        "NotificationService",
        "MarkdownService",
        "TrackingMailInterceptor",
        "Account Service (for user preferences, conceptual)"
      ],
      "provenance": {
        "sources": [
          "services/notification/lib/markdown_service.rb",
          "services/notification/lib/tracking_mail_interceptor.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Dashboard Navigation Rendering",
      "description": "The process of dynamically generating the administrative dashboard's navigation menu. This workflow involves checking the current user's permissions and system-wide feature flags to determine which menu items are visible and accessible.",
      "involvedComponents": [
        "AdminNavigation",
        "User"
      ],
      "provenance": {
        "sources": [
          "app/presenters/admin_navigation.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Reporting Role Management",
      "description": "The manual, console-based process of granting or revoking the `lanalytics.report.admin` role to users. This workflow is critical due to the sensitive nature of the data involved and bypasses UI-driven administration for enhanced control and policy adherence.",
      "involvedComponents": [
        "Role",
        "User",
        "Grant",
        "Context"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Public API Request Handling (Main API)",
      "description": "A client (e.g., mobile app) sends a request to the `/api` endpoint. The request includes an `Accept` header specifying the desired API version. The `Xikolo::API` (Grape application) processes the request, potentially authenticating it, and fetches/stores data from backend services. The response adheres to JSON-API and includes the actual API version and potentially a `Sunset` header for deprecation notices.",
      "involvedComponents": [
        "Xikolo::API",
        "Rails.application.routes",
        "Xi::Controllers::RequireBearerToken",
        "Backend Services"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Portal API Request Handling",
      "description": "An external client (e.g., customer portal) sends a request to the `/portalapi-beta` endpoint. The request must include an `Authorization: Bearer <token>` header for authentication and an `Accept` header for version negotiation. The `Xi::Controllers::RequireBearerToken` middleware validates the token. If valid, the request is routed to the `PortalApi` module's controllers, which process the request and return a JSON-API compliant response, potentially with `application/problem+json` for errors.",
      "involvedComponents": [
        "PortalApi",
        "Rails.application.routes",
        "Xi::Controllers::RequireBearerToken"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb",
          "lib/xi/controllers/require_bearer_token.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Bridge API Request Handling",
      "description": "Internal or specific external systems send requests to various `/bridges` sub-endpoints (e.g., `/bridges/chatbot/authenticate`). These requests are routed to the respective `Bridges` sub-modules (e.g., `Chatbot` module). Authentication and data formats may vary depending on the specific bridge, but they generally facilitate inter-service communication or specialized integrations.",
      "involvedComponents": [
        "Bridges",
        "Rails.application.routes"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Version Negotiation",
      "description": "A client sends an API request with an `Accept` header containing `xikolo-version=<client_version>`. The API determines the latest compatible minor version and responds with `Content-Type` including `xikolo-version=<server_version>`. If the client's version is deprecated, the response also includes a `Sunset` header with an expiration date.",
      "involvedComponents": [
        "Xikolo::API",
        "PortalApi",
        "Rails.application.routes"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Bearer Token Authentication",
      "description": "An API client includes an `Authorization: Bearer <token>` header in its request. The `Xi::Controllers::RequireBearerToken` middleware intercepts the request, extracts the token, and compares it against a configured secret. If the token is missing or invalid, the middleware immediately terminates the request with a `401 Unauthorized` HTTP Problem Details response and a `WWW-Authenticate` header.",
      "involvedComponents": [
        "Xi::Controllers::RequireBearerToken",
        "API Clients",
        "API Endpoints"
      ],
      "provenance": {
        "sources": [
          "lib/xi/controllers/require_bearer_token.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Asset Compilation",
      "description": "The process of compiling, bundling, and optimizing JavaScript, TypeScript, and Sass assets into deployable bundles for the web application.",
      "involvedComponents": [
        "Webpack",
        "Yarn",
        "Babel",
        "Sass",
        "PostCSS",
        "Sass (sass-embedded)",
        "TypeScript"
      ],
      "provenance": {
        "sources": [
          "package.json"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Client-Side UI Rendering",
      "description": "The workflow for rendering dynamic and interactive user interfaces directly in the user's browser using modern JavaScript frameworks and libraries.",
      "involvedComponents": [
        "React",
        "TypeScript",
        "Webpack",
        "I18n-js"
      ],
      "provenance": {
        "sources": [
          "package.json",
          "tsconfig.json"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Server-Side UI Component Rendering",
      "description": "The process of composing and rendering reusable UI components on the server using Ruby, which are then delivered as HTML to the client.",
      "involvedComponents": [
        "ViewComponent",
        "Slim"
      ],
      "provenance": {
        "sources": [
          "Gemfile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Code Quality Enforcement",
      "description": "The workflow for maintaining consistent code style and adherence to best practices across Ruby, Slim, JavaScript/TypeScript, and SCSS codebases using static analysis and formatting tools.",
      "involvedComponents": [
        "RuboCop",
        "Slim-Lint",
        "ESLint",
        "Stylelint",
        "Prettier",
        "scripts/rubocop-changed"
      ],
      "provenance": {
        "sources": [
          ".rubocop.yml",
          ".slim-lint.yml",
          "eslint.config.mjs",
          ".stylelintrc.js",
          ".prettierrc.yml",
          "scripts/rubocop-changed"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Dependency Management",
      "description": "The process of adding, updating, and managing external JavaScript and CSS libraries and tools required for frontend development and deployment.",
      "involvedComponents": [
        "Yarn",
        "package.json"
      ],
      "provenance": {
        "sources": [
          "package.json"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Earns Gamification Points and Badges",
      "description": "A user performs an action (e.g., takes an exam, answers a question, visits a course item) which triggers an event. This event is consumed by the `GamificationConsumer`, which then dispatches to a specific `Gamification::Rules` class to calculate and record points. These accumulated points contribute towards achieving different levels of badges as defined in `Gamification::BadgeTypes`.",
      "involvedComponents": [
        "User",
        "Msgr (RabbitMQ)",
        "GamificationConsumer",
        "Gamification::Rules::*",
        "Gamification::Score (Implied Model)",
        "Gamification::Badge (Implied Model)",
        "Gamification::BadgeTypes (YAML)"
      ],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Views Achievements",
      "description": "A logged-in user navigates to the dashboard achievements page. The system retrieves the user's earned badges and scores. Each badge is rendered by the `Dashboard::GamificationBadge` component, displaying its image and title. The user's total points and course-specific XP are also displayed, provided the gamification feature is enabled.",
      "involvedComponents": [
        "User",
        "Dashboard Achievements View (`app/views/dashboard/achievements.html.slim`)",
        "Gamification::Badge (Implied Model)",
        "Dashboard::GamificationBadge",
        "Gamification::Score (Implied Model)",
        "Gamification::Configuration"
      ],
      "provenance": {
        "sources": [
          "app/views/dashboard/achievements.html.slim",
          "app/components/dashboard/gamification_badge.rb",
          "integration/features/steps/gamification/user_score.rb",
          "integration/features/xikolo/global/gamification/user_score.feature"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Certificate/Open Badge Template Administration",
      "description": "Administrators create, update, and delete templates for certificates and Open Badges within a specific course. This involves uploading PDF or PNG files and configuring template-specific metadata.",
      "involvedComponents": [
        "Course::Admin::CertificateTemplatesController",
        "Course::Admin::OpenBadgeTemplatesController",
        "Certificate::Template",
        "Certificate::OpenBadgeTemplate",
        "FileUpload",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "app/controllers/course/admin/open_badge_templates_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Credential Viewing and Download",
      "description": "Authenticated users can view their earned certificates and Open Badges for a course, and download official PDF certificates. This workflow includes checks for course eligibility and proctoring status for certificate downloads.",
      "involvedComponents": [
        "Course::CertificatesController",
        "Certificate::Template",
        "Certificate::Record",
        "Certificate::OpenBadgeTemplate",
        "Certificate::Record::Render",
        "Certificate::RecordRenderer",
        "Proctoring::SmowlAdapter",
        "Course::Enrollment",
        "Restify",
        "Acfs"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/certificates_controller.rb",
          "app/lib/certificate/record_renderer.rb",
          "app/operations/certificate/record/render.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Public Certificate Verification",
      "description": "Any user can verify the authenticity of an issued certificate by providing its unique verification code. The system displays the certificate details and, if applicable, the associated Open Badge.",
      "involvedComponents": [
        "Course::CertificatesController",
        "Certificate::Record",
        "Certificate::OpenBadgeTemplate"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/certificates_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Proctoring Image Preparation for Certificates",
      "description": "(Intended) After a user completes a proctored quiz, a background job is triggered to fetch their proctoring image from the SMOWL service and store it in S3, making it available for inclusion in their certificates.",
      "involvedComponents": [
        "Proctoring::UploadCertificateImageJob",
        "Proctoring::SmowlAdapter",
        "S3"
      ],
      "provenance": {
        "sources": [
          "app/jobs/proctoring/upload_certificate_image_job.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin LTI Provider Management (Global)",
      "description": "Administrators create, edit, and delete global LTI providers through a dedicated admin interface. This workflow includes form submission, validation, and handling of privacy settings.",
      "involvedComponents": [
        "Admin::LtiProvidersController",
        "Lti::Provider",
        "Course::Admin::LtiProviderForm",
        "Steps::Admin::LtiProvider",
        "Create a global LTI Provider"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/lti_providers_controller.rb",
          "app/forms/course/admin/lti_provider_form.rb",
          "integration/features/steps/admin/lti_provider.rb",
          "integration/features/xikolo/global/admin/lti_provider.feature"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course-Specific LTI Provider Management",
      "description": "Course administrators manage LTI providers that are scoped to a particular course. This involves creating, updating, and deleting LTI provider configurations within the context of a course, with specific permissions for privacy settings.",
      "involvedComponents": [
        "LtiProvidersController",
        "Lti::Provider",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_providers_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Tool Launch (Consumer Side)",
      "description": "A user initiates an LTI tool from a course item. The system determines the display method (intro page or iframe), prepares the LTI launch request, and redirects or embeds the external tool.",
      "involvedComponents": [
        "LtiController",
        "Course::Item",
        "LtiExerciseItemPresenter",
        "Lti::Exercise",
        "Lti::Provider",
        "Course::LtiLaunchPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/presenters/lti_exercise_item_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Tool Grading Callback",
      "description": "An external LTI tool sends a grading callback to the platform. The system validates the request, processes the grade, publishes analytics events, and responds to the LTI tool.",
      "involvedComponents": [
        "LtiController",
        "LtiController::ToolGrading",
        "IMS::LTI::OutcomeRequest",
        "IMS::LTI::ToolConsumer",
        "Lti::Gradebook",
        "Lti::Grade",
        "Lti::Exercise",
        "Lti::Provider",
        "Msgr",
        "IMS::LTI::OutcomeResponse",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Grade Publishing (Internal)",
      "description": "After an LTI grade is received and recorded, a background job is initiated to publish this grade to the course service, ensuring it is accounted for in the user's course progress.",
      "involvedComponents": [
        "Lti::PublishGradeJob",
        "Lti::Grade"
      ],
      "provenance": {
        "sources": [
          "app/jobs/lti/publish_grade_job.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Exercise Content Management",
      "description": "The process of creating or updating the content, specifically instructions, for an LTI exercise. This includes handling embedded S3 file uploads and managing their lifecycle.",
      "involvedComponents": [
        "Lti::Exercise::Store",
        "Lti::Exercise",
        "Xikolo::S3::TextWithUploadsProcessor",
        "S3FileDeletionJob"
      ],
      "provenance": {
        "sources": [
          "app/operations/lti/exercise/store.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Overwrites Item Time Effort",
      "description": "An administrator views a course item's time effort, which can be a calculated value or a previously overwritten value. The administrator then manually enters a new time effort, overriding any calculated value.",
      "involvedComponents": [
        "_time_effort.html.slim",
        "Course::Admin::ItemTimeEffortController",
        "Xikolo::TimeEffort Microservice (Client Proxy)",
        "Xikolo::CourseService Microservice (Client Proxy)"
      ],
      "provenance": {
        "sources": [
          "app/views/items/_time_effort.html.slim",
          "app/controllers/course/admin/item_time_effort_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Resets Item Time Effort",
      "description": "An administrator, after viewing or overwriting a course item's time effort, chooses to remove the manual override. The system then reverts to displaying the automatically calculated time effort for that item.",
      "involvedComponents": [
        "_time_effort.html.slim",
        "Course::Admin::ItemTimeEffortController",
        "Xikolo::TimeEffort Microservice (Client Proxy)",
        "Xikolo::CourseService Microservice (Client Proxy)"
      ],
      "provenance": {
        "sources": [
          "app/views/items/_time_effort.html.slim",
          "app/controllers/course/admin/item_time_effort_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Boot and Initialization",
      "description": "The process of starting the Rails application, loading gems, configuring environment settings, and initializing middleware. This includes conditional loading of `bootsnap` for development speed and setting up core Rails configurations.",
      "involvedComponents": [
        "Xikolo::Web::Application",
        "Xikolo.config",
        "Bootsnap",
        "Puma",
        "Msgr",
        "ActiveRecord::Base"
      ],
      "provenance": {
        "sources": [
          "config/boot.rb",
          "config/environment.rb",
          "config/application.rb",
          "config/puma.rb",
          "Gemfile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Configuration Loading and Management",
      "description": "The process by which the application loads and manages its various settings from YAML files and environment variables. This involves a hierarchical loading order, allowing for environment-specific overrides and centralized management of platform features and integrations.",
      "involvedComponents": [
        "Xikolo.config",
        "Xikolo::Web::Application"
      ],
      "provenance": {
        "sources": [
          "app/xikolo.yml",
          "config/application.rb",
          "config/cache_redis.yml",
          "config/database.yml",
          "config/rabbitmq.yml",
          "config/secrets.yml",
          "config/services.yml",
          "config/sidekiq_redis.yml",
          "config/xikolo.test.yml"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Asset Compilation and Management",
      "description": "The process of compiling, precompiling, and serving frontend assets (JavaScript, CSS, images). This includes internationalization exports for JavaScript and brand-specific asset checks.",
      "involvedComponents": [
        "Xikolo::Web::Application",
        "Sprockets",
        "dartsass-sprockets",
        "i18n-js",
        "Rakefile"
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "Rakefile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Background Job Processing",
      "description": "The mechanism for offloading long-running or asynchronous tasks, such as sending emails or executing scheduled maintenance, to background workers. This involves using Delayed Job for Active Job and Sidekiq for more complex job management and cron-based scheduling.",
      "involvedComponents": [
        "Xikolo::Web::Application",
        "Delayed Job",
        "Sidekiq",
        "sidekiq-cron",
        "Xikolo::Sidekiq",
        "Redis",
        "Services with background workers",
        "ApplicationJob",
        "Delayed (Delayed Job)",
        "Procfile",
        "bin/entrypoint",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "Gemfile",
          "config/application.rb",
          "config/sidekiq_redis.yml",
          "app/jobs/application_job.rb",
          "Procfile",
          "bin/entrypoint",
          "docker/.env",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    {
      "workflowName": "CI Setup and Database Management",
      "description": "A workflow for setting up the application environment specifically for Continuous Integration (CI) pipelines. This involves exporting i18n assets, dropping and recreating databases, and loading the schema.",
      "involvedComponents": [
        "Rakefile",
        "I18nJS",
        "ActiveRecord::Base"
      ],
      "provenance": {
        "sources": [
          "Rakefile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Docker Development Environment Setup",
      "description": "The process of setting up a local development environment using Docker Compose, providing essential services like PostgreSQL, Minio (S3), RabbitMQ, and Redis for local development and testing.",
      "involvedComponents": [
        "Docker Compose",
        "Postgres",
        "Minio",
        "RabbitMQ",
        "Redis"
      ],
      "provenance": {
        "sources": [
          "docker-compose.yml",
          "docker-bake.hcl"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Gamification Event Processing",
      "description": "This workflow involves services publishing events related to user activity (e.g., pinboard interactions, course completions) to RabbitMQ. The main application's GamificationController subscribes to these events and processes them to award experience points or trigger other gamification logic.",
      "involvedComponents": [
        "Msgr",
        "Xikolo.config",
        "PinboardService",
        "CourseService",
        "RabbitMQ",
        "GamificationController",
        "GamificationConsumer",
        "Gamification::Rules::Course::TakeExam",
        "Gamification::Rules::Course::TakeSelftest",
        "Gamification::Rules::Course::VisitedItem",
        "Gamification::Rules::Pinboard::UpvoteAnswer",
        "Gamification::Rules::Pinboard::UpvoteQuestion",
        "Gamification::Rules::Pinboard::CreateComment",
        "Gamification::Rules::Pinboard::CreateQuestion",
        "Gamification::Rules::Pinboard::AcceptedAnswer",
        "Gamification::Rules::Pinboard::AnsweredQuestion"
      ],
      "provenance": {
        "sources": [
          "config/msgr.rb",
          "app/xikolo.yml",
          "app/consumers/gamification_consumer.rb",
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_1",
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    {
      "workflowName": "Video Provider Management",
      "description": "Administrators can add, edit, update, and delete video providers, configuring their credentials. They can also trigger full or partial synchronizations of videos from these providers.",
      "involvedComponents": [
        "Admin::VideoProvidersController",
        "Admin::VideoProviderSyncController",
        "Video::Provider",
        "Video::SyncVideosJob"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/video_providers_controller.rb",
          "app/controllers/admin/video_provider_sync_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Content Upload and Management",
      "description": "Teachers or administrators can upload and associate various digital assets (slides, transcripts, reading material) and subtitles with a video. The system handles storage, processing, and linking of these assets.",
      "involvedComponents": [
        "Video::Store",
        "Video::Video",
        "Video::Subtitle",
        "Xikolo::S3::TextWithUploadsProcessor",
        "Xikolo::S3::SingleFileUpload",
        "Xikolo::S3::UploadByUri",
        "S3FileDeletionJob"
      ],
      "provenance": {
        "sources": [
          "app/operations/video/store.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Streaming and Playback",
      "description": "Users can stream video content, with the system dynamically generating HLS playlists tailored to bandwidth and integrating available subtitles. The client-side player provides interactive features like timestamp seeking and keyboard shortcuts.",
      "involvedComponents": [
        "Video::PlaylistsController",
        "M3u8Playlist",
        "SubtitlesController",
        "Video::Stream",
        "Video::Video",
        "Video::Subtitle",
        "app/assets/course/items/video.js",
        "VideoPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/video/playlists_controller.rb",
          "app/lib/m3u8_playlist.rb",
          "app/controllers/subtitles_controller.rb",
          "app/assets/course/items/video.js",
          "app/presenters/video_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Download",
      "description": "Authenticated users can download video streams in different qualities, provided the course settings allow it. The system generates secure download links and handles various availability and quality-related errors.",
      "involvedComponents": [
        "Stream::DownloadsController",
        "Video::Download",
        "VideoPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/stream/downloads_controller.rb",
          "app/presenters/video_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Discussion (Topics)",
      "description": "Users can create discussion topics directly linked to specific timestamps within a video, fostering contextual conversations. These topics are displayed alongside the video, allowing for easy navigation to relevant video segments.",
      "involvedComponents": [
        "app/assets/course/items/video.js",
        "VideoItemTopicPresenter",
        "VideoItemPresenter"
      ],
      "provenance": {
        "sources": [
          "app/assets/course/items/video.js",
          "app/presenters/video_item_topic_presenter.rb",
          "app/presenters/video_item_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Transpipe Integration",
      "description": "An external translation pipeline (Transpipe) can query course and video metadata, including stream URLs and subtitle content, via a dedicated API. It also allows for updating subtitle content.",
      "involvedComponents": [
        "Transpipe::URL",
        "Video::Video",
        "Video::Subtitle"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Scheduled Background Task Execution",
      "description": "This workflow manages the execution of recurring tasks at predefined intervals using cron expressions. Jobs are defined as ActiveJobs and processed by the configured background job system.",
      "involvedComponents": [
        "sidekiq-cron",
        "ActiveJob",
        "Delayed::Job",
        "Sidekiq",
        "Voucher::DeleteClaimantIPJob",
        "Video::SyncVideosJob"
      ],
      "provenance": {
        "sources": [
          "config/cron.yml"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "General Asynchronous Job Processing",
      "description": "This workflow handles the execution of various jobs asynchronously in the background, offloading work from the main application thread. It includes managing job queues, retries, and execution limits, with integrated monitoring.",
      "involvedComponents": [
        "ActiveJob",
        "Delayed::Job",
        "Sidekiq",
        "Xikolo.metrics"
      ],
      "provenance": {
        "sources": [
          "config/initializers/delayed.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Chatbot User Interaction and Course Management",
      "description": "An external chatbot system authenticates users, retrieves their profile and course information, and enables them to enroll in or unenroll from courses, as well as check their achievements and quizzes. This workflow relies on a two-step authentication process: a shared secret for initial token generation, followed by user-specific PASETO tokens for subsequent interactions.",
      "involvedComponents": [
        "ChatbotBridgeAPI",
        "TokenSigning",
        "User (Model)",
        "Course (Model)",
        "Enrollment (Model)",
        "Quiz (Model)"
      ],
      "provenance": {
        "sources": [
          "config/initializers/chatbot.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Shop Voucher Creation and Listing",
      "description": "External shop systems can programmatically create multiple vouchers for various platform products (e.g., course reactivation, proctoring) and list existing vouchers, optionally filtering by status or date. This enables third-party sales channels to integrate directly with the platform's voucher system.",
      "involvedComponents": [
        "ShopBridgeAPI",
        "Voucher (Model - implied)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "MOOChub Course Data Synchronization",
      "description": "The platform exposes course data to the MOOChub system, adhering to the MOOChub Schema. This workflow facilitates data exchange and potential synchronization of course information with the MOOChub ecosystem.",
      "involvedComponents": [
        "MoochubBridgeAPI",
        "Course (Model)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "TransPipe Video and Subtitle Management",
      "description": "The translation pipeline (TransPipe) retrieves comprehensive course and video details, including their structure and available streams. It also manages video subtitles by retrieving existing VTT files and allowing updates or creation of new subtitles for specific languages.",
      "involvedComponents": [
        "TransPipeBridgeAPI",
        "Course (Model)",
        "Video (Model)",
        "Subtitle (Model - implied)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Platform-Wide Statistics Display",
      "description": "Users with appropriate permissions can view aggregated statistics across the entire platform, including user counts, enrollment trends, and overall activity. Data is fetched concurrently from multiple microservices and cached.",
      "involvedComponents": [
        "Admin::Ajax::PlatformStatisticsController",
        "account_api",
        "course_api",
        "lanalytics_api",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/platform_statistics_controller.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course-Specific Statistics Display",
      "description": "Administrators can access detailed analytics for individual courses, covering geographical distribution of learners, item engagement, video consumption, and pinboard activity. Data is fetched from various microservices and cached.",
      "involvedComponents": [
        "Admin::Ajax::DetailStatisticsController",
        "course_api",
        "lanalytics_api",
        "pinboard_api",
        "GeoIP::Lookup",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/detail_statistics_controller.rb",
          "lib/geo_ip/lookup.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Report Generation and Management",
      "description": "Authorized users can create, monitor, restart, and delete custom data reports. The system fetches available report types and their configurable options, then dispatches report generation jobs to an external analytics service. Permissions are strictly enforced.",
      "involvedComponents": [
        "Admin::ReportsController",
        "Admin::ReportPresenter",
        "Admin::ReportJobPresenter",
        "lanalytics_api",
        "course_api",
        "Course::Classifier",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/reports_controller.rb",
          "app/presenters/admin/report_presenter.rb",
          "app/presenters/admin/report_job_presenter.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Model-Level Statistics Calculation",
      "description": "The core application calculates and provides various statistics directly on `Course` objects, such as enrollment figures, user engagement (shows), and certificate attainment, often leveraging cached data and external analytics services.",
      "involvedComponents": [
        "Course::Statistics",
        "Course::EnrollmentsStatistics",
        "Course::Visit",
        "lanalytics_api",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/models/course/statistics.rb",
          "app/models/course/enrollments_statistics.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Submits Helpdesk Ticket (Frontend)",
      "description": "A user submits a helpdesk ticket via the web interface. The submission is validated, a ticket record is created, and subsequent notifications and messaging events are triggered.",
      "involvedComponents": [
        "HelpdeskController",
        "Helpdesk::TicketForm",
        "Xi::Recaptcha::Integration",
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr",
        "Helpdesk::CategoryOptions"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "app/forms/helpdesk/ticket_form.rb",
          "app/models/helpdesk/ticket.rb",
          "app/mailers/helpdesk/ticket_mailer.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Submits Helpdesk Ticket (API)",
      "description": "An external system or client application submits a helpdesk ticket programmatically via the API. The API endpoint validates the request, creates a ticket record, and triggers notifications and messaging events.",
      "involvedComponents": [
        "Xikolo::V2::Helpdesk::Tickets",
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/v2/helpdesk/tickets.rb",
          "app/models/helpdesk/ticket.rb",
          "app/mailers/helpdesk/ticket_mailer.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Helpdesk Ticket Processing",
      "description": "After a helpdesk ticket is created (either via frontend or API), an email notification is sent to the helpdesk, and a message is published to RabbitMQ for asynchronous processing by other integrated systems.",
      "involvedComponents": [
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr",
        "Xikolo.config"
      ],
      "provenance": {
        "sources": [
          "app/models/helpdesk/ticket.rb",
          "app/mailers/helpdesk/ticket_mailer.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Creation (Admin UI)",
      "description": "Administrators create batches of vouchers through a web interface, specifying the quantity and attributes. This process leverages a service object for the actual voucher generation.",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::BatchCreateVouchers",
        "Voucher::Voucher",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "app/operations/voucher/batch_create_vouchers.rb",
          "docs/app/features/vouchers.md"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Creation (Shop API)",
      "description": "External shop systems programmatically create batches of vouchers by calling a dedicated API endpoint. This enables automated voucher generation as part of a sales or marketing process.",
      "involvedComponents": [
        "Bridges::Shop::VouchersController",
        "Voucher::BatchCreateVouchers",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "app/operations/voucher/batch_create_vouchers.rb",
          "docs/app/features/vouchers.md",
          "docs/bridges/shop/reference/shop-api.v1.yaml"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Redemption",
      "description": "Authenticated users redeem a voucher code on a course details page to activate a specific product for that course. The process involves multiple validations, claiming the voucher, and activating the product atomically.",
      "involvedComponents": [
        "Course::VoucherRedemptionsController",
        "Course::VoucherRedemptionForm",
        "Voucher::Claim",
        "Voucher::Voucher",
        "Voucher::ProductTypes",
        "Course::Course",
        "User"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/voucher_redemptions_controller.rb",
          "app/forms/course/voucher_redemption_form.rb",
          "app/operations/voucher/claim.rb",
          "docs/app/features/vouchers.md"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Management & Querying",
      "description": "Administrators can query individual vouchers and view statistics, while external shops can list created vouchers, filtered by various criteria, to verify their status and redemption details.",
      "involvedComponents": [
        "Admin::VouchersController",
        "Bridges::Shop::VouchersController",
        "Voucher::Voucher",
        "VoucherPresenter",
        "Voucher::Stats",
        "Xikolo.api(:account)",
        "Xikolo.api(:course)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "app/presenters/voucher_presenter.rb",
          "docs/app/features/vouchers.md",
          "docs/bridges/shop/reference/shop-api.v1.yaml"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Data Privacy Cleanup",
      "description": "A daily background job automatically clears claimant IP addresses from redeemed vouchers after one year to comply with data privacy regulations.",
      "involvedComponents": [
        "Voucher::DeleteClaimantIPJob",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/jobs/voucher/delete_claimant_ip_job.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Asset Compilation (Sprockets)",
      "description": "The process of compiling legacy JavaScript assets using Sprockets, primarily for jQuery and Bootstrap dependencies. This is a transitional workflow as the project moves to Webpack.",
      "involvedComponents": [
        "app/assets/javascripts/application.js",
        "app/assets/javascripts/xfn/ready.js"
      ],
      "provenance": {
        "sources": [
          "app/assets/javascripts/application.js",
          "app/assets/javascripts/xfn/ready.js",
          "Foundational Context"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Asset Compilation (Webpack)",
      "description": "The modern process of compiling JavaScript and SCSS assets using Webpack. This workflow integrates polyfills, Rails UJS, and a modular structure for UI components and utilities.",
      "involvedComponents": [
        "app/assets/main.js",
        "app/assets/main.scss",
        "Global::Accordion",
        "Global::ActionsDropdown",
        "Global::CookieConsentBanner",
        "Global::CopyToClipboard",
        "Global::DisclosureWidget",
        "Global::DownloadButton",
        "Global::FaIcon",
        "Global::FilterBar::Controls",
        "Global::FilterBar::Filter",
        "Global::FilterBar::Search",
        "Global::FlashBlock",
        "Global::FlashLayer",
        "Global::FlashMessage",
        "Global::HelpdeskButton",
        "Global::Slider"
      ],
      "provenance": {
        "sources": [
          "app/assets/main.js",
          "app/assets/main.scss",
          "Foundational Context"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Authentication and Authorization",
      "description": "The core workflow for user authentication, session management, and permission checks across the application. This includes handling login, logout, and ensuring users have the necessary privileges for actions.",
      "involvedComponents": [
        "ApplicationController",
        "SessionHelper",
        "UsersController",
        "Xikolo::Common::Auth::Middleware",
        "Xikolo::Common::Auth::CurrentUser",
        "Xikolo.api(:account)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb",
          "app/helpers/session_helper.rb",
          "app/controllers/users_controller.rb",
          "Foundational Context"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Static Page Content Management",
      "description": "The workflow for displaying and managing static content pages, including translations and file uploads. This involves fetching pages for display and providing an administrative interface for editing.",
      "involvedComponents": [
        "Home::PagesController",
        "PagesController",
        "Page",
        "Xikolo::S3::TextWithUploadsProcessor"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/pages_controller.rb",
          "app/controllers/pages_controller.rb",
          "app/models/page.rb",
          "Foundational Context"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Global UI Element Rendering",
      "description": "The process of rendering various reusable UI components that provide consistent user interface elements and interactions across the application. This includes accordions, dropdowns, tooltips, and flash messages.",
      "involvedComponents": [
        "Global::Accordion",
        "Global::ActionsDropdown",
        "Global::BasicTooltip",
        "Global::Callout",
        "Global::CopyToClipboard",
        "Global::DisclosureWidget",
        "Global::DownloadButton",
        "Global::FaIcon",
        "Global::FlashBlock",
        "Global::FlashMessage",
        "Global::HeadlineTooltip",
        "Global::ItemStatus",
        "Global::LabeledCopyButton",
        "Global::LinkItem",
        "Global::Meter",
        "Global::PageHeader",
        "Global::Pill",
        "Global::Slider",
        "Global::SvgIcon",
        "Global::Table",
        "Global::UserAvatar"
      ],
      "provenance": {
        "sources": [
          "app/components/global/accordion.rb",
          "app/components/global/actions_dropdown.rb",
          "app/components/global/basic_tooltip.rb",
          "app/components/global/callout.rb",
          "app/components/global/copy_to_clipboard.rb",
          "app/components/global/disclosure_widget.rb",
          "app/components/global/download_button.rb",
          "app/components/global/fa_icon.rb",
          "app/components/global/flash_block.rb",
          "app/components/global/flash_message.rb",
          "app/components/global/headline_tooltip.rb",
          "app/components/global/item_status.rb",
          "app/components/global/labeled_copy_button.rb",
          "app/components/global/link_item.rb",
          "app/components/global/meter.rb",
          "app/components/global/page_header.rb",
          "app/components/global/pill.rb",
          "app/components/global/slider.rb",
          "app/components/global/svg_icon.rb",
          "app/components/global/table.rb",
          "app/components/global/user_avatar.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Error Handling and Reporting",
      "description": "The workflow for catching, logging, and displaying application errors to users, including custom error pages and integration with monitoring tools.",
      "involvedComponents": [
        "ErrorsController",
        "Sentry",
        "Mnemosyne",
        "AnnotateSentryErrorsForMnemosyne",
        "ActiveSupport::ParameterFilter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/errors_controller.rb",
          "Foundational Context",
          "config/initializers/sentry.rb"
        ],
        "runSources": [
          "run_1",
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Markdown Content Processing",
      "description": "The workflow for rendering and sanitizing Markdown content, ensuring proper display and security against XSS vulnerabilities, and handling special link behaviors.",
      "involvedComponents": [
        "MarkdownHelper",
        "Redcarpet::Markdown",
        "Sanitize"
      ],
      "provenance": {
        "sources": [
          "app/helpers/markdown_helper.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Error Reporting Workflow",
      "description": "When an unhandled exception occurs in the application, Sentry captures it. Sensitive parameters are filtered, and common, expected exceptions are ignored. The `AnnotateSentryErrorsForMnemosyne` middleware ensures that the current Mnemosyne trace ID is added to the Sentry event for cross-system correlation, allowing developers to link errors to their performance context.",
      "involvedComponents": [
        "Sentry",
        "AnnotateSentryErrorsForMnemosyne",
        "Rails application"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Performance Tracing Workflow",
      "description": "Sentry and Mnemosyne work in conjunction to collect performance data for requests and background jobs. Sentry samples transactions based on configured rates and rules (e.g., ignoring health checks). Mnemosyne collects detailed distributed traces, which are then sent to a RabbitMQ instance via AMQP for further analysis.",
      "involvedComponents": [
        "Sentry",
        "Mnemosyne",
        "Rails application"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "config/mnemosyne.yml"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Custom Metrics Collection Workflow",
      "description": "Application code can emit custom metrics (e.g., counters, gauges) using the `Xikolo.metrics` interface. These metrics are sent via UDP to a local Telegraf agent, which is responsible for aggregating and forwarding them to a time-series database for visualization and alerting.",
      "involvedComponents": [
        "Telegraf::Agent (via Xikolo::Common::Metrics)",
        "Rails application"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-common/lib/xikolo/common/metrics.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Dynamic Course Item Form Management",
      "description": "This workflow describes how the form for creating and editing course items (app/views/items/_form.html.slim) dynamically adjusts its visible inputs and content based on the selected content_type (e.g., quiz, video) and other specific attributes like exercise_type. Frontend JavaScript (form.ts) handles the toggling of visibility and appending of relevant form templates.",
      "involvedComponents": [
        "FrontendFormHandler",
        "SimpleForm",
        "Form::DynamicSortableList",
        "Custom SimpleForm Inputs"
      ],
      "provenance": {
        "sources": [
          "config/initializers/simple_form.rb",
          "app/components/form/dynamic_sortable_list.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Automated Testing and Coverage",
      "description": "The process of running automated tests for Ruby code and generating code coverage reports to ensure code quality and identify untested areas.",
      "involvedComponents": [
        "RSpec",
        "SimpleCov"
      ],
      "provenance": {
        "sources": [
          ".rspec",
          "bin/rspec",
          ".simplecov"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Development Environment Initialization and Maintenance",
      "description": "The process of setting up a new development environment or updating an existing one, including dependency management, database setup, and system cleanup.",
      "involvedComponents": [
        "bin/setup",
        "scripts/check-gem-versions"
      ],
      "provenance": {
        "sources": [
          "bin/setup",
          "scripts/check-gem-versions"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Database Setup & Initialization",
      "description": "The process of setting up a new database instance, applying the latest schema definition, enabling necessary PostgreSQL extensions, defining custom functions and enums, and populating it with initial seed data for development or testing environments.",
      "involvedComponents": [
        "Database Configuration",
        "PostgreSQL Extensions",
        "UUID Generation (uuid_generate_v7ms)",
        "Database Schema Definition",
        "Fx Gem Configuration",
        "Custom Enums",
        "Database Seeding"
      ],
      "provenance": {
        "sources": [
          "config/database.yml",
          "db/schema.rb",
          "db/seeds.rb",
          "config/initializers/fx.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Schema Evolution & Migration Management",
      "description": "The ongoing process of modifying the database schema and data in a controlled, incremental manner using Rails migrations. This workflow emphasizes best practices for performance, reversibility, and a structured approach to data transformations, including specific steps for migrating data to new resources.",
      "involvedComponents": [
        "Database Migrations",
        "Database Schema Definition",
        "PostgreSQL Extensions",
        "Custom Enums",
        "UUID Generation (uuid_generate_v7ms)"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "UUID-based Resource Identification",
      "description": "The system-wide strategy for uniquely identifying resources using UUIDs. This includes the generation of time-ordered UUIDv7 as primary keys in the database and their conversion to URL-friendly base62 strings for application-level parameter handling.",
      "involvedComponents": [
        "UUID Generation (uuid_generate_v7ms)",
        "Database Schema Definition"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "config/initializers/uuid.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Retrieve Course Catalog",
      "description": "External systems can retrieve a list of all publicly visible courses or detailed information for a specific course.",
      "involvedComponents": [
        "PortalApiBeta",
        "CourseCatalogAPI",
        "Course",
        "Portal API Gateway",
        "Courses API Resource"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Manage User Profile",
      "description": "External systems can update specific attributes of a user's profile (e.g., email, name, language) or delete a user account.",
      "involvedComponents": [
        "PortalApiBeta",
        "UserManagementAPI",
        "User"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Manage User Enrollments",
      "description": "External systems can retrieve a user's enrollments (either all or for a specific course) and create new enrollments for a user in a given course.",
      "involvedComponents": [
        "PortalApiBeta",
        "EnrollmentManagementAPI",
        "Enrollment",
        "User",
        "Course"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Proctoring Configuration and Activation",
      "description": "This workflow describes the steps required to enable and configure the proctoring feature at both the platform and individual course levels. It involves setting up external shop URLs, SMOWL API credentials, proctoring thresholds, and activating the feature via a feature flipper and course administration settings.",
      "involvedComponents": [
        "::Proctoring (Module)",
        "::Proctoring::SmowlAdapter"
      ],
      "provenance": {
        "sources": [
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    {
      "workflowName": "User Booking/Claiming Proctoring",
      "description": "This workflow covers the process where a user attempts to obtain proctored status for a course, typically by redeeming a voucher. It includes checks for global and course-specific proctoring enablement, user enrollment status, and existing proctored status, culminating in an API call to update the enrollment.",
      "involvedComponents": [
        "Voucher::ProductTypes::Proctoring",
        "::Proctoring (Module)",
        "::Proctoring::CourseContext",
        "Xikolo.api(:course) (Course Microservice)"
      ],
      "provenance": {
        "sources": [
          "app/models/voucher/product_types/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    {
      "workflowName": "Proctoring Data Processing and Storage",
      "description": "This workflow describes how proctoring-related data, such as images or results, are handled and stored. It involves generating unique identifiers for storage paths and processing vendor-specific data from quiz submissions.",
      "involvedComponents": [
        "Course::Enrollment::Proctoring",
        "Quiz::Submission::Proctoring",
        "::Proctoring::SmowlAdapter",
        "Xikolo::S3",
        "UUID4"
      ],
      "provenance": {
        "sources": [
          "app/models/course/enrollment/proctoring.rb",
          "app/models/quiz/submission/proctoring.rb",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    {
      "workflowName": "Proctoring Results Display",
      "description": "This workflow outlines how proctoring results are presented to users or administrators in the application's UI. It involves interpreting raw proctoring data and rendering it in a human-readable format, including status callouts and visual charts.",
      "involvedComponents": [
        "Quiz::Submission::Proctoring",
        "QuizSubmissionProctoringPresenter",
        "_proctoring_chart.html.slim",
        "Global::Callout"
      ],
      "provenance": {
        "sources": [
          "app/models/quiz/submission/proctoring.rb",
          "app/presenters/quiz_submission_proctoring_presenter.rb",
          "app/views/shared/_proctoring_chart.html.slim",
          "cluster:18_LEARN_Proctoring"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": [
          "18_LEARN_Proctoring"
        ]
      }
    },
    {
      "workflowName": "Asynchronous Job Processing (ActiveJob/Delayed::Job)",
      "description": "Handles general background tasks initiated via ActiveJob, processed by `Delayed::Worker` across defined queues. Includes monitoring of job execution and failures.",
      "involvedComponents": [
        "Delayed::Worker",
        "Xikolo.metrics"
      ],
      "provenance": {
        "sources": [
          "config/initializers/delayed.rb",
          "Gemfile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Scheduled Job Execution (Sidekiq/sidekiq-cron)",
      "description": "Manages the execution of periodic tasks defined in `config/cron.yml` using `Sidekiq` and `sidekiq-cron`. Examples include data cleanup and synchronization tasks.",
      "involvedComponents": [
        "Sidekiq",
        "Voucher::DeleteClaimantIPJob",
        "Video::SyncVideosJob"
      ],
      "provenance": {
        "sources": [
          "Gemfile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "RabbitMQ Event Processing (Msgr)",
      "description": "Processes incoming RabbitMQ messages from various services, routing them to specific internal consumers to trigger actions, particularly for gamification events.",
      "involvedComponents": [
        "Msgr",
        "Gamification"
      ],
      "provenance": {
        "sources": [
          "config/msgr.rb",
          "Gemfile"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application-wide URL Generation",
      "description": "The process of consistently generating URLs and asset paths across the main web application. This ensures that all links and resource references are correctly formed, taking into account the application's base URL configuration.",
      "involvedComponents": [
        "Xikolo::V2::URL",
        "Rails.application.routes"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/v2/url.rb",
          "config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Safe External Redirection",
      "description": "When a user clicks an external link within the application, this workflow ensures a safe redirection by validating the target URL and optionally displaying an interstitial notice. This prevents open redirect vulnerabilities.",
      "involvedComponents": [
        "Home::GoController",
        "RedirectURL",
        "app/views/home/go/redirect.html.slim"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "lib/redirect_url.rb",
          "app/views/home/go/redirect.html.slim"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Deep Linking and App Link Verification",
      "description": "This workflow enables deep linking from mobile applications to specific content within the Xikolo platform, supporting both iOS Universal Links and Android Digital Asset Links. It involves serving `.well-known` files with specific configurations.",
      "involvedComponents": [
        "WellKnownFile",
        "WellKnownFile::AppleAppSiteAssociation",
        "WellKnownFile::GoogleAssetLinks",
        "Rails.application.routes"
      ],
      "provenance": {
        "sources": [
          "app/models/well_known_file.rb",
          "app/models/well_known_file/apple_app_site_association.rb",
          "app/models/well_known_file/google_asset_links.rb",
          "config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Feature-Specific Redirections (Go Controller)",
      "description": "Handles various specialized redirection needs, such as launching courses, navigating to specific items or pinboard discussions, and forwarding users to external survey platforms like LimeSurvey, often involving inter-service communication to retrieve necessary data.",
      "involvedComponents": [
        "Home::GoController",
        "Xikolo::Course::Application.routes",
        "Xikolo::Pinboard::Application.routes"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "services/course/config/routes.rb",
          "services/pinboard/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Microservice API Routing",
      "description": "Each microservice defines its own set of API endpoints, primarily for internal communication or specific external integrations. This workflow describes how requests are routed and handled within each service to provide JSON-based responses.",
      "involvedComponents": [
        "Xikolo::Account::Application.routes",
        "Xikolo::Course::Application.routes",
        "Xikolo::News::Application.routes",
        "Xikolo::Notification::Application.routes",
        "Xikolo::Pinboard::Application.routes",
        "Xikolo::Quiz::Application.routes",
        "Xikolo::TimeEffort::Application.routes"
      ],
      "provenance": {
        "sources": [
          "services/account/config/routes.rb",
          "services/course/config/routes.rb",
          "services/news/config/routes.rb",
          "services/notification/config/routes.rb",
          "services/pinboard/config/routes.rb",
          "services/quiz/config/routes.rb",
          "services/timeeffort/config/routes.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Document Management (CRUD)",
      "description": "Administrators create, view, edit, and delete documents. This involves interacting with the `Admin::DocumentsController` in the main web application, which then communicates with the `Document` model in the `Xikolo::Course` microservice. File uploads are handled via `DocumentHelper` and the `xikolo-s3` gem.",
      "involvedComponents": [
        "Admin::DocumentsController",
        "Document",
        "DocumentsListPresenter",
        "DocumentHelper",
        "Xikolo::S3::UploadByUri",
        "Xikolo::S3::TextWithUploadsProcessor"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/documents_controller.rb",
          "services/course/app/models/document.rb",
          "app/presenters/documents_list_presenter.rb",
          "gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb",
          "gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Document Localization Management (CRUD)",
      "description": "Administrators create, view, edit, and delete localized versions of documents. This workflow is managed by the `Admin::DocumentLocalizationsController`, which interacts with the `DocumentLocalization` model in the `Xikolo::Course` microservice. File uploads for localized documents are handled through `DocumentHelper` and the `xikolo-s3` gem.",
      "involvedComponents": [
        "Admin::DocumentLocalizationsController",
        "DocumentLocalization",
        "DocumentHelper",
        "Xikolo::S3::UploadByUri"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/document_localizations_controller.rb",
          "services/course/app/models/document_localization.rb",
          "gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Document Viewing by User",
      "description": "Users view documents associated with a specific course. The `Course::DocumentsController` in the main web application fetches relevant documents from the `Xikolo::Course` microservice API and displays them to the user, ensuring the user is logged in and within the correct course context.",
      "involvedComponents": [
        "Course::DocumentsController",
        "Document",
        "DocumentLocalization"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/documents_controller.rb",
          "services/course/app/models/document.rb",
          "services/course/app/models/document_localization.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Document File Upload and Storage",
      "description": "Files for documents and document localizations are uploaded to a temporary S3 bucket, validated, and then copied to their final S3 destination. This process is orchestrated by `DocumentHelper` in the frontend and handled by `Xikolo::S3::UploadByUri` or `Xikolo::S3::TextWithUploadsProcessor` in the backend, ensuring correct metadata (`xikolo-state`, `xikolo-purpose`) and S3 key generation.",
      "involvedComponents": [
        "DocumentHelper",
        "Xikolo::S3::UploadByUri",
        "Xikolo::S3::TextWithUploadsProcessor",
        "Xikolo::S3::SingleFileUpload",
        "DocumentLocalization"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/document_localizations_controller.rb",
          "app/controllers/admin/documents_controller.rb",
          "services/course/app/models/document_localization.rb",
          "gems/xikolo-s3/lib/xikolo/s3/upload_by_uri.rb",
          "gems/xikolo-s3/lib/xikolo/s3/text_with_uploads_processor.rb",
          "gems/xikolo-s3/lib/xikolo/s3/single_file_upload.rb"
        ],
        "runSources": [
          "run_1"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Overview Display",
      "description": "A user views the main page for a course, seeing general information, teachers, sections, and featured items.",
      "involvedComponents": [
        "Course::CoursesController",
        "CourseContextHelper",
        "Course::TeacherListPresenter",
        "FeaturedItemPresenter",
        "CourseLargePreviewPresenter",
        "Course::CourseDetailsPresenter",
        "Xikolo::Course::Course",
        "Xikolo::Course::Section",
        "Xikolo::Course::Item"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/courses_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "Course Syllabus Navigation",
      "description": "A user navigates to the course syllabus to see an overview of all content and their progress.",
      "involvedComponents": [
        "Course::SyllabusController",
        "CourseContextHelper",
        "Course::ProgressPresenter",
        "Navigation::TableOfContents",
        "Xikolo::Course::Course",
        "Xikolo::Course::Section",
        "Xikolo::Course::Item"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/syllabus_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "Item Content Display",
      "description": "A user views a specific learning item within a course, potentially encountering prerequisites or recording a visit.",
      "involvedComponents": [
        "ItemsController",
        "CourseContextHelper",
        "ItemContextHelper",
        "ItemPresenter",
        "Course::PositionPresenter",
        "Xikolo::Course::Item",
        "Xikolo::Course::Visit",
        "Xikolo::Account::Preferences",
        "Video::Video",
        "Course::Richtext",
        "Xikolo::Quiz::Quiz",
        "Lti::Exercise"
      ],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/helpers/item_context_helper.rb",
          "app/presenters/item_presenter.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "Section Management (Admin)",
      "description": "A content editor creates, updates, moves, or deletes sections within a course.",
      "involvedComponents": [
        "SectionsController",
        "CourseContextHelper",
        "CoursePresenter",
        "Xikolo::Course::Section",
        "Xikolo::Pinboard::ImplicitTag",
        "Course::Structure::Node"
      ],
      "provenance": {
        "sources": [
          "app/controllers/sections_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "Item Management (Admin)",
      "description": "A content editor creates, updates, moves, or deletes learning items within a course section.",
      "involvedComponents": [
        "ItemsController",
        "CourseContextHelper",
        "ItemContextHelper",
        "Xikolo::Course::Item",
        "Video::Video",
        "Video::Store",
        "Course::Richtext",
        "Course::Richtext::Store",
        "Xikolo::Quiz::Quiz",
        "Lti::Exercise",
        "Lti::Exercise::Store",
        "FileUpload",
        "Course::Structure::Node"
      ],
      "provenance": {
        "sources": [
          "app/controllers/items_controller.rb",
          "app/helpers/course_context_helper.rb",
          "app/helpers/item_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "Course Progress Tracking",
      "description": "A user or administrator views the progress of a learner in a course, seeing metrics and item statuses.",
      "involvedComponents": [
        "Course::ProgressController",
        "CourseContextHelper",
        "Xikolo::Account::User",
        "Course::DocumentsPresenter",
        "Xikolo.api(:course)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/progress_controller.rb",
          "app/helpers/course_context_helper.rb",
          "cluster:04_CORE_CourseNavigation"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "04_CORE_CourseNavigation"
        ]
      }
    },
    {
      "workflowName": "User Registration",
      "description": "A new user registers for the platform, providing personal details and consenting to required and optional data treatments. The system then sends a confirmation email and, upon confirmation, allows the user to log in.",
      "involvedComponents": [
        "Account::AccountsController",
        "Account::AccountForm",
        "Account::Register",
        "Account::ConfirmationsController",
        "Account::Consent",
        "Account::Treatment",
        "Xikolo.api(:account)",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/accounts_controller.rb",
          "app/forms/account/account_form.rb",
          "app/operations/account/register.rb",
          "app/controllers/account/confirmations_controller.rb",
          "app/models/account/consent.rb",
          "app/models/account/treatment.rb",
          "integration/features/xikolo/account/registration.feature"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Login (Native & SSO)",
      "description": "Users authenticate to the platform using either their registered email and password or via a Single Sign-On (SSO) provider. The system handles session management, redirects, and policy acceptance.",
      "involvedComponents": [
        "Account::SessionsController",
        "AuthenticationHandler",
        "Account::Authorization",
        "Account::Session",
        "Account::PoliciesController",
        "Account::PolicyPresenter",
        "Xikolo.api(:account)",
        "Rack::Attack"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/sessions_controller.rb",
          "app/models/account/authorization.rb",
          "app/models/account/session.rb",
          "app/controllers/account/policies_controller.rb",
          "app/presenters/account/policy_presenter.rb",
          "integration/features/xikolo/account/authentication.feature",
          "integration/features/xikolo/account/saml_sso.feature",
          "integration/features/xikolo/account/accept_policy.feature",
          "config/omniauth.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Profile Update",
      "description": "Logged-in users can view and update their personal information, email addresses, linked external accounts, custom profile fields, and avatar image.",
      "involvedComponents": [
        "Account::ProfilesController",
        "Account::ProfilePresenter",
        "Account::User",
        "Account::Email",
        "Account::Authorization",
        "Account::ChangePassword",
        "account-profile.js",
        "Xikolo.api(:account)",
        "Xikolo::S3",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/profiles_controller.rb",
          "app/presenters/account/profile_presenter.rb",
          "app/models/account/user.rb",
          "app/models/account/email.rb",
          "app/models/account/authorization.rb",
          "app/operations/account/change_password.rb",
          "app/assets/legacy/account-profile.js",
          "docs/app/features/profile/custom_fields.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Consent Management",
      "description": "Users can review and modify their consent preferences for various data treatments on their profile page. The system updates their consent status and associated memberships.",
      "involvedComponents": [
        "Account::ConsentsController",
        "consents.ts",
        "Account::Consent",
        "Account::Treatment",
        "Xikolo.api(:account)",
        "Account::User",
        "Account::Membership"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/consents_controller.rb",
          "app/assets/user/profile/consents.ts",
          "app/models/account/consent.rb",
          "app/models/account/treatment.rb",
          "docs/app/features/profile/consents.md",
          "app/models/account/user.rb"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Password Reset",
      "description": "Users who have forgotten their password can request a reset. The system sends a unique link to their email, allowing them to set a new password.",
      "involvedComponents": [
        "Account::PasswordResetsController",
        "Account::PasswordRequestForm",
        "Account::PasswordResetForm",
        "Xikolo.api(:account)",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/password_resets_controller.rb",
          "app/forms/account/password_request_form.rb",
          "app/forms/account/password_reset_form.rb",
          "integration/features/xikolo/account/reset_password.feature"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Preference Management",
      "description": "Users can configure their platform preferences, such as email notification settings and UI behaviors.",
      "involvedComponents": [
        "Account::PreferencesController",
        "Account::PreferencesPresenter",
        "preferences.ts",
        "Xikolo.api(:pinboard)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/preferences_controller.rb",
          "app/presenters/account/preferences_presenter.rb",
          "app/assets/user/settings/preferences.ts"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Page Rendering Workflow",
      "description": "Describes the process of rendering a web page in the Xikolo application, from controller action to final HTML output, integrating layouts, ViewComponents, and frontend assets.",
      "involvedComponents": [
        "ApplicationController",
        "application.html.slim",
        "simple.html.slim",
        "plain.html.slim",
        "ApplicationHelper",
        "ApplicationComponent",
        "main.js",
        "application.js",
        "main.scss",
        "_theme.scss",
        "_global.scss"
      ],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb",
          "app/views/layouts/application.html.slim",
          "app/views/layouts/simple.html.slim",
          "app/views/layouts/plain.html.slim",
          "app/helpers/application_helper.rb",
          "app/components/application_component.rb",
          "app/assets/main.js",
          "app/assets/javascripts/application.js",
          "app/assets/main.scss",
          "app/assets/stylesheets/_theme.scss",
          "app/assets/stylesheets/_global.scss"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Asset Compilation and Serving Workflow",
      "description": "Details how JavaScript and SCSS assets are processed, bundled, and served to the client, highlighting the hybrid approach using both Sprockets and Webpack.",
      "involvedComponents": [
        "application.js",
        "main.js",
        "main.scss",
        "_theme.scss",
        "_global.scss",
        "_bs-variables.scss",
        "_components.scss",
        "_partials.scss",
        "_grid-settings.scss"
      ],
      "provenance": {
        "sources": [
          "app/assets/javascripts/application.js",
          "app/assets/main.js",
          "app/assets/main.scss",
          "app/assets/stylesheets/_theme.scss",
          "app/assets/stylesheets/_global.scss",
          "app/assets/stylesheets/_bs-variables.scss",
          "app/assets/stylesheets/_components.scss",
          "app/assets/stylesheets/_partials.scss",
          "app/assets/stylesheets/_grid-settings.scss"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Interface Interaction Workflow",
      "description": "Describes how user actions on the frontend trigger JavaScript code, which then manipulates the DOM or communicates with the backend, supported by global UI components and form actions.",
      "involvedComponents": [
        "main.js",
        "application.js",
        "ApplicationController",
        "application.html.slim"
      ],
      "provenance": {
        "sources": [
          "app/assets/main.js",
          "app/assets/javascripts/application.js",
          "app/controllers/application_controller.rb",
          "app/views/layouts/application.html.slim"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "ManageCourseClassifiers",
      "description": "Platform administrators define and organize classifiers and their clusters through a web interface, which are then used to tag and filter courses for end-users. ",
      "involvedComponents": [
        "ClassifierAdministrationUI",
        "Xikolo::CourseService"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "CreateAndManageVouchers",
      "description": "Administrators or integrated external shop systems create vouchers, either via a self-service UI or an API, that users can later redeem to activate paid features for courses. ",
      "involvedComponents": [
        "VoucherAdministrationUI",
        "ShopBridgeAPI"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "GrantOrRevokeReportingRole",
      "description": "Administrators manually assign or remove the `lanalytics.report.admin` role to specific users using the Rails console within the `xi-account` service, granting or revoking access to sensitive reporting data. ",
      "involvedComponents": [
        "ReportingRoleManagementConsole",
        "User (xi-account)",
        "Role (xi-account)",
        "Grant (xi-account)",
        "Context (xi-account)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Tool Launch",
      "description": "Allows users to launch external LTI tools from an LTI exercise item within a course, potentially displaying an introductory page or embedding the tool directly.",
      "involvedComponents": [
        "LtiExerciseItemPresenter",
        "LtiController",
        "Lti::Exercise",
        "Lti::Provider",
        "Course::Item",
        "Course::LtiLaunchPresenter"
      ],
      "provenance": {
        "sources": [
          "app/presenters/lti_exercise_item_presenter.rb",
          "app/controllers/lti_controller.rb",
          "app/presenters/course/lti_launch_presenter.rb",
          "spec/controllers/lti_controller_spec.rb",
          "spec/system/lti/tool_launch_spec.rb"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Grade Submission",
      "description": "Processes grade submissions from external LTI tools, including validation, score persistence, and publishing analytics events.",
      "involvedComponents": [
        "LtiController",
        "LtiController::ToolGrading",
        "Lti::Gradebook",
        "Lti::Grade",
        "Lti::Provider",
        "Msgr",
        "IMS::LTI::OutcomeRequest",
        "IMS::LTI::ToolConsumer",
        "Lti::PublishGradeJob"
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_controller.rb",
          "app/jobs/lti/publish_grade_job.rb",
          "spec/controllers/lti_controller_spec.rb"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Grade Internal Publishing",
      "description": "Asynchronously publishes recorded LTI grades to the course service to update user progress and other internal systems.",
      "involvedComponents": [
        "Lti::PublishGradeJob",
        "Lti::Grade"
      ],
      "provenance": {
        "sources": [
          "app/jobs/lti/publish_grade_job.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Provider Management",
      "description": "Enables authorized users (administrators) to create, view, update, and delete LTI provider configurations for courses, including managing privacy settings.",
      "involvedComponents": [
        "LtiProvidersController",
        "Lti::Provider",
        "User",
        "Course::Admin::LtiProviderForm",
        "PrivacyAlert",
        "LtiProvidersIndex"
      ],
      "provenance": {
        "sources": [
          "app/controllers/lti_providers_controller.rb",
          "app/forms/course/admin/lti_provider_form.rb",
          "app/assets/admin/lti_providers/privacy-alert.js",
          "app/assets/teacher/lti-providers/index.js",
          "spec/controllers/lti_providers_controller_spec.rb",
          "integration/features/xikolo/global/admin/lti_provider.feature"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Achievement Display",
      "description": "When a user accesses their dashboard achievements page, a `Gamification` presenter/decorator aggregates their earned badges and scores. The `achievements.html.slim` view then renders this data, utilizing the `Dashboard::GamificationBadge` component for individual badge representation and a table for displaying scores, or a `State::Empty` component if no scores exist.",
      "involvedComponents": [
        "Gamification (Presenter/Decorator)",
        "Dashboard::GamificationBadge",
        "Gamification::Badge",
        "State::Empty",
        "I18n"
      ],
      "provenance": {
        "sources": [
          "app/views/dashboard/achievements.html.slim",
          "app/components/dashboard/gamification_badge.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Badge Definition and Leveling",
      "description": "Gamification badges are defined through the `Gamification Badge Configuration` (`badge_types.yml`), which specifies the rules that contribute to each badge and the score thresholds for achieving various levels. As users accumulate scores from relevant events processed by `Gamification::Rules`, they progress through the levels of applicable badges.",
      "involvedComponents": [
        "Gamification Badge Configuration",
        "Gamification::Badge",
        "Gamification::Rules::*"
      ],
      "provenance": {
        "sources": [
          "app/components/dashboard/gamification_badge.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Level Progression",
      "description": "User levels are configured in the `Gamification User Level Configuration` (`user_levels.yml`), mapping accumulated experience points (XP) to specific level titles and associated imagery. As users gain XP through various gamified actions, their overall user level is determined based on these thresholds.",
      "involvedComponents": [
        "Gamification User Level Configuration"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Question and Answer Management",
      "description": "Content editors create, edit, update, reorder, and delete quiz questions and their associated answers within a course item. This workflow ensures the integrity of quiz content.",
      "involvedComponents": [
        "QuizQuestionsController",
        "QuizAnswersController",
        "Xikolo::Quiz::Question",
        "Xikolo::Quiz::Answer",
        "Xikolo::Quiz::Quiz",
        "Xikolo::Course::Item",
        "Xikolo::QuizService"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_answers_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Submission by Learner",
      "description": "A learner initiates a quiz, potentially saves intermediate progress, and finally submits their answers. The system validates deadlines, time limits, and processes the submission, publishing an event upon completion.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizSubmissionSnapshotController",
        "QuizItemPresenter",
        "Xikolo::Quiz::Quiz",
        "Xikolo::Submission::QuizSubmission",
        "Xikolo::Submission::UserQuizAttempts",
        "Xikolo::QuizService",
        "Xikolo::CourseService",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "app/presenters/quiz_item_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Submission Review and Recap",
      "description": "After submitting a quiz, a learner can review their submission, view results, and see a recap of questions. They can also navigate through past submissions.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizRecapController",
        "QuizResultPresenter",
        "QuizSubmissionProctoringPresenter",
        "app/assets/course/items/quiz.ts",
        "app/assets/quiz-recap/quiz-recap.ts",
        "Course::QuizRecap",
        "Xikolo::Quiz::Quiz",
        "Xikolo::Submission::QuizSubmission",
        "Xikolo::QuizService",
        "Xikolo::CourseService"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_recap_controller.rb",
          "app/presenters/quiz_result_presenter.rb",
          "app/presenters/quiz_submission_proctoring_presenter.rb",
          "app/assets/course/items/quiz.ts",
          "app/assets/quiz-recap/quiz-recap.ts",
          "app/components/course/quiz_recap.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "View Pinboard Index",
      "description": "A user navigates to the pinboard index for a course, potentially filtering by sections or tags. The system fetches and displays a list of questions.",
      "involvedComponents": [
        "PinboardController",
        "PinboardPresenter",
        "Xikolo.api(:pinboard)",
        "Xikolo::Pinboard::ImplicitTag",
        "Xikolo::Pinboard::ExplicitTag",
        "Xikolo::Course::Section",
        "PinboardRoutesHelper",
        "PinboardBreadcrumbsPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "app/presenters/pinboard_presenter.rb",
          "app/helpers/pinboard_routes_helper.rb",
          "app/presenters/pinboard_breadcrumbs_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "View Question Details",
      "description": "A user clicks on a specific question to view its details, including the question text, answers, comments, and related metadata. The system also tracks question reads for analytics.",
      "involvedComponents": [
        "QuestionController",
        "QuestionPresenter",
        "PinboardUserStatePresenter",
        "PinboardPresenter",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Answer",
        "Xikolo::Pinboard::Comment",
        "Xikolo::Pinboard::Subscription",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/presenters/question_presenter.rb",
          "app/presenters/pinboard_user_state_presenter.rb",
          "app/presenters/pinboard_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Create Pinboard Content (Question, Answer, Comment)",
      "description": "A user creates a new question, answer, or comment. The system validates the input, persists the data via the Pinboard microservice, and handles notifications.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "Pinboard::TopicForm",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Comment",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb",
          "app/forms/pinboard/topic_form.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Moderate Pinboard Content (Edit, Delete, Block, Unblock, Close, Reopen)",
      "description": "Authorized users (e.g., instructors or administrators) can edit, delete, block, unblock, close, or reopen questions and comments. The system performs authorization checks and updates the content status.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Comment",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Report Abuse",
      "description": "Users can report questions or comments for abuse. The system records the report and provides feedback to the user.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "Xikolo::Pinboard::AbuseReport",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Vote on Content",
      "description": "Logged-in users can upvote questions or answers. The system records the vote and updates the vote count.",
      "involvedComponents": [
        "QuestionController",
        "Xikolo::Pinboard::Vote",
        "Xikolo::Pinboard::Question",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Accept Answer",
      "description": "The author of a question can accept one of the answers. This action marks the answer as accepted and publishes an event for analytics.",
      "involvedComponents": [
        "QuestionController",
        "Xikolo::Pinboard::Question",
        "Msgr",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Content Delivery (HLS & Downloads)",
      "description": "This workflow describes how video content, including various quality streams, subtitles, and supplementary materials, is delivered to the user for playback or download. It involves dynamic HLS playlist generation and direct file serving.",
      "involvedComponents": [
        "VideoItemPresenter",
        "VideoPresenter",
        "Video::VideoPlayer",
        "Video::PlaylistsController",
        "M3u8Playlist",
        "SubtitlesController",
        "Video::Video",
        "Video::Stream",
        "Video::Subtitle",
        "Restify",
        "Xikolo::V2::URL"
      ],
      "provenance": {
        "sources": [
          "app/presenters/video_item_presenter.rb",
          "app/presenters/video_presenter.rb",
          "app/controllers/video/playlists_controller.rb",
          "app/lib/m3u8_playlist.rb",
          "app/controllers/subtitles_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Chromecast Integration",
      "description": "This workflow enables custom styling for the Google Chromecast Styled Media Receiver (SMR) based on Xikolo's configuration, allowing for branded casting experiences.",
      "involvedComponents": [
        "ChromecastController",
        "Chromecast"
      ],
      "provenance": {
        "sources": [
          "app/controllers/chromecast_controller.rb",
          "app/lib/chromecast.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Transpipe External Service Integration",
      "description": "This workflow facilitates the generation of specific URLs for courses and videos that are intended for consumption or processing by an external 'Transpipe' service, if enabled.",
      "involvedComponents": [
        "Transpipe",
        "Transpipe::URL"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Request Processing",
      "description": "An incoming API request is received by the `Xikolo::API` gateway. It passes through `Xikolo::Versioning::Middleware` for version negotiation based on the `Accept` header, followed by authentication middlewares (`Auth::Middleware::LegacyToken`, `Auth::Middleware::Session`). The request is then routed to the appropriate endpoint within the mounted API version (e.g., `V2::Base`). Any exceptions are caught by `Xikolo::API`'s `rescue_from` block, which converts `Error::Base` exceptions into standardized HTTP Problem Details responses. Responses are formatted using `Format::PrettyJSON` or other defined formatters.",
      "involvedComponents": [
        "Xikolo::API",
        "Xikolo::Versioning::Middleware",
        "Auth::Middleware::LegacyToken",
        "Auth::Middleware::Session",
        "V2::Base",
        "Error::Base",
        "Format::PrettyJSON",
        "Grape::Parser::Json"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/VERSIONING.md",
          "docs/portalapi/docs/authentication.md",
          "docs/portalapi/docs/errors.md",
          "docs/portalapi/docs/negotiation.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Version Management",
      "description": "The `Xikolo::API` maintains a list of `Versioning::Version` objects representing supported API versions. When a client makes a request, `Xikolo::Versioning::Middleware` inspects the `Accept` header to determine the client's desired API version. The API responds with the latest compatible minor version. If a client requests a deprecated version, the `Xikolo::Versioning::Middleware` may add a `Sunset` header to the response, informing the client about the upcoming end-of-life for that API version.",
      "involvedComponents": [
        "Xikolo::API",
        "Versioning::Version",
        "Xikolo::Versioning::Middleware"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/VERSIONING.md",
          "docs/portalapi/docs/negotiation.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Documentation Generation",
      "description": "The `Xikolo::API` provides a `make_docs!` method that triggers the `Xikolo::Docs::Generator` to create API documentation. This generator processes the definitions within specific API versions, such as `V2::Base`, to produce comprehensive documentation files, typically in a directory like `./doc/api/`.",
      "involvedComponents": [
        "Xikolo::API",
        "Xikolo::Docs::Generator",
        "V2::Base",
        "Rakefile"
      ],
      "provenance": {
        "sources": [
          "api/xikolo/api.rb",
          "api/README.md",
          "Rakefile"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Account Administration",
      "description": "This workflow encompasses the core operations for managing user accounts, including creation, retrieval, modification (e.g., password changes, confirmation), deletion, and masquerading. These actions are typically performed by administrators or helpdesk agents with appropriate permissions.",
      "involvedComponents": [
        "Xikolo::Account Service",
        "Permission (Concept)",
        "Role (Concept)",
        "Group (Concept)",
        "Admin::UsersController",
        "Admin::BansController",
        "Admin::ManualConfirmationsController",
        "Admin::MasqueradesController",
        "Admin::PermissionsController",
        "Admin::Ajax::UsersController"
      ],
      "provenance": {
        "sources": [
          "services/account/lib/tasks/permissions/account.yml",
          "docs/app/features/permissions/index.md",
          "app/controllers/admin/users_controller.rb",
          "app/controllers/admin/bans_controller.rb",
          "app/controllers/admin/manual_confirmations_controller.rb",
          "app/controllers/admin/masquerades_controller.rb",
          "app/controllers/admin/permissions_controller.rb",
          "app/controllers/admin/ajax/users_controller.rb",
          "spec/controllers/admin/users_controller_spec.rb",
          "spec/requests/admin/bans/create_spec.rb",
          "spec/requests/admin/ajax/find_users_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    {
      "workflowName": "Permission Definition and Loading",
      "description": "This workflow describes how new permissions, roles, and groups are defined and integrated into the system. Definitions are made in YAML files within the `Xikolo::Account` service, and then loaded into the database using a specific Rake task, typically during deployment.",
      "involvedComponents": [
        "Xikolo::Account Service",
        "Permission (Concept)",
        "Role (Concept)",
        "Group (Concept)",
        "permissions:load Rake Task"
      ],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Permission Regranting",
      "description": "This critical operational workflow is executed when existing permissions, roles, or groups are modified or removed, especially for course-specific groups. It involves generating and executing SQL scripts to ensure that grants are correctly updated or deleted across the database, preventing stale or incorrect permissions from persisting.",
      "involvedComponents": [
        "Xikolo::Account Service",
        "Permission (Concept)",
        "Role (Concept)",
        "Group (Concept)"
      ],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/regranting_permissions.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Global Permission Group Management",
      "description": "This workflow focuses on the management of platform-wide permission groups, such as `xikolo.gdpr_admins` or `xikolo.helpdesk`. It involves defining these groups and their roles, and in specific cases (e.g., removing grants or restructuring groups), performing manual console operations to adjust existing grants.",
      "involvedComponents": [
        "Xikolo::Account Service",
        "Role (Concept)",
        "Group (Concept)"
      ],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "docs/app/features/permissions/regranting_permissions.md",
          "services/account/lib/tasks/permissions/account.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Chatbot Integration",
      "description": "This workflow enables an external chatbot to interact with the Xikolo platform on behalf of users. It encompasses authenticating the chatbot, then authenticating specific users via SAML UIDs, and subsequently allowing the chatbot to query user-specific data (courses, achievements, quizzes) and perform actions like course enrollment/unenrollment.",
      "involvedComponents": [
        "Chatbot Bridge API",
        "Xikolo::Web"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "MOOChub Course Data Exchange",
      "description": "This workflow facilitates the exchange of course information between Xikolo and the MOOChub platform. While the specifics of the data exchange (e.g., push, pull, synchronization) are not detailed in the provided context, an API endpoint is exposed for this purpose.",
      "involvedComponents": [
        "MOOChub Bridge API",
        "Xikolo::Web"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Shop Voucher Management",
      "description": "This workflow allows external e-commerce shops to programmatically create and manage digital vouchers for Xikolo products. This includes bulk creation of vouchers and querying the status of existing vouchers (e.g., whether they have been claimed).",
      "involvedComponents": [
        "Shop Bridge API",
        "Xikolo::Web"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "TransPipe Video Translation Pipeline",
      "description": "This workflow supports an external translation pipeline (TransPipe) by providing structured access to Xikolo's course and video content. This includes fetching course and video metadata, retrieving existing subtitles, and allowing the translation service to upload updated or new subtitles for videos.",
      "involvedComponents": [
        "TransPipe Bridge API",
        "Transpipe::URL",
        "Xikolo::Web"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Progress Tracking and Evaluation",
      "description": "When a user interacts with a learning item (visits it or submits a result), the system updates their progress. This involves recording the visit, storing the result, and then recalculating the user's progress for the specific section and the overall course. The final learning evaluation can be dynamic (calculated on-the-fly) or persisted (pre-calculated).",
      "involvedComponents": [
        "VisitsController",
        "Visit",
        "ResultsController",
        "Result",
        "SectionProgress::Calculate",
        "SectionProgress",
        "CourseProgress::Calculate",
        "CourseProgress",
        "LearningEvaluation (Module)",
        "Enrollment",
        "EnrollmentCompletionWorker",
        "LearningEvaluation::UpdateSectionProgressWorker",
        "LearningEvaluation::UpdateCourseProgressWorker",
        "NextDate::ItemSubmissionPublishingCreateWorker"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/visits_controller.rb",
          "services/course/app/models/visit.rb",
          "services/course/app/controllers/results_controller.rb",
          "services/course/app/models/result.rb",
          "services/course/app/operations/section_progress/calculate.rb",
          "services/course/app/models/section_progress.rb",
          "services/course/app/operations/course_progress/calculate.rb",
          "services/course/app/models/course_progress.rb",
          "services/course/app/models/learning_evaluation.rb",
          "services/course/app/models/enrollment.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course and Item Statistics Reporting",
      "description": "The system provides various API endpoints to retrieve statistics about courses, enrollments, and individual learning items. This includes overall enrollment counts, enrollment trends, and detailed item performance metrics like submissions and average points.",
      "involvedComponents": [
        "StatisticsController",
        "StatsController",
        "ItemStatisticsController",
        "ItemStatistics",
        "Stat",
        "Course",
        "Enrollment",
        "Item",
        "Result",
        "Visit",
        "FixedLearningEvaluation"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/statistics_controller.rb",
          "services/course/app/controllers/stats_controller.rb",
          "services/course/app/controllers/item_statistics_controller.rb",
          "services/course/app/models/item_statistics.rb",
          "services/course/app/models/stat.rb",
          "services/course/app/models/enrollment.rb",
          "services/course/app/models/fixed_learning_evaluation.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Learning Evaluation Recalculation",
      "description": "For specific courses, the learning evaluation can be explicitly triggered for recalculation. This is typically an administrative action or a scheduled task to ensure all progress data is up-to-date, especially after significant course structure changes or data migrations.",
      "involvedComponents": [
        "LearningEvaluation::RecalculationsController",
        "Course",
        "LearningEvaluation::PersistForCourseWorker",
        "CourseProgress::Calculate",
        "SectionProgress::Calculate"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/learning_evaluation/recalculations_controller.rb",
          "services/course/app/models/course_progress.rb",
          "services/course/app/models/section_progress.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Enrollment Data API",
      "description": "The Course service provides API endpoints for managing enrollments, including creation, updates (e.g., marking as completed), and deletion. It also exposes detailed enrollment information, including visits, points, and completion status, which can be enriched with learning evaluation data.",
      "involvedComponents": [
        "Enrollment",
        "LastVisitsController",
        "ItemGradeController",
        "ItemResultsController",
        "LearningEvaluation (Module)",
        "EnrollmentDecorator"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/enrollment.rb",
          "services/course/README.md",
          "services/course/app/controllers/last_visits_controller.rb",
          "services/course/app/controllers/item_grade_controller.rb",
          "services/course/app/controllers/item_results_controller.rb",
          "services/course/app/models/learning_evaluation.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Lifecycle Management",
      "description": "Covers the creation, updating, and deletion of courses, including associated metadata, content structure, and external integrations. This workflow ensures that course data is consistent and propagated across the system.",
      "involvedComponents": [
        "CoursesController",
        "Course",
        "Section",
        "Item",
        "Channel",
        "Classifier",
        "Course::Create",
        "Course::Update",
        "Course::Destroy",
        "UpdateCourseSearchIndexWorker",
        "NextDate::CourseStartSyncWorker",
        "NextDate::SectionStartSyncWorker",
        "NextDate::ItemSubmissionDeadlineSyncWorker",
        "NextDate::ItemSubmissionPublishingSyncWorker",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/courses_controller.rb",
          "services/course/app/models/course.rb",
          "services/course/app/models/section.rb",
          "services/course/app/models/item.rb",
          "services/course/app/workers/update_course_search_index_worker.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Enrollment and Progress Tracking",
      "description": "Manages user enrollments in courses, tracks their progress through sections and items, and calculates overall course completion and achievements (CoP/RoA). It also handles course reactivation.",
      "involvedComponents": [
        "EnrollmentsController",
        "Enrollment",
        "Course",
        "Section",
        "Item",
        "Result",
        "Visit",
        "CourseProgress",
        "SectionProgress",
        "AlternativeSectionProgress",
        "LearningEvaluation::UpdateCourseProgressWorker",
        "EnrollmentCompletionWorker",
        "ReactivationsController",
        "Enrollment::Reactivate",
        "NextDate::OnDemandExpiresSyncWorker",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/enrollments_controller.rb",
          "services/course/app/models/enrollment.rb",
          "services/course/app/models/course_progress.rb",
          "services/course/app/models/alternative_section_progress.rb",
          "services/course/app/workers/enrollment_completion_worker.rb",
          "services/course/app/controllers/reactivations_controller.rb",
          "docs/app/features/reactivation.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Prerequisites and Relations",
      "description": "Defines and evaluates prerequisites for courses using course sets and relations. This ensures users meet specific criteria (e.g., Confirmation of Participation or Record of Achievement in other courses) before accessing certain content or enrolling.",
      "involvedComponents": [
        "PrerequisiteStatusController",
        "Prerequisites",
        "Course",
        "CourseSet",
        "CourseSetRelation",
        "Relation",
        "Enrollment",
        "EnrollmentGroupWorker"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/prerequisite_status_controller.rb",
          "services/course/app/models/prerequisites.rb",
          "services/course/app/models/course_set.rb",
          "services/course/app/models/course_set_relation.rb",
          "docs/app/features/courses/relations.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Content Tree Migration",
      "description": "A one-time or on-demand process to migrate courses from a legacy structure (where hierarchy is implicit) to a new explicit content tree managed by `Structure` nodes. This enables advanced content management features.",
      "involvedComponents": [
        "Course",
        "Section",
        "Item",
        "Structure::CreateCourseContentTreeWorker",
        "Structure::Root",
        "Structure::Section",
        "Structure::Item"
      ],
      "provenance": {
        "sources": [
          "services/course/app/workers/structure/create_course_content_tree_worker.rb",
          "services/course/app/models/course.rb",
          "services/course/app/models/section.rb",
          "services/course/app/models/item.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Content A/B Testing",
      "description": "Allows course administrators to set up A/B tests for course content by defining content tests with multiple groups. Users are assigned to groups in a round-robin fashion, and content forks are created for each group.",
      "involvedComponents": [
        "ContentTest",
        "Fork",
        "Branch",
        "Duplicated::Group",
        "Duplicated::Membership",
        "Section",
        "Structure::Fork",
        "Structure::Branch"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/content_test.rb",
          "services/course/app/models/fork.rb",
          "services/course/app/models/branch.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Document Lifecycle Management",
      "description": "Covers the creation, retrieval, update, and soft deletion of documents and their localized versions, including file storage and event publishing.",
      "involvedComponents": [
        "Document",
        "DocumentLocalization",
        "DocumentsController",
        "DocumentLocalizationsController",
        "Msgr",
        "Xikolo::S3",
        "FileReference",
        "FileDeletionWorker",
        "PaperTrail"
      ],
      "provenance": {
        "sources": [
          "services/course/app/models/document.rb",
          "services/course/app/models/document_localization.rb",
          "services/course/app/controllers/documents_controller.rb",
          "services/course/app/controllers/document_localizations_controller.rb",
          "services/course/app/workers/file_deletion_worker.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Document Search and Filtering",
      "description": "Allows users to search and filter documents based on various criteria such as associated course, item, language, and tags.",
      "involvedComponents": [
        "Document",
        "DocumentLocalization",
        "DocumentsController",
        "DocumentsTagsController"
      ],
      "provenance": {
        "sources": [
          "services/course/app/controllers/documents_controller.rb",
          "services/course/app/controllers/documents_tags_controller.rb",
          "services/course/app/models/document.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Visual Asset Cloning",
      "description": "Enables the duplication of course-specific visual assets (images, videos, and their subtitles) from one course to another, including S3 file operations and database record management.",
      "involvedComponents": [
        "Duplicated::Visual",
        "Course::Visual::Clone",
        "Xikolo::S3",
        "Course",
        "Duplicated::Video",
        "Subtitle"
      ],
      "provenance": {
        "sources": [
          "services/course/app/operations/course/visual/clone.rb",
          "services/course/app/models/duplicated/visual.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Pinboard Content Management",
      "description": "Users interact with the Pinboard Service to create, view, update, and delete discussion posts or 'pins'. This workflow involves fetching user and course context from respective services and potentially triggering notifications.",
      "involvedComponents": [
        "PinboardService",
        "AccountService",
        "CourseService",
        "NotificationService",
        "Xikolo::Web (client)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Notification Event Processing",
      "description": "A service publishes an event message to Msgr. The NotificationService, via its consumers, receives and processes this message, leading to the creation of a notification record and triggering email generation.",
      "involvedComponents": [
        "Msgr",
        "Notification Consumers",
        "Xikolo::NotificationService"
      ],
      "provenance": {
        "sources": [
          "services/notification/README.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Email Notification Generation",
      "description": "Following the processing of a notification event, the NotificationService renders a mail template, applies styling using Inky and Foundation, and then inlines CSS with Premailer before sending the final HTML email.",
      "involvedComponents": [
        "Xikolo::NotificationService",
        "Notification Mail Templates",
        "Inky",
        "Foundation for Emails",
        "Premailer"
      ],
      "provenance": {
        "sources": [
          "services/notification/README.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Email Branding Customization",
      "description": "Allows for brand-specific customization of email layouts and stylesheets by placing custom files in designated brand folders within the NotificationService, overriding default templates.",
      "involvedComponents": [
        "Xikolo::NotificationService",
        "Notification Mail Templates"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "News Item Management",
      "description": "Users (e.g., administrators, course instructors) create, edit, and delete news items, which can be designated as global announcements or specific to a particular course. This workflow involves API interactions with the `Xikolo::NewsService` to persist and manage these items.",
      "involvedComponents": [
        "Xikolo::NewsService",
        "News (Data Entity)"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "News Distribution and Notification",
      "description": "Upon creation or update of a news item, the `Xikolo::NewsService` handles its distribution. This can involve making the news accessible via its API for display in the main web application and potentially sending out email notifications to relevant users. Email notifications can be customized per brand.",
      "involvedComponents": [
        "Xikolo::NewsService",
        "News (Data Entity)",
        "Email Notification Component"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Calculate Course Item Time Effort",
      "description": "This workflow involves the TimeEffortService fetching necessary data from CourseService and QuizService to compute and potentially store or expose the estimated time effort for individual course items.",
      "involvedComponents": [
        "TimeEffortService",
        "CourseService",
        "QuizService"
      ],
      "provenance": {
        "sources": [
          "services/timeeffort/config/services.yml",
          "services/timeeffort/README.rdoc"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Data Management",
      "description": "The process of creating, retrieving, updating, and deleting quiz definitions, including questions and their respective answers, within the system.",
      "involvedComponents": [
        "Quiz Service"
      ],
      "provenance": {
        "sources": [
          "services/quiz/README.md"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Submission Management",
      "description": "The workflow encompassing the recording, storage, and initial scoring of user responses to quizzes. This includes handling the lifecycle of a user's attempt at a quiz.",
      "involvedComponents": [
        "Quiz Service"
      ],
      "provenance": {
        "sources": [
          "services/quiz/README.md",
          "services/quiz/config/services.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Regrading Workflow",
      "description": "A critical operational workflow for adjusting quiz scores and submission data. This process is initiated when quiz content (questions, answers, points) changes after users have already submitted their answers. It involves executing specific `rake` tasks to modify submission records and recalculate points, followed by an update to the overall course results.",
      "involvedComponents": [
        "Quiz Service",
        "Regrading Rake Tasks"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Centralized Configuration Management",
      "description": "Ensures that all Xikolo applications and services access consistent, environment-aware configuration values. The `xikolo-config` gem manages the loading and merging of configuration from various YAML files, allowing for platform-specific overrides.",
      "involvedComponents": [
        "Xikolo::Config",
        "All Xikolo services and the main application"
      ],
      "provenance": {
        "sources": [
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    {
      "workflowName": "S3 File Management",
      "description": "Standardizes the handling of file uploads, storage, and retrieval across the Xikolo ecosystem. Services use the `xikolo-s3` gem to interact with AWS S3, managing their dedicated file spaces, validating uploads, and processing file references within content.",
      "involvedComponents": [
        "Xikolo::S3",
        "AWS S3",
        "Services requiring file storage (e.g., CourseService, PinboardService)"
      ],
      "provenance": {
        "sources": [
          "cluster:43_INFRA_ServiceCommunication"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "43_INFRA_ServiceCommunication"
        ]
      }
    },
    {
      "workflowName": "Database Setup and Evolution",
      "description": "The process of initializing the PostgreSQL database schema and applying subsequent changes over time. This workflow involves configuring database connections, executing Active Record migrations, and leveraging custom PostgreSQL features for efficient and robust data management.",
      "involvedComponents": [
        "Database Configuration",
        "Database Schema",
        "Migration System (Active Record Migrations)",
        "Custom UUID Generator (uuid_generate_v7ms)"
      ],
      "provenance": {
        "sources": [
          "config/database.yml",
          "db/schema.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Data Seeding",
      "description": "The process of populating the database with initial data, typically for development, testing, or initial production setup. This workflow allows for structured and environment-specific data loading, ensuring a consistent state across different environments.",
      "involvedComponents": [
        "Seed Data Loader",
        "Database Schema"
      ],
      "provenance": {
        "sources": [
          "db/seeds.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Development Server",
      "description": "Running a local development server with hot module reloading for efficient frontend development, powered by Webpack Dev Server.",
      "involvedComponents": [
        "Webpack",
        "Webpack Dev Server"
      ],
      "provenance": {
        "sources": [
          "package.json"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Code Quality Enforcement (Pre-commit)",
      "description": "Automated checks for code style, formatting, and linting errors before code is committed to the repository, ensuring consistent code quality.",
      "involvedComponents": [
        "Husky & lint-staged",
        "ESLint",
        "Stylelint",
        "Prettier",
        "TypeScript"
      ],
      "provenance": {
        "sources": [
          "package.json",
          "eslint.config.mjs",
          "tsconfig.json"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Code Formatting",
      "description": "Automated formatting of various code files (JS, TS, CSS, SCSS, Markdown, Ruby, Slim) using Prettier and other language-specific formatters.",
      "involvedComponents": [
        "Prettier",
        "ESLint",
        "Stylelint",
        "Husky & lint-staged"
      ],
      "provenance": {
        "sources": [
          "package.json"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "TypeScript Type Checking",
      "description": "Static analysis of TypeScript code to catch type-related errors before runtime, improving reliability and maintainability.",
      "involvedComponents": [
        "TypeScript"
      ],
      "provenance": {
        "sources": [
          "package.json",
          "tsconfig.json"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LocalDevelopmentStartup",
      "description": "Starts all necessary Xikolo web application and microservices locally using `overmind` based on the `Procfile` definitions. This workflow enables developers to run and test the entire distributed system on their local machines.",
      "involvedComponents": [
        "Procfile",
        "EnvFile",
        "PumaConfiguration",
        "UnicornConfiguration",
        "PostgreSQL",
        "RabbitMQ",
        "RedisCache",
        "RedisSidekiq"
      ],
      "provenance": {
        "sources": [
          "Procfile",
          "Procfile.web",
          ".env",
          "config/puma.rb",
          "config/unicorn.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "DockerImageBuild",
      "description": "The process of building Docker images for the Xikolo platform, including base images (ruby-base, ruby-base-node, ruby-base-chrome) and individual service images. This workflow uses `docker buildx bake` and respects the `.dockerignore` rules.",
      "involvedComponents": [
        "DockerBakeHCL",
        "Dockerignore"
      ],
      "provenance": {
        "sources": [
          "docker-bake.hcl",
          ".dockerignore"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "DockerizedDeployment",
      "description": "Orchestrates and deploys the entire Xikolo platform, including all microservices, the main web application, and supporting infrastructure, using Docker Compose. This workflow ensures all services are built, configured, linked, and started in the correct order.",
      "involvedComponents": [
        "DockerComposeMain",
        "DockerComposeBackground",
        "DockerComposeInit",
        "DockerComposeWeb",
        "DockerComposeService",
        "DockerComposeNginx",
        "EnvFile",
        "PostgreSQL",
        "RabbitMQ",
        "RedisCache",
        "RedisSidekiq",
        "Minio",
        "Mailpit",
        "Nginx"
      ],
      "provenance": {
        "sources": [
          ".env.docker"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "ApplicationServerConfiguration",
      "description": "Configures the web application servers (Puma or Unicorn) for optimal performance and resource management in different environments. This includes setting thread/worker counts, port binding, and managing database/message queue connections during process lifecycle events.",
      "involvedComponents": [
        "PumaConfiguration",
        "UnicornConfiguration",
        "EnvFile",
        "PostgreSQL",
        "RabbitMQ"
      ],
      "provenance": {
        "sources": [
          "config/puma.rb",
          "config/puma.production.rb",
          "config/unicorn.rb",
          ".env"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "DatabaseInitialization",
      "description": "Sets up and migrates the PostgreSQL database for the Xikolo platform. This workflow is critical for preparing the database schema and ensuring all services have a consistent and up-to-date data store.",
      "involvedComponents": [
        "DockerComposeInit",
        "PostgreSQL"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "PermissionsInitialization",
      "description": "Loads initial user permissions into the database, typically after database migration. This ensures that the `Xikolo::Account` service and other dependent services have the necessary authorization data available.",
      "involvedComponents": [
        "DockerComposeInit",
        "PostgreSQL"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Performance Monitoring",
      "description": "Mnemosyne actively extracts full application traces, including cross-application requests, providing detailed performance and execution flow information. Sentry also collects transaction data for performance monitoring, with configurable sampling rates and exclusion of health checks.",
      "involvedComponents": [
        "Sentry",
        "Mnemosyne",
        "RabbitMQ"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "config/mnemosyne.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Error Debugging and Correlation",
      "description": "Developers can use a Sentry event ID or a Mnemosyne trace ID (found in error pages or Sentry reports) to look up detailed application traces in Mnemosyne. This allows for in-depth analysis of the request flow, including query parameters, across microservices.",
      "involvedComponents": [
        "ErrorsController",
        "Sentry",
        "Mnemosyne"
      ],
      "provenance": {
        "sources": [
          "app/controllers/errors_controller.rb",
          "config/initializers/sentry.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Bootstrapping",
      "description": "The process of starting the Rails application, including loading gems, configuring the Rails environment, and initializing the application instance.",
      "involvedComponents": [
        "Bootsnap",
        "Xikolo::Web::Application",
        "Xikolo.config (app/xikolo.yml)",
        "Secrets (config/secrets.yml)",
        "Service Endpoints (config/services.yml)",
        "Redis Configuration (Cache & Sidekiq)"
      ],
      "provenance": {
        "sources": [
          "config/boot.rb",
          "config/environment.rb",
          "config/application.rb",
          "config.ru",
          "app/xikolo.yml",
          "config/secrets.yml",
          "config/services.yml",
          "config/cache_redis.yml",
          "config/sidekiq_redis.yml"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "CI Environment Setup",
      "description": "A Rake task-driven workflow to prepare a Continuous Integration environment, involving database setup and asset internationalization export.",
      "involvedComponents": [
        "Rake Tasks",
        "Xikolo::Web::Application"
      ],
      "provenance": {
        "sources": [
          "Rakefile"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Asset Precompilation with Branding Check",
      "description": "The process of precompiling frontend assets, which includes a check to ensure that if a specific brand is set, its corresponding asset directory exists.",
      "involvedComponents": [
        "Rake Tasks",
        "Xikolo.config (app/xikolo.yml)"
      ],
      "provenance": {
        "sources": [
          "Rakefile",
          "config/application.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Internationalization Management",
      "description": "A workflow for managing and validating translation keys across different locales, including exporting translations for JavaScript consumption and identifying missing keys.",
      "involvedComponents": [
        "Rake Tasks",
        "Xikolo::Web::Application",
        "Xikolo.config (app/xikolo.yml)",
        "I18n",
        "Rakefile"
      ],
      "provenance": {
        "sources": [
          "Rakefile",
          "config/application.rb"
        ],
        "runSources": [
          "run_2",
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Displaying Localized UI Text",
      "description": "Users interact with the application in their preferred language, with all static UI elements, messages, and dynamic content rendered according to the active locale.",
      "involvedComponents": [
        "I18n (Rails Gem)",
        "ActionView::Helpers::TranslationHelper (Extended)",
        "i18n-js",
        "Translations"
      ],
      "provenance": {
        "sources": [
          "config/initializers/i18n.rb",
          "config/initializers/i18n_translate.rb",
          "app/lib/translations.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Handling Missing Translations",
      "description": "When a translation key is not found for the active locale, the system gracefully falls back to English or displays a placeholder, ensuring a consistent user experience and aiding debugging.",
      "involvedComponents": [
        "I18n (Rails Gem)",
        "ActionView::Helpers::TranslationHelper (Extended)"
      ],
      "provenance": {
        "sources": [
          "config/initializers/i18n_translate.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Localization",
      "description": "Backend-defined translations are made available to the JavaScript frontend, allowing dynamic UI components and client-side logic to be localized without duplicating translation efforts.",
      "involvedComponents": [
        "I18n (Rails Gem)",
        "i18n-js"
      ],
      "provenance": {
        "sources": [
          "config/initializers/i18n.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Brand-Specific Localization",
      "description": "The application supports loading locale files specific to a particular brand, enabling customization of language resources for different platform instances or white-labeling scenarios.",
      "involvedComponents": [
        "I18n (Rails Gem)",
        "Xikolo.config"
      ],
      "provenance": {
        "sources": [
          "config/initializers/i18n.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Dynamic Content Localization",
      "description": "Content stored in the database with multiple language variants can be dynamically selected and displayed based on the user's locale preferences, ensuring that user-generated or administrative content is also localized.",
      "involvedComponents": [
        "Translations",
        "I18n (Rails Gem)"
      ],
      "provenance": {
        "sources": [
          "app/lib/translations.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Static Page Editing and Publishing",
      "description": "This workflow describes the process of an authorized user creating or updating a static content page, including handling embedded file uploads and managing translations.",
      "involvedComponents": [
        "PagesController",
        "Page",
        "Xikolo::S3::TextWithUploadsProcessor",
        "Xikolo::S3::Markup",
        "S3FileDeletionJob",
        "PagePresenter",
        "MarkdownHelper"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pages_controller.rb",
          "app/models/page.rb",
          "app/presenters/page_presenter.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Standard RSpec Test Execution",
      "description": "The process of running unit, integration, request, feature, and view tests using the RSpec framework to verify individual components and their interactions.",
      "involvedComponents": [
        "RSpec",
        "SimpleCov",
        "Stubbing Utilities (xikolo-common/rspec/stub.rb)",
        "Capybara"
      ],
      "provenance": {
        "sources": [
          "bin/rspec",
          ".rspec",
          ".simplecov"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "End-to-End Test Execution",
      "description": "Running comprehensive, full-stack tests that simulate real user behavior across all microservices and the UI by driving a browser. This workflow ensures critical functionality works from a user's perspective.",
      "involvedComponents": [
        "Gurke",
        "Capybara",
        "Minio",
        "Application Services"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Code Quality Check",
      "description": "Performing static analysis on Ruby code to ensure adherence to predefined style guides, best practices, and to identify potential issues before runtime.",
      "involvedComponents": [
        "RuboCop",
        "scripts/rubocop-changed"
      ],
      "provenance": {
        "sources": [
          "bin/rubocop",
          "scripts/rubocop-changed"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Helpdesk Ticket Submission (General/Anonymous)",
      "description": "A user (logged-in or anonymous) accesses the helpdesk, describes an issue, provides an email (if anonymous), and submits the ticket. The system verifies reCAPTCHA, creates a ticket record, sends an email to support, and publishes a message to the message queue.",
      "involvedComponents": [
        "HelpdeskController",
        "Helpdesk::TicketForm",
        "Xi::Recaptcha::Integration",
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "app/forms/helpdesk/ticket_form.rb",
          "app/models/helpdesk/ticket.rb",
          "app/mailers/helpdesk/ticket_mailer.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Helpdesk Ticket Submission (Course-Specific)",
      "description": "A user accesses the helpdesk, potentially with a course pre-selected, selects a course category, describes an issue, and submits the ticket. The system verifies reCAPTCHA, creates a course-associated ticket, sends a course-prefixed email to support, and publishes a message to the message queue.",
      "involvedComponents": [
        "HelpdeskController",
        "Helpdesk::TicketForm",
        "Xi::Recaptcha::Integration",
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr",
        "Helpdesk::CategoryOptions"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "app/forms/helpdesk/ticket_form.rb",
          "app/models/helpdesk/ticket.rb",
          "app/mailers/helpdesk/ticket_mailer.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "reCAPTCHA Verification",
      "description": "Before a helpdesk ticket is processed, the system performs a reCAPTCHA verification. If the initial verification fails, the user may be prompted for manual verification. Ticket creation proceeds only upon successful verification.",
      "involvedComponents": [
        "HelpdeskController",
        "Xi::Recaptcha::Integration"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Creation (Admin)",
      "description": "Administrators create new voucher codes, often in batches, for specific products or courses, which can then be distributed externally.",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::BatchCreateVouchers",
        "Voucher::Voucher",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Redemption (User)",
      "description": "A logged-in user enters a voucher code to activate a paid feature (e.g., Proctoring, Reactivation) for a specific course, subject to product prerequisites.",
      "involvedComponents": [
        "Course::VoucherRedemptionsController",
        "Course::VoucherRedemptionForm",
        "Voucher::Claim",
        "Voucher::ProductTypes",
        "Voucher::Voucher",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/voucher_redemptions_controller.rb",
          "app/forms/course/voucher_redemption_form.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Data Privacy (Background Job)",
      "description": "A daily background job automatically anonymizes claimant IP addresses for vouchers claimed more than one year ago to comply with data privacy regulations.",
      "involvedComponents": [
        "Voucher::DeleteClaimantIPJob",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/jobs/voucher/delete_claimant_ip_job.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Query (Admin)",
      "description": "Administrators can search for and view the detailed information of a specific voucher using its code.",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::Voucher",
        "VoucherPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Voucher Statistics (Admin)",
      "description": "Administrators can view aggregated statistics about voucher usage and status.",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::Stats"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "View Next Available Poll",
      "description": "When a user navigates to the dashboard, an AJAX request is initiated to fetch and display the next available poll for them to interact with. If no poll is available, no content is displayed.",
      "involvedComponents": [
        "app/views/dashboard/_polls.html.slim",
        "PollsController#next",
        "Poll::Poll",
        "Dashboard::Poll::Widget",
        "Dashboard::Poll::Question"
      ],
      "provenance": {
        "sources": [
          "app/views/dashboard/_polls.html.slim",
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    {
      "workflowName": "Vote on a Poll",
      "description": "A user selects one or more options for a poll and submits their vote. The system records the response, and then displays a confirmation message, potentially revealing poll results and indicating if another poll is available.",
      "involvedComponents": [
        "PollsController#vote",
        "Poll::Poll",
        "Poll::Response",
        "Dashboard::Poll::Widget",
        "Dashboard::Poll::Thanks"
      ],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    {
      "workflowName": "View Poll Archive and Results",
      "description": "Users can access an archive of past polls. For each poll, the system determines whether to display results based on the poll's status and the user's participation, or provides informational messages if results are not yet available.",
      "involvedComponents": [
        "PollsController#archive",
        "Poll::Poll",
        "PollArchivePresenter",
        "Dashboard::Poll::Question",
        "Global::Callout"
      ],
      "provenance": {
        "sources": [
          "app/controllers/polls_controller.rb",
          "app/presenters/poll_archive_presenter.rb",
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    {
      "workflowName": "Take a Survey (Conceptual)",
      "description": "As described in the RAG context, this workflow involves a student interacting with a survey item within a course, selecting answers, and submitting the survey. This is conceptually similar to voting on a poll, but likely uses distinct models and potentially different UI components, integrated as a course 'item'.",
      "involvedComponents": [
        "Survey (inferred model)",
        "Question (inferred model)",
        "Answer (inferred model)",
        "Item (foundational context)",
        "SurveyController (inferred controller)"
      ],
      "provenance": {
        "sources": [
          "cluster:16_LEARN_PollsSurveys"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": [
          "16_LEARN_PollsSurveys"
        ]
      }
    },
    {
      "workflowName": "Displaying Course List Banner",
      "description": "The system displays a promotional banner on the course list. The `Global::CourseListBanner` component attempts to retrieve the banner from `Rails.cache`. If not found, it queries the `Banner` model for the currently active banner, which is then cached for 30 minutes. The component renders the banner using its image URL, link, and alt text.",
      "involvedComponents": [
        "Global::CourseListBanner",
        "Banner",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/components/global/course_list_banner.rb",
          "app/models/banner.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Displaying System Alerts",
      "description": "The system displays active system alerts to users. The `Navigation::SystemAlerts` component fetches published alerts from the `Alert` model, caching them per language for 5 minutes. It then checks the user's `seen_alerts` cookie to determine which alerts are new and renders them, potentially with a popover for unread messages. User interaction (e.g., opening the alert list) updates the `seen_alerts` cookie.",
      "involvedComponents": [
        "Navigation::SystemAlerts",
        "Alert",
        "Alert::Translation",
        "Rails.cache",
        "Cookies (seen_alerts)"
      ],
      "provenance": {
        "sources": [
          "app/components/navigation/system_alerts.rb",
          "app/models/alert.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Creating/Managing Banners",
      "description": "Administrators create and manage banners using a `rake banner:create` task. This task prompts for banner details, uploads the image to S3 via `Banner.upload!`, and creates a `Banner` record. Deleting a `Banner` record triggers an asynchronous job (`S3FileDeletionJob`) to remove the corresponding S3 object after a delay, accounting for caching. The `Rails.cache` can be manually cleared to force immediate banner updates.",
      "involvedComponents": [
        "Banner",
        "Xikolo::S3",
        "S3FileDeletionJob",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/models/banner.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Creating/Managing System Alerts",
      "description": "System alerts are created by administrators via the Rails console. An `Alert` record is created with publication and expiry dates, and localized translations (title and text) which support Markdown formatting. The `Alert` model ensures a default translation exists.",
      "involvedComponents": [
        "Alert",
        "Alert::Translation"
      ],
      "provenance": {
        "sources": [
          "app/models/alert.rb"
        ],
        "runSources": [
          "run_2"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Cross-Service Gem Version Management",
      "description": "This workflow ensures that gem dependencies are consistently versioned across the main application and all microservices. The `check-gem-versions` script automates the process of identifying discrepancies, which is crucial for maintaining a stable and predictable microservice environment.",
      "involvedComponents": [
        "check-gem-versions",
        "Xikolo::Common",
        "Xikolo::Config",
        "Xikolo::S3",
        "Xikolo::Sidekiq",
        "Xikolo::UI::Form"
      ],
      "provenance": {
        "sources": [
          "scripts/check-gem-versions",
          "Gemfile"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Configuration Management",
      "description": "This workflow describes how application-wide and environment-specific configurations are managed and applied across services. The `xikolo-config` gem centralizes configuration, allowing values to be defined in YAML files and overridden based on the environment and deployment context, ensuring consistent settings like base URLs and branding.",
      "involvedComponents": [
        "Xikolo::Config"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-config/README.md",
          "gems/xikolo-config/lib/xikolo/config.yml",
          "gems/xikolo-config/lib/xikolo/config.development.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "S3 File Upload and Management",
      "description": "This workflow outlines the process for handling file uploads and managing S3 resources across services. The `xikolo-s3` gem provides the necessary abstractions for interacting with AWS S3, validating uploads, and managing file references within content. It emphasizes a decentralized approach where each service is responsible for its own file space.",
      "involvedComponents": [
        "Xikolo::S3"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-s3/README.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Background Job Scheduling and Execution",
      "description": "This workflow details how background jobs are configured and executed across the application. The `xikolo-sidekiq` gem sets up Sidekiq, integrates with ActiveJob, and manages Redis connections. It also enables the scheduling of periodic tasks using `sidekiq-cron` based on environment-specific configurations.",
      "involvedComponents": [
        "Xikolo::Sidekiq"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-sidekiq/README.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Cross-Service Metric Collection",
      "description": "This workflow describes the process of collecting custom application and engineering metrics from various Ruby-based services. The `xikolo-common` gem provides a standardized interface (`Xikolo.metrics`) to send data to Telegraf, enabling centralized monitoring and analysis in Grafana for performance and operational insights.",
      "involvedComponents": [
        "Xikolo::Common"
      ],
      "provenance": {
        "sources": [
          "gems/xikolo-common/README.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Asset Build Workflow",
      "description": "The process of compiling and bundling frontend assets for deployment or development. It involves Webpack for modern assets and the Rails Asset Pipeline for legacy assets.",
      "involvedComponents": [
        "Webpack",
        "Rails Asset Pipeline",
        "Node.js",
        "Yarn",
        "Babel",
        "Sass (dartsass-sprockets)"
      ],
      "provenance": {
        "sources": [
          "package.json",
          "config/assets/webpack.config.mjs",
          "app/assets/config/manifest.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Pre-commit Code Quality Workflow",
      "description": "Automated checks performed before a commit is finalized to ensure code quality, style consistency, and type correctness. This workflow is managed by Git hooks.",
      "involvedComponents": [
        "Husky",
        "lint-staged",
        "ESLint",
        "Stylelint",
        "Prettier",
        "TypeScript Compiler (tsc)",
        "Markdownlint"
      ],
      "provenance": {
        "sources": [
          "package.json",
          ".husky/pre-commit",
          "eslint.config.mjs",
          ".stylelintrc.js",
          ".prettierignore",
          "tsconfig.json"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Adding New Frontend Module Workflow",
      "description": "The process for developers to add new JavaScript or TypeScript code to a specific Webpack bundle.",
      "involvedComponents": [
        "Webpack",
        "Yarn",
        "ESLint",
        "TypeScript Compiler (tsc)",
        "Sass (dartsass-sprockets)"
      ],
      "provenance": {
        "sources": [
          "app/assets/main.js",
          "app/assets/admin/admin.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Adding New Node Module Workflow",
      "description": "The standard procedure for integrating new third-party JavaScript libraries or tools into the project's frontend dependencies.",
      "involvedComponents": [
        "Yarn",
        "Node.js"
      ],
      "provenance": {
        "sources": [
          "package.json"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Node.js Version Update Workflow",
      "description": "The process for updating the Node.js version used across the project, including local development environments and CI/CD pipelines.",
      "involvedComponents": [
        "Node.js",
        "Yarn"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Startup",
      "description": "The process of initializing the Rails application, loading configurations, setting up the runtime environment, and preparing the server to handle requests. This includes loading gems, configuring Rails defaults, and applying environment-specific settings.",
      "involvedComponents": [
        "Xikolo::Web::Application",
        "config/application.rb",
        "config/boot.rb",
        "config/environment.rb",
        "config/initializers/enable_yjit.rb",
        "config/puma.rb",
        "Bootsnap",
        "RubyVM::YJIT"
      ],
      "provenance": {
        "sources": [
          "config/application.rb",
          "config/boot.rb",
          "config/environment.rb",
          "config/initializers/enable_yjit.rb",
          "config/puma.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Asset Compilation",
      "description": "The process of compiling and bundling frontend assets (JavaScript, CSS) using Webpack and Sprockets, and exporting internationalization data. This workflow supports multiple brands and is crucial for preparing the application's UI.",
      "involvedComponents": [
        "Makefile",
        "Rakefile",
        "I18n",
        "docker/files/web.Dockerfile"
      ],
      "provenance": {
        "sources": [
          "Makefile",
          "Rakefile",
          "docker/files/web.Dockerfile"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Docker Image Building",
      "description": "The multi-stage process of building Docker images for the web application and other services. This includes installing dependencies, compiling assets, and setting up the runtime environment for efficient deployment.",
      "involvedComponents": [
        "docker-bake.hcl",
        "docker/Makefile",
        "docker/files/base.Dockerfile",
        "docker/files/web.Dockerfile",
        "bin/entrypoint",
        "Makefile"
      ],
      "provenance": {
        "sources": [
          "docker-bake.hcl",
          "docker/Makefile",
          "docker/files/base.Dockerfile",
          "docker/files/web.Dockerfile",
          "bin/entrypoint",
          "Makefile"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Authentication & Authorization",
      "description": "The comprehensive workflow covering user login, session management, permission checks, and feature flag evaluation to control access to application resources and functionalities.",
      "involvedComponents": [
        "ApplicationController",
        "Xikolo::Common::Auth::Middleware",
        "Xikolo::Common::Auth::CurrentUser"
      ],
      "provenance": {
        "sources": [
          "app/controllers/application_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Mobile Application Data Exchange",
      "description": "Mobile applications interact with the Xikolo API (mounted at `/api`) to fetch and submit learning-related data. This workflow involves version negotiation using the `Accept` header and handling deprecation notices via the `Sunset` header to ensure client compatibility and guide updates.",
      "involvedComponents": [
        "Xikolo::API",
        "Xikolo::Endpoint::CollectionEndpoint",
        "API Gateway (Rails Routes)",
        "API Changelog"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Internal Service Integration via Bridge APIs",
      "description": "Various internal services and components integrate with the main application through dedicated 'bridge' APIs (e.g., Transpipe for video, Lanalytics for statistics, Moochub for courses, Chatbot for user interaction, Shop for vouchers). These APIs provide specialized endpoints for specific domain interactions.",
      "involvedComponents": [
        "API Gateway (Rails Routes)",
        "Transpipe Bridge API",
        "Lanalytics Bridge API",
        "Moochub Bridge API",
        "Chatbot Bridge API",
        "Shop Bridge API"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "External Customer Portal Integration",
      "description": "External customer portals access and manage data related to courses, users, and enrollments through the dedicated Portal API (`/portalapi-beta`). This provides a controlled interface for external systems to interact with core application data.",
      "involvedComponents": [
        "API Gateway (Rails Routes)",
        "Portal API"
      ],
      "provenance": {
        "sources": [
          "config/routes.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "API Version Management and Client Updates",
      "description": "The API actively manages different versions to support diverse client bases. Clients declare their supported API version, and the API responds accordingly, including 'Sunset' headers for deprecated versions. This process guides clients, especially mobile apps, to update to newer API versions before older ones are removed.",
      "involvedComponents": [
        "Xikolo::API",
        "API Changelog"
      ],
      "provenance": {
        "sources": [
          "api/CHANGELOG.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Schema Migration Management",
      "description": "The process of evolving the database schema over time using ActiveRecord migrations, adhering to best practices for reversibility and performance.",
      "involvedComponents": [
        "ActiveRecord",
        "PostgreSQL Database",
        "Fx Gem",
        "Scenic Gem"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb",
          "config/initializers/fx.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Data Migration Workflow",
      "description": "A multi-step process for migrating data between old and new schema structures, designed to ensure data integrity and minimize impact on production systems.",
      "involvedComponents": [
        "ActiveRecord",
        "PostgreSQL Database"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Database Initialization and Seeding",
      "description": "The process of setting up a new database instance and populating it with essential or sample data, configurable for different environments.",
      "involvedComponents": [
        "PostgreSQL Database",
        "ActiveRecord",
        "Database Seeding Mechanism"
      ],
      "provenance": {
        "sources": [
          "db/seeds.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "UUID Generation Strategy",
      "description": "The architectural decision and implementation for using UUID v7 as primary keys across the database, leveraging custom PostgreSQL functions.",
      "involvedComponents": [
        "PostgreSQL Database",
        "uuid_generate_v7ms Function",
        "pgcrypto Extension",
        "uuid-ossp Extension"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Data Denormalization for Querying",
      "description": "The strategy to create a pre-joined and denormalized view of complex course data to optimize read performance for common queries.",
      "involvedComponents": [
        "PostgreSQL Database",
        "embed_courses View",
        "ActiveRecord"
      ],
      "provenance": {
        "sources": [
          "db/schema.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Application Error Reporting",
      "description": "This workflow describes how application errors are captured and reported to Sentry, including filtering of sensitive data and exclusion of expected exceptions.",
      "involvedComponents": [
        "Sentry Configuration (Web)",
        "Sentry Configuration (Microservice)",
        "Xikolo.site/Xikolo.brand",
        "MsgrSentryIntegration"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "services/account/config/initializers/sentry.rb",
          "services/course/config/initializers/sentry.rb",
          "services/news/config/initializers/sentry.rb",
          "services/notification/config/initializers/sentry.rb",
          "services/pinboard/config/initializers/sentry.rb",
          "services/quiz/config/initializers/sentry.rb",
          "services/timeeffort/config/initializers/sentry.rb",
          "services/course/config/initializers/sentry_msgr.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Distributed Tracing and Error Linking",
      "description": "This workflow outlines how Mnemosyne captures full application traces and how Sentry error events are linked to these traces using a unique Trace ID, enabling cross-service debugging.",
      "involvedComponents": [
        "Mnemosyne Configuration",
        "AnnotateSentryErrorsForMnemosyne",
        "Sentry Configuration (Web)"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb",
          "config/mnemosyne.yml",
          "services/account/config/mnemosyne.yml",
          "services/course/config/mnemosyne.yml",
          "services/news/config/mnemosyne.yml",
          "services/notification/config/mnemosyne.yml",
          "services/pinboard/config/mnemosyne.yml",
          "services/quiz/config/mnemosyne.yml",
          "services/timeeffort/config/mnemosyne.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Debugging with Trace IDs",
      "description": "This workflow describes the process for developers to use a Trace ID from a Sentry error to look up the complete application trace in Mnemosyne for detailed debugging, including query parameters and cross-service calls.",
      "involvedComponents": [
        "Sentry Configuration (Web)",
        "Mnemosyne Configuration",
        "AnnotateSentryErrorsForMnemosyne"
      ],
      "provenance": {
        "sources": [
          "config/initializers/sentry.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Authentication via SSO/OAuth",
      "description": "Users authenticate through various external identity providers (e.g., SAML, OpenID Connect) configured via OmniAuth. Upon successful authentication, the system either finds an existing user or creates a new one, linking an authorization record to their account. A user session is then established.",
      "involvedComponents": [
        "OmniAuth::Builder",
        "Account::User",
        "Account::Authorization",
        "Account::Session",
        "External Identity Providers (e.g., SAML IdP, OpenID Connect Provider)"
      ],
      "provenance": {
        "sources": [
          "config/initializers/omniauth.rb",
          "app/models/account/user.rb",
          "app/models/account/authorization.rb",
          "app/models/account/session.rb",
          "Gemfile"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Profile Information Update",
      "description": "Users can modify their profile details, such as display name, full name, email address, birthdate, and avatar, directly on their profile page. The frontend JavaScript handles the inline editing UI and sends asynchronous AJAX requests to the backend API to persist these changes in the database.",
      "involvedComponents": [
        "account-profile.js",
        "bootstrap-editable",
        "I18n (JS)",
        "Account::User",
        "Account::Email",
        "Backend API (implied by AJAX calls)"
      ],
      "provenance": {
        "sources": [
          "app/assets/legacy/account-profile.js",
          "app/models/account/user.rb",
          "app/models/account/email.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Content Access & Eligibility",
      "description": "A user attempts to access course content, and the system verifies their eligibility based on course publication status, start date, user authentication, and enrollment status/permissions.",
      "involvedComponents": [
        "CourseContextHelper",
        "Course::Course",
        "Course::Section",
        "Course::Item",
        "Course::Enrollment",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/helpers/course_context_helper.rb",
          "app/models/course/course.rb",
          "app/models/course/section.rb",
          "app/models/course/item.rb",
          "app/models/course/enrollment.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Learning Progress Tracking & Prerequisites Fulfillment",
      "description": "Users interact with learning items (visit, submit assessments), and the system records their activity and determines if item and section prerequisites are fulfilled based on visits or scores.",
      "involvedComponents": [
        "ItemContextHelper",
        "Course::Item",
        "Course::Section",
        "Course::Visit",
        "Course::Result",
        "ProgressHelper",
        "current_user"
      ],
      "provenance": {
        "sources": [
          "app/helpers/item_context_helper.rb",
          "app/helpers/progress_helper.rb",
          "app/models/course/item.rb",
          "app/models/course/section.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Content Management (Admin/Teacher)",
      "description": "Administrators and teachers create, edit, and configure courses, sections, items, metadata, offers, and visual assets through a dynamic frontend interface.",
      "involvedComponents": [
        "Course::Course",
        "Course::Section",
        "Course::Item",
        "Course::Metadata",
        "Course::Offer",
        "Course::Visual",
        "form.ts",
        "app/views/items/_form.html.slim",
        "app/views/items/_form_wrapper.html.slim"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb",
          "app/models/course/section.rb",
          "app/models/course/item.rb",
          "app/models/course/metadata.rb",
          "app/models/course/offer.rb",
          "app/models/course/visual.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Categorization & Discovery",
      "description": "Courses are categorized using classifiers and clusters, enabling filtering, tagging, and highlighting (e.g., featured courses) on the course list and detail pages.",
      "involvedComponents": [
        "Course::Course",
        "Course::Classifier",
        "Course::Cluster",
        "Course::Channel",
        "Banner"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb",
          "app/models/course/classifier.rb",
          "app/models/course/cluster.rb",
          "app/models/course/channel.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Reactivation",
      "description": "Users can reactivate expired courses, extending their access and submission deadlines, typically requiring vouchers and specific platform/course configurations.",
      "involvedComponents": [
        "Course::Course",
        "Course::Enrollment"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb",
          "app/models/course/enrollment.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Deadline Management",
      "description": "The system automatically calculates, creates, updates, and deletes deadlines for various course resources, ensuring users are informed of upcoming actions.",
      "involvedComponents": [
        "NextDate",
        "Course::Course",
        "Course::Section",
        "Course::Item",
        "Background Jobs"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb",
          "app/models/course/section.rb",
          "app/models/course/item.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Tracks & Relations",
      "description": "Courses are grouped into sets, and directed relations between these sets define complex prerequisites for course tracks, requiring specific achievements (e.g., Confirmation of Participation) in preceding courses.",
      "involvedComponents": [
        "Course::Course",
        "CourseSet",
        "CourseSetRelation"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Open Mode Video Preview",
      "description": "Anonymous or unenrolled users are directed to a featured video item in 'open mode' to provide a preview of course content, enhancing engagement and SEO.",
      "involvedComponents": [
        "Course::Course",
        "Course::Item",
        "Video::Video"
      ],
      "provenance": {
        "sources": [
          "app/models/course/course.rb",
          "app/models/course/item.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Account Lifecycle Management",
      "description": "This workflow encompasses the entire lifecycle of a user account, from creation and registration to updates (e.g., password changes, profile edits), and potential deletion or administrative actions like masquerading and manual confirmation.",
      "involvedComponents": [
        "Account Service",
        "User Management API",
        "Custom Profile Fields Manager",
        "Permissions Manager"
      ],
      "provenance": {
        "sources": [
          "services/account/lib/tasks/permissions/account.yml",
          "docs/app/features/profile/custom_fields.md",
          "config/routes.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Authorization and Access Control Enforcement",
      "description": "This workflow describes how user access to platform features and data is controlled. It involves defining permissions, bundling them into roles, assigning roles to groups, and then granting these groups access based on context. This system supports global and course-specific permissions.",
      "involvedComponents": [
        "Account Service",
        "Permissions Manager"
      ],
      "provenance": {
        "sources": [
          "docs/app/features/permissions/index.md",
          "services/account/lib/tasks/permissions/account.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Custom User Profile Data Collection",
      "description": "This workflow enables platforms to define and manage additional, custom data fields for user profiles. It includes the process of creating these fields (text, select, multi-select), making them mandatory, and handling user input, potentially interrupting user access until mandatory fields are completed.",
      "involvedComponents": [
        "Account Service",
        "Custom Profile Fields Manager"
      ],
      "provenance": {
        "sources": [
          "docs/app/features/profile/custom_fields.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Content Management",
      "description": "This workflow encompasses the creation, configuration, and maintenance of quizzes, including their questions and answers. It supports both direct API interaction and bulk import via XML.",
      "involvedComponents": [
        "Quiz Service",
        "Quiz",
        "Question",
        "Answer",
        "QuizImporter"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Quiz Submission and Grading",
      "description": "This workflow describes the process where a user takes a quiz, submits their answers, and the system processes these submissions, potentially grading them and storing the results.",
      "involvedComponents": [
        "Quiz Service",
        "Quiz",
        "Question",
        "Answer",
        "QuizSubmission",
        "Account Service"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Content Management (Admin/Editor)",
      "description": "Content editors create, edit, update, move, and delete quiz questions and their associated answers within a course item. This workflow involves selecting specific question types (e.g., Multiple Choice, Free Text) and defining properties for questions and answers.",
      "involvedComponents": [
        "QuizQuestionsController",
        "QuizAnswersController",
        "ACFS Client Models (e.g., Xikolo::Quiz::Question, Xikolo::Quiz::Answer)",
        "Microservice API Clients (Xikolo.api(:quiz))"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_questions_controller.rb",
          "app/controllers/quiz_answers_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Quiz Attempt & Submission",
      "description": "A logged-in user initiates a new quiz attempt, interacts with quiz questions, and submits their answers. The system manages time limits, submission deadlines, and proctoring (if enabled). User progress can be auto-saved via snapshots. Upon submission, an event is published to the messaging queue for further processing.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizItemPresenter",
        "QuizSubmissionSnapshotController",
        "ACFS Client Models (e.g., Xikolo::Quiz::Quiz, Xikolo::Submission::QuizSubmission, Xikolo::Submission::UserQuizAttempts, Xikolo::Submission::QuizSubmissionSnapshot)",
        "Microservice API Clients (Xikolo.api(:quiz), Xikolo.api(:course))",
        "Msgr",
        "Proctoring::ItemContext"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/controllers/quiz_submission_snapshot_controller.rb",
          "app/presenters/quiz_item_presenter.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Submission Review & Results Display",
      "description": "After completing a quiz, users can view their submission, review results, and access historical attempts. The system determines which submission to display (e.g., highest score or newest) and presents the results, including a score, percentage, and a graph of past performance. Users can navigate between different submissions.",
      "involvedComponents": [
        "QuizSubmissionController",
        "QuizResultPresenter",
        "QuizSubmissionNavigator",
        "ACFS Client Models (e.g., Xikolo::Quiz::Quiz, Xikolo::Submission::QuizSubmission, Xikolo::Submission::UserQuizAttempts)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_submission_controller.rb",
          "app/presenters/quiz_result_presenter.rb",
          "app/assets/course/items/quiz.ts"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Quiz Recap Data Retrieval",
      "description": "An API endpoint allows frontend components to fetch aggregated quiz recap data for a specific course. This data includes questions, answers, and links back to the original course items, enabling a summary view of quizzes.",
      "involvedComponents": [
        "QuizRecapController",
        "Course::QuizRecap",
        "Microservice API Clients (Xikolo.api(:quiz), Xikolo.api(:course))"
      ],
      "provenance": {
        "sources": [
          "app/controllers/quiz_recap_controller.rb",
          "app/components/course/quiz_recap.rb",
          "spec/requests/app/quiz-recap/show_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Listing and Retrieval",
      "description": "Users or other services request a list of available courses or detailed information about a specific course. The Course Service filters courses based on visibility and can embed additional data like descriptions or enrollment status.",
      "involvedComponents": [
        "CourseServiceAPI",
        "Course (Model/Entity)",
        "Enrollment (Model/Entity)"
      ],
      "provenance": {
        "sources": [
          "services/course/README.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Enrollment and Unenrollment",
      "description": "Users can enroll in or unenroll from a course. This workflow involves creating, updating, or deleting an Enrollment record, reflecting the user's participation status.",
      "involvedComponents": [
        "CourseServiceAPI",
        "Enrollment (Model/Entity)",
        "Course (Model/Entity)"
      ],
      "provenance": {
        "sources": [
          "services/course/README.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Progress and Achievement Tracking",
      "description": "The system tracks a user's progress and points within a course to determine eligibility for 'Confirmation of Participation' and 'Record of Achievement' certificates, based on configured thresholds.",
      "involvedComponents": [
        "Enrollment (Model/Entity)",
        "Course (Model/Entity)",
        "CertificateLogic",
        "Quiz Service",
        "TimeEffort Service",
        "Sidekiq (Background Processor)",
        "XikoloConfig"
      ],
      "provenance": {
        "sources": [
          "services/course/app/xikolo.yml",
          "services/course/config/locales/de.yml",
          "services/course/config/locales/en.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Role Assignment and Management",
      "description": "When a course is created or a user is assigned a specific role (e.g., teacher, admin) within a course, the system manages the creation of course-specific user groups and grants appropriate permissions.",
      "involvedComponents": [
        "RoleManagement",
        "Course (Model/Entity)",
        "Account Service",
        "XikoloConfig"
      ],
      "provenance": {
        "sources": [
          "services/course/app/xikolo.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Discussion Post Management",
      "description": "Users create, read, update, and delete discussion questions, answers, and comments. This workflow involves direct API interactions for content submission and retrieval.",
      "involvedComponents": [
        "Pinboard Microservice",
        "Pinboard API Server",
        "Pinboard Sidekiq Worker",
        "Sentiment Analysis Module"
      ],
      "provenance": {
        "sources": [
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Engagement (Voting & Subscriptions)",
      "description": "Users interact with discussion content by casting votes (up/down) and subscribing to discussions to receive updates. This involves API calls and potentially asynchronous notifications.",
      "involvedComponents": [
        "Pinboard Microservice",
        "Pinboard API Server",
        "Pinboard Sidekiq Worker",
        "Pinboard Msgr Consumer"
      ],
      "provenance": {
        "sources": [
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Content Moderation (Abuse Reporting)",
      "description": "Users can report inappropriate discussion content. This workflow captures abuse reports via the API and likely triggers background processes for review and potential action.",
      "involvedComponents": [
        "Pinboard Microservice",
        "Pinboard API Server",
        "Pinboard Sidekiq Worker"
      ],
      "provenance": {
        "sources": [
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Asynchronous Content Processing",
      "description": "Tasks such as sentiment analysis of new posts, sending notifications for subscribed discussions, or other long-running operations are handled asynchronously to maintain API responsiveness.",
      "involvedComponents": [
        "Pinboard Microservice",
        "Pinboard Msgr Consumer",
        "Pinboard Sidekiq Worker",
        "Sentiment Analysis Module"
      ],
      "provenance": {
        "sources": [
          ""
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Pinboard Browsing and Filtering",
      "description": "Users can view a list of discussion questions (topics) for a course, filter them by tags, and navigate through different sections, including a dedicated 'Technical Issues' section.",
      "involvedComponents": [
        "PinboardController",
        "PinboardPresenter",
        "PinboardRoutesHelper",
        "Xikolo::Pinboard::ExplicitTag",
        "Xikolo::Pinboard::ImplicitTag",
        "Xikolo::Course::Section",
        "Xikolo.api(:pinboard)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_controller.rb",
          "app/presenters/pinboard_presenter.rb",
          "app/helpers/pinboard_routes_helper.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Question Lifecycle Management",
      "description": "Users can create, view, edit, delete, upvote, close, reopen, block, unblock, and report abuse for discussion questions. This workflow also includes accepting an answer for a question.",
      "involvedComponents": [
        "QuestionController",
        "Pinboard::TopicForm",
        "QuestionPresenter",
        "PinboardUserStatePresenter",
        "PinboardRoutesHelper",
        "Xikolo::Pinboard::Question",
        "Xikolo::Pinboard::Vote",
        "Xikolo::Pinboard::AbuseReport",
        "Xikolo::Pinboard::Subscription",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/forms/pinboard/topic_form.rb",
          "app/presenters/question_presenter.rb",
          "app/presenters/pinboard_user_state_presenter.rb",
          "app/helpers/pinboard_routes_helper.rb",
          "services/account/lib/tasks/permissions/pinboard.yml",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Comment and Answer Management",
      "description": "Users can create, view, edit, update, delete, block, unblock, and report abuse for comments made on questions and answers.",
      "involvedComponents": [
        "PinboardCommentController",
        "PinboardRoutesHelper",
        "Xikolo::Pinboard::Comment",
        "Xikolo::Pinboard::Answer",
        "Xikolo::Pinboard::AbuseReport",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pinboard_comment_controller.rb",
          "app/helpers/pinboard_routes_helper.rb",
          "services/account/lib/tasks/permissions/pinboard.yml",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Gamification Integration",
      "description": "User actions on the pinboard, such as creating questions, answers, comments, accepting answers, and voting, trigger asynchronous events that update user gamification scores.",
      "involvedComponents": [
        "QuestionController",
        "PinboardCommentController",
        "PinboardUserStatePresenter",
        "Msgr",
        "Gamification::Score",
        "Gamification::Level"
      ],
      "provenance": {
        "sources": [
          "app/controllers/question_controller.rb",
          "app/controllers/pinboard_comment_controller.rb",
          "app/presenters/pinboard_user_state_presenter.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Announcement Management (CRUD)",
      "description": "Administrators create, edit, delete, and view announcements through a dedicated interface. This includes handling multilingual content and managing publication settings.",
      "involvedComponents": [
        "AnnouncementsController",
        "Admin::NewsForm",
        "Admin::NewsForm::Translation",
        "Admin::AnnouncementsListPresenter",
        "Admin::AnnouncementPresenter",
        "news microservice",
        "account microservice (for permissions)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/announcements_controller.rb",
          "app/forms/admin/news_form.rb",
          "app/presenters/admin/announcement_presenter.rb",
          "app/presenters/admin/announcements_list_presenter.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Announcement Email Notification",
      "description": "Administrators can send email notifications for announcements, either as a test or to all recipients. The system tracks and displays email delivery statistics.",
      "involvedComponents": [
        "AnnouncementsController",
        "Admin::AnnouncementEmailPresenter",
        "news microservice",
        "account microservice"
      ],
      "provenance": {
        "sources": [
          "app/controllers/announcements_controller.rb",
          "app/presenters/admin/announcement_email_presenter.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Event-Driven Notification Delivery",
      "description": "A workflow where other microservices publish events to RabbitMQ, which are then consumed by the Notification Service to generate and send corresponding email notifications to users.",
      "involvedComponents": [
        "Notification Service",
        "Msgr Consumer",
        "Mailer",
        "Sidekiq Worker"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Email Content Localization",
      "description": "The process of dynamically selecting and rendering email content (subjects, body text, links) based on the user's preferred language, using extensive locale files.",
      "involvedComponents": [
        "Mailer",
        "Notification Service"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Daily Statistics Email Generation",
      "description": "A scheduled workflow (likely initiated by Sidekiq cron) that compiles and sends daily administrative and course-specific statistics reports via email.",
      "involvedComponents": [
        "Notification Service",
        "Mailer",
        "Sidekiq Worker"
      ],
      "provenance": {
        "sources": [
          "Foundational Context: Background Jobs"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "News Item Creation and Distribution",
      "description": "A user or system creates a new global or course-specific news item via the News API. This action triggers the storage of the news item in the database and potentially publishes a message to RabbitMQ. A Sidekiq job is subsequently enqueued to process and send notifications (e.g., emails) to relevant users, potentially fetching user preferences from the Account service and course context from the Course service.",
      "involvedComponents": [
        "News API Server",
        "News Msgr Consumer",
        "News Sidekiq Worker",
        "Account Service",
        "Course Service"
      ],
      "provenance": {
        "sources": [
          "services/news/README.md",
          "docker/compose.news.yml",
          "services/news/config/locales/en.yml",
          "services/news/config/services.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Notification Preference Management",
      "description": "Users can manage their notification preferences related to news and announcements, including options to unsubscribe from specific types of announcements or all emails globally. Links for these actions are provided within the notification emails. The News Service likely queries the Account service for user notification settings to determine which notifications to send.",
      "involvedComponents": [
        "News API Server",
        "News Sidekiq Worker",
        "Account Service"
      ],
      "provenance": {
        "sources": [
          "services/news/config/locales/en.yml",
          "services/news/config/services.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Playback and User Interaction",
      "description": "Users view videos, interact with the player (seek, pause), and create discussion topics linked to specific video timestamps. Keyboard shortcuts enhance accessibility.",
      "involvedComponents": [
        "VideoPlayerFrontendLogic",
        "xm-player"
      ],
      "provenance": {
        "sources": [
          "app/assets/course/items/video.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Video Provider Management",
      "description": "Administrators can add, edit, delete, and view video providers, configuring their credentials and initiating synchronization processes.",
      "involvedComponents": [
        "Admin::VideoProvidersController",
        "Admin::VideoProviderSyncController",
        "Video::Provider",
        "Video::SyncVideosJob"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/video_providers_controller.rb",
          "app/controllers/admin/video_provider_sync_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Item Creation/Update with Attachments and Subtitles",
      "description": "Teachers create or update video items, uploading associated reading materials, slides, transcripts, and subtitles. The system handles S3 storage and subtitle processing.",
      "involvedComponents": [
        "Video::Store",
        "Xikolo::S3::TextWithUploadsProcessor",
        "Xikolo::S3::SingleFileUpload",
        "Xikolo::S3::UploadByUri",
        "S3FileDeletionJob",
        "Video::Subtitle"
      ],
      "provenance": {
        "sources": [
          "app/operations/video/store.rb",
          "spec/operations/video/store_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Streaming and HLS Playlist Generation",
      "description": "The system dynamically generates HLS master and stream playlists, incorporating various video qualities and subtitle tracks, optimizing for different devices and bandwidths.",
      "involvedComponents": [
        "M3u8Playlist",
        "Video::Subtitle"
      ],
      "provenance": {
        "sources": [
          "app/lib/m3u8_playlist.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Subtitle Display and Management",
      "description": "Users can view subtitles for videos, and administrators can upload, update, or delete subtitle files. Subtitles are served as VTT files with appropriate headers.",
      "involvedComponents": [
        "SubtitlesController",
        "Video::Subtitle",
        "Video::Store"
      ],
      "provenance": {
        "sources": [
          "app/controllers/subtitles_controller.rb",
          "app/operations/video/store.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "TransPipe URL Generation",
      "description": "When enabled, the system generates specific URLs for courses and videos that integrate with the external TransPipe service.",
      "involvedComponents": [
        "Transpipe"
      ],
      "provenance": {
        "sources": [
          "app/lib/transpipe.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Download Control",
      "description": "The ability for users to download video and audio content is controlled by a course-specific setting, while supplementary materials like slides and transcripts are always downloadable.",
      "involvedComponents": [],
      "provenance": {
        "sources": [
          "spec/system/video/video_download_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Certificate Template Management",
      "description": "Allows administrators to create, view, edit, and delete PDF certificate templates for a specific course, including uploading PDF backgrounds, defining dynamic content, and previewing the generated certificates.",
      "involvedComponents": [
        "Course::Admin::CertificateTemplatesController",
        "Certificate::Template",
        "FileUpload",
        "Course::Course",
        "Certificate::Record::Render",
        "Certificate::RecordRenderer",
        "Certificate::RenderDataPresenter",
        "Course::CertificateTemplatePresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/certificate_templates_controller.rb",
          "app/operations/certificate/record/render.rb",
          "app/lib/certificate/record_renderer.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Open Badge Template Management",
      "description": "Enables administrators to create, view, edit, and delete Open Badge templates for a specific course, including uploading PNG badge images and defining badge metadata.",
      "involvedComponents": [
        "Course::Admin::OpenBadgeTemplatesController",
        "Certificate::OpenBadgeTemplate",
        "FileUpload",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/admin/open_badge_templates_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Certificate PDF Generation (System)",
      "description": "The internal process for generating a PDF certificate from a `Certificate::RecordOfAchievement` and its associated `Certificate::Template`.",
      "involvedComponents": [
        "Certificate::Record::Render",
        "Certificate::RecordOfAchievement",
        "Certificate::RenderDataPresenter",
        "Certificate::RecordRenderer"
      ],
      "provenance": {
        "sources": [
          "app/operations/certificate/record/render.rb",
          "app/lib/certificate/record_renderer.rb",
          "spec/lib/certificate/record_renderer_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Open Badge Baking (System)",
      "description": "The internal process of embedding a signed Open Badge assertion into a PNG image file, creating a 'baked' Open Badge.",
      "involvedComponents": [
        "OpenBadgeBakery",
        "Certificate::V2::OpenBadge",
        "Certificate::OpenBadgeTemplate"
      ],
      "provenance": {
        "sources": [
          "spec/lib/open_badge_bakery_spec.rb",
          "spec/support/badge_support.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course and Content Management",
      "description": "Administrators can create, edit, clone, and delete courses. They can manage course channels, classify courses into clusters, and order both channels and classifiers. Document management (a beta feature) and teacher profiles are also administered here. Quiz content can be previewed and imported.",
      "involvedComponents": [
        "Admin::CoursesController",
        "Admin::CourseManagementController",
        "Admin::ChannelsController",
        "Admin::ChannelsOrderController",
        "Admin::ClustersController",
        "Admin::ClassifiersController",
        "Admin::Cluster::ClassifiersOrderController",
        "Admin::Classifier::CoursesOrderController",
        "Admin::DocumentsController",
        "Admin::DocumentLocalizationsController",
        "Admin::TeachersController",
        "Admin::PollsController",
        "Admin::PollOptionsController",
        "Admin::Ajax::ClassifiersController",
        "Admin::Ajax::CoursesController",
        "Admin::Ajax::StreamsController"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/courses_controller.rb",
          "app/controllers/admin/course_management_controller.rb",
          "app/controllers/admin/channels_controller.rb",
          "app/controllers/admin/channels_order_controller.rb",
          "app/controllers/admin/clusters_controller.rb",
          "app/controllers/admin/classifiers_controller.rb",
          "app/controllers/admin/cluster/classifiers_order_controller.rb",
          "app/controllers/admin/classifier/courses_order_controller.rb",
          "app/controllers/admin/documents_controller.rb",
          "app/controllers/admin/document_localizations_controller.rb",
          "app/controllers/admin/teachers_controller.rb",
          "app/controllers/admin/polls_controller.rb",
          "app/controllers/admin/poll_options_controller.rb",
          "app/controllers/admin/ajax/classifiers_controller.rb",
          "app/controllers/admin/ajax/courses_controller.rb",
          "app/controllers/admin/ajax/streams_controller.rb",
          "spec/controllers/admin/course_management_controller_spec.rb",
          "spec/controllers/admin/courses_controller_spec.rb",
          "spec/requests/admin/channels_order/update_spec.rb",
          "spec/requests/admin/courses/list_spec.rb",
          "spec/requests/admin/ajax/find_courses_spec.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    {
      "workflowName": "Platform Statistics and Dashboard Viewing",
      "description": "Administrators can view a dashboard with platform-wide and course-specific statistics, including user activity, enrollments, certificate counts, and geographical distribution of learners. This data is often cached for performance.",
      "involvedComponents": [
        "Admin::DashboardController",
        "Admin::Ajax::DetailStatisticsController",
        "Admin::Ajax::PlatformStatisticsController"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/dashboard_controller.rb",
          "app/controllers/admin/ajax/detail_statistics_controller.rb",
          "app/controllers/admin/ajax/platform_statistics_controller.rb",
          "cluster:30_ADMIN_GeneralPanel"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "30_ADMIN_GeneralPanel"
        ]
      }
    },
    {
      "workflowName": "LTI Exercise Configuration",
      "description": "Enables teachers to create and modify LTI exercises, including setting up rich text instructions that can incorporate S3-hosted files.",
      "involvedComponents": [
        "Lti::Exercise",
        "Lti::Exercise::Store",
        "Xikolo::S3::TextWithUploadsProcessor",
        "S3FileDeletionJob"
      ],
      "provenance": {
        "sources": [
          "app/operations/lti/exercise/store.rb",
          "spec/operations/lti/exercise/store_spec.rb",
          "spec/system/teacher/item/lti_exercise/modification_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Learning Item Duration Calculation",
      "description": "This workflow involves the process of determining and storing the estimated time effort for various learning items (e.g., courses, sections, quizzes). It likely involves fetching item details from CourseService and QuizService, applying calculation logic within the TimeEffortService, and persisting the results. This process can be triggered by messages (via MsgrConsumer) or background jobs (via TimeEffortWorker). ",
      "involvedComponents": [
        "TimeEffortService",
        "MsgrConsumer",
        "TimeEffortWorker",
        "CourseService",
        "QuizService",
        "PostgreSQL"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Gamification Score Generation",
      "description": "This workflow describes how user actions across different services (e.g., Course, Pinboard) lead to the creation of gamification scores. Events are published to RabbitMQ, consumed by the GamificationConsumer, and then processed by specific rule classes to create score records.",
      "involvedComponents": [
        "Msgr (RabbitMQ)",
        "GamificationConsumer",
        "Gamification::Rules::*",
        "Gamification::Score",
        "Xikolo.config.gamification"
      ],
      "provenance": {
        "sources": [
          "app/consumers/gamification_consumer.rb",
          "spec/events/xikolo.course.result.create_spec.rb",
          "spec/events/xikolo.course.visit.create_spec.rb",
          "spec/events/xikolo.pinboard.answer.create_spec.rb",
          "spec/events/xikolo.pinboard.comment.create_spec.rb",
          "spec/events/xikolo.pinboard.question.create_spec.rb",
          "spec/events/xikolo.pinboard.question.update_spec.rb",
          "spec/events/xikolo.pinboard.vote.create_spec.rb",
          "spec/factories/gamification.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Gamification Badge Display",
      "description": "This workflow outlines how earned badges are rendered and displayed to the user, typically on a dashboard or achievements page. The Dashboard::GamificationBadge component retrieves badge data and uses asset images to visualize them.",
      "involvedComponents": [
        "Gamification::Badge",
        "Dashboard::GamificationBadge",
        "app/models/gamification/badge_types.yml",
        "app/assets/images/gamification/badges/"
      ],
      "provenance": {
        "sources": [
          "app/components/dashboard/gamification_badge.rb",
          "app/assets/images/gamification/**/*"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Level Progression and Display",
      "description": "This workflow describes how users progress through different levels based on accumulated experience points (XP) and how their current level and score are displayed in the UI.",
      "involvedComponents": [
        "Gamification::Score",
        "app/models/gamification/user_levels.yml",
        "app/assets/images/gamification/userstates/",
        "UI (global nav bar, dashboard achievements page)"
      ],
      "provenance": {
        "sources": [
          "integration/features/xikolo/global/gamification/user_score.feature"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Chatbot User Interaction Workflow",
      "description": "An external chatbot authenticates a user using a shared SAML `uid` to obtain a temporary user token. This token is then used to retrieve user-specific information (e.g., internal ID, enrolled courses, achievements, quizzes) and manage course enrollments (enroll/unenroll) on behalf of the user. ",
      "involvedComponents": [
        "Chatbot API (Controller/Service Layer)",
        "TokenSigning",
        "Abstract::BridgeAPIController",
        "Xi::Controllers::RequireBearerToken"
      ],
      "provenance": {
        "sources": [
          "config/initializers/chatbot.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Shop Voucher Management Workflow",
      "description": "External shop systems interact with the platform to programmatically create new vouchers (e.g., for course reactivation or proctoring) in bulk. They can also query and list existing vouchers, including their current status (claimed/unclaimed) and associated details. ",
      "involvedComponents": [
        "Shop API (Controller/Service Layer)",
        "Abstract::BridgeAPIController",
        "Xi::Controllers::RequireBearerToken"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Translation Pipeline Workflow",
      "description": "An external translation pipeline system retrieves course and video metadata from the platform. It can also fetch existing subtitle files (WEBVTT format) for specific videos and languages, and subsequently update or create new subtitle files, optionally marking them as automatically generated. ",
      "involvedComponents": [
        "TransPipe API (Controller/Service Layer)",
        "Abstract::BridgeAPIController",
        "Xi::Controllers::RequireBearerToken"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "MOOChub Course Synchronization Workflow",
      "description": "The platform provides a dedicated API endpoint to facilitate integration with the MOOChub Schema repository. This workflow enables the exchange or synchronization of course-related data with external MOOChub systems, adhering to the MOOChub schema specification. ",
      "involvedComponents": [
        "MOOChub API (Controller/Service Layer)",
        "Abstract::BridgeAPIController",
        "Xi::Controllers::RequireBearerToken"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Helpdesk Ticket Submission",
      "description": "A user navigates to the helpdesk page, fills out a form with their issue, and submits it. The system verifies the submission, creates a ticket, sends an email notification, and publishes a message queue event.",
      "involvedComponents": [
        "HelpdeskController",
        "Helpdesk::TicketForm",
        "Xi::Recaptcha::Integration",
        "Helpdesk::Ticket",
        "Helpdesk::TicketMailer",
        "Msgr",
        "Helpdesk::CategoryOptions"
      ],
      "provenance": {
        "sources": [
          "app/controllers/helpdesk_controller.rb",
          "app/forms/helpdesk/ticket_form.rb",
          "app/mailers/helpdesk/ticket_mailer.rb",
          "app/models/helpdesk/ticket.rb",
          "spec/models/helpdesk/ticket_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Dashboard Display",
      "description": "A logged-in user accesses their personalized dashboard, which aggregates and displays their current, upcoming, and completed courses, promoted content, upcoming dates, and potentially a notice for new SSO users.",
      "involvedComponents": [
        "DashboardController",
        "Xikolo.api",
        "Acfs",
        "Course::Enrollment",
        "Catalog::Course",
        "CoursePresenter",
        "Course::NextDatePresenter",
        "Xikolo::Account::Authorization",
        "Xikolo::Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb",
          "spec/controllers/dashboard_controller_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Public Homepage Display",
      "description": "An anonymous or logged-in user visits the application's root URL, seeing a public homepage that features announcements and dynamically loaded course categories, topics, or videos based on configuration.",
      "involvedComponents": [
        "Home::HomeController",
        "Xikolo.api",
        "AnnouncementPresenter",
        "Home::Category",
        "Catalog::Category::Channel",
        "Catalog::Category::Classifier",
        "Catalog::Category::CurrentAndUpcoming"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/home_controller.rb",
          "spec/controllers/home/home_controller_spec.rb",
          "docs/app/development/branding/homepage.md"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Public Course Listing and Filtering",
      "description": "Users can browse a public list of courses, apply filters based on channel, topic (classifier), language, and search queries, with support for pagination to load more courses.",
      "involvedComponents": [
        "Home::HomeController (indirectly via course loaders)",
        "Catalog::Course",
        "Xikolo.api (for course data)",
        "spec/requests/home/courses/index_spec.rb (testing)",
        "spec/system/home/course_list_spec.rb (testing)"
      ],
      "provenance": {
        "sources": [
          "spec/requests/home/courses/index_spec.rb",
          "spec/system/home/course_list_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Document Retrieval",
      "description": "A logged-in user can view a list of their certificates and other relevant documents associated with their completed course enrollments.",
      "involvedComponents": [
        "DashboardController",
        "Xikolo.api",
        "Acfs",
        "Course::Enrollment",
        "DocumentsPresenter",
        "Xikolo::Account::Preferences"
      ],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb",
          "spec/controllers/dashboard_controller_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Achievements Display",
      "description": "If the gamification feature is enabled, a logged-in user can view their achievements and gamification progress on their dashboard.",
      "involvedComponents": [
        "DashboardController",
        "Gamification::DashboardPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/dashboard_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Views Preferences",
      "description": "Describes the process of a user navigating to their preferences page and the system retrieving and displaying their current settings.",
      "involvedComponents": [
        "Account::PreferencesController",
        "Xikolo::Account::Preferences",
        "API::PreferencesController",
        "User",
        "PreferencesDecorator",
        "Account::PreferencesPresenter",
        "Account::PreferencesPresenter::PreferencePresenter",
        "Account::PreferencesPresenter::NotificationPresenter"
      ],
      "provenance": {
        "sources": [
          "app/controllers/account/preferences_controller.rb",
          "clients/xikolo-account/lib/xikolo/account/preferences.rb",
          "services/account/app/controllers/api/preferences_controller.rb",
          "services/account/app/models/user.rb",
          "services/account/app/decorators/preferences_decorator.rb",
          "app/presenters/account/preferences_presenter.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "User Updates Preferences",
      "description": "Outlines the end-to-end process when a user changes a preference setting, from frontend interaction to backend persistence and event propagation.",
      "involvedComponents": [
        "preferences.ts",
        "Account::PreferencesController",
        "Xikolo::Account::Preferences",
        "API::PreferencesController",
        "User",
        "Msgr"
      ],
      "provenance": {
        "sources": [
          "app/assets/user/settings/preferences.ts",
          "app/controllers/account/preferences_controller.rb",
          "clients/xikolo-account/lib/xikolo/account/preferences.rb",
          "services/account/app/controllers/api/preferences_controller.rb",
          "services/account/app/models/user.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Course Cloning",
      "description": "A message-driven process to duplicate an existing course, triggered by an event containing the old and new course identifiers.",
      "involvedComponents": [
        "CourseConsumer",
        "Course::Clone"
      ],
      "provenance": {
        "sources": [
          "services/course/app/consumers/course_consumer.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "News Item State Update",
      "description": "Updates the state and recipient count of a news item based on messages received, likely from a notification service.",
      "involvedComponents": [
        "NewsConsumer",
        "News"
      ],
      "provenance": {
        "sources": [
          "services/news/app/consumers/news_consumer.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "LTI Grade Publishing",
      "description": "Asynchronously publishes a user's LTI grade to the course service to ensure their progress is accurately reflected.",
      "involvedComponents": [
        "Lti::PublishGradeJob",
        "Lti::Grade"
      ],
      "provenance": {
        "sources": [
          "app/jobs/lti/publish_grade_job.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Proctoring Result Storage",
      "description": "After a proctored quiz submission, this job fetches the detailed proctoring results from an external vendor and stores them locally for future reference.",
      "involvedComponents": [
        "Proctoring::StoreSubmissionResultsJob",
        "Proctoring::ServiceError"
      ],
      "provenance": {
        "sources": [
          "app/jobs/proctoring/store_submission_results_job.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Proctoring Certificate Image Upload",
      "description": "Following a proctored quiz, the user's proctoring image is retrieved from the vendor (SMOWL) and uploaded to S3 for inclusion on certificates.",
      "involvedComponents": [
        "Proctoring::UploadCertificateImageJob",
        "Proctoring::ServiceError"
      ],
      "provenance": {
        "sources": [
          "app/jobs/proctoring/upload_certificate_image_job.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Scheduled Unconfirmed Account Deletion",
      "description": "Periodically deletes user accounts that have remained unconfirmed for a specified duration to maintain data hygiene.",
      "involvedComponents": [
        "UnconfirmedAccountsDeletionWorker"
      ],
      "provenance": {
        "sources": [
          "services/account/config/cron.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Scheduled Voucher Claimant IP Deletion",
      "description": "A recurring task to remove IP addresses associated with voucher claims, likely for privacy or data retention compliance.",
      "involvedComponents": [
        "Voucher::DeleteClaimantIPJob"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Scheduled Video Synchronization",
      "description": "A recurring task to synchronize newly added videos, ensuring content is up-to-date across the platform.",
      "involvedComponents": [
        "Video::SyncVideosJob"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Interactive Accordion/Disclosure",
      "description": "Users can expand and collapse content sections to reveal or hide information. The system ensures that only one section is expanded at a time within a given accordion group.",
      "involvedComponents": [
        "Accordion (JS)",
        "Accordion (Ruby ViewComponent)",
        "DisclosureWidget"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/accordion.js",
          "app/components/global/accordion.rb",
          "app/components/global/accordion.html.slim",
          "app/components/global/accordion_section.rb",
          "app/components/global/accordion_section.html.slim",
          "app/components/global/disclosure_widget.rb",
          "app/components/global/disclosure_widget.html.slim"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Filter and Search Content",
      "description": "Users can filter and search content on a page by entering text into a search bar or selecting options from dropdowns. The system provides a clear button to reset the search and dynamically updates the displayed content, often with a loading indicator.",
      "involvedComponents": [
        "Clear Button",
        "Custom Select (TomSelect)",
        "FilterBar::Search",
        "FilterBar::Filter",
        "FilterBar::Controls",
        "Fixed Bar"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/clear-button.js",
          "app/assets/components/global/custom-select.ts",
          "app/assets/components/global/custom-select/classifiers-select.js",
          "app/assets/components/global/custom-select/item-stats-select.js",
          "app/assets/components/global/custom-select/settings.js",
          "app/components/global/filter_bar/search.rb",
          "app/components/global/filter_bar/search.html.slim",
          "app/components/global/filter_bar/filter.rb",
          "app/components/global/filter_bar/filter.html.slim",
          "app/components/global/filter_bar/controls.rb",
          "app/components/global/filter_bar/controls.html.slim",
          "app/assets/components/global/fixed-bar.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Copy Text to Clipboard",
      "description": "Users can click a UI element (button or icon) to copy associated text to their clipboard. The system provides visual feedback to confirm the copy action.",
      "involvedComponents": [
        "Copy to Clipboard (JS)",
        "Copy to Clipboard (Ruby ViewComponent)",
        "LabeledCopyButton"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/copy-to-clipboard.ts",
          "app/components/global/copy_to_clipboard.rb",
          "app/components/global/copy_to_clipboard.html.slim",
          "app/components/global/labeled_copy_button.rb",
          "app/components/global/labeled_copy_button.html.slim"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Date and Time Selection",
      "description": "Users interact with a date/time picker to select specific dates and times. The system supports custom formatting, timezone handling, and provides convenience buttons for common actions like 'Today' or 'Clear'.",
      "involvedComponents": [
        "Flatpickr (JS)"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/flatpickr.js",
          "app/assets/components/global/flatpickr/customButtonsPlugin.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Horizontal Content Browsing",
      "description": "Users can navigate through horizontally arranged content (e.g., course cards, topics) using scroll buttons or by directly scrolling. The system dynamically adjusts the visibility of navigation buttons based on content overflow.",
      "involvedComponents": [
        "Slider (JS)",
        "Slider (Ruby ViewComponent)",
        "Expand Course Card"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/slider.js",
          "app/components/global/slider.rb",
          "app/components/global/slider.html.slim",
          "app/assets/components/global/expand-course-card.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Dismissing Banners and Alerts",
      "description": "Users can dismiss various banners (browser warnings, cookie consents) and system-wide alerts. The system hides the UI element and often records the dismissal via a cookie to prevent repeated display.",
      "involvedComponents": [
        "Browser Warning",
        "Cookie Consent Banner (JS)",
        "Cookie Consent Banner (Ruby ViewComponent)",
        "System Alerts",
        "FlashMessage"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/browser-warning.js",
          "app/assets/components/global/cookie-consent-banner.js",
          "app/components/global/cookie_consent_banner.rb",
          "app/components/global/cookie_consent_banner.html.slim",
          "app/assets/components/global/system-alerts.js",
          "app/components/global/flash_message.rb",
          "app/components/global/flash_message.html.slim"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Video Transcript Interaction",
      "description": "Users interact with an interactive transcript displayed alongside a video. They can see the currently spoken text highlighted, automatically scroll the transcript, or click on a transcript cue to jump to that specific point in the video.",
      "involvedComponents": [
        "Transcript"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/transcript.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Helpdesk Access",
      "description": "Users can access a helpdesk panel by clicking a dedicated button. The system dynamically adjusts the button's appearance and position, and the panel may contain a chatbot or other support options.",
      "involvedComponents": [
        "Helpdesk Button (JS)",
        "Helpdesk Button (Ruby ViewComponent)"
      ],
      "provenance": {
        "sources": [
          "app/assets/components/global/helpdesk-button.js",
          "app/components/global/helpdesk_button.rb",
          "app/components/global/helpdesk_button.html.slim"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Locale Detection and Switching",
      "description": "This workflow describes how the application determines the active language for a user's request and allows users to change it. It follows a specific priority order to ensure the most relevant locale is applied.",
      "involvedComponents": [
        "Locale",
        "I18n",
        "Xikolo.config",
        "Xikolo.api(:account)",
        "params",
        "session"
      ],
      "provenance": {
        "sources": [
          "app/controllers/concerns/locale.rb",
          "spec/controllers/concerns/locale_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Translation Retrieval and Rendering",
      "description": "This workflow outlines how localized strings are accessed from the translation data store and then used to render dynamic content in the application's views or within business logic.",
      "involvedComponents": [
        "I18n",
        "Translations",
        "Locale YAML Files",
        "Xikolo.config"
      ],
      "provenance": {
        "sources": [
          "app/lib/translations.rb",
          "spec/lib/translations_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Frontend Translation Export",
      "description": "This workflow details the process of compiling backend YAML translation files into a JSON format that can be consumed by the frontend JavaScript application, enabling client-side localization.",
      "involvedComponents": [
        "config/i18n.yml",
        "Xikolo.config"
      ],
      "provenance": {
        "sources": [
          "config/i18n.yml"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Admin Voucher Creation",
      "description": "Administrators create multiple vouchers through a web interface, specifying details like count, tag, associated course, and product type. ",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::BatchCreateVouchers",
        "Voucher::Voucher",
        "Course::Course"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "Shop API Voucher Creation",
      "description": "External shop systems programmatically create batches of vouchers by sending requests to the Bridge API, specifying quantity, product type, country, and tag. ",
      "involvedComponents": [
        "Bridges::Shop::VouchersController",
        "Voucher::BatchCreateVouchers",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "User Voucher Redemption",
      "description": "A logged-in user redeems a voucher code for a specific course product. The system validates the code, checks product prerequisites, and applies the voucher's benefits. ",
      "involvedComponents": [
        "Course::VoucherRedemptionsController",
        "Course::VoucherRedemptionForm",
        "Voucher::Claim",
        "Voucher::ProductTypes",
        "Course::Course",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/controllers/course/voucher_redemptions_controller.rb",
          "app/forms/course/voucher_redemption_form.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "Voucher Claimant IP Deletion",
      "description": "A daily scheduled background job automatically clears the `claimant_ip` field for vouchers that were claimed over a year ago, ensuring compliance with data privacy regulations. [Source: app/jobs/voucher/delete_claimant_ip_job.rb, spec/jobs/voucher/delete_claimant_ip_job_spec.rb]",
      "involvedComponents": [
        "Voucher::DeleteClaimantIPJob",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/jobs/voucher/delete_claimant_ip_job.rb",
          "spec/jobs/voucher/delete_claimant_ip_job_spec.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "Voucher Query and Statistics (Admin)",
      "description": "Administrators can query individual voucher details by code and view aggregated statistics about voucher usage through the admin interface. [Source: app/controllers/admin/vouchers_controller.rb]",
      "involvedComponents": [
        "Admin::VouchersController",
        "Voucher::Voucher",
        "VoucherPresenter",
        "Voucher::Stats"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "Voucher Listing (Shop API)",
      "description": "External shops can retrieve a list of existing vouchers, with options to filter by tag, claimed status, and claim date ranges, via the Bridge API. ",
      "involvedComponents": [
        "Bridges::Shop::VouchersController",
        "Voucher::Voucher"
      ],
      "provenance": {
        "sources": [
          "app/controllers/bridges/shop/vouchers_controller.rb",
          "cluster:34_ADMIN_Vouchers"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": [
          "34_ADMIN_Vouchers"
        ]
      }
    },
    {
      "workflowName": "View Platform Statistics",
      "description": "Administrators view platform-wide statistics like user counts, enrollments, and activity. The data is fetched from various microservices and cached for performance.",
      "involvedComponents": [
        "Admin::Ajax::PlatformStatisticsController",
        "account_api (Microservice)",
        "course_api (Microservice)",
        "learnanalytics_api (Microservice)",
        "Rails.cache"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/platform_statistics_controller.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "View Course Statistics",
      "description": "Administrators or course staff view detailed statistics for a specific course, including geographical data, item visits, and video statistics.",
      "involvedComponents": [
        "Admin::Ajax::DetailStatisticsController",
        "Course::Admin::StatisticsController",
        "Course::Statistics",
        "Course::EnrollmentsStatistics",
        "learnanalytics_api (Microservice)",
        "course_api (Microservice)",
        "pinboard_api (Microservice)",
        "Rails.cache",
        "Course::Visit"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/ajax/detail_statistics_controller.rb",
          "app/controllers/course/admin/statistics_controller.rb",
          "app/models/course/statistics.rb",
          "app/models/course/enrollments_statistics.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Manage Report Jobs",
      "description": "Users with appropriate permissions can view, create, restart, and delete data export report jobs through the admin interface. The frontend polls for job status updates.",
      "involvedComponents": [
        "Admin::ReportsController",
        "Admin::ReportJobPresenter",
        "Admin::ReportPresenter",
        "report-jobs.js",
        "learnanalytics_api (Microservice)",
        "course_api (Microservice)",
        "Course::Classifier",
        "lanalytics.report.admin Role"
      ],
      "provenance": {
        "sources": [
          "app/controllers/admin/reports_controller.rb",
          "app/presenters/admin/report_job_presenter.rb",
          "app/presenters/admin/report_presenter.rb",
          "app/assets/admin/reports/report-jobs.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Direct File Upload (Image/General)",
      "description": "A user selects a file (image or general document) via a form. The frontend JavaScript (Dropzone.js) intercepts the upload, uses pre-signed S3 URLs and metadata provided by the backend, and uploads the file directly to S3. The backend then receives a reference to this uploaded file (upload ID or S3 URI) for validation and final processing.",
      "involvedComponents": [
        "ImageUploadInput",
        "UploadInput",
        "image-upload.js",
        "upload.js",
        "Dropzone.js",
        "FileUpload",
        "Xikolo::S3"
      ],
      "provenance": {
        "sources": [
          "app/inputs/image_upload_input.rb",
          "app/inputs/upload_input.rb",
          "app/assets/util/forms/image-upload.js",
          "app/assets/util/forms/upload.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Existing File Display and Deletion",
      "description": "When editing a form with an existing file, the backend provides the file's URL to the frontend. The frontend JavaScript displays this file in the Dropzone preview area. Users can choose to delete the existing file, which triggers a client-side DELETE request to S3 and updates hidden form fields to signal deletion to the backend upon form submission.",
      "involvedComponents": [
        "ImageUploadInput",
        "image-upload.js",
        "Dropzone.js",
        "Xikolo::S3"
      ],
      "provenance": {
        "sources": [
          "app/inputs/image_upload_input.rb",
          "app/assets/util/forms/image-upload.js"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Asynchronous S3 File Deletion",
      "description": "After a file is no longer needed (e.g., replaced by a new upload, or associated resource deleted), the backend schedules an asynchronous job to remove the file from S3. This job uses the `xikolo-s3` gem to perform the deletion.",
      "involvedComponents": [
        "S3FileDeletionJob",
        "Xikolo::S3"
      ],
      "provenance": {
        "sources": [
          "app/jobs/s3_file_deletion_job.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Markup with Embedded File Management",
      "description": "For rich text fields containing embedded file references (e.g., images in a markdown editor), the `Xikolo::S3::TextWithUploadsProcessor` helps manage these files. It tracks changes, commits new uploads, and identifies obsolete files for deletion when the markup content is updated.",
      "involvedComponents": [
        "Xikolo::S3::TextWithUploadsProcessor",
        "Xikolo::S3",
        "S3FileDeletionJob"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Manage External User Profile",
      "description": "External applications can update certain attributes of a user's profile on the openHPI platform or initiate the deletion of a user account. User identification is based on their SAML 2.0 protocol ID.",
      "involvedComponents": [
        "Portal API Gateway",
        "Users API Resource"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Manage Course Enrollments",
      "description": "External applications can interact with user enrollments in courses. This includes retrieving a list of all courses a user is enrolled in (optionally filtered by a specific course) or creating a new enrollment for a user in a designated course.",
      "involvedComponents": [
        "Portal API Gateway",
        "Enrollments API Resource"
      ],
      "provenance": {
        "sources": [],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Displaying System Alerts to Users",
      "description": "Users visit the application and are presented with a navigation component that displays system-wide alerts. New alerts are visually highlighted, and users can interact with the component to view details and dismiss alerts, marking them as 'seen'.",
      "involvedComponents": [
        "Alert",
        "Navigation::SystemAlerts (Ruby View Component)",
        "Navigation::SystemAlerts (View Component Template)",
        "system-alerts.js",
        "_system_alerts.scss"
      ],
      "provenance": {
        "sources": [
          "app/models/alert.rb",
          "app/components/navigation/system_alerts.rb",
          "app/components/navigation/system_alerts.html.slim",
          "app/assets/components/global/system-alerts.js",
          "app/assets/stylesheets/components/_system_alerts.scss"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Administrator Management of System Alerts",
      "description": "Administrators create and manage system-wide alerts, including defining their content (with localization and Markdown support) and publication schedule. This is currently performed via the Rails console.",
      "involvedComponents": [
        "Alert",
        "Xikolo.config"
      ],
      "provenance": {
        "sources": [
          "app/models/alert.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Displaying Banners to Users",
      "description": "The application displays a single active banner, typically in a prominent location like a course list. The banner's content, image, and link are determined by the currently active banner record.",
      "involvedComponents": [
        "Banner",
        "_banners.scss"
      ],
      "provenance": {
        "sources": [
          "app/models/banner.rb",
          "app/assets/stylesheets/partials/_banners.scss"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Administrator Management of Banners",
      "description": "Administrators create new banners by providing an image URL, alternative text, and publication/expiry dates. The system handles downloading the image, uploading it to S3, creating the database record, and asynchronously deleting the S3 object when a banner is destroyed.",
      "involvedComponents": [
        "Banner",
        "banner:create",
        "Xikolo::S3",
        "S3FileDeletionJob"
      ],
      "provenance": {
        "sources": [
          "app/models/banner.rb",
          "lib/tasks/create_banner.rake"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "View Static Page",
      "description": "A user requests a static page, which is retrieved based on locale preferences, rendered from Markdown to HTML, and displayed with S3 URIs converted to public URLs. Administrators can see options to create missing pages.",
      "involvedComponents": [
        "Home::PagesController",
        "Page",
        "PagePresenter",
        "Xikolo::S3::Markup"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/pages_controller.rb",
          "app/models/page.rb",
          "spec/requests/pages/show_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Edit Static Page (Admin)",
      "description": "An administrator edits a static page. The rich text editor handles embedded file uploads to S3. Upon submission, the content and S3 files are processed, and obsolete files are scheduled for deletion.",
      "involvedComponents": [
        "PagesController",
        "Page",
        "MarkdownInput",
        "Xikolo::S3::Markup",
        "Xikolo::S3::TextWithUploadsProcessor",
        "S3FileDeletionJob",
        "initializeMarkdownEditor",
        "initMarkdownEditorOnSelector"
      ],
      "provenance": {
        "sources": [
          "app/controllers/pages_controller.rb",
          "app/models/page.rb",
          "app/inputs/markdown_input.rb",
          "app/assets/util/markdown-editor.ts",
          "spec/requests/admin/pages/edit_spec.rb"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "Create/Update Course Rich Text",
      "description": "A teacher creates or updates rich text content for a course item. The system processes the rich text, handles S3 file uploads, and conditionally schedules obsolete files for deletion, ensuring files still referenced elsewhere are preserved.",
      "involvedComponents": [
        "Course::Richtext::Store",
        "Course::Richtext",
        "Xikolo::S3::Markup",
        "Xikolo::S3::TextWithUploadsProcessor",
        "S3FileDeletionJob",
        "MarkdownInput",
        "initializeMarkdownEditor",
        "initMarkdownEditorOnSelector"
      ],
      "provenance": {
        "sources": [
          "app/operations/course/richtext/store.rb",
          "app/models/course/richtext.rb",
          "app/inputs/markdown_input.rb",
          "app/assets/util/markdown-editor.ts",
          "spec/operations/course/richtext/store_spec.rb",
          "integration/features/xikolo/content/richtexts/create_richtext_item.feature"
        ],
        "runSources": [
          "run_3"
        ],
        "enhancedBy": []
      }
    },
    {
      "workflowName": "External Referrer Tracking",
      "description": "Captures information about external websites that refer users to the platform. This data is enriched with user and context information, then asynchronously sent to an analytics service for aggregation and reporting.",
      "involvedComponents": [
        "TracksReferrers",
        "Msgr",
        "current_user",
        "Xikolo.base_url"
      ],
      "provenance": {
        "sources": [
          "app/controllers/concerns/tracks_referrers.rb",
          "spec/requests/tracking/referrer_spec.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    {
      "workflowName": "Safe External Redirect",
      "description": "Manages redirects to external URLs, ensuring the target link is valid and providing an optional interstitial notice page to inform users before redirection, mitigating open redirect vulnerabilities.",
      "involvedComponents": [
        "Home::GoController",
        "RedirectURL",
        "Xikolo::Common::Tracking::ExternalLink"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "lib/redirect_url.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    {
      "workflowName": "Course/Item/Pinboard Deep Linking",
      "description": "Provides dedicated endpoints for direct navigation to specific courses, items, or pinboard entries within the platform. It involves fetching necessary resource details from respective microservices.",
      "involvedComponents": [
        "Home::GoController",
        "Xikolo.api(:course)",
        "Xikolo.api(:pinboard)"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    {
      "workflowName": "LimeSurvey Integration",
      "description": "Facilitates redirecting users to an external LimeSurvey instance for surveys. It carefully manages query parameters, sanitizing sensitive tracking data, adding required survey parameters, and including a hashed user identifier for authenticated users.",
      "involvedComponents": [
        "Home::GoController",
        "Xikolo.config.limesurvey_url",
        "Xikolo.config.brand",
        "current_user",
        "Digest::SHA256",
        "Addressable::URI"
      ],
      "provenance": {
        "sources": [
          "app/controllers/home/go_controller.rb",
          "spec/requests/go/survey_spec.rb",
          "cluster:22_COMM_ReferralTracking"
        ],
        "runSources": [],
        "enhancedBy": [
          "22_COMM_ReferralTracking"
        ]
      }
    },
    {
      "workflowName": "Cookie Consent Decision",
      "description": "A user encounters a cookie consent banner, makes a decision (accept or decline), and their preference is stored, preventing the banner from reappearing for that specific consent.",
      "involvedComponents": [
        "Global::CookieConsentBanner",
        "CookieConsentController",
        "ConsentCookie"
      ],
      "provenance": {
        "sources": [
          "app/components/global/cookie_consent_banner.html.slim",
          "app/components/global/cookie_consent_banner.rb",
          "app/controllers/cookie_consent_controller.rb",
          "spec/lib/consent_cookie_spec.rb",
          "spec/requests/cookie_consent/create_spec.rb",
          "integration/features/xikolo/global/cookie_consents.feature",
          "integration/features/steps/global/cookie_consents.rb",
          "cluster:50_SEC_CookieConsent"
        ],
        "runSources": [],
        "enhancedBy": [
          "50_SEC_CookieConsent"
        ]
      }
    }
  ]
}