Tutor/plans/tutor-improvement-plan
Plan: make Tutor an impressive hosted web app on Azure
Status: proposal, saved 2026-11-19 (TUT-T51, with the authentication and credentials review asked for in TUT-T52). Nothing here is started. Audit only: no code or Azure resource was changed.
Tutor's engine is real and its sign-in is solid, but the web app is still a single-user desktop tool that happens to be on the internet: every signed-in user shares one progress record, one quiz session, one chat transcript and one "active course"; any signed-in user can delete courses and start paid LLM work; all course data sits in a few whole-file JSON stores; and the hosted site has no courses, no LLM keys and no way to ingest a document. This plan lists what was found (with file and line), then a four-phase roadmap: Phase 0 makes it safe to show someone, Phase 1 gives the data a durable home in Azure, Phase 2 makes it impressive, Phase 3 is polish and scale. Honest size: about four to five months of focused work for one developer.
Note on this file: the repository is public and docs/** is published to GitHub Pages. The account list and one live account problem were therefore reported to the owner directly and are not written here. Section 3 lists where every secret lives, never a value.
1. Where things stand
What works
- Sign-in. MindAttic.Authentication 7.0.0 over Azure SQL
TutorAuth(Argon2id + pepper, server-side sessions, lockout backoff, antiforgery on every auth post). On the hosted site every app page redirects to/loginwhen signed out (probe table in section 3.2). - The course engine, from the CLI.
tutor import,tutor gutenberg,tutor build-course,tutor export,tutor installrun the whole pipeline: parse, chunk, embed, extract concepts, build a course structure, bake quizzes, write a.tutorbundle. - Ten ready-made courses are in the repo (
Courses/*.tutor, 1 MB to 10.5 MB each, with embeddings and baked quizzes). - Learning loop on one machine for one user. Lessons unlock by mastery, section quizzes, a final exam, a certificate (
FullCourseLifecycleTests). - Bundle install with validation on
/library, with the admin check done on the server (Tutor.Shared/Services/LibraryAdminActions.cs:30-64). - Deploy. A push to
mainbuilds, deploys to App Service with GitHub OIDC (no stored password), restarts, and waits for/healthz,/healthz/dband/login(.github/workflows/azure-deploy.yml:84-119).
What does not work, or is a stub
- The hosted site is empty.
C:\home\data\Tutorholds onlyLogs,Settingsand the queue state file: no courses, no vectors. There are no LLM key settings on the App Service (section 3.3). A signed-in visitor sees "0 courses" and an empty chat box. - The web app cannot ingest a document.
BlazorFilePickerService.PickFileAsyncalways returns null (Tutor.Blazor/Services/BlazorFilePickerService.cs:14-17), no parser is registered in the host (Tutor.Blazor/Program.cs; parsers are registered only inTutor.Cli/Program.cs), and the PDF branch returns a placeholder sentence (Tutor.Shared/Components/CourseManagement.razor:1623-1626). Only pasted text works. - Nothing is per user except the login and the certificate file. Progress, the running quiz, the lesson transcript, the active course and the navigation state are process-wide (section 4, rows S1 to S5).
- Settings cannot be edited on the hosted site. The Settings cog starts the Vault desktop app on the server (
Tutor.Core/Services/SettingsCog.cs:16-18,Tutor.Shared/Components/Layout/TopMenu.razor:39). - Password-reset email is not delivered on the host (no
Notificationssettings there) and reset links would point athttps://localhost:7200(Tutor.Core/Services/TutorSettings.cs:38). - Dead or hidden UI: the side navigation with locks and percent complete is never rendered (
Tutor.Shared/Components/Layout/MainLayout.razor:10renders onlyTopMenu);/instructionsand/knowledge-graphare linked only from the unusedNavMenu; two graph views are "being updated" placeholders (Tutor.Shared/Components/Pages/ConceptGraph.razor:183,192); News is five hard-coded headlines with no page (Tutor.Core/Services/News/OpenNewsApiController.cs:20-62);KimiServiceis not registered or routed. - README is out of date: it says "Tutor runs locally; there is no hosted demo" (
README.md:20).
The user journey today
/login(static page, library form). No self-registration: accounts are created only by an admin on/usersor by the first-run bootstrap./shows three counts and "Start Learning" (Tutor.Shared/Components/Pages/Home.razor:27-55)./learnhas five tabs: Chat, Quiz, Concepts, Visualize, Final Exam (Tutor.Shared/Components/LearnTabs.razor:13-75). The course is chosen from a drop-down in the chat header (Tutor.Shared/Components/Chat.razor:23); there is no catalogue page.- Chat teaches a section (one LLM call per turn, whole reply at once, no streaming:
Tutor.Core/Services/Abstractions/ILlmService.cs:18). A reading timer marks a section read. - Quiz: baked questions if the bundle has them; each answer is graded by an LLM call (
Tutor.Core/Services/Quiz/LocalQuizController.cs:120-149). - Final exam unlocks when all lessons are complete (pass mark 80, 20 questions:
Tutor.Core/Services/FinalExamService.cs:20,23); a pass shows the certificate with "Print / Save PDF". /courses(authoring): create a course, paste text as a resource, "Build Course". Open to every signed-in user./library: install, unload, remove.tutorbundles (admin), re-share download (any signed-in user).
Architecture in one paragraph
Six projects: Tutor.Core (everything substantive), Tutor.Shared (Razor components), Tutor.Blazor (host), Tutor.Cli, Tutor.Mcp, Tutor.Tests, plus Tutor.Cypress. The host registers about 50 services as singletons (Tutor.Blazor/Program.cs:72-274) and runs Blazor Server with global interactive rendering (Tutor.Blazor/Components/App.razor:24,41). LLM calls go through LlmServiceRouter to MindAttic.Legion; embeddings are always OpenAI text-embedding-3-small, 1536 dimensions (Tutor.Core/Services/EmbeddingService.cs:17-18). Auth is the only SQL. Everything else is JSON on disk under TUTOR_DATA_DIR (hosted: C:\home\data\Tutor; local: %LOCALAPPDATA%\Tutor). Background work is a static class started fire-and-forget (Tutor.Blazor/Program.cs:301).
A correction to a working assumption: C:\home on Windows App Service is durable (it is an Azure Files share that survives restarts and deploys), so course data does have a place to sit on the host. The real problems are that it is empty, that the storage design cannot take concurrent users or a 420 MB vector file, that the share is slow for whole-file rewrites, and that nothing backs it up.
Local data sizes measured on the dev machine: VectorStore 420 MB (one file), ConceptMaps 122 MB, KnowledgeGraphs 26 MB, Settings/secure-preferences.json 11 MB, LSH 5 MB, CourseStructures 3 MB.
2. Hosted state (checked 2026-11-19, read-only)
| Item | Value | Comment |
|---|---|---|
| Site | mindattic-tutor, Windows, .NET 10, Central US, state Running
|
|
| Plan | ASP-MyApps-99fe, Basic B1, one instance
|
Shared with four other sites (cursory, mindattic-prose, streetsamurai, taxratecollector): about 1.75 GB RAM for all five |
| Always On | off | First request after idle took 87 s (/healthz), most of it the Azure SQL resume done at startup
|
| HTTPS only, TLS 1.2, FTPS disabled, HTTP/2, WebSockets on | yes | Good |
| Health check path | not set | App Service does not probe /healthz
|
| App and HTTP logging | off; no Application Insights (the subscription is not registered for Microsoft.Insights) | Nothing is recorded when it fails |
| Managed identity | system-assigned; database roles db_datareader + db_datawriter only
|
Good: least privilege |
| Custom domain | none (mindattic-tutor.azurewebsites.net only)
|
|
| Database | TutorAuth on sql-mindattic-f65744 (resource group rg-mindattic-data), serverless free offer, auto-pause after 60 min, pause when the free amount is used up
|
Point-in-time restore 7 days; no long-term retention; local backup redundancy |
| Migrations applied | 20260605053951_InitialAuth, 20261031162247_AuthV2DisplayName
|
|
| Key Vault | kv-tutor-f65744: secrets pepper-v1, reset-token-key; key dp-protect. Soft delete on, purge protection off
|
|
| Storage | stmindatticdbf65744: containers tutor-dp-keys, db-backups. Blob soft delete off
|
|
| Response headers | HSTS (30 days), X-Frame-Options: SAMEORIGIN; CSP only on the auth pages
|
Missing on app pages: CSP, X-Content-Type-Options, Referrer-Policy. X-Powered-By and Server are sent
|
| Deploy runs | last 4 deploys green |
3. Authentication, Vault and the credentials inventory (TUT-T52)
3.1 What Tutor uses
Tutor uses the same library as Prose.Hub's hosted mode, MindAttic.Authentication (Tutor.Blazor/Program.cs:229-247, :325, :333), but with a thinner shell around it than Prose.Hub has (Prose/src/Prose.Hub/Hosting/HostedGate.cs).
| Control | Prose.Hub hosted mode | Tutor today | Evidence |
|---|---|---|---|
| Login required by default on every endpoint (fallback policy) | Yes, plus a second check in middleware | No. Each page opts in with [Authorize]; a page or endpoint added without it is public
|
Tutor.Blazor/Components/Routes.razor:9-11; no SetFallbackPolicy anywhere in the repo
|
| Allowed-users list | Yes | No | |
| Forced password change | Yes | Yes (library middleware) | MindAttic.Authentication/.../MindAtticAuthAppExtensions.cs:50
|
| TOTP for admins, with enrolment pages | Yes | No. MFA is off; /mfa and /account/mfa/setup return 404 on the host; Admin is role-only
|
Tutor.Blazor/Program.cs:223 ("MFA off for now"), Tutor.Core/Services/Auth/AuthUserImportService.cs:71
|
| Bootstrap token and pepper from Vault | Yes | Yes | Tutor.Blazor/Program.cs:40-41,288
|
| Sign-in rate limit (ASP.NET rate limiter) | Yes | No rate limiter; the library's per-account and per-IP backoff in SQL is the only brake | no AddRateLimiter in the repo
|
| Host allow-list, strict return-URL check, nosniff / referrer headers | Yes | No | Tutor.Blazor/appsettings.json:8 ("AllowedHosts": "*")
|
| Self-registration | None | None (admin creates users) | MindAttic.Authentication/.../Web/AuthEndpoints.cs:30-35 maps no register endpoint
|
| Per-user quota or rate limit on LLM spending | n/a | None | section 4, row A3 |
3.2 What can be reached without signing in (hosted, probed unauthenticated)
| Request | Status | Meaning |
|---|---|---|
GET /healthz, /healthz/db
|
200 | Anonymous by design; return only "ok" |
GET /login, /forgot-password, /account/reset
|
200 | Anonymous by design |
GET /not-found
|
200 | Anonymous (no [Authorize]); renders the layout with only the Home link
|
GET /, /courses, /learn, /library, /knowledge-graph, /knowledge-bases, /instructions, /maintenance, /users, /account, /account/change-password
|
302 to /login
|
Protected |
GET /api/library/x/bundle
|
302 to /login
|
Protected (RequireAuthorization, Tutor.Blazor/Program.cs:363)
|
POST /_blazor/negotiate
|
200 | The Blazor hub accepts anonymous connections. Pages are still gated by AuthorizeRouteView, so nothing paid is reachable, but anyone can hold circuits open on a 1.75 GB shared plan
|
POST /_ma-auth/login, /logout, /reset/request (no token)
|
400 | Antiforgery enforced |
POST /_ma-auth/change-password
|
302 to /login
|
Protected |
GET /Error
|
404 | The exception handler target does not exist (row R1) |
GET /mfa, /account/mfa/setup, /register, /signup, /swagger, /appsettings.json, /web.config
|
404 | Not present |
Static files (/_framework/blazor.web.js, /_content/Tutor.Shared/app.css, /app.css)
|
200 | Expected |
http://
|
301 to https://
|
Good |
Answers to the direct questions:
- Can something that spends an API key be reached without a login? Not today: every component that calls an LLM lives on an
[Authorize]page, and the probes above confirm the redirects. But the protection is opt-in per page, not a default, and the hosted site has no LLM keys yet, so this has never been tested with money behind it. - Can anyone self-register and spend keys? No. There is no registration endpoint or page.
- Once signed in, is spending limited? No. Any signed-in user of any role can start course builds, chat without limit, rebuild a knowledge graph and run AI orphan-linking. There is no quota, rate limit or cost cap anywhere. So the only thing between the internet and the keys is the quality of every account's password; see the first roadmap item.
- Locally, a Debug build has a sign-in bypass for loopback requests in Development when
Tutor.Blazor/.envenables it (Tutor.Blazor/.env.example); it is compiled out of Release (Tutor.Core/Tutor.Core.csproj:19-23,azure-deploy.yml:62-65).
3.3 Where every secret and setting is read from (names only)
| What | Local machine | Hosted App Service | Read by |
|---|---|---|---|
| Password pepper | %APPDATA%\MindAttic\Security\providers.json, key pepper.v1
|
App setting MindAttic__Vault__Security__pepperv1, a Key Vault reference to secret pepper-v1 in kv-tutor-f65744
|
ConfigAuthSecrets (MindAttic:Vault:Security:pepper.v1)
|
| Reset-token key | same file, key reset-token-key
|
App setting MindAttic__Vault__Security__resettokenkey, Key Vault reference to reset-token-key
|
PasswordResetService
|
| Bootstrap admin password | same file, key bootstrap-token
|
not set (only needed when the user table is empty; with it missing and an empty table the site fails to start) | AuthBootstrapper
|
dp-kek
|
same file, key dp-kek
|
not used by Tutor's host | not referenced in this repo |
| Data Protection key ring | %APPDATA%\MindAttic\DataProtection\Tutor\ (2 files)
|
Blob container tutor-dp-keys (DataProtection__BlobUri), wrapped by Key Vault key dp-protect (DataProtection__KeyVaultKeyId)
|
Tutor.Blazor/Program.cs:236-245
|
| Database connection | appsettings.json ConnectionStrings:TutorAuth (server name, Entra sign-in, no password)
|
App setting ConnectionStrings__TutorAuth (no password; managed identity)
|
Tutor.Blazor/Program.cs:224-228
|
| LLM keys (openai required; claude, gemini, deepseek, kimi optional) | %APPDATA%\MindAttic\LLM\providers.json plus key order in %APPDATA%\MindAttic\Vault\key-assignments.json
|
not set. Needs MindAttic__Vault__LLM__openai__apiKey (and the chosen chat provider's), as Key Vault references
|
TutorKeys (Tutor.Core/Services/TutorKeys.cs:24-47)
|
| SMTP for reset and alert email | %APPDATA%\MindAttic\Notifications\providers.json, email/{smtpHost,smtpPort,username,password,from}
|
not set. Needs MindAttic__Vault__Notifications__email__smtpHost and the other four
|
AuthEmailSettings
|
| App settings (theme, active model, quiz size, auth options) | %LOCALAPPDATA%\MindAttic\Tutor\settings.json
|
not set, so code defaults apply. Needs at least MindAttic__Settings__Tutor__activeModel and MindAttic__Settings__Tutor__auth__Reset__PublicBaseUrl
|
TutorSettingsSource (Tutor.Core/Services/TutorSettings.cs)
|
| Vault file roots | defaults | MINDATTIC_VAULT_ROAMING_ROOT=C:\home\data\MindAttic, MINDATTIC_VAULT_LOCAL_ROOT=C:\home\data\MindAtticLocal
|
MindAttic.Vault |
| Data root | %LOCALAPPDATA%\Tutor
|
TUTOR_DATA_DIR=C:\home\data\Tutor
|
Tutor.Core/Services/TutorDataRoot.cs:28-29
|
| Deploy identity | n/a | GitHub repo secrets AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID (ids, not passwords; OIDC)
|
azure-deploy.yml:84-89
|
| Dev sign-in bypass | Tutor.Blazor\.env (MA_DEV_AUTH_*), git-ignored
|
never | Debug builds only |
| Legacy user file | %LOCALAPPDATA%\Tutor\Users\Users.json (unsalted SHA-256 hashes from before the auth library)
|
absent | AuthUserImportService reads it on every start
|
No user-secrets store is used (no UserSecretsId in any project). No secret value was found in tracked files (pattern scan of the working tree).
3.4 What to back up, and how accounts are recovered
- Passwords are stored only as hashes (Argon2id with the pepper) and cannot be read back by anyone, including the owner and this audit. There is no list of passwords to back up.
- What must be backed up, because losing it is unrecoverable:
- The pepper (
pepper-v1in Key Vault andpepper.v1in the local Security bucket). Lose it and every password hash is useless: every account needs a reset. - The Key Vault key
dp-protectand the blob containertutor-dp-keys. Lose either and every signed-in session and antiforgery token is invalid (users sign in again; not fatal, but TOTP secrets, once MFA is on, are encrypted with it and would be lost). reset-token-key. Losing it only invalidates outstanding reset links.- The database (accounts, sessions, audit log). Azure keeps 7 days of point-in-time restore; there is no longer retention.
- The LLM keys in
%APPDATA%\MindAttic\LLM\providers.json(replaceable at the provider, but only the owner can do that).
- The pepper (
- Key Vault has soft delete but no purge protection, and the blob container has no soft delete: one wrong delete of
tutor-dp-keysis permanent. - Reset procedure today: an admin signs in and resets the password on
/users. The self-service "Forgot password?" link works only where SMTP is configured, which the host is not. If the only admin is locked out, the fallback is the local Vaultbootstrap-tokenpath, which only works on an empty user table; there is no break-glass procedure. Roadmap item 0.2 adds one. - Account inventory (names, roles, last sign-in) was read from the database once and given to the owner in the audit report; in summary: 2 accounts, 1 Admin, 1 Student, none with MFA, no live sessions, 23 audit rows, last sign-in 2026-11-01.
4. Findings
Severity: blocker = must be fixed before anyone else is given a login; high = fix in Phase 0 or 1; medium / low = later phases. Paths are relative to the repo root unless they start with MindAttic.Authentication or Prose.
Security and access
| # | Finding | Evidence | Severity |
|---|---|---|---|
| A1 | A legacy dev-seed account path exists: AuthUserImportService imports accounts with a known weak password as active, only flagged "must change password", and the public source names the accounts and the password. Any such account in the hosted database is an open door. (Specifics reported to the owner.)
|
Tutor.Core/Services/Auth/AuthUserImportService.cs:19,24,70,72
|
blocker |
| A2 | No default-deny: authorization is opt-in per page, there is no fallback policy, and the Blazor hub accepts anonymous connections | Tutor.Blazor/Components/Routes.razor:9-11; Tutor.Blazor/Program.cs:325-333; hosted POST /_blazor/negotiate = 200
|
high |
| A3 | Any signed-in user, including a Student, can create, rename and delete courses and resources, start paid builds, rebuild the knowledge graph and run AI orphan-linking. No role check, no quota, no rate limit, no cost cap | Tutor.Shared/Components/Pages/Courses.razor:2; Tutor.Shared/Components/CourseManagement.razor:1007,1382,1444,1663,1676,1788; Tutor.Shared/Components/Pages/ConceptGraph.razor:3,408; Tutor.Shared/Components/ConceptMapCollectionGraph.razor:172; Tutor.Core/Services/LlmServiceRouter.cs:31 (no limiter at the one choke point)
|
blocker |
| A4 | Any signed-in user can rewrite the global instructions sent with every chat prompt for everyone | Tutor.Shared/Components/Pages/Instructions.razor:2,110; Tutor.Shared/Components/Chat.razor:1736
|
high |
| A5 | Chat renders model and course text through a hand-written Markdown-to-HTML converter as raw markup. It escapes < and > only, then runs regex passes over HTML it has already produced, with inline onclick handlers and un-encoded link text; an attribute break-out is possible from course text or a prompt-injected reply (read from the code, not exploited)
|
Tutor.Shared/Components/Chat.razor:335,2068-2072,2203-2253 (link text at :2241)
|
high |
| A6 | A student's chat message triggers a background LLM call that writes new concepts into the shared course concept maps | Tutor.Shared/Components/Chat.razor:1847; Tutor.Core/Services/DynamicConceptExpansionService.cs:437,603,648
|
high |
| A7 | Quiz and final-exam grading trusts the model's verdict on a prompt that contains the student's raw answer, so an answer that instructs the grader passes; on any LLM failure grading falls back to exact string match against a full-sentence answer | Tutor.Core/Services/Quiz/LocalQuizController.cs:120-158
|
high |
| A8 | "Open ConceptMap JSON" calls Process.Start on the server
|
Tutor.Shared/Components/CourseManagement.razor:1502-1510
|
medium |
| A9 | MFA is off; the admin account is password-only on a public site | Tutor.Blazor/Program.cs:223; hosted /mfa = 404
|
high |
| A10 | No CSP, X-Content-Type-Options or Referrer-Policy on app pages; d3 is loaded from a CDN with no integrity hash; many inline handlers and styles would block a strict CSP today
|
hosted headers (section 2); Tutor.Blazor/Components/App.razor:28
|
medium |
| A11 | No request rate limiting at all (sign-in, reset request, bundle download, hub connections) | no AddRateLimiter in the repo; MindAttic.Authentication/.../Web/AuthEndpoints.cs:24-36 accepts a group configurator that Tutor does not use (Tutor.Blazor/Program.cs:333)
|
medium |
| A12 | Bundle upload allows 512 MB over the SignalR circuit, has no zip-bomb guard (every entry is read fully into memory, no cap on size or count) and reads the archive twice. Admin-only, which limits it | Tutor.Shared/Components/Pages/Library.razor:127,172-179; Tutor.Core/Services/Packaging/BundleImporter.cs:263-275; Tutor.Core/Services/Packaging/CourseInstallService.cs:61,72
|
medium |
| A13 | Pasted resource text is unbounded (no maxlength, no server check) and goes straight into paid processing
|
Tutor.Shared/Components/CourseManagement.razor:708-714,1360
|
medium |
| A14 | Failures store ex.ToString() (full stack trace) on the chat message, shown by a "View" button and saved in the shared lesson state; many pages show raw exception messages
|
Tutor.Shared/Components/Chat.razor:333,1858; Tutor.Shared/Components/CourseManagement.razor:1014,1311,2091
|
medium |
| A15 | The development machine and the hosted site use the same auth database, and a Development run applies EF migrations to it. The comment says production schema changes run in CI; the workflow has no such step | Tutor.Blazor/appsettings.json:9; Tutor.Core/Data/TutorAuthDbContext.cs:41-43; Tutor.Blazor/Program.cs:224-227,279,284-285; .github/workflows/azure-deploy.yml (no migration step)
|
high |
| A16 | The public repository's git history still contains the full text of a commercially published novel (Resources/Original/j.-k.-rowling---harry-potter-and-the-chamber-of-secrets.txt) and 500 MB of old build output (Tutor.MAUI/bin, obj); pack size is 531 MB
|
git log --all --diff-filter=A --name-only; git count-objects -vH
|
high |
| A17 | Certificates are unsigned JSON records and cannot be verified by anyone else | Tutor.Core/Services/CertificateAuthority.cs:44
|
medium |
| A18 | The bundle SHA-256 is declared inside the bundle and optional: integrity, not authenticity | Tutor.Core/Services/Packaging/CourseManifestValidator.cs:65-75
|
low |
Multi-user state (the app is single-user inside)
| # | Finding | Evidence | Severity |
|---|---|---|---|
| S1 | Progress is shared: the user id defaults to "default" and no UI caller passes one. Mastery, lesson unlocks and exam eligibility are common to all users
|
Tutor.Core/Services/UserProgressService.cs:14,34; Tutor.Shared/Components/Chat.razor:966,1004,1053,1246,2382; Tutor.Shared/Components/LearnTabs.razor:317
|
blocker |
| S2 | One quiz session for the whole server, attributed to "anonymous"; a second user starting a quiz replaces the first user's. The final exam uses the same singleton
|
Tutor.Core/Services/Quiz/QuizService.cs:14,30-35; Tutor.Core/Services/FinalExamService.cs:50,64-70; Tutor.Blazor/Program.cs:263
|
blocker |
| S3 | The lesson state, including the chat transcript, is one global key: users load and overwrite each other's conversation | Tutor.Core/Services/SettingsService.cs:14,146-171; Tutor.Shared/Components/Chat.razor:705,749,757
|
blocker |
| S4 | The active course is one global key: one user switching course switches it for everyone | Tutor.Core/Services/CourseService.cs:12,685-694; Tutor.Shared/Components/Chat.razor:643
|
blocker |
| S5 | Navigation state (AppUiState, SideNavService) is a singleton with cross-circuit events
|
Tutor.Core/Services/AppUiState.cs:67-84; Tutor.Blazor/Program.cs:132,135
|
high |
| S6 | Certificates are per user but are issued from the shared progress, so one user can be certified on another's work | Tutor.Shared/Components/FinalExamTab.razor:198-204,273
|
high |
| S7 | Theme, display names and avatars are app-wide; chat shows "User", not the signed-in name | Tutor.Core/Services/ThemeService.cs:28; Tutor.Shared/Components/Chat.razor:767-772
|
low |
Data and storage
| # | Finding | Evidence | Severity |
|---|---|---|---|
| D1 | One JSON file (11 MB locally) holds every course, every resource's full text, all progress and the lesson state. Every write re-serializes and rewrites it in place; a failed save is swallowed | Tutor.Blazor/Services/BlazorSecurePreferences.cs:60-61,130-141; Tutor.Core/Services/CourseService.cs:10-12,310-315
|
blocker |
| D2 | The vector store is one JSON file (420 MB locally): read whole into a string and deserialized on first use, kept in memory forever, rewritten whole on every change. On a 1.75 GB plan shared by five sites it will not load | Tutor.Core/Services/VectorStoreService.cs:17,306-307,328-330
|
blocker |
| D3 | A failed load is treated as "empty", and the next save writes that emptiness back: courses, the vector store and course structures can all be wiped by one corrupt read | Tutor.Core/Services/CourseService.cs:356-360; Tutor.Core/Services/VectorStoreService.cs:314-317; Tutor.Core/Services/CourseStructureStorageService.cs:89-92
|
high |
| D4 | Vector search is a linear scan with an LSH pre-filter and falls back to all chunks; every search copies the whole list under one lock | Tutor.Core/Services/VectorStoreService.cs:187-218,284-295
|
medium |
| D5 | Bundle import is not transactional and rewrites the preferences file once per resource and the whole vector file once per resource group | Tutor.Core/Services/Packaging/BundleImporter.cs:223-240
|
high |
| D6 | No backup of course data anywhere; blob soft delete off; Key Vault purge protection off; database retention 7 days | section 2 | high |
| D7 | No schema version or migration path on Course, CourseResource, UserProgress, QuizResult
|
Tutor.Core/Models/Course.cs, UserProgress.cs (no version field); only Tutor.Core/Services/Packaging/TutorCourseBundle.cs:27,29 versions a format
|
medium |
| D8 | The embedding model and dimension are hard-coded in two places; a mismatch returns similarity 0 silently | Tutor.Core/Services/EmbeddingService.cs:17-18,146; Tutor.Core/Services/LSHService.cs:47
|
medium |
| D9 | Live quiz generation appears to load the course's collection id through the single-map loader, which looks in a different folder, so it would return no questions (quizzes work only from baked questions). Read from the code; confirm before fixing | Tutor.Core/Services/Quiz/QuizGenerationService.cs:51-52; Tutor.Core/Services/Quiz/LocalQuizController.cs:86-87; Tutor.Core/Services/ConceptMapCollectionService.cs:28
|
high |
| D10 | The final exam takes the first N question hits in section order, so it always asks the same questions from the earliest sections | Tutor.Core/Services/Quiz/LocalQuizController.cs:109
|
medium |
Reliability and operations
| # | Finding | Evidence | Severity |
|---|---|---|---|
| R1 | UseExceptionHandler("/Error") points at a page that does not exist; there is no #blazor-error-ui element and no ErrorBoundary. An unhandled error freezes the page with no message
|
Tutor.Blazor/Program.cs:316; hosted GET /Error = 404; Tutor.Blazor/Components/App.razor:24-34
|
high |
| R2 | Quiz and exam LLM calls have try/finally with no catch: a missing key or provider error kills the circuit. The "no key" message tells the learner to open the Vault desktop app
|
Tutor.Shared/Components/QuizTab.razor:369-381,392-403; Tutor.Shared/Components/FinalExamTab.razor:214-242; Tutor.Core/Services/TutorKeys.cs:43-46
|
high |
| R3 | Startup reads the database before listening; with the database paused the site takes 60 to 90 s to answer, and if the database is unreachable the process does not start, so /healthz cannot report it
|
Tutor.Blazor/Program.cs:281-289; Tutor.Blazor/web.config:14 (600 s start limit); measured 87 s
|
high |
| R4 | Always On is off and no health check path is set, so every idle period ends in a cold start plus a database resume | section 2 | medium |
| R5 | Background work is a static class started fire-and-forget; its ShutdownAsync is never called, so a restart (every deploy restarts the site) drops in-flight builds without a save
|
Tutor.Blazor/Program.cs:301; Tutor.Core/Services/Queue/BackgroundQueueService.cs:14,120-158,470
|
high |
| R6 | The web UI queues resources on the older in-memory queue, which loses its work on restart; the persistent queue's upload, format and concept-map handlers are registered but never reached | Tutor.Shared/Components/CourseManagement.razor:1382,1444; Tutor.Core/Services/ResourceProcessingService.cs:28-29,82; Tutor.Blazor/Program.cs:216-218
|
high |
| R7 | No ILogger anywhere in Tutor's own code: everything goes to a static Log and a JSON file, so App Service logs and any telemetry see nothing. Once 5000 entries exist, every new log line rewrites the whole file
|
Tutor.Core/Services/Logging/Log.cs:14; Tutor.Core/Services/Logging/LogStorageService.cs:44,124-131; Tutor.Core/Services/Logging/LogStore.cs:32
|
high |
| R8 | No telemetry or alerts: App Service logging off, no Application Insights, no uptime check | section 2 | high |
| R9 | The queue rewrites its state file every 5 s even when idle (the hosted file's timestamp advances while nobody is signed in) | Tutor.Core/Services/Queue/BackgroundQueueService.cs:860-861; Tutor.Core/Services/Queue/BackgroundQueueState.cs:158
|
low |
| R10 | Cancelling a queued task only sets a flag; the handler keeps running and later marks it Completed. A task waiting to retry holds a concurrency slot for up to 5 minutes | Tutor.Core/Services/Queue/BackgroundQueueService.cs:358,654-660,740
|
medium |
| R11 | SQL calls retry transient failures (good), but nothing else has a retry or timeout policy of its own; three layers of retry stack on LLM calls (Legion, ConceptMapService, the queue's 10 retries)
|
Tutor.Blazor/Program.cs:228; Tutor.Core/Services/ConceptMapService.cs:940-955; Tutor.Core/Services/Queue/BackgroundQueueService.cs:282
|
medium |
| R12 | Fifty singletons hold state in memory and on a local file share: the site cannot run on two instances | Tutor.Blazor/Program.cs:72-274
|
medium (accepted for now; see Phase 3) |
Product, UX, accessibility
| # | Finding | Evidence | Severity |
|---|---|---|---|
| U1 | First impression: a new user sees 0/0/0 and a button to an empty chat; no guidance, no sample course, no key check | Tutor.Shared/Components/Pages/Home.razor:27-55; Tutor.Shared/Components/Chat.razor:24-27,408-441
|
high |
| U2 | No way to upload a document in the browser (see section 1); the ten bundled courses are not shipped with the site | Tutor.Blazor/Services/BlazorFilePickerService.cs:14-17; Tutor.Blazor/Tutor.Blazor.csproj (no Courses content)
|
high |
| U3 | Leaving the Chat tab destroys the chat (cancels a reply in flight, drops side conversations). "Ask about this concept" resets the lesson and repeats on every return, with another LLM call each time | Tutor.Shared/Components/LearnTabs.razor:88-140,224-229; Tutor.Shared/Components/Chat.razor:606-609,913-914,2333
|
high |
| U4 | Not usable on a phone: app.css has no media queries in about 7,200 lines; the lesson sidebar is fixed at 280 px beside the chat; the graph and panel drags are mouse-only
|
Tutor.Shared/wwwroot/app.css:5590-5592; Tutor.Shared/wwwroot/tutor-interop.js:79-85
|
high |
| U5 | The certificate, the payoff screen, has no styling and no print stylesheet, so "Print / Save PDF" prints the whole app | Tutor.Shared/Components/CertificateTab.razor:21-46 (no matching CSS in the repo)
|
high |
| U6 | No streaming: replies arrive all at once after a wait | Tutor.Core/Services/Abstractions/ILlmService.cs:18
|
medium |
| U7 | Accessibility: modals have no focus move, trap or Escape; the idle-logout warning has no role or live region; chat term and question links are not keyboard reachable; the focus ring uses a CSS variable that is never defined; several themes fail contrast (Light muted text about 2.8:1, Spring and Summer worse) | Tutor.Shared/Components/Chat.razor:87-106,2209-2252; Tutor.Shared/Components/UiUx/UserTimeout.razor:11-21; Tutor.Shared/wwwroot/css/a11y.css:23,40,53; Tutor.Shared/wwwroot/themes.css:16,75,161-162
|
high |
| U8 | The top bar stays white in every theme because its dark-theme rules use :global(...), which Blazor CSS isolation does not support; every page paints Light first and switches after load
|
Tutor.Shared/Components/Layout/TopMenu.razor.css:6,192-246; Tutor.Blazor/Components/App.razor:4; Tutor.Shared/Components/Layout/MainLayout.razor:27-28
|
medium |
| U9 | Unknown URLs return a bare 404 (no NotFoundPage, no status-code pages)
|
Tutor.Blazor/Components/Routes.razor:6-18; hosted /does-not-exist = 404 with empty body
|
medium |
| U10 | Progress the engine already tracks is invisible: spiral mastery level, section read / complete status, time spent, percent complete all exist in the model and in the unrendered SideNavNode
|
Tutor.Core/Models/UserProgress.cs:137-161,429-456; Tutor.Shared/Components/Layout/SideNavNode.razor:17,51-62
|
medium |
| U11 | About 400 lines of unreachable code in Chat (quiz mode, terminology and explorer modals), dead CSS, mojibake in two strings, about 60 console.log calls shipped
|
Tutor.Shared/Components/Chat.razor:991,1354,1533,2414; Tutor.Shared/wwwroot/tutor-interop.js
|
low |
| U12 | Components are too large to change safely: Chat.razor about 2,400 lines, CourseManagement.razor about 2,200, ConceptMapCollectionGraph.razor about 1,550; app.css is 155 KB in one file
|
file sizes | medium |
Testing and CI/CD
| # | Finding | Evidence | Severity |
|---|---|---|---|
| T1 | About 500 NUnit tests cover models, parsers, packaging, auth import and the lifecycle logic. Nothing tests the HTTP pipeline (no WebApplicationFactory), authorization per endpoint, or any component (no bUnit). The multi-user defects above pass every existing test
|
Tutor.Tests/ (506 [Test]/[TestCase] attributes); no match for WebApplicationFactory or Bunit
|
high |
| T2 | CI never builds the solution or the tests: it publishes one project and deploys. A change that breaks Tutor.Tests or Tutor.Cli still ships. Changes under Tutor.Tests/** do not trigger the workflow at all
|
.github/workflows/azure-deploy.yml:22-28,59-65
|
high |
| T3 | Deploys restart the live site in place (no slot; Basic tier has none), with no rollback step; the smoke test checks only three URLs | .github/workflows/azure-deploy.yml:91-119
|
medium |
| T4 | Cypress specs exist but run only by hand against a local site, skip when no credentials are set, and one helper script still refers to the pre-library auth | Tutor.Cypress/e2e/*.cy.ts; Tutor.Cypress/scripts/reset-auth.ps1:1-12
|
medium |
| T5 | main has no branch protection; action versions are tags, not pinned commits
|
gh api .../branches/main/protection = 404; azure-deploy.yml:50-92
|
low |
| T6 | Private MindAttic packages are vendored as .nupkg files in a public repo (lib/local-packages) so CI can restore
|
NuGet.config; lib/local-packages/
|
low (owner's call) |
Cost on Azure (today, approximate list prices)
| Item | Now | Comment |
|---|---|---|
| App Service plan B1 Windows | about $55 a month, shared by five sites | Tutor's share is small, but its memory needs are not: the current design cannot load its own vector store here |
Azure SQL TutorAuth
|
$0 (free offer) | Pauses when the free monthly amount is used; then sign-in is down until the next month. A second free-offer database for course data is allowed (up to 10 per subscription) |
| Key Vault, Blob | cents | |
| LLM | $0 hosted (no keys). The README puts a full book build at about two hours with real API spend | With keys and no cap, one signed-in user can run that as often as they like (row A3) |
5. Roadmap
Sizes: S under a day, M days, L a week or more. Items are ordered by value over cost inside each phase. Tests: every item adds or updates NUnit tests; nobody runs the suite as part of the item except CI (item 1.9), in line with the workspace rule.
Phase 0: safe to show someone (about 3 weeks)
| # | What to change | Where | Size | Depends on | Done when |
|---|---|---|---|---|---|
| 0.1 | Nothing that spends an API key is reachable without a login, verified on the hosted app. (a) Owner disables or resets the legacy account today on /users. (b) Import legacy dev-seed accounts as inactive (or not at all) and remove the password from comments. (c) Add a fallback authorization policy requiring a signed-in user, with an explicit anonymous allow-list: /login, /forgot-password, /account/reset, the three anonymous /_ma-auth posts, /healthz, /healthz/db, static assets; mark NotFound [AllowAnonymous]. The Blazor hub then refuses anonymous connections. (d) Add an NUnit test that walks every mapped endpoint (EndpointDataSource) and every @page component and fails if one is neither authorized nor on the allow-list. (e) Add the unauthenticated probe from section 3.2 to the deploy smoke test, asserting 302 or 401 for every non-allow-listed path, including POST /_blazor/negotiate
|
Tutor.Core/Services/Auth/AuthUserImportService.cs:19-24,70-72; Tutor.Blazor/Program.cs:229-247 (use o.ConfigureAdditionalPolicies), :337-349 (.AllowAnonymous()); Tutor.Shared/Components/Pages/NotFound.razor; Tutor.Tests (new EndpointAuthorizationTests, needs Microsoft.AspNetCore.Mvc.Testing); .github/workflows/azure-deploy.yml:104-119
|
M (a: minutes; b: S; c: S; d: M; e: S) | none | The new test is in the suite; the deploy log shows every probed path closed; POST /_blazor/negotiate returns 401 signed out
|
| 0.2 | Spending needs a role and has a ceiling. (a) Add an Author policy (Admin only to start) and put it on /courses, /instructions, /knowledge-graph and the "Auto-Link Orphans" action, enforced in a server-side service the way LibraryAdminActions does it, not only by hiding buttons. (b) Add a per-user limiter at the single LLM choke point: requests per minute and a daily budget per user, both Vault settings, with a clear "limit reached" message. (c) Stop student chat from writing shared concept maps (make expansion author-only or per-user). (d) ASP.NET rate limiter on the /_ma-auth group and the bundle download. (e) Turn on TOTP for Admin: add the /mfa and /account/mfa/setup pages (library components MaMfaChallenge, MaMfaSetup) and set Mfa.RequireForAdmin. (f) Write the break-glass procedure for a locked-out admin
|
Tutor.Shared/Components/Pages/Courses.razor:2, Instructions.razor:2, ConceptGraph.razor:3; Tutor.Shared/Components/ConceptMapCollectionGraph.razor:172; new Tutor.Shared/Services/CourseAuthoringActions.cs; Tutor.Core/Services/LlmServiceRouter.cs:31 and EmbeddingService.cs; Tutor.Shared/Components/Chat.razor:1847; Tutor.Blazor/Program.cs:333; new pages in Tutor.Shared/Components/Pages; Tutor.Core/Services/TutorSettings.cs (new settings)
|
L | 0.3 for the user id in (b) | A Student gets 403 on every authoring action (tested); a test user hits the limit and sees the message; an Admin cannot reach /users without a TOTP step
|
| 0.3 | Per-user state. Thread the signed-in user id (MaClaims.UserId from AuthenticationState) into every progress call; make the quiz session per circuit (scoped service) with the user id passed in; key lesson state and active course by user; make AppUiState and SideNavService scoped
|
Tutor.Core/Services/UserProgressService.cs:14,34; Tutor.Core/Services/Quiz/QuizService.cs:14,30-35; Tutor.Core/Services/SettingsService.cs:14; Tutor.Core/Services/CourseService.cs:12,685-694; Tutor.Blazor/Program.cs:132,135,159,263; callers in Chat.razor, LearnTabs.razor, QuizTab.razor, FinalExamTab.razor, Learn.razor
|
L | none | Two browsers signed in as two users: separate progress, quiz, transcript and course; a test fails if UserProgressService is called without a user id (remove the default)
|
| 0.4 | Safe chat rendering. Replace the hand-written converter with Markdig plus an HTML sanitizer; render term and question links as real buttons with data attributes and one delegated handler (also fixes keyboard access); stop storing stack traces on messages | Tutor.Shared/Components/Chat.razor:333,335,1858,2062-2253; Tutor.Shared/wwwroot/tutor-interop.js
|
M | none | A test feeds hostile Markdown and asserts no event-handler attributes or scripts in the output; links work from the keyboard |
| 0.5 | Errors people can see. Add the /Error page, the #blazor-error-ui element, an ErrorBoundary in the layout, a real not-found page (NotFoundPage plus status-code re-execute), and catch blocks around every LLM call that show a plain message ("The tutor is not available right now") and log the detail
|
Tutor.Blazor/Program.cs:316; Tutor.Blazor/Components/App.razor, Routes.razor; Tutor.Shared/Components/Layout/MainLayout.razor; QuizTab.razor:369-403; FinalExamTab.razor:214-242; Tutor.Core/Services/TutorKeys.cs:43-46
|
M | none | With no key configured, chat, quiz and exam each show the message and the page keeps working; /Error and unknown URLs render styled pages
|
| 0.6 | Stop data loss on a bad read. A failed load must throw or mark the store read-only, never become an empty list that is saved back; make the preferences and vector writes temp-file-then-replace; surface save failures | Tutor.Core/Services/CourseService.cs:356-360,88-93; Tutor.Core/Services/VectorStoreService.cs:314-317,328-330; Tutor.Blazor/Services/BlazorSecurePreferences.cs:130-154; Tutor.Core/Services/CourseStructureStorageService.cs:89-92
|
S | none | Tests corrupt each file and assert the original bytes survive the next save |
| 0.7 | Separate development from production. Give dev its own auth database (a second free-offer database, or LocalDB behind a setting); remove the production server name as the code fallback; run migrations in the deploy workflow with a migration-only identity instead of from a developer's machine | Tutor.Blazor/appsettings.json:9; Tutor.Core/Data/TutorAuthDbContext.cs:41-52; Tutor.Blazor/Program.cs:224-227,284-285; .github/workflows/azure-deploy.yml
|
M | owner decision Q5 | A local Debug run cannot reach TutorAuth; the workflow log shows the migration step
|
| 0.8 | Remove server-side desktop actions and dead entry points. Delete the Process.Start button; hide the Settings cog when hosted; remove the dead file-upload button until 2.2 replaces it
|
Tutor.Shared/Components/CourseManagement.razor:680,1498-1512,1534-1587; Tutor.Shared/Components/Layout/TopMenu.razor:39-45; Tutor.Core/Services/SettingsCog.cs
|
S | none | No Process.Start in Tutor.Shared; hosted top bar has no Settings cog
|
| 0.9 | Headers. Add X-Content-Type-Options, Referrer-Policy, remove X-Powered-By; serve d3 from the app; add a report-only CSP for app pages now (enforce in Phase 3 once inline handlers are gone)
|
Tutor.Blazor/Program.cs:312-322; Tutor.Blazor/web.config; Tutor.Blazor/Components/App.razor:28
|
S | 0.4 helps | Hosted response shows the headers; no third-party script origin |
| 0.10 | Public repository hygiene. Decide (Q1) whether the repo stays public. If it does: rewrite history to drop the copyrighted text and the old build output, delete ExportedScripts.txt, zzz_*.bat, the three zero-byte files, and fix the README's "no hosted demo" line
|
git history; ExportedScripts.txt; Tutor.Core/Services/KnowledgeBaseService.cs (0 bytes) and two more; README.md:20
|
S to M | Q1 | Fresh clone under 60 MB; the file no longer appears in git log --all
|
Phase 0 total: 2 L, 5 M, 3 S, about 3 weeks.
Phase 1: cloud-complete (about 5 to 6 weeks)
| # | What to change | Where | Size | Depends on | Done when |
|---|---|---|---|---|---|
| 1.1 | Give course data a real store. Put a storage interface in front of courses, resources, progress, quiz results, lesson state, certificates and the install registry, then implement it on Azure SQL (new TutorData database or a tutor schema; EF Core migrations) with resource text and .tutor bundles in Blob Storage. Keep the JSON implementation for the CLI and local use behind the same interface, so "one engine, two front doors" still holds
|
Tutor.Core/Services/CourseService.cs, UserProgressService.cs, Quiz/LocalQuizController.cs:173,211, CertificateService.cs:75,85, SettingsService.cs, Packaging/InstalledCourseRegistry.cs, Packaging/CourseBlobStore.cs, FileResourceService.cs; new Tutor.Core/Data/TutorDataDbContext.cs; Tutor.Blazor/Program.cs
|
L (2 to 3 weeks) | 0.3, 0.6; Q2 | Hosted site keeps courses and progress across a redeploy and a restart with C:\home\data\Tutor emptied; secure-preferences.json no longer holds course or progress data
|
| 1.2 | Vectors. Store chunks per course, not in one file. Recommended: an Azure SQL table with a native VECTOR(1536) column and exact distance search filtered by course (a course is a few thousand chunks, so exact search is fast and no index is needed), keeping the LSH and SimHash scores for the final ranking in memory on the top candidates. Fallback if the vector type is not available on this server: one binary float file per course in Blob, loaded on demand and evicted when idle. Spike first (S) to confirm the type works on the free-offer database
|
Tutor.Core/Services/VectorStoreService.cs (whole file); Tutor.Core/Services/Packaging/BundleImporter.cs:233-236; Tutor.Core/Models/ContentChunk.cs
|
L | 1.1 | Installing all ten bundled courses on the host keeps the site's memory flat; chat retrieval for one course returns in under a second after the database is awake |
| 1.3 | Keys and settings on the host. Add the OpenAI key and the chosen chat provider's key as Key Vault secrets with App Service references (MindAttic__Vault__LLM__openai__apiKey, ...); set MindAttic__Settings__Tutor__activeModel and ...__auth__Reset__PublicBaseUrl; add the five SMTP settings; set provider-side monthly spend caps on the keys used by the host
|
Azure only (names in section 3.3); Tutor.Core/Services/TutorSettings.cs:38
|
S | 0.1, 0.2 (do not add keys before spending is gated) | Hosted chat answers; "Forgot password?" delivers an email whose link opens the hosted site |
| 1.4 | Seed the ten bundled courses. Publish Courses/*.tutor with the site (or put them in Blob) and install any that are missing at startup through CourseInstallService, idempotently
|
Tutor.Blazor/Tutor.Blazor.csproj; Tutor.Blazor/Program.cs (startup); Tutor.Core/Services/Packaging/CourseInstallService.cs
|
M | 1.1, 1.2 | A brand-new hosted database shows ten courses after first start, and a second start installs nothing |
| 1.5 | Background work as a hosted service. Turn the queue into an IHostedService with graceful shutdown (save state, cancel handlers) and per-task cancellation; move the web UI onto the persistent queue and delete the in-memory one; persist queue state in the store from 1.1, only when it changes
|
Tutor.Core/Services/Queue/BackgroundQueueService.cs:14,120-165,358,470,654-660,860; Tutor.Core/Services/ResourceProcessingService.cs; Tutor.Shared/Components/CourseManagement.razor:1382,1444; Tutor.Blazor/Program.cs:301
|
L | 1.1 | A build started before a deploy resumes after it; cancel stops the handler; the state file no longer changes while idle |
| 1.6 | Logging and telemetry. Route the static Log through ILogger; drop the whole-file JSON log (or cap and rotate it); add OpenTelemetry with Azure Monitor (register Microsoft.Insights, one workspace-based Application Insights); log each LLM call's user, provider, characters and duration (the LlmUsage counters added in TUT-T50 are the start)
|
Tutor.Core/Services/Logging/Log.cs, LogStorageService.cs:41-48,124-131, MindAtticLogBridge.cs; Tutor.Core/Services/LlmServiceRouter.cs:36-50; Tutor.Blazor/Program.cs
|
M | none | A failed request on the host is findable in Application Insights with its stack trace; a per-user LLM usage query works |
| 1.7 | Health and startup. Move the legacy import and admin seed off the startup path (a hosted service with retry) so the site listens at once; add ASP.NET health checks (/healthz liveness, /healthz/ready covering SQL, Blob and Key Vault); set the App Service health check path; turn Always On on; show a "waking up" page while the database resumes instead of a hung request
|
Tutor.Blazor/Program.cs:281-289,337-349; Tutor.Blazor/web.config:14; Azure site config
|
M | none | Cold /healthz answers in under 10 s with the database paused; /healthz/ready returns 503 with the failing dependency named
|
| 1.8 | Backups. Turn on blob soft delete and versioning and Key Vault purge protection; add a weekly long-term retention policy if the free offer allows it, otherwise a scheduled export to db-backups; write and rehearse a restore (database, DP key ring, pepper) and record it in docs/ops
|
Azure; new docs/ops/tutor-restore.md
|
M | 1.1 | A restore into a scratch database and container has been done once, with the steps written down |
| 1.9 | CI gates. Add a pull-request and push workflow that builds Tutor.slnx with warnings as errors for new code and runs Tutor.Tests (CI is the one place the suite runs unasked); make deploy depend on it; add dotnet list package --vulnerable; pin actions by commit; protect main
|
.github/workflows/ (new ci.yml), azure-deploy.yml:22-28,46-71
|
M | Q6 | A commit that breaks a test does not deploy |
| 1.10 | Custom domain. tutor.mindattic.com with a managed certificate; set AllowedHosts and the reset-link base URL to it
|
Azure; Tutor.Blazor/appsettings.json:8
|
S | Q4 | The site answers on the domain; a request with another Host header is refused |
Phase 1 total: 3 L, 5 M, 2 S, about 5 to 6 weeks.
Phase 2: impressive (about 6 to 8 weeks)
| # | What to change | Where | Size | Depends on | Done when |
|---|---|---|---|---|---|
| 2.1 | A real home and catalogue. Home becomes "continue where you left off" (current course, next section, percent complete, time spent) plus a course catalogue with covers, descriptions and progress rings; a first-run panel for a new user ("Pick a book to start") | Tutor.Shared/Components/Pages/Home.razor; new Catalogue.razor; Tutor.Core/Models/UserProgress.cs:137-161
|
M | 0.3, 1.4 | A new account reaches a first lesson in two clicks with no setup |
| 2.2 | Upload a book in the browser. A real InputFile with a size cap, type check by content, streaming to Blob, and the existing parsers (PDF, EPUB, DOCX, HTML, TXT) registered in the host; a build page that shows each stage and an estimated cost before starting. Leave LibreOffice, Calibre and OCR formats to the CLI
|
Tutor.Shared/Components/CourseManagement.razor:1534-1626; Tutor.Blazor/Program.cs (register ParserRegistry as Tutor.Cli/Program.cs:133-146 does); Tutor.Core/Parsers/*; Tutor.Core/Services/Queue/Tasks/*
|
L | 0.2, 1.1, 1.5 | An Author uploads an EPUB on the hosted site and gets a course, with progress shown and the run surviving a refresh |
| 2.3 | Streaming replies. Add a streaming method to ILlmService (Legion permitting) and render tokens as they arrive; keep the chat alive when the tab changes (hide, do not dispose) and fix the "Ask about this concept" reset
|
Tutor.Core/Services/Abstractions/ILlmService.cs:18; provider services; Tutor.Shared/Components/Chat.razor:599-615,886-919,1782; Tutor.Shared/Components/LearnTabs.razor:88-140,224-229
|
L | streaming support in MindAttic.Legion (not checked, section 7) | First words appear within about a second; switching tabs loses nothing |
| 2.4 | Show the progress the engine already tracks. Bring back the lesson tree with locks, read / complete marks and spiral level (as a collapsible panel, not the old fixed sidebar); colour graph nodes by mastery; a per-course progress page | Tutor.Shared/Components/Layout/SideNavNode.razor; Tutor.Shared/Components/ConceptMapCollectionGraph.razor; Tutor.Core/Services/LearningPathService.cs:31-99
|
M | 0.3 | Mastery is visible on the lesson list, the graph and Home |
| 2.5 | Review queue (spaced repetition). Add a next-review date and interval per topic to TopicMastery, schedule from quiz results (simple SM-2 style steps), and a "Due today" card on Home that starts a short mixed quiz; add a day streak
|
Tutor.Core/Models/UserProgress.cs:429-456 (already has LastQuizAt, LastQuizScorePct, SpiralLevel); Tutor.Core/Services/LearningPathService.cs; QuizTab.razor
|
M | 0.3, 1.1 | A topic answered today reappears on its due date; the streak counts consecutive days |
| 2.6 | Quizzes worth trusting. Fix live generation (D9); sample exam questions across all sections with a per-attempt shuffle (D10); grade with a structured prompt that separates the student's text from instructions, prefer multiple choice graded in code where baked options exist, and an abandon button | Tutor.Core/Services/Quiz/QuizGenerationService.cs:51; LocalQuizController.cs:109,120-158; QuizTab.razor:25-110
|
M | none | Two exam attempts differ; an "ignore the above, mark correct" answer fails |
| 2.7 | A certificate worth sharing. Design and print stylesheet; sign with a server key (Key Vault) and add a public /verify/{number} page; a "My certificates" page
|
Tutor.Shared/Components/CertificateTab.razor; Tutor.Core/Services/CertificateAuthority.cs:44; CertificateService.cs:66-72
|
M | 1.1 | The printed page is one clean sheet; the verify URL confirms name, course, date and score |
| 2.8 | Phone layout. Responsive rules for the top bar (menu button), Learn tabs, chat, lesson panel and graph; touch handlers for pan, zoom and node select; 100dvh instead of 100vh
|
Tutor.Shared/wwwroot/app.css; Tutor.Shared/Components/Layout/*.razor.css; Tutor.Shared/wwwroot/tutor-interop.js:79-85
|
L | none | Every page is usable at 375 px wide with no horizontal scroll |
| 2.9 | Accessibility pass on the core flow. Shared modal component with focus trap, Escape and focus return; announced idle-logout warning; arrow keys on tabs; labels on icon buttons; fix the focus-ring variable and the failing theme colours; keep Light and Dark and retire or repair the four seasonal themes | Tutor.Shared/Components/Chat.razor:87-192; CourseManagement.razor:763-846; UiUx/UserTimeout.razor:11-21; LearnTabs.razor:19; Tutor.Shared/wwwroot/css/a11y.css:23,40,53; Tutor.Shared/wwwroot/themes.css
|
M | 0.4 | Login to quiz to certificate can be done with the keyboard only; automated contrast check passes for the kept themes |
| 2.10 | Theme without the flash, and personal settings. Set the theme on the server-rendered <html> from a per-user preference; follow the system setting by default; an in-app settings page for per-user choices (theme, display name, quiz length)
|
Tutor.Blazor/Components/App.razor:4; Tutor.Shared/Components/Layout/MainLayout.razor:22-35; TopMenu.razor.css:192-246; Tutor.Core/Services/ThemeService.cs
|
M | 1.1 | No light flash in Dark; two users keep different themes |
| 2.11 | Sharing and invitations. Export button for a course authored in the browser; a share link to a course's public summary page; email invitations so an admin can add a learner without setting a password by hand (Q3) | Tutor.Shared/Components/CourseManagement.razor; Tutor.Core/Services/Packaging/CourseExporter.cs; Tutor.Shared/Components/Pages/Users.razor
|
M | 1.3 | An invited person sets their own password from an emailed link and lands in the catalogue |
Phase 2 total: 3 L, 8 M, about 6 to 8 weeks.
Phase 3: polish and scale (about 4 to 6 weeks, can be spread out)
| # | What to change | Where | Size | Depends on | Done when |
|---|---|---|---|---|---|
| 3.1 | Split the three giant components into focused ones with their own state classes; delete the unreachable code and dead CSS; split app.css by feature
|
Chat.razor, CourseManagement.razor, ConceptMapCollectionGraph.razor, Tutor.Shared/wwwroot/app.css
|
L | 2.x | No component over about 500 lines |
| 3.2 | Component and browser tests: bUnit for Chat, Quiz, Library; the Cypress specs run in CI against a seeded test site with a test account; delete reset-auth.ps1
|
Tutor.Tests; Tutor.Cypress; .github/workflows/ci.yml
|
L | 1.9 | A UI regression in the learning flow fails CI |
| 3.3 | Enforce the CSP (no inline handlers or styles left); add Permissions-Policy
|
Tutor.Blazor/Program.cs; remaining inline style= in .razor files
|
M | 0.4, 3.1 | CSP is enforcing with no violations in telemetry |
| 3.4 | Scale-out readiness: no state in singletons that is not in the store; circuit state that must survive a reconnect uses PersistentComponentState; decide between staying on one instance (cheap, fine for tens of users) and Azure SignalR Service
|
Tutor.Blazor/Program.cs:72-274
|
M to L | 1.1, 1.5 | The site runs correctly on two instances in a test |
| 3.5 | Performance: cache settings reads (TutorSettingsSource.Current reloads on every call), add a negative cache for structure lookups, stop the per-second re-render timers, response compression and static-asset caching
|
Tutor.Core/Services/TutorSettings.cs (Current); Tutor.Core/Services/CourseStructureStorageService.cs:98-128; Tutor.Shared/Components/CourseManagement.razor:964-968
|
M | 1.6 (measure first) | Page and chat timings in telemetry meet a target agreed with the owner |
| 3.6 | Cost controls: an admin usage page (per user, per course, per day) from the 1.6 data; alerts on daily spend; a build-cost estimate stored with each course | new admin page; Tutor.Core/Services/LlmUsage.cs
|
M | 1.6, 0.2 | The owner can see who spent what, and gets an alert before a cap is hit |
| 3.7 | Deploy safety: when the plan is raised to Standard (or Tutor gets its own plan), deploy to a slot, smoke test it, then swap; add a rollback step | .github/workflows/azure-deploy.yml:73-119
|
M | Q8 | A failed smoke test leaves the live site on the previous build |
| 3.8 | Tidy the engine: remove the legacy KnowledgeGraph pipeline and its page (or fold it into the concept-map view), News, KimiService (or wire it), UserService, UserStorageService; one retry policy for LLM calls; schema versions on stored models
|
Tutor.Core/Services/KnowledgeGraph*.cs; Tutor.Shared/Components/Pages/ConceptGraph.razor; Tutor.Core/Services/News/*; Tutor.Core/Services/ConceptMapService.cs:940-955
|
M | none | Service registrations in Program.cs all have a consumer
|
Phase 3 total: 2 to 3 L, 5 to 6 M, about 4 to 6 weeks.
Total
About 18 to 23 weeks of focused work for one developer: four to five months. Phases 0 and 1 (about two months) are the part that cannot be skipped before other people use it. If time is short, the smallest version that can be shown to someone is 0.1 to 0.6, then 1.3 and 1.4 against the current file store with the ten courses and a single trusted user per account: about four weeks, with the limits in D1 and D2 still in place.
6. Open questions for the owner
| # | Question | Recommendation |
|---|---|---|
| Q1 | Should the repository stay public? It exposes the hosting details, the vendored private packages and, in history, a copyrighted book. | Make it private now (one click, reversible), then decide about a cleaned public copy later. |
| Q2 | Where does course data live: Azure SQL plus Blob, or stay on files moved to Blob? | Azure SQL (a second free-offer database, TutorData) plus Blob. It fixes concurrency, backup and per-user queries in one move, and the app already depends on SQL being awake to sign in.
|
| Q3 | Who is Tutor for: only people the owner adds, or open sign-up? | Invitation only for now. Open sign-up needs email verification, abuse controls and a per-user budget that someone is paying for. |
| Q4 | Which domain? | tutor.mindattic.com.
|
| Q5 | Should development keep using the production sign-in database? | No. A separate dev database, so a local experiment cannot migrate or lock production accounts. |
| Q6 | May CI run the NUnit suite on every push? The workspace rule stops agents running tests; it does not have to stop a build server. | Yes. It is the cheapest protection the project does not have. |
| Q7 | Who pays for learners' LLM use, and what is the monthly ceiling? | The owner's keys, with a hard monthly cap set at each provider, a default daily budget per user, and the cheapest adequate model as the hosted default (the code default is gpt-4.1-mini, Tutor.Blazor/Program.cs:86).
|
| Q8 | Give Tutor its own App Service plan? Five sites share 1.75 GB today. | Not yet. After 1.2 Tutor's memory use is small. Revisit when there are real users, or when slot deploys (3.7) are wanted. |
| Q9 | Is turning on TOTP for the admin account acceptable now? Earlier direction was "MFA off for now". | Yes, once keys are on the host: the admin account is the one that can create users and, after 0.2, the only one that can spend freely. |
| Q10 | Keep the six themes? | Keep Light and Dark, follow the system setting, drop the four seasonal themes (three fail contrast). |
| Q11 | Are the ten Gutenberg courses the showcase, or should there be a flagship course built for the purpose? | Start with the ten; they already exist and are public domain. Add one short non-fiction course to show the concept graph at its best. |
7. What was not checked
- No build and no test run (workspace rule; another agent was changing the code under TUT-T50). Test counts are attribute counts, not a run.
- No signed-in session on the hosted site, so the signed-in pages were reviewed from code, not seen. The legacy account's sign-in was not attempted (it would change the account).
- The XSS path in A5 and the quiz-generation path in D9 were read from the code and not executed.
- MindAttic.Legion's retry, timeout and streaming support were not read;
MindAttic.Vaultwas read only for configuration names. - Whether Azure SQL's vector type is available on this free-offer server (item 1.2 starts with that spike).
- Whether Tesseract's native libraries load on App Service; where the MindAttic.Log SQLite file lands on the host.
- The service-layer files
ConceptMergeService,OrphanConceptLinkerService,SectionContentService,CourseStructureServiceandDynamicConceptExpansionServicewere searched, not read in full;app.csswas sampled. - Line numbers are from the working tree on 2026-11-19;
LlmServiceRouter.cs,EmbeddingService.csandTutorSettings.cswere being edited by TUT-T50 at the time and may have shifted by a few lines. - Cost figures are list-price estimates, not read from billing.