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

@ -571,7 +571,7 @@ const TOOLS: ToolSpec[] = [
['type', 'stem', 'options', 'rationale'],
),
},
cards: { type: 'array', items: obj({ front: S, back: S, hint: S }, ['front', 'back']) },
cards: { type: 'array', items: obj({ front: S, back: S }, ['front', 'back']) },
content: { ...S, description: 'Markdown body, for kind = note.' },
},
['kind', 'title'],
@ -1110,8 +1110,8 @@ function systemPrompt(app: AppContext, context: AssistantContext, opts: { web?:
- Use tools instead of guessing. To answer questions about their material, search or read the documents first and base the answer on what you find.
- Cite document passages inline with the ref id in square brackets right after the claim, exactly as given, e.g. [c42]. Only cite refs that a tool returned in this conversation. ${
opts.web
? 'If the documents do not cover something, say so and ask whether to search the web (see Web search below) instead of answering from your own knowledge.'
: 'If the documents do not cover something, say so, then answer from general knowledge and label it as such.'
? 'Never answer factual questions from your own general knowledge. If the documents do not cover something, say so and ask whether to search the web (see Web search below); if the user says no, tell them you do not have information to answer it.'
: 'Never answer factual questions from your own general knowledge. If the documents do not cover something, say that you do not have information on it in their class materials.'
}
- You can browse everything: list_materials and search_library for quizzes, flashcards and notes; get_quiz, get_deck and read_note to open them; search_documents and read_document for uploaded files.
- When you mention a specific quiz, deck, note or document, link it with Markdown using the url the tool gave you, for example [Cardiac drug cards](/decks/abc123). Never invent a url.