Bỏ qua, tới nội dung chính

Kiến trúc · ADR 0061

Showcase projects and course materials

Trạng thái
accepted
Ngày
2026-11-24
Người quyết định
SmartLearn team (#179)

Context

The showcase courses need a project to submit and materials to download. A project is a SUBMISSION quiz with one CODE question answered by a ZIP. The grading job for a ZIP carries spec.testCases: []: the worker scores each rubric criterion with its engine and never runs test cases for a ZIP. Uploaded documents live in Cloudinary or on the API's local disk, and the seed runs at boot inside packages/database, with no Cloudinary client.

Decision

  • One project per course (all six teach code, the cryptography course included), keyed by course slug + project key, inserted published and approved like the wizard's output.
  • Rubric types that tell the truth for a ZIP: STATIC_CHECK on the deterministic engines (BUILD_ARTIFACT_PROBE, UNIVERSAL_STATIC with the project's static patterns), AI_REVIEW for correctness and code quality (the ADR-0054 button proposes these), MANUAL_INSTRUCTOR for the written part. No AUTOMATED_TEST: it would read "điểm theo tỉ lệ test" with no test behind it.
  • Superseded by ADR-0062 for correctness: each project's correctness criterion is now AUTOMATED_TEST, scored by the pass ratio of its public and hidden cases run on the single-file entry point (codeSpec.entryPoint, timeoutMs 5000); AI_REVIEW keeps code quality, and re-saving the rubric keeps AUTOMATED_TEST and STATIC_CHECK instead of demoting them to HYBRID.
  • Test cases are stdin/stdout, public and hidden, in testCases and codeSpec; the student paper shows the public ones, the AI review prompt redacts hidden ones and the reference solution. Each reference solution passes its suite on the worker's own multi-language runner (checked when the pack changes).
  • Materials are self-built PDFs (tools/showcase-materials/), shipped as base64 in the pack. The seed inserts a LOCAL Document row once; ShowcaseMaterialsService writes the bytes into the local document store on every boot (same switch), because a container disk does not survive a redeploy. Status stays UPLOADED: not ingested for retrieval.

Consequences

  • Hidden tests are a contract for the reviewer, not an executed suite, until ZIP grading runs test cases; that is a grader change, not a pack change.
  • When the AI provider is configured, the worker's UNIVERSAL_STATIC score is the model's judgment informed by the static scan; without it, the scan ratio.
  • An AI review on a showcase submission is charged to the passwordless owner's free monthly instructor uses (200 by default); none left and no points means a FAILED proposal with BUDGET_EXHAUSTED, nothing charged.