Consolidate review-criteria validation while preserving migration identity
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, databases, testing-qa
Direzione di ricerca
Read AGENTS.md, _docs/PROCESS.md, courses/validators/criteria_validators.py, ReviewCriteria.options, CriteriaForm.clean_options, and courses/migrations/0001_initial.py. Run the authoritative characterization and focused validator, admin, migration, and adoption tests before and after the delegation. Done means the exact validation behavior, Django callable identity, migration behavior, and required metadata gates remain unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Goal
Consolidate review-criteria validation into the existing released community_base.coursework.validators owner while preserving every current DTC validation result, admin behavior and Django migration identity. This backend refactor has no visible UI or feature changes.
Read first
AGENTS.md,_docs/PROCESS.md, current protectedcoding-standard.md._docs/specs/04-courses-and-cohorts.md(adoption baseline and review criteria),_docs/specs/10-verification-strategy.md._docs/architecture/app-boundaries.md,_docs/ci/change-selective-ci.md.courses/validators/criteria_validators.py; projectReviewCriteria.options; adminCriteriaForm.clean_options; historicalcourses/migrations/0001_initial.py.- Existing unit-criteria/admin-form tests,
ci/tests/test_adoption_gate_coverage.py, and the reviewed Gate B seal contract.
Audited base: 106c777d2cd39666afb5f0990c7301fe5ad418c3. Immutable installed package: v0.5.10 at 4c692db461f4c7cbbc2f60afaa05162987a640f6. Before source assignment, the orchestrator confirms the actual committed integration base and coordinates the specific metadata entries below. Cached origin/main is not a fresh remote claim.
Framework entry-point disposition
Historical migration 0001_initial.py serializes courses.validators.criteria_validators.validate_review_criteria_options; the current model field uses that callable. A bare package re-export changes its serialized module identity. Retain precisely this named site function, with a historical Django serialization explanation and direct delegation to the package module. It owns only the stable framework callable identity. All list/dict/key/type/content validation belongs to the released package. No compatibility domain translation, alternate policy, fallback, duplicated helpers or exception conversion is permitted. Do not retain the six local policy helpers, rewrite old migrations or add a field-validator migration.
This necessary framework serialization boundary is consistent with the coding standard's framework constraints and one-rule/one-owner requirement. It does not authorize general legacy runtime shims prohibited by AGENTS. If actual characterization shows that direct delegation cannot preserve behavior or identity, stop and return the concrete conflict to PM.
Exact write scope
courses/validators/criteria_validators.py: replace the duplicated policy with the same-name framework entry point and direct public package module import only.- New
courses/tests/test_review_criteria_validator_contract.py: cohesive owning behavior/serialization contract, at most 300 lines and functions at most 30 lines. No ternaries. scripts/ci.py: add exactlycourses/validators/criteria_validators.pyandcourses/tests/test_review_criteria_validator_contract.pytoADOPTION_INTEGRATION_PYTHON.pyproject.toml: add exactlycourses.validators.criteria_validatorsandcourses.tests.test_review_criteria_validator_contractto the existing strictignore_errors = falsemodule list.ci/adoption_baseline.txt: remove onlycourses/validators/criteria_validators.py, which is now strictly opted in. The coverage gate forbids the same file appearing in both lists. No new exclusions or baseline exemptions.core/tests/test_deployment_workflow.py: only the final reviewedSTUDIO_COURSES_PYPROJECT_SHA256value and an issue-454 configuration-only history annotation. All seal assertions, negative controls and other seals remain unchanged.
The existing oversized registry and seal file receive only these literal metadata changes: their canonical tool ownership makes arbitrary splitting inappropriate here. This documented tool/cohesion exception permits no function growth or broader file edits. The validator and new test meet normal 300/30 limits.
Project models, course admin, existing tests, migration files, package source, dependency pins, uv.lock, graph/policy, selectors and commands are not write owners. Preserve all shared coding-wave and unrelated dirty work. Existing metadata candidates, especially #453, must be composed as separate exact entries on the assigned base; never replace a foreign file or seal from an older copy. No active validator/test-path claim was established by the bounded status scan; absence of dirtiness does not release any lease.
Dependencies and assignment
No new package release, model adoption or #453 behavior prerequisite is needed. Actual source assignment requires an isolated worktree, an exact committed base and allocation of the six named paths/metadata slices by the orchestrator. Shared gate metadata conflicts are resolved through ordinary integration, not by changing another candidate. Held #439/#55 and protected #425/coding-wave work remain separate.
Acceptance criteria
- Before replacing policy, run authoritative characterization against the unchanged site callable on the assigned base, then run the identical expectations after delegation. Preserve
Nonereturn for success and no input mutation. - Preserve complete ValidationError messages,
message/messages, codes and params, including the non-list type interpolation. Error codes currently default toNone; no new codes or wrapping. - Preserve list/nonempty -> option dictionary -> required
criteriathenscore-> criteria string then score integer -> nonblank criteria ordering, including first invalid option and multi-defect precedence. No error aggregation or reordered checks. - Preserve extra-key allowance, original whitespace/content, zero/negative/arbitrary integer scores and current boolean acceptance (
boolis anint). Reject non-list containers, empty lists, non-dictionary entries, missing keys, non-string criteria, non-integer scores, empty and whitespace-only text with the exact current errors. - Prove the real model field and admin valid/save/invalid behavior remain unchanged with synthetic data. Existing
test_unit_criteria_validationandtest_admin_criteria_formpass. - Prove
__module__/__qualname__andMigrationWriter.serializeretain the exact historical site import/function path. The live model field validator and historical migration validator refer to the same site function. Migration drift is empty; replay the unchanged migrations on a fresh synthetic database through the native migration gate. - Include a meaningful negative control showing that the package callable alone serializes to a different package path and therefore fails the site identity assertion; do not alter historical migrations. Include one behavior-owning mutation (for example accepting an empty list or bypassing delegation), show the owning test fails for the intended assertion, and restore exact final bytes.
- Inventory all tracked imports, functional/dynamic/patch targets before and after. Remove local policy helpers only after confirming no external helper callers. No fallback or duplicated policy remains.
- Both touched Python modules receive actual Ruff/format and strict mypy coverage. Native adoption coverage passes; the reviewed Gate B contract and synthetic unreviewed pyproject drift rejection pass. Pins, lock, other seals and gate assertions remain unchanged.
- Engineer generates the actual versioned diff-derived graph/plan, runs every normally required component, and validates evidence and final report. Root configuration touches may select full verification; do not override or narrow it. Bind base, source manifest, graph/plan/environment hashes and all four disposition buckets. Preserve failed attempts honestly.
- Independent Tester recomputes the plan, verifies every criterion, runs required focused Django/admin/migration and selected browser gates, and reports no required skip/pending evidence. Final PM accepts afterward; no source commit before both gates.
- Report actual production and whole-repository deltas separately. The earlier approximately 67-line production deletion is an estimate, not a required exact result or executed proof.
Verification scenarios
Use uv and the assigned frozen immutable package environment. Focused Django labels include courses.tests.test_review_criteria_validator_contract, courses.tests.test_unit_criteria_validation and courses.tests.test_admin_criteria_form. Run uv run --frozen python scripts/ci.py migrations-check and test-migrations on disposable synthetic databases; use the normal verification-plan, verification-run, verification-evidence-check and verification-report-check pipeline. Run the owning native Gate B and adoption coverage tests without modifying their assertions. Exact selected commands/dispositions come from the actual candidate plan.
Browser: no route, template, form declaration, permission, copy or rendered markup changes. The tester runs the graph-selected backend smoke tier; render screenshots are not applicable only if the actual graph confirms no render impact. Existing valid criteria can still be saved and invalid criteria show the same errors. A graph-selected render requirement cannot be waived here.
Non-goals and retained gates
No policy tightening, bool rejection, score bounds, schema/model/migration changes, old migration edits, package bump/adoption, UI redesign, fallback, facade, deployment/reset, production data or cloud/provider access. No changes to #453, #439/#55 or broader course unification. Fresh site CI/development deployment and any later adoption/release gates remain their owners' responsibility; local tests do not prove those outcomes.
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataTalksClub/website
-
bug infra operations P1 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DataTalksClub/website#329 ·
-
bug content data-migration documentation events operations P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
DataTalksClub/website#327 ·
-
bug frontend P0 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
DataTalksClub/website#300 · 7 commenti ·
-
bug data-migration events P0 testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DataTalksClub/website#295 · 6 commenti ·
-
courses enhancement P2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
DataTalksClub/website#455 · 6 commenti ·
Tutte le issue di DataTalksClub/website
Issue simili
-
needs-human needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#2400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reusedForse già presa @sylvesterkaczmarek l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google-deepmind/bsuite#56 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
LearningCircuit/local-deep-research#7206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chingu-voyages/V62-tier3-team-33#285 ·
I maintainer di solito rispondono entro 1 giorno