Fifth revision: share-link AI safety, sturdier generation, cleaner UI
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 1m0s

- Malformed model JSON is sent back for repair, then retried; a failed job
  starts over once before it fails. Visitors can dismiss failed sets.
- Generated sets get a short distinct name and description; flashcards are
  atomic and have no hints; standard study shows known/learning counts.
- Share links: "In progress" list, finished sets join the normal lists with a
  "New" tag, plain progress steps, newest exam first.
- Share-link AI expires after a week, can be limited to the US or Arizona
  (DB-IP Lite or Cloudflare headers) and is locked by abuse protection
  (migration 8).
- The assistant never answers from general knowledge; MCP and web search
  tools load without a manual test.
- Plain-text copy, no question count in exam mode, filler text removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-16 09:17:50 -07:00
parent d8df5edf30
commit 85d5c9186d
46 changed files with 1242 additions and 283 deletions

View file

@ -121,6 +121,24 @@ export interface Share {
lastViewedAt: number | null;
createdAt: number;
ai?: ShareAi;
/** AI switches itself off at this time (a week after it was turned on). */
aiExpiresAt?: number | null;
/** Abuse protection turned AI off. */
aiBlocked?: { at: number; reason: string } | null;
/** AI is on, within its week and not locked. */
aiActive?: boolean;
}
/** Share-link AI safety settings (Settings → Sharing). */
export interface ShareAiSettings {
geo: {
region: 'anywhere' | 'us' | 'arizona';
trustProxy: boolean;
country: { ready: boolean; builtAt: number | null; downloading: boolean; error: string | null };
city: { ready: boolean; builtAt: number | null; downloading: boolean; error: string | null } | null;
lastDay: { allowed: number; blocked: number; local: number; unknown: number };
};
abuse: { windowMs: number; addresses: number; devices: number; burst: number; burstMs: number; outside: number; limited: number };
}
export interface ClassDetail {
@ -617,6 +635,6 @@ export interface PublicCollection {
description?: string;
color: ClassColor;
folders: { id: string; name: string }[];
items: { kind: 'quiz' | 'deck' | 'note' | 'document'; id: string; title: string; description: string; folderId: string | null; count: number }[];
items: { kind: 'quiz' | 'deck' | 'note' | 'document'; id: string; title: string; description: string; folderId: string | null; count: number; createdAt?: number }[];
}
export type PublicPayload = (PublicQuiz | PublicDeck | PublicNote | PublicDocument | PublicCollection) & { ai?: ShareAi };