Adds Learn AI tutor as a feedback source - #2698
rachellougee wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Downstream facts currently drop or incompletely resolve Learn AI records, and the selected business key is not migration-stable.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Learn AI tutor messages as a second feedback source in the dbt pipeline.
Changes:
- Adds and documents the Learn AI feedback adapter.
- Unions tutor messages with Zendesk feedback.
- Adds cross-database support for nullable varchar arrays.
File summaries
| File | Description |
|---|---|
src/ol_dbt/seeds/feedback_sources.csv |
Registers Learn AI Tutor. |
src/ol_dbt/models/intermediate/feedback/int__feedback__unioned.sql |
Adds tutor feedback to the common stream. |
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql |
Maps chatbot messages to the feedback contract. |
src/ol_dbt/models/intermediate/feedback/_feedback_models.yml |
Documents and tests the new model. |
src/ol_dbt/macros/cross_db_functions.sql |
Adds portable nullable varchar-array casts. |
Review details
Suppressed comments (4)
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:33
- This uses the Postgres row PK as the feedback business key, but the feedback contract explicitly specifies Learn AI's stable
checkpoint_id. Becausefeedback_pkis derived from this value, a later source swap/backfill will mint different keys for the same turns. Select and usecheckpoint_idhere (including any namespace/thread qualification needed by its uniqueness contract), and retaindjangocheckpoint_idonly as an ordering tie-breaker.
, cast(human_turns.djangocheckpoint_id as varchar) as source_record_ref
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:48
CanvasSyllabusBotis a documented value emitted byint__learn_ai__chatbot(_learn_ai__models.yml.yml:64-66), but it falls through this case to null. Sincetfact_feedback.subject_typehas anot_nulltest, any such conversation will fail the downstream build. Map it to the samecoursesubject type asSyllabusBot.
, case human_turns.chatsession_agent
when 'TutorBot' then 'courseware_block'
when 'VideoGPTBot' then 'courseware_block'
when 'SyllabusBot' then 'course'
when 'ResourceRecommendationBot' then 'resource'
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:39
- This correctly emits a global user ID, but
tfact_feedbackcurrently resolves everysubject_user_refonly againstlower(dim_user.email)(tfact_feedback.sql:74-75). Authenticated Learn AI turns will therefore get a nulluser_fkunless the UUID happens to equal an email. Add source-aware identity resolution againstdim_user.user_global_id, including the incremental re-key comparison.
, human_turns.user_global_id as subject_user_ref
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:43
- The seed marks this source as course-scoped and this adapter emits a course-run ID, but
platformis always null andtfact_feedbackstill hardcodes bothcourserun_fkandplatform_fkto null (tfact_feedback.sql:43-46). Consequently these rows cannot support the instructor/course filtering this source is meant to add. Populate the platform and resolve the conformed course/platform FKs downstream.
, human_turns.courserun_readable_id
, cast(null as varchar) as platform
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔎 ol-dbt impact — column-level blast radius0 breaking, 0 surrogate-key regeneration, 1 warning, 1 info across 2 changed model(s). Details
Posted by |
What are the relevant tickets?
#2534
Description (What does it do?)
Adds Learn AI tutor as a second source of the feedback system, so it flows through the rest of the feedback pipeline
int__feedback__learn_ai_tutorint__feedback__unionedHow can this be tested?
Run
dbt build --target dev_production --select int__feedback__learn_ai_tutor int__feedback__unionedAdditional Context