Consolidate homework answer encryption on the shared package
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend, security, testing-qa
Hướng nghiên cứu
Start with the import and patch-target inventory, then compare courses/homework_answer_crypto.py with community_base.coursework.answer_crypto at v0.5.10. Review courses/homework_answer_checks.py, courses/homework_answer_resolution.py, and their tests, including the deterministic envelope vector. Done means the duplicate is removed, callers share the package classes, focused tests and the documented selective verification pass, and crypto and scoring behavior remain unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Consolidate homework answer encryption on the shared package
Status: pending
Tags: courses, security, enhancement, P1
Depends on: None
Blocks: —
Reporter context
The owner asks to unify and simplify community-base, AISL and DTC while preserving every feature and the current UX, with no visible UI changes. Use focused changes in an isolated DTC worktree because shared checkouts have other owners. The cross-repository inventory identified the 490-line courses/homework_answer_crypto.py as a duplicate of the shared answer-crypto owner already present in DTC's pinned community-base release.
Normative references
_docs/specs/04-courses-and-cohorts.md, especially preserved learner homework behavior and the rule to characterize scoring behavior before deduplication._docs/specs/07-security-privacy-operations.mdfor bounded failures and privacy._docs/architecture/app-boundaries.mdandAGENTS.mdfor direct domain ownership and the prohibition on legacy runtime shims._docs/ci/change-selective-ci.mdand_docs/specs/10-verification-strategy.mdfor versioned, change-selective verification.community-basev0.5.10community_base.coursework.answer_cryptofor the existing implementation contract.
Scope
Delete the duplicated courses/homework_answer_crypto.py implementation. Retarget all proven live and test imports directly to community_base.coursework.answer_crypto, including courses/homework_answer_checks.py, courses/homework_answer_resolution.py, and their tests. The existing DTC pyproject.toml and uv.lock pin community-base to v0.5.10, whose crypto module has the same implementation plus validate_source_envelope; this issue needs no package release or dependency bump. Before deleting, inventory all repository Python import forms, aliases, test imports, patch targets, and literal/dynamic references, then repeat the check on the final diff. Do not leave a compatibility facade or copy classes/exceptions locally.
Keep the DTC keyring configuration lookup, answer-resolution boundary, source option-ID mapping, free-form answer conversion, answer-check handling, homework models, and persisted envelopes in place. Preserve exact object identity for HomeworkAnswerKeyring, HomeworkAnswerCryptoError and its validation, unavailable-key, and decryption subclasses across every remaining caller. Change the deterministic test patch from the deleted site's secrets.token_bytes path to the shared module's path; keep its known AES-GCM/HKDF envelope vector meaningful. Existing encrypted answers must decrypt with the shared implementation, and newly encrypted answers must remain compatible with the prior implementation.
Characterize and preserve strict keyring parsing and rotation, canonical authenticated context, scalar and choice payloads, envelope validation and size bounds, malformed/tampered ciphertext failures, unknown key IDs, context mismatch, redacted error text, and failure handling in scoring. Do not compare independently randomized ciphertext for equality. If the existing tests leave a specific behavior gap, add one authoritative behavior test before changing the import owner and prove it passes before and after.
Non-goals
- No visible UI, template, route, API, access, scoring-policy, feature, or schema change.
- No model migration, stored-data rewrite, keyring configuration change, or new crypto algorithm/version.
- No package-code change, new abstraction, legacy runtime shim, or unrelated dependency pin update.
- No shared-main edit, commit, merge, push, or pull request in this grooming/implementation-review stage.
Acceptance criteria
- A final-revision caller inventory covers all three Python import forms, aliases, tests, scripts, patch targets, and dynamic references; no use of the deleted site module remains.
-
courses/homework_answer_crypto.pyis deleted, all callers use the package owner directly, and the report measures actual net application lines removed separately from tests or moved code. - Class and exception identity is single-owner: DTC resolution/checks and package encrypt/decrypt paths use the same
HomeworkAnswerKeyringand crypto exception classes. - Existing and new scalar/choice envelopes interoperate across old and shared implementations; the deterministic envelope vector, key rotation, malformed/oversized envelope rejection, unknown-key behavior, authenticated-context mismatch, and tamper failures retain their exact contract.
- DTC's configured keyring source, answer-resolution mapping, scoring behavior and safe failure handling stay unchanged; no secret or answer value is added to logs or error output.
- The authoritative crypto and answer-resolution tests pass before and after; the old
secrets.token_bytespatch is retargeted to the shared owner without weakening the vector assertion. - No page, API, template, route, model, migration, stored envelope, feature, or visible UX changes.
-
make lint,make lint-advisory, focused tests, and the versioned_docs/ci/change-selective-ci.mdverification plan pass. Engineer and Tester report exact base/head, graph and plan digests, every component'srerun/reused/skipped/not_applicabledisposition, exact commands/counts, and the graph-selected backend browser tier (smoke when the focused backend profile applies); any full-profile fallback follows the plan. - Independent Tester verifies the uncommitted isolated worktree and records screenshot evidence as
not_applicableif the graph confirms no render impact. Shared main remains untouched; no commit, merge, push, or PR occurs before the owner-authorized handoff.
Browser regression scenario
Scenario: learner submits source-managed homework with an encrypted answer
Given: an enrolled learner sees a homework question whose answer is stored as an encrypted source envelope
When: the learner submits an answer through the existing homework flow
Then: the response and score follow the same existing policy, and the learner sees no plaintext source answer, key detail, or new error message
The cryptographic boundary cases belong in focused unit/service tests. This backend-only ownership change introduces no new page or browser behavior.
Repository and operations scenarios
- A previously stored envelope decrypts with the shared owner using the existing configured keyring and the exact course/homework/question context.
- An envelope with a wrong context, unavailable key, malformed fields, or tampered ciphertext fails in the same bounded class and does not leak its secret input.
Blocked by: (none)
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataTalksClub/website
-
bug infra operations P1 testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DataTalksClub/website#329 ·
-
bug content data-migration documentation events operations P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
DataTalksClub/website#327 ·
-
bug frontend P0 testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
DataTalksClub/website#300 · 7 bình luận ·
-
bug data-migration events P0 testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DataTalksClub/website#295 · 6 bình luận ·
-
admin courses data-migration email enhancement integration operations P1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DataTalksClub/website#468 · 6 bình luận ·
Tất cả issue của DataTalksClub/website
Issue tương tự
-
Edit tool converts CRLF files to LFCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
huggingface/tau#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
show ignores the row limit when a column or table name contains "limit"Có thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Agents panel: Codex token stats always empty because Codex now writes `*.jsonl.zst` sessionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
eclipse-score/inc_someip_gateway#356 ·
Maintainer thường phản hồi trong vòng 2 ngày