You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retire duplicate homework answer checks using the pinned shared package
Status: blocked; isolated candidate frozen and uncommitted
Tags: courses, enhancement, P1
Depends on: #438 development deployment recovery through #440 (operational hold). #438 code is merged at f143a19b7d5ef7b713c7b8139d01619f333961b6; the accepted source is the implementation base, but the failed development deploy remains unresolved.
Blocks: —
Reporter context
The owner wants DTC, AISL, and community-base course code simplified without changing any feature or visible UX. The retirement inventory named DTC homework checking and scoring as a candidate, but a candidate is not approval to replace scoring orchestration or to bypass the larger cohort adoption in #55.
Normative references
_docs/specs/04-courses-and-cohorts.md, especially the preserved homework/question/answer/scoring contract and its characterization requirement.
_docs/specs/07-security-privacy-operations.md for bounded answer failures and redaction.
_docs/architecture/app-boundaries.md and AGENTS.md for one domain owner and no legacy runtime shim.
_docs/ci/change-selective-ci.md and _docs/specs/10-verification-strategy.md for versioned verification.
community-base v0.5.10, community_base.coursework.answer_checks, the public owner already in DTC's pin.
With #438 merged at f143a19b7d5ef7b713c7b8139d01619f333961b6 as the implementation base, remove the duplicate courses/homework_answer_checks.py module and retarget its production and test imports directly to community_base.coursework.answer_checks. Production importers are courses/homework_score_calculation.py (is_answer_correct) and courses/views/homework_answers.py (is_free_form_answer_correct); verify the complete caller set on the implementation revision, including all Python import forms, aliases, tests, patch targets, and dynamic strings. Do not leave a compatibility facade or copy the checks into another site file.
The v0.5.10 shared module has the same answer and question type values and checking rules as the site duplicate. Its Question and Answer annotations do not enforce model identity at runtime; its checks use the existing DTC question/answer attributes and methods. DTC already installs community_base.coursework. Characterize this interoperability on actual DTC model instances before deleting the duplicate. Preserve the exact HomeworkAnswerCryptoError identity established by #438 and the current Question.get_correct_answer() resolution and configuration path.
Keep courses/homework_score_calculation.py as DTC's scoring owner. Its FAQ and learning-in-public components, persistence, observability, invalidation and transaction behavior are outside this slice. Retargeting its answer-check import does not adopt package scoring.py. Report actual net application lines deleted separately from changed test imports; the 145-line site check module is a gross candidate, not a promised net reduction.
Behavior to preserve
ANY answer handling, free-form trimming, case-insensitive exact and contains checks, integer parsing, and the existing 0.01 default float tolerance.
Multiple-choice and checkbox answer indexing, comma splitting, blank answers, malformed numeric input behavior, and unknown answer/question type behavior.
The precise crypto failure boundary: is_answer_correct converts HomeworkAnswerCryptoError to False, while other exceptions keep their existing behavior. Never reveal source answers, key material or ciphertext in errors or logs.
Keep the shared DTC main and other agents' work untouched. Use an isolated issue worktree; no merge, push or PR during review.
Acceptance criteria
A pre-deletion and final-revision caller inventory covers direct, parent-package and dotted imports, aliases and attributes, tests, scripts, patch targets and dynamic references; no use of the deleted site module remains.
courses/homework_answer_checks.py is deleted and every caller uses the v0.5.10 public package owner directly, with no facade or second implementation; actual net application lines deleted are reported separately from test changes.
Shared checks operate on DTC Question and Answer instances with the same AnswerTypes and QuestionTypes values, answer resolution/configuration, and exact shared crypto exception identity established by Consolidate homework answer encryption on the shared package #438.
Existing tests characterize and preserve correct/incorrect ANY, exact, contains, float, integer, multiple-choice, checkbox, blank, malformed and unknown-type outcomes, including score values and safe crypto failure. Add a focused behavior test before deletion only for a material uncovered boundary.
DTC FAQ and learning-in-public score components, persistence, observability, invalidation, scoring errors, timestamps and grading UX remain unchanged; no package scoring orchestration is adopted.
No package pin, model, migration, template, route, API, permission, stored answer or visible page change occurs.
Focused answer-check, answer-resolution, crypto, homework-scoring and rendered-answer tests pass before and after. uv run --frozen python scripts/ci.py lint and the versioned _docs/ci/change-selective-ci.md verification plan, run, evidence-check and report-check pass; execute the graph-selected scripts/ci.py quality contract (including verification-quality when required by the plan) with exact base/head, graph and plan digests and every component disposition recorded by Engineer and independent Tester. Use the graph-selected backend browser tier; any fallback follows the plan.
Independent Tester verifies the uncommitted isolated diff, including a repository-wide import check and screenshot evidence classified as not_applicable only if the graph confirms no render impact. PM accepts afterward. No commit, merge, push or PR occurs before the approved handoff.
Browser regression scenario
Learner submits and reviews graded homework
Given an enrolled learner has an existing homework containing free-form and choice questions, including a source-managed encrypted correct answer,
when the learner submits answers and later views the scored homework,
then answer correctness, question/FAQ/learning-in-public components, total score, feedback and safe answer visibility match the current site. The backend ownership change introduces no new page or browser behavior.
Repository and operations scenarios
An answer whose stored encrypted source value cannot be resolved produces the same safe false correctness result through the shared crypto exception class.
A malformed numeric choice retains the existing failure boundary; the refactor does not silently turn it into an incorrect-answer result.
Blocked by: #438 development deployment failure; #440 owns recovery. The #439 isolated candidate remains frozen, uncommitted, unmerged and unpushed pending that result.
Retire duplicate homework answer checks using the pinned shared package
Status: blocked; isolated candidate frozen and uncommitted
Tags:
courses,enhancement,P1Depends on: #438 development deployment recovery through #440 (operational hold). #438 code is merged at
f143a19b7d5ef7b713c7b8139d01619f333961b6; the accepted source is the implementation base, but the failed development deploy remains unresolved.Blocks: —
Reporter context
The owner wants DTC, AISL, and
community-basecourse code simplified without changing any feature or visible UX. The retirement inventory named DTC homework checking and scoring as a candidate, but a candidate is not approval to replace scoring orchestration or to bypass the larger cohort adoption in #55.Normative references
_docs/specs/04-courses-and-cohorts.md, especially the preserved homework/question/answer/scoring contract and its characterization requirement._docs/specs/07-security-privacy-operations.mdfor bounded answer failures and redaction._docs/architecture/app-boundaries.mdandAGENTS.mdfor one domain owner and no legacy runtime shim._docs/ci/change-selective-ci.mdand_docs/specs/10-verification-strategy.mdfor versioned verification.community-basev0.5.10,community_base.coursework.answer_checks, the public owner already in DTC's pin.docs/plan/evidence/code-retirement-inventory-2026-09-29.md, ranked bundle 8.Scope
With #438 merged at
f143a19b7d5ef7b713c7b8139d01619f333961b6as the implementation base, remove the duplicatecourses/homework_answer_checks.pymodule and retarget its production and test imports directly tocommunity_base.coursework.answer_checks. Production importers arecourses/homework_score_calculation.py(is_answer_correct) andcourses/views/homework_answers.py(is_free_form_answer_correct); verify the complete caller set on the implementation revision, including all Python import forms, aliases, tests, patch targets, and dynamic strings. Do not leave a compatibility facade or copy the checks into another site file.The v0.5.10 shared module has the same answer and question type values and checking rules as the site duplicate. Its
QuestionandAnswerannotations do not enforce model identity at runtime; its checks use the existing DTC question/answer attributes and methods. DTC already installscommunity_base.coursework. Characterize this interoperability on actual DTC model instances before deleting the duplicate. Preserve the exactHomeworkAnswerCryptoErroridentity established by #438 and the currentQuestion.get_correct_answer()resolution and configuration path.Keep
courses/homework_score_calculation.pyas DTC's scoring owner. Its FAQ and learning-in-public components, persistence, observability, invalidation and transaction behavior are outside this slice. Retargeting its answer-check import does not adopt packagescoring.py. Report actual net application lines deleted separately from changed test imports; the 145-line site check module is a gross candidate, not a promised net reduction.Behavior to preserve
ANYanswer handling, free-form trimming, case-insensitive exact and contains checks, integer parsing, and the existing 0.01 default float tolerance.is_answer_correctconvertsHomeworkAnswerCryptoErrortoFalse, while other exceptions keep their existing behavior. Never reveal source answers, key material or ciphertext in errors or logs.Non-goals and dependency boundary
courses/homework_score_calculation.pyor homework batch scoring with package scoring. Preserve cohort homework, answer, submission, scoring, and statistics behavior #55 remains the dependency-blocked domain adoption owner for that larger transition; this issue does not satisfy or bypass its prerequisites Migrate edition-like Course records to reusable Course → Cohort #51, Replace global course staff access and plaintext API tokens with scoped capabilities #52, Add Course/Cohort lifecycle, public routes, and complete cohort duplication #53 and Preserve cohort learner preferences, progress, dashboard, and calendar behavior #244.f143a19b7d5ef7b713c7b8139d01619f333961b6, but its development deployment failed. Add a guarded development website schema rebuild and redeploy #440 owns the bounded recovery. Keep this candidate frozen and uncommitted until that operational hold clears. Do not edit or reuse Consolidate homework answer encryption on the shared package #438's frozen verification worktree. Its shared crypto exception identity is part of this contract.mainand other agents' work untouched. Use an isolated issue worktree; no merge, push or PR during review.Acceptance criteria
courses/homework_answer_checks.pyis deleted and every caller uses the v0.5.10 public package owner directly, with no facade or second implementation; actual net application lines deleted are reported separately from test changes.QuestionandAnswerinstances with the sameAnswerTypesandQuestionTypesvalues, answer resolution/configuration, and exact shared crypto exception identity established by Consolidate homework answer encryption on the shared package #438.ANY, exact, contains, float, integer, multiple-choice, checkbox, blank, malformed and unknown-type outcomes, including score values and safe crypto failure. Add a focused behavior test before deletion only for a material uncovered boundary.uv run --frozen python scripts/ci.py lintand the versioned_docs/ci/change-selective-ci.mdverification plan, run, evidence-check and report-check pass; execute the graph-selectedscripts/ci.pyquality contract (includingverification-qualitywhen required by the plan) with exact base/head, graph and plan digests and every component disposition recorded by Engineer and independent Tester. Use the graph-selected backend browser tier; any fallback follows the plan.not_applicableonly if the graph confirms no render impact. PM accepts afterward. No commit, merge, push or PR occurs before the approved handoff.Browser regression scenario
Learner submits and reviews graded homework
Given an enrolled learner has an existing homework containing free-form and choice questions, including a source-managed encrypted correct answer,
when the learner submits answers and later views the scored homework,
then answer correctness, question/FAQ/learning-in-public components, total score, feedback and safe answer visibility match the current site. The backend ownership change introduces no new page or browser behavior.
Repository and operations scenarios
Blocked by: #438 development deployment failure; #440 owns recovery. The #439 isolated candidate remains frozen, uncommitted, unmerged and unpushed pending that result.