Commit graph

99 commits

Author SHA1 Message Date
e0bc7b580e Resizable assistant drawer, and the same drawer on share links
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
- The assistant drawer can be resized by dragging its left edge (or with the
  arrow keys), from 340 to 760 px, always leaving the page 420 px; double-click
  resets it. The width is remembered in the browser.
- Share-link visitors get the same side-drawer assistant as the owner instead
  of the small popup, with a New chat button; a full-screen sheet on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:22:04 -07:00
517278be71 Varied question openers, readable rationales, plain practice score
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s
- Stems no longer all open the same way: the writing rules, batch prompt and
  planner ask for varied openings (age openings stay part of the mix), and when
  one opener covers more than a quarter of a quiz the excess stems have only
  their opening reworded, keeping every number, before the check.
- Rationales are asked for as Markdown (a bold key point, then short bullets);
  older one-paragraph rationales are laid out the same way on display.
- The practice score in the quiz header is a plain "x/y correct", with no
  percentage or colour.
- Fix a flaky assertion: the mock's answer-key fix is a no-op when the shuffle
  already put the answer in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:05:46 -07:00
10be5c39da Separate settings per generation step; explain Practice and Exam on shares
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
- Settings -> AI: Planning, Writing, Python check and Second review each get
  their own model, reasoning effort, temperature and output limit, shown under
  Content generation. Unset choices follow Content generation, then the
  default model.
- Shared quizzes say what Practice and Exam mean under the mode toggle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:08:21 -07:00
2454ab6e95 Faster quiz generation: planned parallel batches, room to reason
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 25s
- Output limits leave room for reasoning (answer plus 8k-64k by effort, up to
  the model maximum); a call cut off before answering is retried with double
  the limit. At "max" effort, batches were being cut off at 16k tokens.
- Quizzes are planned first (one distinct angle per question), then written
  in waves of four batches; med math runs alongside the first wave.
- Replacements for removed questions are planned and written in parallel.
- The Python check and the second review run at the same time each round.

Measured live (DeepSeek flash, max reasoning, 50 questions): 7 min 21 s with
no duplicates, against 20 min and 29 replaced duplicates without planning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:00:27 -07:00
1a212bb8ba Quiz check: fix before handing over, with an independent second review
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
- The check can rewrite a whole question (garbled or contradictory stems,
  missing data, two defensible answers); a key fix that changes nothing is
  skipped.
- Removed questions are replaced with new ones, so a 50-question quiz stays 50.
- A second, independent model call reads the whole quiz for badly written
  items, helped by a scan for leftovers such as "A 78 kg? No - an 80 kg".
- The quiz is checked again after any rewrite, replacement or open problem,
  up to three rounds, before it is handed over.
- Reviewers see full rationales (a shortened one is marked as shortened).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:07:32 -07:00
85d5c9186d 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>
2026-11-16 09:17:50 -07:00
d8df5edf30 Class share links: visitors choose the exam for a generated set
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 24s
On a class link with exams, the visitor's Generate dialog asks which exam the
set is for (opening on the latest exam with materials, with "Not in an exam"
when there is loose material). Only that exam's class materials are offered,
and the set is saved into it. The server requires the choice and refuses
materials from another exam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:13:11 -07:00
76112cb4ae Share-link sets save into the class; flashcards up to 75
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 28s
- Sets visitors generate show in the owner's Drafts while being written, then
  save into the class (and exam, for an exam link) automatically, as if
  approved. If the save fails, the draft waits in Drafts for review.
- Deleting a share link keeps what was made on it; running jobs finish and save.
- Visitor flashcard sets go up to 75 cards (default 30); quizzes stay at 50.
- The visitor page links finished sets to the class items; the separate
  AI-set view is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:11:07 -07:00
e945f589ce Share-link generation and med math on request
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 34s
- Visitors of class and exam links can generate NCLEX-style quizzes (default
  and maximum 50 questions, 25% select-all, Python-checked, optional 5 med
  math questions) and flashcard sets from chosen class materials, once the
  owner turns it on for the link.
- 4 quizzes and 2 flashcard sets per link per day; failed attempts do not
  count; "Reset limits" in the share dialog gives a fresh allowance.
- Sets are drafts tied to the link (migration 7): listed for every visitor,
  explainable, kept off the owner's drafts list, and reviewable or savable
  from the share dialog.
