-
Notifications
You must be signed in to change notification settings - Fork 1
feat(api): collect AI shown/hidden flag for cases and fix assign cases shell script #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces tracking of whether an AI-generated score was shown to users and refines the case-assignment shell script, alongside applying Black formatting rules across the codebase.
- Add
ai_score_shownhandling in the answer service and model - Enhance
generate_config.shfor interactive password entry and per-user loops - Update Black configuration and reformat imports/signatures project-wide
Reviewed Changes
Copilot reviewed 20 out of 66 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/configration/utils/answer_config_validations/multiple_choice.py | Reformatted import block |
| src/configration/service/answer_config_service.py | Reformatted import block |
| src/configration/controller/answer_config_controller.py | Reformatted _needs_attention_check signature |
| src/common/service/email_service.py | Reformatted import block |
| src/common/exception/exception_handlers.py | Reformatted import block |
| src/common/exception/BusinessException.py | Reformatted enum formatting |
| src/cases/service/case_service.py | Reformatted chained calls and imports |
| src/cases/repository/visit_occurrence_repository.py | Reformatted import |
| src/cases/repository/measurement_repository.py | Reformatted import |
| src/cases/controller/case_controller.py | Reformatted imports |
| src/answer/service/answer_service.py | Added ai_shown flag extraction and passing to repository |
| src/answer/model/answer.py | Added ai_score_shown column to Answer model |
| src/answer/controller/answer_controller.py | Reformatted imports |
| src/analytics/service/analytics_service.py | Reformatted record_metrics signature |
| src/analytics/repository/analytics_repository.py | Cleaned up extra blank line |
| src/analytics/model/analytics.py | Reformatted timestamp columns |
| src/analytics/controller/analytics_controller.py | Reformatted imports and error-message punctuation |
| script/assign_cases/generate_config.sh | Switched to bash, interactive password prompt, per-user loop |
| pyproject.toml | Set Black line-length and target-version |
| README.md | Added Black and migration guidance |
Comments suppressed due to low confidence (1)
src/answer/service/answer_service.py:31
- The new
ai_score_shownbehavior isn’t covered by existing tests. Consider adding unit tests to verify that this flag is correctly extracted, stored, and retrieved.
ai_shown = data.get("aiScoreShown", False)
|
|
||
| configuration = self.configuration_repository.get_configuration_by_id(task_id) | ||
|
|
||
| if not configuration or configuration.user_email != user_eamil: |
Copilot
AI
Jun 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the variable name user_eamil. It should be user_email to match the existing variable.
| if not configuration or configuration.user_email != user_eamil: | |
| if not configuration or configuration.user_email != user_email: |
| @@ -1,4 +1,4 @@ | |||
| #!/usr/bin/env sh | |||
| #!/usr/bin/env bash | |||
Copilot
AI
Jun 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding set -euo pipefail immediately after the shebang to ensure the script exits on errors, treats unset variables as errors, and fails on pipeline errors.
SUMMARY
This PR collects AI flag for each case and assign cases to all participants in the study. It also fixes
Blackformatter rules and reformatted all Python files in the project.Pre-merge author checklist