mise ~/.config/mise/config.toml tools: crush@0.91.0

feat(api): add /admin/solved endpoint and commit source handling
This commit is contained in:
Prad Nukala
2026-08-25 15:43:21 -04:00
parent aba3d9b18b
commit e4de74c935
4 changed files with 99 additions and 12 deletions
+4 -2
View File
@@ -18,12 +18,14 @@ CREATE TABLE attempts (
date TEXT NOT NULL,
kind TEXT NOT NULL, -- first|review|drill|gate
result TEXT NOT NULL, -- pass|fail
source TEXT NOT NULL -- email|webhook|import
source TEXT NOT NULL -- email|webhook|commit|import
);
-- One-tap email links must be idempotent (same link twice = no-op), but
-- /done webhook corrections (pass then fail, same day) must stay legal —
-- so uniqueness applies to email-sourced attempts only.
-- so uniqueness applies to email-sourced attempts only. Commit-sourced
-- attempts need no index: logAttempt() only accepts them for a stage-'new'
-- problem, so a re-push cannot insert a second one.
CREATE UNIQUE INDEX attempts_email_once
ON attempts (lc_number, date, kind) WHERE source = 'email';
CREATE INDEX attempts_by_date ON attempts (date);