- Generate gains "Include med math" with a count (default 5): exactly that
  many dosage calculation questions at the chosen difficulty, spread through
  the quiz, even when the material has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:04:08 -07:00
25bc03ea75 Fourth revision: OpenRouter, live tool stages, Explain layout, share sections
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
- Interactive blocks are encouraged by default; Explain gets a reduced library
  and never writes practice questions.
- Assistant tool steps breathe while running, show live stages from generation
  and the Python check, and read in the past tense when done.
- The assistant asks before searching the web when class materials do not
  cover a question; clarifying questions list every class's exams and never
  ask about format (always NCLEX).
- Explain opens beside the question from 900px wide, moving the question left
  while open and back on the next one.
- Generate dialog drops the practice set/exam switch (presets cover it) and the
  Generate buttons lose their icon.
- Python check notes are green when every check passed, applied fixes neutral.
- Share pages group by exam, then Quizzes, Flashcards, Notes, Class Materials,
  hiding empty groups; the class page uses the same order. "Documents" is now
  "Class Materials".
- OpenRouter provider replaces the Ollama type; migration 6 turns Ollama
  connections into OpenAI-compatible ones at /v1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:54:39 -07:00
c595e0ff2c Third revision: web search, MCP sign-in, exams, intelligent UI, clarifying questions
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 1m0s
- Built-in Parallel web search (keyless; optional sign-in for higher limits and research)
  with its own settings page; OAuth sign-in (RFC 9728/8414/7591, PKCE, RFC 8707) for any
  MCP server, with token refresh and pre-registered client support
- Friendly tool steps (icon, name, status; details on click) and ids stripped from results;
  per-chat tool switches; taller thinking box
- Exams within classes: exam tabs, scoped lists, uploads, imports and Generate; exam-only
  material for generation; class setting for what the groups are called
- Assistant can ask clarifying questions in an inline form before generating
- OpenUI blocks (charts, questions, flashcards, inputs) in assistant, Explain and share chats
- Explain beside the quiz on wide screens, grounded in the cited source pages
- Quiz results: percentage ring coloured by score band, rainbow at 100
- Share links: assistant button like the owner's, hidden during quizzes; documents readable
  in the browser
- Live draft and library updates over server-sent events

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:30:00 -07:00
60cf2322f7 Share links: per-device AI limits and an MCP "Share links" switch
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 28s
- Each MCP server gets a "Share links" switch (off by default). Shared Explain and Ask use
  only the servers that have it on.
- Visitor AI requests are limited per device instead of per IP, so one campus network
  doesn't share an allowance. Each browser gets a random id in a signed, HTTP-only cookie
  (20 requests per 10 minutes per link). Forged ids are replaced. A link-wide cap of 500
  requests per hour stays as a cost backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:12:45 -07:00
031f7bec31 Second revision: MCP servers, shared-link AI, flashcard modes, document previews
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s
Generation
- Every quiz is NCLEX style; "Practice exam" writes 50 questions.
- Calculation questions only when the material involves calculations (max 5 per exam).
- Broad topics: the class's topics are listed in the prompt, a quick grouping call maps
  narrow labels onto broad ones, and leftover variants are merged.
- Exact select-all count per batch; option order shuffled.
- Python check: at most 3 runs, fixed problems count as passed, cosmetic remarks ignored.

Assistant
- Text, tool steps and cards appear in the order they happen, with paragraph breaks
  between steps.
- Optional thinking box: fixed height, follows the newest text, can be scrolled back.
- "+" opens a material picker listing recent items; items can be dragged in from class
  pages; shorter placeholder.

MCP servers
- Streamable HTTP client; encrypted headers.
- Per-server instructions and switches for chat, Explain, generation and the quiz check.
- Settings UI.

Share links
- Optional "Explain this" and "Ask about this material" per link, off by default.
- Items are loaded on the server and checked against the share; no tools; rate-limited.
- Migration 4 stores the switches.

Study and documents
- Standard flashcard mode (optionally repeat missed cards until known) next to spaced
  repetition.
- Streak visuals restyled in the app palette.
- Side by side / Original document views, with sandboxed previews of Word and PowerPoint
  files.

Other
- Built-in embedding model baked into the image; sharp stubbed if it cannot load; real
  load error shown in Settings.
