feat(srs): switch ladder to +3/+7 and enforce rest‑day logic

This commit is contained in:
Prad Nukala committed 2026-08-31 10:41:45 -04:00
1 parent 7e46fceb1c
commit 38fbb18f32
12 files changed
+140 -161

No files matched your search

+6 -5
View File
@@ -10,7 +10,7 @@
* so relabelling a problem is enough to move it and titles stay readable.
* The `problem` label is what marks a sub-issue as curriculum.
*/
import { addDays } from "./srs.ts";
import { workingDay } from "./srs.ts";
import type { GitHub } from "./github.ts";
const TITLE_RE = /^LC (\d+) · (.+)$/;
@@ -18,7 +18,7 @@ const TITLE_RE = /^LC (\d+) · (.+)$/;
const DIFFICULTIES = ["easy", "medium", "hard"] as const;
const SETS = ["core", "optional", "deferred"] as const;
/** Deferred Hards enter the queue from this date, two per day. */
/** Deferred Hards enter the queue from this date, two per working day. */
const DEFER_FROM = "2026-09-28";
export interface ReconcileReport {
@@ -96,9 +96,10 @@ export async function reconcileCatalog(db: D1Database, gh: GitHub): Promise<Reco
continue;
}
const lc = Number(m[1]);
// Two deferred Hards per day from DEFER_FROM, in catalog walk order —
// applied only when the row is first created (SRS owns it afterwards).
const defer = set === "deferred" ? addDays(DEFER_FROM, Math.floor(deferredSeen / 2)) : null;
// Two deferred Hards per WORKING day from DEFER_FROM, in catalog walk
// order — applied only when the row is first created (SRS owns it
// afterwards). Sunday is skipped like every other scheduled date.
const defer = set === "deferred" ? workingDay(DEFER_FROM, Math.floor(deferredSeen / 2)) : null;
if (set === "deferred") deferredSeen++;
statements.push(
db