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

@ -1,5 +1,7 @@
import { serve } from '@hono/node-server';
import { tidyDrafts } from './ai/generate.ts';
import { startGeoSchedule } from './services/geo.ts';
import { startMcpWarmup } from './ai/mcp.ts';
import { createApp } from './app.ts';
import { initAuth } from './auth.ts';
import { loadConfig } from './config.ts';
@ -39,6 +41,8 @@ async function main(): Promise<void> {
if (resumed > 0) log('info', `Resuming processing of ${resumed} document(s)`);
scheduleIndexing(app);
const stopBackups = startBackupSchedule(app);
const stopGeo = startGeoSchedule(app);
const stopMcp = startMcpWarmup(app);
const server = serve({ fetch: createApp(app).fetch, port: config.port, hostname: config.host }, (info) => {
log('info', `Listening on http://${info.address === '::' || info.address === '0.0.0.0' ? 'localhost' : info.address}:${info.port}`);
@ -52,6 +56,8 @@ async function main(): Promise<void> {
closing = true;
log('info', `${signal} received, shutting down`);
stopBackups();
stopGeo();
stopMcp();
server.close(() => {
try {
db.close();