- Python runner blocks network and process modules in JavaScript too.
- "View questions and answers" removed from the quiz start screen.
- Docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:48:54 -07:00
5ea61c882c Add sandboxed Python for the assistant and a Python check of generated quizzes
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 51s
- Pyodide (Python 3.14, WebAssembly) in a separate Node process under the permission
  model: read-only access to Pyodide's files, no writes, processes or network, empty
  environment, JS bridges removed, time limit with kill and restart.
- Assistant tool run_python, which can load a draft or quiz as Python data.
- After quiz generation the model checks question count, type mix, correct answers per
  type, duplicates and recomputed calculations with Python, then submits fixes that are
  applied only if the question still validates. Switch in the Generate dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:03:24 -07:00
f0aabe4d5d First revision: DeepSeek, numeric questions, background assistant, UI fixes
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 1m2s
Providers and pricing
- Add a DeepSeek provider: thinking mode with low/high/max effort, reasoning_content
  replayed between tool steps, cache-hit usage, /models discovery and catalog prices.
- Fix "does not support tool calling": a rejected forced tool_choice (DeepSeek thinking
  mode) now asks for the call in the prompt; only a genuine no-tools 400 is "unsupported".
- Seven reasoning-effort levels (Off to Max) mapped per adapter.
- Cached-input price per model, cache-write and DeepSeek off-peak aware cost estimates.
- Built-in bge-small embedding model (transformers.js) as the semantic search default.

Quizzes
- Numeric (type-the-answer) questions: units ignored, optional ± tolerance; editor,
  runner, importer, templates and generation prompts.
- Quiz start screen instead of showing answers; navigator ring no longer clipped and
  key legend removed; clock only for timed exams; 7-point letter grades.

Assistant and generation
- Assistant turns run on the server independently of the browser, with re-attach and
  an explicit stop; drafts tray shows generations in progress.
- Per-chat model switcher, @-tagging of class materials, full-width assistant page and
  a smaller assistant button.
- Editable generation instructions and built-in presets, separate from the chatbot
  import instructions.

Other
- Dialog footer padding, keyboard hints removed, copy buttons work over plain HTTP,
  class and folder shares include documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:48:17 -07:00
ccdad9728b Add drag reordering, exam deadlines, frozen shared quizzes, batched OCR and semantic search
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 33s
- Drag-to-reorder for class materials, folders, quiz questions and deck cards. Pointer-based
  so touch works, plus keyboard (arrows/Home/End) with screen-reader announcements.
- Timed exams get a wall-clock deadline. The server refuses late answers, submits overdue
  exams with what was saved, and the countdown keeps running while the page is closed.
- Shared quiz sessions keep a frozen copy of their questions and flag later owner edits.
- Scanned PDFs are read in cached 8-page batches with real page numbers (pdf-lib), removing
  the 30 MB whole-file limit. Compatible providers now receive PDFs as file parts.
- Semantic search: embeddings for OpenAI, Gemini, Ollama and compatible servers, background
  indexing into chunk_vectors (migration 2), hybrid keyword + vector ranking for search, the
  assistant and focused generation, and a Settings -> AI section.

181 tests pass locally and in the Docker test stage on Node 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:48:20 -07:00
3046e46d1c Add V2 Forgejo workflow publishing study:v2 image
Pushes to v2 typecheck and test inside the Node 24 image via a new Dockerfile
test stage, build and smoke-test the production image as a fresh non-root
container, then publish :v2 and :v2-<sha>. Never touches V1's :latest.
Document the image tags and Unraid 99:100 volume ownership.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:29:22 -07:00
d7e19db468 Restore study gestures and shuffle progress; harden note autosave and record V1 comparison 2026-11-11 20:00:17 -07:00
4bf121728b Verify V1 scheduling and static boundaries; record Terra workflow and visual QA 2026-11-11 19:36:24 -07:00
ffaa1f6afa Harden private media and backup recovery; add V2 deployment and migration guides 2026-11-11 19:31:32 -07:00
c549c34f60 Polish: link buttons, theme-aware dark variant, assistant drawer overlay, sticky draft bar
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:32:46 -07:00
aed14cd04f Address first round of feedback
- Flashcards: whole card flips on click (both sides), 3D turn, swipe-away on grading,
  streak chip and flame bursts, bigger cards on desktop, arrow keys for everything
