feat(api): add review day handling and dynamic campaign length

This commit is contained in:
Prad Nukala committed 2026-09-30 17:33:32 -04:00
1 parent 7e9ea8d7c2
commit 239c7013f8
9 files changed
+176 -32

No files matched your search

+3 -1
View File
@@ -5,7 +5,8 @@
* The gate half is a topic-blind quiz. When the plan fixes the set
* (`gate` in data/schedule.json) that list IS the gate, verbatim — every
* number must be a catalog problem, or the issue is not created, because a
* `/done` on an uncatalogued number can never be logged. Otherwise the set
* `/done` on an uncatalogued number can never be logged; an empty list skips
* the week's checkpoint outright. Otherwise the set
* is sampled: one unsolved optional problem per topic scheduled this week
* (which is why daily drills only draw from earlier weeks), never one the
* plan has reserved. The recap half is generated data, deliberately NOT a
@@ -77,6 +78,7 @@ export async function createReviewIssue(env: Env, gh: GitHub, date: string): Pro
// week without topics, across every topic that still has an unsolved pool.
const picks: { p: ProblemRow; fallback: boolean }[] = [];
const planned = SCHEDULE[date]?.gate;
if (planned?.length === 0) return { created: false, reason: `the plan skips the week ${week} checkpoint` };
if (planned) {
const { rows, missing } = await lookupProblems(db, planned);
if (missing.length) {