problem-bank/ is the source of truth. Add the same id, in bank order, to
problems.json, judges.json, and variants.json; then regenerate the
candidate pages, judges, private server data, page map, and cards:
python3 scripts/gen-problems.py
python3 scripts/gen-problem-cards.py
python3 scripts/gen-problems.py --check
python3 scripts/gen-problem-cards.py --checkEvery problem needs difficulty, topics, constraints, starter code, and private
summary, optimal, and pitfalls fields. The generator keeps those fields
on the server; never copy them into the browser payload.
A judge has executable cases, and a variant supplies the candidate-facing
scenario, renamed entry point or class name, examples, clarifications,
follow-ups, and hints. Class judges omit C because its harness supports only
function exercises.
An imported LeetCode exercise keeps title and published examples in
problems.json, belongs to scripts/top-interview-150.json, and is checked
against the study plan. An original exercise sets "origin": "original",
has no published title or examples, and stays outside that plan. Its
candidate page and web/problem-pages.json deliberately omit source.
Run the focused bank checks before the full gate:
python3 -m unittest -v -k outside_the_plan tests/test_gen_problems.py
cargo test --test agent problem_bank_matches_imported_golden
python3 scripts/gen-problems.py --check
./scripts/test.shWhen an original exercise intentionally changes the private-rubric golden, refresh it explicitly and review the resulting fixture:
UPDATE_PROBLEM_GOLDEN=1 cargo test --test agent problem_bank_matches_imported_goldenThe generator stops at the first broken contract. These messages identify the source file to fix; do not edit generated output to silence them.
missing or duplicate problem id,origin must be leetcode or original,an original problem has no published title or examples, andan imported problem needs its published titlecome fromproblems.jsonidentity and origin checks.missing rubric,unknown difficulty, andtopics must contain 1..8 values(ortopics must be non-empty and unique) name required problem metadata.variants must list every problem once, in bank order,a variant has exactly,a function problem declares a new entry, anda class problem declares a new classNamename the scenario record to repair.the brief never names,starter does not define,case labels repeat,examples show published case, and the source-title messages mean the candidate-facing scenario, starter, or selected judge case leaks an invalid name or does not match the executable contract.variant titles must be unique, and unique as page namesandpage names must not equal a problem idprotect links and saved history.plan diverges from problem-bankmeans an imported id and the study plan differ. Mark a course-owned exerciseoriginalinstead of adding it to the plan.