- Review and browse keep the sidebar on desktop
- Quizzes: live practice score, partial-credit explanation, time limit for shared exams
- Class page: items grouped by type inside each folder
- Import: copyable, editable instructions for outside chatbots
- Assistant: reads notes and links to library items

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 18:30:07 -07:00
c59591ccb9 Reject mismatched uploads; add local mock AI runner
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 13:31:01 -07:00
75158c4449 Add mock AI provider and AI integration tests; fix sign-in transition and card flip
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 13:30:27 -07:00
74a98ac1f1 Add the V2 web app: design system, shell, study flows, AI, settings, sharing
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 08:53:01 -07:00
eae109c166 Add HTTP routes, app wiring, V1 migration, backups, templates and API tests
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 08:22:47 -07:00
3e74ecd843 Start Study Desk V2: remove V1 sources, add backend foundation
V1 remains intact on main and in history. This branch replaces it with a new
application: node:sqlite storage with migrations, scrypt auth and sessions,
content/SRS/attempt/stats services, document extraction and chunking, a
provider-neutral AI layer (OpenAI, Anthropic, Gemini, OpenAI-compatible,
Ollama), the generation pipeline and the tool-using assistant.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 08:16:41 -07:00
7bd0a9aad4 Limit CI linting to changed source files
All checks were successful
Verify and publish container / build-and-push (push) Successful in 1m10s
2026-08-08 18:54:39 -07:00
e8dffc9692 Remove obsolete project artifacts
Some checks failed
Verify and publish container / build-and-push (push) Failing after 33s
2026-08-08 18:50:16 -07:00
5db7fc8afd Harden migration preflight and startup adoption checks
All checks were successful
Verify and publish container / build-and-push (push) Successful in 1m26s
2026-08-08 18:17:17 -07:00
931e674814 Fixed CL failure
All checks were successful
Verify and publish container / build-and-push (push) Successful in 1m9s
2026-08-07 19:59:02 -07:00
a95f7c1d18 Harden changed-file lint workflow
Some checks failed
Verify and publish container / build-and-push (push) Failing after 1m0s
2026-08-07 19:50:38 -07:00
e86b0b21df Merge pull request 'Refactor Study Desk application structure' (#3) from codex/majorfixes into main
Some checks failed
Verify and publish container / build-and-push (push) Failing after 34s
Reviewed-on: #3
2026-08-07 19:33:37 -07:00
089439ed90 Refactor Study Desk application structure 2026-08-07 19:31:23 -07:00
faaccf8a7e Changed: Show newly created material groups first and place uncategor -
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m8s
2026-08-01 08:48:26 -07:00
c3c26718f9 Delete task.md
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m10s
2026-07-31 10:46:36 -07:00
7b9ff1931c Configure Prisma migrations and dark mode
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m9s
2026-07-29 14:24:59 -07:00
3cf20514f4 Improve activity banner light theme styling
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m17s
2026-07-29 14:14:41 -07:00
32bce673ac Add streak counter to flashcards
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m17s
2026-07-27 14:05:35 -07:00
a6af3a49ad Highlight assisted crossword cells in final results
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m1s
2026-07-14 20:33:39 -07:00
5bec95fb30 Initial crossword addition and arcade redesign
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m41s
2026-07-14 19:32:41 -07:00
611a585757 Initial addition of the Arcade study feature. Add connections as the first working game.
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m4s
2026-07-13 17:35:18 -07:00
7b90409f2e Add deck generation and study flow improvements
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m22s
2026-07-13 14:56:33 -07:00
d6f3502cb1 Tighten typing and input validation across study pages
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m2s
2026-07-13 06:55:17 -07:00
6d1d918355 Improve responsive layout for study and quiz cards
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m14s
2026-07-13 06:32:54 -07:00
e3265f03e2 Remove activity summary stats from banner
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m0s
2026-07-12 12:01:31 -07:00
dad62c9914 Add study activity tracking and refresh class header UI
All checks were successful
Automated Container Build / build-and-push (push) Successful in 54s
2026-07-12 11:44:26 -07:00
95af276d2e Refactor login flow with reset token support
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m6s
2026-07-12 07:53:48 -07:00
f0548bcc6e Fix: share popup not closing when clicking outside menu
All checks were successful
Automated Container Build / build-and-push (push) Successful in 57s
2026-07-11 19:36:17 -07:00
061d13f421 Update AGENTS.md
All checks were successful
Automated Container Build / build-and-push (push) Successful in 59s
2026-07-11 19:29:45 -07:00