Project
Changelog
What changed in each SmartKMS release, newest first.
v2.0.0-beta.22 — November 21, 2026 (supersedes beta.21)
Moving Files After a Storage Switch
Changes
- Move files into the current storage: after switching where documents are stored (MinIO to SharePoint, say),
python scripts/move_files.pymoves the files uploaded before the switch. Each file is copied, the copy is checked against the original, the document and its versions are pointed at it, and only then is the old file deleted. A file that fails stays where it was and keeps working; run it again to retry.--dry-runlists what would move. - Startup check: the server log says how many files are still in the previous storage, and warns when that storage can't be reached, because those documents won't open until it runs again.
Upgrade notes
- No database changes and no new settings. Restart with Quick Start, or rebuild the
apiservice on a Docker deployment. See Configuration → Storage for the command.
v2.0.0-beta.21 — November 20, 2026 (supersedes beta.20)
Ready for the University's Server
Changes
- Documents in SharePoint: SmartKMS can store uploads in a SharePoint site's Documents library (or one person's OneDrive) in the university's Microsoft 365. Previews and downloads stream through SmartKMS, so its own access rules still apply.
- Storage warnings: administrators see a banner on every page once storage is 80% full, with the space used. When it's full, an upload that won't fit is refused before anything is stored, the uploader is told to ask an administrator, and the Activity Log records it. Works for MinIO and SharePoint.
- Files up to 500 MB, as the final-defense panel asked (was 100 MB).
- AI on another server: SmartKMS can use an Ollama on another machine, or send only the chat model to a vLLM server with the local one as a backup.
- Shorter page addresses:
/p/login,/p/documentsand so on. Old/pages/….htmllinks still work. - Security: pages no longer say which software serves them, the browser code is obfuscated in the Docker image, and signed-out visitors' pages no longer call the session refresh.
- The home page's How It Works clips come from the updated explainer video.
Fixes
- A brief server error could sign you out for good (a refresh during a restart). Only an expired session does that now.
- The Docker image couldn't start on Python 3.11 (a search query used newer syntax).
- Documents stored in MinIO stopped previewing after switching storage to Google Drive or SharePoint.
- Files saved from a SharePoint or Google Drive preview now keep the document's name.
Upgrade notes
- No database changes. Restart with Quick Start, or for a Docker deployment run
start.sh/start.bat→ Docker Deployment, which addsCOMPOSE_PROFILES=ollamato an older.env.deployso the bundled AI keeps starting (by hand: add that line yourself). - New optional settings:
STORAGE_WARN_PERCENT,STORAGE_RESERVE_MB, theONEDRIVE_*storage settings andCHAT_API_*(see Configuration). - The upload limit is 500 MB unless your
.envsetsMAX_UPLOAD_SIZE_MB. An older.envmay still say100: change or delete that line.
v2.0.0-beta.20 — November 20, 2026 (supersedes beta.19)
Import from Google Drive and OneDrive
Changes
- Import from Google Drive or OneDrive: the Documents upload area can offer Google Drive and OneDrive buttons. Connect your school account, pick up to 20 files from your drive (folders and search included), and SmartKMS copies them in and processes them like any upload. Google Docs, Sheets and Slides arrive as Word, Excel and PowerPoint files.
- Read-only and short-lived: SmartKMS can only read your drive, the connection lasts about an hour, and no Google or Microsoft password or sign-in is stored. Disconnect ends it at once.
Upgrade notes
- Restart the app with Quick Start in
start.bat/start.shafter updating. There are no database changes. - The import is off until the server administrator sets
GOOGLE_DRIVE_IMPORT/ONEDRIVE_IMPORTand adds the read-files permission and a redirect URI to the Google or Microsoft sign-in app (see Configuration).
v2.0.0-beta.19 — November 19, 2026 (supersedes beta.18)
Search Spelling Fix
Fixes
- “Did you mean …?” no longer “corrects” everyday words. A search for How many absences are allowed in a semester? suggested How may absences …, because suggestions come from the words in your documents and none of them said “many”. Common English words, and Filipino question words such as paano, saan and kailan, now count as spelled correctly. Real typos are still caught (scolarship → scholarship).
Upgrade notes
- Restart the app with Quick Start in
start.bat/start.shafter updating. There are no database changes and no new settings.
v2.0.0-beta.18 — November 18, 2026 (supersedes beta.17)
Public Ask Check
Changes
- The server log says what the public Ask page answers from when SmartKMS starts, and warns about any folder with the public folder's name that is ignored because no administrator created it (see Configuration).
Upgrade notes
- Restart the app with Quick Start in
start.bat/start.shafter updating, then look for thePublic Askline in the server log. There are no database changes.
v2.0.0-beta.17 — November 18, 2026 (supersedes beta.16)
Audit Fixes
Changes
- Only an administrator changes email addresses, like your organization. Microsoft and Google sign-in find your account by its email address.
- Changing your password signs you out everywhere else. This browser stays signed in.
- The public Ask page answers only from a public folder an administrator created.
Fixes
- A view-only share of a restricted folder let its holder manage the folder: share it wider, give themselves editing, or delete it. Now only its creator, an administrator, or someone it's shared with as Can edit can.
- A document in the Trash or the Archive could be approved, which brought it back into search and the Q&A Assistant. It must be restored first now, and a reapproval request for it is refused.
- Cancelling while an edited document was being processed deleted the whole document and its history, skipping the Trash. Cancel now only works on a new upload.
- Document views and downloads were missing from Analytics.
- The Activity Log export keeps text that looks like a spreadsheet formula as text.
- Folder names can't be blank, very long tag names and very large profile pictures are refused with a clear message, and a few other inputs that caused a server error now explain what is wrong.
Upgrade notes
- Restart the app with Quick Start in
start.bat/start.shafter updating. There are no database changes. - If your public Ask folder was created by someone who isn't an administrator, have an administrator create it and move its documents there.
v2.0.0-beta.16 — November 17, 2026 (supersedes beta.15)
Ask Without an Account
Changes
- Public Ask page:
/asklets anyone ask about the documents an administrator puts in the public folder, with no account. It looks and works like the Q&A Assistant, its numbered sources open the document, and it doesn't save the questions. - Sign in with Google: people can sign in with their school Google account, if the server administrator turns it on.
- Did you mean …? AI Search corrects misspelled searches using the words in the documents you can open. When nothing matches what you typed it shows the results for the corrected words, with Search instead for to keep your spelling.
- Handles more people at once: tested with 200 users at the same time, 100 uploads in a burst and the 100 MB file limit.
Fixes
- Searches and Q&A answers could fail under heavy use because they kept a database connection open while waiting for the AI model.
- A very large upload was read into memory before it was refused. Files over the limit are now refused straight away, and at most four uploads are processed at a time.
- The Terms & Conditions checkbox could stay locked after scrolling to the end.
- Why this answer? now fits its content, and Back works on the How SmartKMS uses AI page.
Upgrade notes
- Restart the app with Quick Start in
start.bat/start.shafter updating. It applies the small database update itself. - Both new features are off until set in
.env:PUBLIC_ASK_FOLDERfor the public Ask page andGOOGLE_OAUTH_CLIENT_ID/GOOGLE_OAUTH_CLIENT_SECRETfor Google sign-in (see Configuration).
v2.0.0-beta.15 — November 16, 2026 (supersedes beta.14)
AI You Can Check
Changes
- Told when it's AI: the Q&A Assistant says it is an AI the first time you open it, and answers, summaries and suggested tags are labelled as AI-generated.
- Why this answer? under each Q&A answer shows whether it came from your documents or from general knowledge, which model wrote it, every document it was given and how well each matched, and which ones it cited and why.
- How this was decided in a document's Approval section lists each automatic content check, what it found, and whether a person made the final decision, with Request Reapproval on a rejected upload.
- How SmartKMS uses AI: a new page in the Help menu describes each AI feature, the model behind it, what it sees, what it can get wrong and where people decide. It follows the EU AI Act's transparency principles.
- Terms & Conditions 1.9.0: covers archiving, scheduled backups and the AI explanations. Everyone accepts the new version at their next sign-in.
Fixes
- A document could be approved without being screened when the AI model was down during the upload. It now waits for a person to review it.
Upgrade notes
- Database change: Quick Start in
start.bat/start.shnow applies database updates itself, and starts Docker Desktop if it is closed. Restart the app with it after updating.
v2.0.0-beta.14 — November 16, 2026 (supersedes beta.13)
Archive, Backup & Restore, and a New Q&A Assistant
Changes
- Archive: the uploader of a document, or an admin, can Archive it from its right-click menu or the viewer's File menu when it is outdated or was uploaded by mistake. For everyone else it disappears from Documents, AI Search and the Q&A Assistant, and old links to it say it is no longer available. The new Archive page in the sidebar lists what you archived (admins can see everyone's); Retrieve puts a document back exactly as it was.
- Backup & Restore: admins get a new card in Settings. Backups can run every day, week or month at a set time, into a folder you choose, keeping the newest few. Back up now, download, delete or upload a backup, and Restore one: a backup of the current data is made first, then everything is replaced with the backup's and everyone signs in again. A backup holds the database, every document file, profile pictures and logos.
- Q&A Assistant: while it works, a short list shows each step (searching, the documents it is reading, writing, checking sources), then folds into one line you can open again. Answers mark their sources with small numbers you can click to open the document, N sources under the answer opens the list, and Follow-ups suggests questions to ask next.
Fixes
- Replaced files could be deleted after an update: a file kept by Replace could be moved to the Trash by the next Full Install and removed 30 days later. Updates no longer do this, and any file already moved comes back.
- Delete forever waited half a minute when file storage was down before saying it failed. It now gives up within seconds.
- Folder counts included replaced files, so a folder could say it held more documents than it showed.
Upgrade notes
- Database changes: run the setup again (Full Install, or
python scripts/setup_db.py), then restart the app. Automatic backups start off. - Two dependencies with security advisories were updated (dnspython, opentelemetry-api).
v2.0.0-beta.13 — November 12, 2026 (supersedes beta.12)
Cleaner Q&A Answers
Fixes
- The Q&A Assistant repeated curse words back: sent a Filipino/Tagalog curse on its own, it answered with the same word. It is now told never to curse in any language or repeat the user's, and curse words that slip through are hidden behind asterisks in the answer and the conversation's title. Everyday words that only look similar are left alone.
- "I can't provide links", followed by a link: asked for the link to its source, the assistant said it couldn't, then gave two. It now gives a link only when that address is in the documents, such as a paper's DOI, and says so plainly; any other link in an answer is shown as plain text.
Upgrade notes
- Server changes: restart the app after updating. No database changes.
v2.0.0-beta.12 — November 12, 2026 (supersedes beta.11)
Getting Started Checklist
Changes
- Getting started: Help > Getting started in the account menu lists a few first things to try, with a progress bar and a link to each. Adding a profile photo, asking the Q&A assistant a question and uploading a document (not shown to researchers) tick themselves; trying AI Search and reading the user manual you tick yourself.
Fixes
- The old onboarding page was a leftover placeholder: made-up tasks, someone else's initials, nothing saved, and open to anyone. It is now the checklist above, for signed-in users only.
Upgrade notes
- Page changes only: no database changes and no restart needed.
v2.0.0-beta.11 — November 12, 2026 (supersedes beta.10)
Phone Preview Fixes
Changes
- Previews fill the phone screen: the preview that opens from AI Search, Q&A citations and the dashboard now takes the whole screen on a phone, with the title cut to two lines. On an iPhone a long title used to leave the PDF a strip about 200 pixels tall.
Fixes
- Pages further into a long PDF could come out blank on iPhones: every page scrolled past stayed drawn, and iPhones stop drawing once those drawings use too much memory. Pages far from view now let go of theirs and are drawn again when you scroll back.
- The wrong document could show after switching quickly: opening a second document before the first finished loading could leave the first one's title or pages on screen, or stop the second one drawing.
- iPads asking for the desktop site got the browser's viewer, which shows only page 1 there; they now get the same page-by-page preview as phones.
- Settings on small phones: the Full Name and Email boxes ran past the edge of the card.
- Admins' organization switcher on Documents used the wrong font and could run off a phone screen.
Upgrade notes
- Page changes only: no database changes and no restart needed.
v2.0.0-beta.10 — November 11, 2026 (supersedes beta.9)
PDF Previews on Phones
Changes
- PDF previews on phones and tablets: phone browsers have no built-in PDF viewer, so SmartKMS now draws the pages itself with pdf.js 4.10.38 (Apache-2.0, served from the SmartKMS server), one page at a time as you scroll. This covers the Documents preview and the preview from AI Search, Q&A citations and the dashboard. Computers keep the browser's own viewer.
Fixes
- "This content is blocked. Contact the site owner to fix the issue." instead of a PDF preview on phones, reported by pilot testers. It was not Private DNS or an ad blocker: the preview was a frame that phone browsers cannot fill with a PDF.
- The answer rating buttons were hard to find: Copy and the thumbs only appeared on mouse hover, which touch screens do not have. They now always show on phones and tablets and under the latest answer.
Upgrade notes
- Page changes only: no database changes and no restart needed. File storage must allow the site's address (CORS) so pdf.js can fetch the file; MinIO does by default.
- User manual, edition 2.6: the preview and rating sections describe phones and tablets.
v2.0.0-beta.9 — November 11, 2026 (supersedes beta.8)
Selecting Without Checkboxes
Changes
- Selecting several, like Windows Explorer: on Documents, Ctrl+click (Cmd+click on a Mac) adds or removes a document, Shift+click selects a range, Ctrl+A selects everything listed and Esc clears; a plain click still opens a document. In the Trash a click selects a row. Right-click > Select does the same without a keyboard, including on touch screens. The checkboxes are gone.
Fixes
- The Name column was narrow and a wide blank gap sat at the right of the Documents table (since beta.8): the checkbox column had shifted every column one place, so names were cut off after a few words, and on phones the document names were hidden. Every column is back in place.
Upgrade notes
- Page changes only: no database changes and no restart needed. User manual edition 2.4.
- User manual, edition 2.5: every screenshot retaken on beta.9, so the menu, File menu, Password, Documents and sign-in figures now show the Trash, the show-password eye and folder sharing; new figure of the Trash page.
- Testing: the browser tests now select with Ctrl+click, Shift+click and Ctrl+A, and a new test checks the Name column is the widest. Full browser suite: 41 pass; the review-queue test that is flaky in full runs passes on its own.
v2.0.0-beta.8 — November 10, 2026 (supersedes beta.7)
Right-Click Menus and Multi-Select
Changes
- Right-click menus: right-click any document or folder, in the list or the grid, for what you can do with it: Open, Download, Rename, Remove from folder and Move to Trash for documents; Open, Share, Rename and Delete for folders. Only the actions you're allowed to take are listed. In the Trash, right-click a row for Restore or Delete forever.
- Selecting several documents: tick documents, or Select all, and move them to the Trash together from the bar above the list.
- Trash: tick several to restore or delete them together; Restore all; Delete all (formerly Empty Trash). The time left reads N days left, in red in the last 3 days.
Fixes
- A tile's ⋮ menu offered Rename and Delete to everyone, and the server then refused people who weren't allowed. It now only offers what you can do.
Upgrade notes
- Page changes only: no database changes and no restart needed.
- Testing: the full browser suite passes (40 tests), including new ones for right-clicking, selecting several documents and the Trash's bulk actions. The 30-day purge was also run once against the real MinIO: the file and the document were both removed. Google Drive deletion uses the same code but wasn't tested live.
- User manual, edition 2.3: new section on right-click menus and selecting several documents; the Trash section updated.
v2.0.0-beta.7 — November 10, 2026 (supersedes beta.6)
Terms & Conditions 1.8.0 and User Manual Edition 2.2
Changes
- Terms & Conditions 1.8.0: deleted documents are kept 30 days in the Trash, restorable by the uploader or an administrator, then purged (Section 13; version 1.7.0 said 90 days). Filing a document in a folder shares it with everyone who can open the folder (Section 10.2), and folder suggestions only list folders you can open (Section 8.3). Everyone is asked to accept the new version at their next sign-in.
- User manual, edition 2.2: new sections on sharing a folder, restoring documents from the Trash, and leaving Q&A while an answer is written; the ad-blocker notice, the show-password eye in Settings, menu tooltips and the Terms reading hint; retention, recovery, the role matrix and the glossary corrected to match. Download the PDF.
Upgrade notes
- Page changes only: no database changes and no restart needed. Section 26 of the Terms promises at least 30 days' notice for material changes, so announce this one if your deployment treats it as material.
- The manual's existing screenshots were not retaken for these versions: the menu, File menu, Password and Documents screenshots don't yet show the Trash, the eye icons or the folder sharing icon.
v2.0.0-beta.6 — November 10, 2026 (supersedes beta.5)
Q&A Answers Survive Leaving the Page
Fixes
- Leaving Q&A mid-answer lost the question and the answer. The answer was generated inside the page's connection, so leaving stopped it, and the question, saved only together with the finished answer, was thrown away too. Now the question is saved when sent and the answer keeps being written on the server until it's done.
- Coming back mid-answer re-attaches to it: what was already written appears at once and the rest streams in live, with Stop still working. This is the resumable streams design documented by LibreChat and the Vercel AI SDK.
- Interrupted answers say so: a question left without an answer, with nothing still being written (for example after a server restart), shows This answer was interrupted before it finished and an Ask again button.
- A message sent the moment Q&A opened could have its reply wiped by the page's own loading finishing afterwards; sending now waits for it.
Upgrade notes
- Restart the API after updating. No database changes. New endpoint:
GET /api/chat/sessions/{id}/stream(204 when nothing is being written). - Answers in progress live in the server's memory: with several API workers, or across a restart, a returning page shows the answer as interrupted instead of re-attaching.
- Testing: 755 tests pass (
pytest -m "not live_ai"), including tests that drop the connection mid-answer and browser tests that leave for AI Search and come back. Live-AI tests were not run.
v2.0.0-beta.5 — November 10, 2026 (supersedes beta.4)
Folder Sharing and Trash
Changes
- Folder sharing: folders have the same levels as documents (Private, Shared with people, Public, Cross-Org, Global), set with Share on a folder. Like Google Drive, everyone who can open a folder can open every document in it, even Private ones; people get Can view or Can edit, and downloads follow each document's own setting. A document shared more widely than its folder keeps its own audience, and people who can't open the folder see it on its own.
- Who manages folders: faculty, staff and admins can rename, share and delete any folder they can see in their organization. Researchers stay read-only. New folders start private.
- Warnings: moving a document into a folder that opens it to more people asks first, and widening a folder with documents in it warns in the Share dialog.
- Trash: deleting moves a document to the Trash (sidebar). My Trash lists what you uploaded; admins can switch to everyone's. Restore, Delete forever and Empty Trash. After 30 days the file and its earlier versions are removed from storage (MinIO or Google Drive) and the document is deleted.
Fixes
- Deleted files stayed in storage forever, and a deleted document still opened from a direct link. Both are fixed by the Trash.
- Search, chat prompts and folder suggestions follow folder sharing too, and a folder's count shows only what you can open.
Upgrade notes
- Database changes: run
python scripts/setup_db.py(or the launcher) and restart the API. It adds folder sharing (existing folders become Public) and the Trash columns. - Earlier deletes join the Trash, dated from the audit log. Ones deleted more than 30 days ago are removed from storage within about 6 hours of upgrading, permanently. Restoring one sends it back through review.
- Testing: 750 tests pass (
pytest -m "not live_ai"), including 24 new API tests and 4 browser tests. The migration was run on a copy of the pilot database. Live-AI tests were not run.
v2.0.0-beta.4 — November 10, 2026 (supersedes beta.3)
Fixes from the Pilot Testers
Changes
- Show-password eye in Settings: Current, New and Confirm password each have an eye button to show or hide what was typed, the same one the sign-in page has.
- Sidebar tooltips when collapsed: hovering an icon shows the page name, and screen readers get each link's name while the label is hidden.
- Nudge on the Terms gate: clicking I have read and agree before scrolling to the end turns the Scroll to the bottom hint red and shakes it (no shake with reduce motion).
Fixes
- Researchers could start an upload: clicking repeatedly while Documents loaded could hit the upload area before the page hid it, and the file was sent (the server refused it). The upload area now starts hidden and only appears for roles that can upload; files a researcher drops on a folder are ignored too. The dashboard no longer tells researchers to "Upload one."
- Landing page: "Staff" removed from Get Answers and the Q&A Chatbot card.
Upgrade notes
- Front end only (
static/): no database or API changes, and no restart needed for the pages./healthreports the new version after a restart. - Testing: 722 tests pass (
pytest -m "not live_ai"), including seven new browser tests. Live-AI tests were not run. - Faster AI on laptops with built-in graphics: see Troubleshooting → AI answers are slow. On the pilot laptop this cut an answer from about 21 s to about 9 s.
v2.0.0-beta.3 — November 10, 2026 (supersedes beta.2)
Ad-Blocker Notice, Folder Permissions and Reliable Background Tags
Changes
- Ad-blocker notice for the document editor: ONLYOFFICE has no check of its own, so a blocked editor was a blank pane or a Loading editor… that never finished. Now a notice says an ad blocker or privacy extension may be stopping it, with Reload and Continue anyway. It shows when the editor's script is blocked, or after 15 seconds without the editor getting ready, and closes itself if the editor turns up late.
- How It Works clips: the home page plays three short silent clips (upload, analyze, answers) served from
/videos. - Shorter suggestion chips: on Search and Q&A, long paper titles are cut to their main title so the chips no longer run off the page.
- Updated CSS and JavaScript reach browsers at once: pages link their stylesheets and scripts with a version taken from the file's modified time, so a change is not held back by browser or Cloudflare caching.
Fixes
- Folder permissions: only a folder's creator or an admin can rename or delete it, and researchers (read-only) can no longer create folders. Before, any colleague in the organization could rename or delete a shared folder, which moved all its documents to the root.
- Summaries and tags after bulk uploads: when several files were processed together, the fixed 60 to 120 second AI timeout expired and the document was saved with an empty summary and no tags. Background calls now wait up to 900 seconds for their turn.
- Editor retry: opening a document again after the editor's script had failed to load no longer hangs on Loading editor….
Upgrade notes
- Restart the API after updating: everything except the ad-blocker notice touches Python (folder permissions, the background timeout, the shorter chips, and the
/videosroute and versioned CSS/JS links inapp/main.py). The notice is front end only. No database changes. - Testing: 716 tests pass (
pytest -m "not live_ai"), including two browser tests for the notice. Not tested with a real ad-blocker extension.
v2.0.0-beta.2 — November 4, 2026 (pre-release; supersedes beta.1)
Review Queue for Flagged Documents
Changes
- Needs review: administrators get a Needs review button on the Documents page, with the number of documents waiting. It lists every document the content screen flagged, from every folder; uploads still being screened are left out. The button only appears while something is waiting.
- Approve and Reject in the list: each flagged document's row or tile has Approve and Reject, so a decision no longer needs the document opened. The list stays where it is.
- Next document: approving or rejecting in the document viewer opens the next flagged document. After the last one, the viewer stays on it and shows its new status.
Upgrade notes
- Front end only (
static/pages/documents.html): the existingGET /api/documents?status=pendingfilter supplies the list. No database or API changes. - Feature freeze: this feature is an exception to the freeze announced with beta.1. Other releases until the stable 2.0.0 still carry only fixes.
- Testing: 710 tests pass (
pytest -m "not live_ai"), including the browser tests and new ones for working through a queue and for non-administrators not getting it. Live-AI tests were not run.
v2.0.0-beta.1 — October 27, 2026 (pre-release; supersedes alpha.14)
Beta 1: Feature Freeze for UAT and the Pilot
Beta
- Feature freeze: until the stable 2.0.0, releases only carry fixes found on the university staging server, in user acceptance testing and in the pilot. Each fix ships as the next
beta.N.
Security
- JWT library: PyJWT 2.15.1 replaces python-jose. python-jose's DER-key algorithm-confusion bypass has no fixed release, and it pulled in
ecdsa(CVE-2024-23342, never fixed). Every token is still HS256, with the algorithm pinned when it is decoded. - Generated secrets:
start.batandstart.shrun the newscripts/ensure_secrets.pyon every launch. It replaces the publicCHANGE_MEplaceholders forSECRET_KEYandONLYOFFICE_JWT_SECRETin.envwith random values and leaves keys that are already set alone. Anyone who knew a placeholder could forge login tokens or ONLYOFFICE download and save tokens. - One ONLYOFFICE secret:
docker-compose.ymlnow passesONLYOFFICE_JWT_SECRETfrom.envto both the ONLYOFFICE container and the API, so the two can't drift apart. The launchers' old mismatch check is gone. - Dependencies: Pillow 13.0.0 (October 2026 fixes: JPEG/TIFF/FPX heap overflows, Ghostscript argument injection, decoder denial-of-service bugs) and pypdf 6.21.2 (xref, form-field and array runtime and memory bugs).
Upgrade notes
pyproject.toml/uv.lock:2.0.0b1;/healthreports2.0.0-beta.1. Runuv sync(the launcher does this) for PyJWT, Pillow and pypdf. No database changes.- Docker: set
ONLYOFFICE_JWT_SECRETin.env.docker composenow stops with an error when it is missing;start.bat/start.shgenerate it for you. - Testing: all 690 non-browser tests pass (
pytest -m "not browser and not live_ai", 5.5 min), including the newtest_ensure_secrets.py. Browser and live-AI tests were not run.
v2.0.0-alpha.14 — October 20, 2026 (pre-release; supersedes alpha.13)
Terms Update, Load-Test Performance & ZAP Fixes
Changes
- Terms of Service: Section 29, Contact & Data Protection Officer, and its table-of-contents entry are removed. Data-rights requests, copyright takedown notices, breach and security reports, and notices to us now go to your organization's SmartKMS administrator.
- Image policy (CSP):
img-srcallows only the configuredBRAND_*_URLorigins instead of anyhttps:image.scripts/share.pyno longer puts thehttp://local editor address in the public site's CSP.
Performance (100-user load test)
- Database: connections are pooled (10 + 20 overflow, pre-ping, recycled every 30 minutes) instead of opened per request; the SCRAM login on every request was most of the API's CPU.
- AI calls: one shared TLS context for every Ollama and NudeNet client; building a new one per call was about 13% of CPU.
- Keep-alive: 75 seconds in
run.pyanddocker-compose.deploy.yml, so connections reused by Caddy or Cloudflare are not closed mid-request. - Load-test kit:
tests/load/seeds 100 test users and documents, runs the Locust workload, and measures time to first answer and sequential uploads (see its README; use a separate database and bucket).
Fixes
- OWASP ZAP findings: malformed ids return 404 and text the database can't store (NUL bytes, over-long values) returns 422, instead of 500 errors that echoed the SQL and its values. The ONLYOFFICE callback rejects bodies that aren't a JSON object with 400.
- Support page: View Documentation pointed at the retired
skms-wikiaddress; it now openshttps://nncast.github.io/smartkms-docs/.
Upgrade notes
pyproject.toml/uv.lock:2.0.0a14;/healthreports2.0.0-alpha.14. No database or dependency changes.- Testing: all 688 non-browser tests pass (
pytest -m "not browser and not live_ai", 6 min), including the newtest_bad_input.py. The two CSP tests that failed in alpha.13 when.envselects Google Drive now pin MinIO storage and pass. Browser and live-AI tests were not run.
v2.0.0-alpha.13 — October 13, 2026 (pre-release; supersedes alpha.12)
Security Hardening, User Import/Export & Personal Google Drive
Security
- Refresh tokens: signing in again or refreshing now really retires the old token. Tokens were stored as bcrypt hashes, which read only the first 72 bytes, so any older token still matched; they are now SHA-256 hashes compared in constant time, each with a unique
jti. Existing sessions sign in once more after upgrading. - Microsoft sign-in: accounts are matched on the verified
userPrincipalName, not themailfield any tenant admin can set; guest accounts (#EXT#) are refused. - MinIO: the bucket stays private. Startup no longer adds an anonymous read policy and removes that statement from existing installs (keeping any others), so presigned URLs' expiry means something again.
- Organization changes: only admins can change a user's organization; Settings shows it read-only to everyone else.
- Editing: editing a document's text or restoring a version requires being able to see the document, and edited text goes through the same sensitive-content screen as an upload.
- Image screening: an image the screen couldn't check (NudeNet down, model missing, timeout) is held for manual review instead of being approved as clean.
- Pages: titles, tags, summaries, names, reasons and citations are escaped wherever they reach HTML;
avatar_urlaccepts only the path an upload produces. - ONLYOFFICE: the save callback accepts only real Document Server callbacks and uses the signed data, not the request body.
- pypdf 6.20.0 for the latest crafted-PDF denial-of-service fixes.
Features
- User import and export: the Users page exports users to Excel (same layout as the import template) or CSV, and imports them from the template, which has drop-downs for role and organization.
- Personal Google Drive: a personal @gmail.com Drive can hold the documents. Sign in once with
scripts/gdrive_login.py(an OAuth "Desktop app" client) and pointGOOGLE_DRIVE_CREDENTIALS_FILEat the saved token; files use that account's own quota. A service account still needs a folder in a Workspace Shared Drive, since it has no storage of its own (.env.examplewalks through both). - "Keep me signed in for 7 days": the checkbox says how long, taken from
REFRESH_TOKEN_EXPIRE_DAYS. - Launchers: option 5 (Clean) deletes the database with the new
scripts/drop_db.py, which asks for its name first; tidier colors instart.bat/start.sh. Silent session refresh runs once even when several requests expire together.
Fixes
- Cross-Org documents: colleagues in the uploader's own organization see them again in the list, tag filter, search, AI chat retrieval and suggestions; the Cross-Org filter, access chip and organization panel work on the Documents page.
- Replace: the old document is archived only once its replacement is stored, so a storage hiccup no longer leaves nothing in its place.
- File names: downloads and previews work with any characters in the name (em dashes, smart quotes, emoji, CJK).
- NudeNet service: detection runs off the event loop, images are decoded to the format the model expects, and non-images get a 422.
- Uploads and errors: a cancelled upload stays cancelled; Microsoft sign-in and storage errors show plain messages (technical detail for admins only); a file deleted outside SmartKMS shows a clear "not found".
- Windows: pages no longer hang on the loading spinner (explicit content types for
.js,.cssand others), and a document deleted or rejected while still processing stays that way. - The sidebar opens and closes instantly; the Support page links point to the renamed repository.
Version
pyproject.toml/uv.lock:2.0.0a13;/healthreports2.0.0-alpha.13. Runuv sync(the launcher does this) for pypdf 6.20.0; no database changes. Test suite: 686 non-browser tests pass with the default MinIO storage (two security-header tests assume MinIO and fail when .env selects Google Drive). Known issue: the browser tests still fail at the Sign In click ("element is not stable").
v2.0.0-alpha.12 — September 28, 2026 (pre-release; supersedes alpha.11)
Sharing Rights for Colleges, Profile Pictures, E-mail Suggestions & Fast Document Lists
Documents list for thousands of files
- The Documents page loads 50 documents at a time and fetches the next 50 as you scroll ("Showing 250 of 9,000 documents"). It used to request only the first 100 and filter those in the browser, so anything beyond them never appeared — not even in search.
- Search, the tag / type / access / date filters, sorting (name, owner, date, size), folders and the organization scope now run on the server, so they cover every document. Changing any of them starts the list from the top; renaming, moving or deleting a file keeps your place. The tag filter lists every tag in scope (new
GET /api/documents/tags); links to a document and finished uploads open even when they'd sort beyond what's loaded. GET /api/documentsgainedunfiled,category,since_days,tag_exact,sort/dirandvisible_to_org; page size up to 500;%and_in search text match literally. Tested with 10,000 documents: first page in about a second.
Sharing
- Cross-Org rights: each college a document is shared with gets Can view / Can edit / No access plus a download switch, like people do (
document_org_access.can_edit,can_download). Members see "Shared with your organization by … — view only, download not allowed". - E-mail suggestions: Add person by email is one dialog with the e-mail, access and download together. Typing suggests SmartKMS accounts whose e-mail or name starts with what you typed, people you've shared with recently first ("Recent"); ↑/↓, Enter, Esc. New
GET /api/users/lookup(uploaders only; name, e-mail and college). - Owner-only controls: the access chip, Rename, Delete and the rename pencil are shown only to the uploader and admins (the server already refused them for everyone else).
Profile pictures
- Settings → Profile: click your initials to add a picture (PNG, JPG, WebP or GIF up to 5 MB), or Remove it. It's checked as an image, turned upright, cropped to a square and saved as a 256×256 WebP (
POST/DELETE /api/users/me/avatar). Shown on the sidebar account button and next to names in the Documents Owner column and on Reapprovals.avatar_urlno longer accepts outside links. - Stored in
static/images/avatars/; the Docker deployment keeps pictures and Customization logos in theavatars_data/branding_datavolumes (added to the backup commands indeploy/README.md) and leaves them out of the image.
Fixes
- "File already exists" for someone else's file: the name check compared against every document in the folder, including other people's private ones — it revealed their titles and Replace would have archived them. Only files you could replace yourself (your own; any for an admin) count now, for uploads and renames.
- Word editor not loading on localhost while sharing online: with the named tunnel running, pages opened on
localhostwere given the tunnel's editor address, a cross-site frame that Edge's tracking prevention (Strict, the InPrivate default) breaks. They now get the local editor (ONLYOFFICE_LOCAL_URL, set byscripts/share.py); the CSP allows both. - MinIO image: the official
minio/minioimage was removed from Docker Hub and Quay, so a full install failed. Both compose files usepgsty/minio(a maintained community build, pinned), and the launchers pull with--ignore-pull-failures.
Version
pyproject.toml/uv.lock:2.0.0a12;/healthreports2.0.0-alpha.12. Existing databases: runpython scripts/setup_db.py(the launcher does this) for the two newdocument_org_accesscolumns. Test suite: 608 non-browser tests passing. Known issue: the browser tests still fail at the Sign In click ("element is not stable").
v2.0.0-alpha.11 — September 28, 2026 (pre-release; supersedes alpha.10)
Per-Person Download Rights, Folder Suggestion Feedback & UI Fixes
Sharing: edit, view or no access, with or without download
- Each person a document is shared with now has three access levels in the dropdown next to their name: Can edit, Can view and No access (removes them), plus a download checkbox beside it.
- Adding a person opens a single Share Document dialog: Can view or Can edit, and Allow download (on by default). Cancelling or closing it now shares nothing — before, closing the old "Access level" question quietly shared the document as view-only.
- Without download, the person can still open and preview the document, but the Download buttons show a lock, the server refuses both download routes (
403), and the document editor's own Download and Print are turned off. The owner and admins can always download. Stored asdocument_user_access.can_download(default true, so existing shares keep downloading). - The access option is labelled "Shared" in the app (formerly documented as "Restricted").
Close a folder suggestion as "not recommended"
- The Suggested folder card has a ✕. Closing it records the folders it showed as not recommended for that document (new table
folder_suggestion_dismissals), so they aren't suggested for it again, and logs the dismissal in the Activity Log. Only the uploader or an admin can dismiss. Terms of Service Section 8.3 and the retention table describe this.
Organization colours
- Settings → Add / Edit Organization replaces the browser's colour box and its hex/rgb/hsl readout with twelve preset swatches (the first five are the colleges' own colours), a custom-colour swatch, a hex field, and a live preview of the organization's dot, name and code. Works in light and dark mode.
Fixes
- AI Search results: the file-type icon stretched to the full height of the card when the description wrapped — the card used an
items-startclass that didn't exist. The icon is a fixed square now, and the description is one line ending in "…" (full text on hover). - Red buttons that weren't red: "Delete" (document, conversation), "Replace" (file already exists) and "Discard changes" used an undefined
btn-destructiveclass and rendered grey. Also added the other missing utility classes (justify-end,mb-1,ml-2,block,space-y-5), which restores the spacing in Settings → Appearance and Display. - Flagged images cut off after "Show anyway": revealing a flagged image only removed the blur from a copy cropped to fill the pane. It now opens the normal viewer, which fits the whole image and keeps zoom.
Version
pyproject.toml/uv.lock:2.0.0a11;/healthreports2.0.0-alpha.11. Existing databases: runpython scripts/setup_db.py(the launcher does this) to add the new column and table. Test suite: 592 non-browser tests passing (new: download rights intest_document_sharing.py, dismissals intest_ai_organization.py). Known issue: the browser tests currently fail at the Sign In click ("element is not stable"); this predates this release.
v2.0.0-alpha.10 — September 26, 2026 (pre-release; supersedes alpha.9)
Visible Length Limits, Blank-Form Screening Fix & Test Suite Reliability
Chat and search length limits you can see
- There used to be no limit on what you could type, but long input was silently cut at several points behind the scenes — only the first 4,000 characters were safety-checked, only the first 8,000 were used to find documents, and the model's working memory could push the rest out without saying so. A long pasted message looked accepted while part of it was ignored.
- Chat: messages are now capped at 4,000 characters (matching the safety check, so nothing goes unscreened). A counter appears under the input from 3,200 characters ("3,412 / 4,000"), turns red with "limit reached" at 4,000, and the box stops accepting more. Shown on mobile too.
- Search: the search box, the four Advanced search word fields, suggestions and the Documents page filter accept up to 500 characters.
- Both limits are enforced in the browser and validated on the server (
422) —MESSAGE_MAX_LENinapp/schemas/chat.py,SEARCH_QUERY_MAX_LENinapp/schemas/search.py. A rejected chat message now shows the actual reason instead of "[object Object]". See the User Manual.
Fixes
- Blank forms flagged as sensitive: a form listing only field labels ("Name: ____ Address: ____ TIN: ____") was flagged, because the model met the "quote your evidence" rule by quoting the blank field itself. The screening prompt now covers multi-field blank forms explicitly, and
_is_placeholder_evidence()drops any flag whose quoted evidence is just a label next to blanks, "N/A", "TBD" or x/0 fill. Real values (an SSS number, an address, a bank account) are still flagged. Found byscripts/eval_ai.py; screening now scores 5/5 there. - "what is 12 + 30?" was sent to document search because the arithmetic check only recognised a bare sum; a "what is / calculate / how much is" lead-in now routes to plain chat as well.
- Upload tests without MinIO: the ten upload tests mocked the upload itself but not the storage readiness check that runs just before it, so they failed with 503 whenever MinIO was stopped. A shared test fixture now stubs it.
- Browser test cleanup: the table wipe between browser tests could deadlock with a request the closed page left in flight on the app server; it now uses a 5-second lock timeout and retries.
Version
pyproject.toml/uv.lock:2.0.0a10;/healthreports2.0.0-alpha.10. Test suite: 596 tests, all passing with MinIO stopped (new: chat and search length-limit cases intest_chat.py,test_search.py,test_documents.py).
v2.0.0-alpha.9 — September 25, 2026 (pre-release; supersedes alpha.8)
Splash & Login Redesign, Conversational Assistant, Model-Comparable Test Suite
Gradient-ribbon splash hero, and a login screen that flows out of it
- The landing hero's floating logo glyph is gone; in its place two soft gradient ribbons (drawn from the logo's five brand colours — purple, blue, teal, amber, red) drift slowly behind the headline over a fine grain texture, with a bottom scrim so the page copy stays readable. Dark mode's background is now
#121416throughout (cards, sidebar, borders each a step lighter), matched from the reference screens rather than the previous flat near-black; light mode's hero sits on the plain page background with no gradient wash. - Clicking through to Sign In now plays a genuine page transition (
@view-transition { navigation: auto; }) instead of a hard cut, with the logo mark itself morphing between the two pages via a sharedview-transition-name. The login screen gets its own colour treatment — thin gradient "strands" in a different pattern from the hero's ribbons, pushed out to the left and right edges so they frame the form instead of competing with it, drawn once on load and otherwise static. - The hero's highlighted headline no longer draws an underline beneath it. The "See How it Works" button picked up a frosted-glass fill (
backdrop-filter: blur()over a translucent tint) instead of a flat outline.
The assistant can now just talk to you
- Casual messages — greetings, "how are you", small arithmetic ("what is 12 + 30?"), a follow-up like "what are they" right after "i like apples" — get a direct conversational reply instead of being run through document search or answered as if every message were a knowledge-base question. The router (
is_smalltalk()) recognises a much wider range of casual phrasing, question starters, and short follow-ups tied to the previous message. - The last 6 turns of a conversation are now carried into every prompt, casual or document-grounded, so the assistant remembers what was just said instead of restating the same generic reply each turn. Document answers gained a third "casual/general" response category so an off-topic aside inside a document chat doesn't get a "couldn't find a source" brush-off.
Launchers and Docker follow whichever models are set in .env
start.bat/start.shand the Docker deployment no longer assumeqwen2.5:3b/nomic-embed-text/llava: they readOLLAMA_CHAT_MODEL,OLLAMA_EMBED_MODEL,OLLAMA_VISION_MODEL(and the optional moderation model overrides) from.envand pull whatever is actually configured, so swapping to a larger model before deployment is a one-line.envchange rather than an edit to the launcher scripts. Embedding requests now use the correct instruction prefix for the configured model's family instead of one hard-coded scheme.
Test suite now exercises the AI models and the browser, not just mocks
- Live AI tests (
tests/test_live_ai.py) run the real Ollama models end to end — retrieval picks the right document, unknown questions are admitted rather than guessed at, casual chat never claims it "couldn't find a source", conversation history is actually used, tags come back as plain values, and a record with an SSN is flagged while an ordinary policy isn't. They skip automatically when Ollama or the configured models aren't available, so the rest of the suite is unaffected. - Browser tests (
tests/test_browser.py) drive the real app in a real browser end to end: landing → login → dashboard, a wrong password staying on the form with an error, being bounced back to login when signed out, the sidebar account menu and its logout confirmation, a chat reply's thumbs-up being saved and reflected in the UI, view-only vs. can-edit sharing (the Edit button appearing or not), and the#121416dark-mode background. - Model quality check (
scripts/eval_ai.py, not part of the test suite) scores whichever chat/embedding models are configured against 62 fixed questions with known answers — retrieval accuracy, correct facts, admitting what isn't in the documents, casual chat, tag format, and sensitive-content screening — and saves a per-model JSON report, so a model swap (e.g.qwen2.5:3b→7b) can be compared objectively before it ships. Run withuv run python scripts/eval_ai.py; requires Ollama running locally.
Version
pyproject.toml/uv.lock:2.0.0a9;/healthreports2.0.0-alpha.9. Test suite: 586 tests (new:tests/test_live_ai.py,tests/test_browser.py;scripts/eval_ai.pyis a standalone quality-comparison script, not part of the pytest run).
v2.0.0-alpha.8 — September 21, 2026 (pre-release; supersedes alpha.7)
Real Document Sharing with View/Edit Rights, Chat Feedback the AI Learns From & Brand Refresh
Sharing that actually works, with view-only vs. can-edit
- The document viewer's Access panel (add a person by e-mail, "Can view" / "Can edit", share with other colleges) only ever edited the page's local state: nothing was saved, a "shared" person could not open the document at all, and anyone who could open a document could also edit it. It is now real end to end —
PUT /api/documents/{id}/accessstores people (each withcan_edit) and organizations, unknown e-mails are reported back by name instead of being dropped, and every change is audit-logged (app/routers/documents.py,document_user_access.can_edit). - Access checks honour the shares: a restricted document appears in the shared person's list (even across colleges) and opens for them; a cross-org document does the same for the ticked colleges. View only means exactly that — the Edit button becomes a "View only" note and the content editor, ONLYOFFICE edit mode / force-save and version restore all refuse with 403. Can edit unlocks them. Shares are dormant while the document isn't Restricted.
- Document payloads now carry
can_editfor the current viewer; the share lists themselves are returned only to the uploader/admin. Non-managers see "Shared with you by … — view only / you can edit" in place of the management panel. See the User Manual.
Thumbs up / down on answers — and the assistant learns from them
- Hovering an assistant reply shows Copy, thumbs up and thumbs down; a rating is stored per answer (
chat_messages.feedback,POST /api/chat/messages/{id}/feedback), survives a reload, and can be flipped or cleared. Owner of the conversation only, assistant messages only, audit-logged. - Ratings change later answers in two ways (
app/services/feedback_service.py). Document nudge, organization-wide: every rated answer's citations vote for the documents behind it; retrieval scales each candidate's relevance by 5% per net vote (capped at ±20%), so documents that keep producing bad answers sink and good ones rise — nothing about the conversations is exposed, only a ranking bias. Answer memory, per person: when the same user asks something very similar (cosine ≥ 0.80 on a question embedding stored at rating time), their earlier rated answer goes into the prompt — liked as an approach to build on, disliked as something not to repeat. Deliberately not shared between users, since an answer can quote documents the original asker could see and a colleague may not. - The reply says when either applied ("Informed by your 1 disliked answer to similar questions" / "Informed by 3 document ratings from your organization"), and the first rating of a session gets a short thanks. The
chat_messages.question_embeddingcolumn is added bysetup_db.py.
Brand and UI refresh
- AI icon: everything labelled "AI" (AI Summary, Suggested folder, Analyzing badge, landing page "AI Analyzes", suggestion chips) uses a monochrome glyph derived from the SmartKMS mark — filled with
currentColorso it follows the theme — instead of the generic four-point sparkle; on the chips it's drawn in the theme's primary colour. Where the assistant is actually working (chat thinking bubble, citation check, AI Summary re-processing, Analyzing badge) the full-colour logo spins; the three bouncing dots are gone. - Chat: no avatars on either side — replies sit flush left, yours flush right, bubble colour tells them apart. The action row under a reply is hover-only.
- Sidebar account menu: the standalone Logout row is replaced by a clickable profile block (initials avatar, name, role; full-width hover like the nav links) that opens a menu above itself: Help → About SmartKMS (these docs) / Terms of Service, and Log out with confirmation. Works from the collapsed rail too. The chat assistant's built-in App Guide now describes this flow instead of a "Sign Out, top right" button that no longer existed.
- Type: all headings use DM Sans Bold instead of Playfair Display, which read as decorative next to the body text; the extra font download is gone.
- Landing page: the hero's pill, headline, copy, buttons and stats rise in one after another, the highlighted line draws a blue-to-amber underline, and three soft brand-coloured glows drift behind it with the logo glyph turning once every 90 seconds at ~5% opacity. All decorative and off under reduced-motion.
- Amber theme is the brand's
#E69B19(with the logo's blue as accent) and white text. - Assets:
static/images/logo-wordmark.svg/-light.svg— mark + "SmartKMS" in DM Sans Bold, with the seven glyphs embedded as a 1.3 KB font subset so they render identically anywhere — plus 2040×480 transparent PNG renders of both. - Removed the last user-facing emoji (dashboard greeting, the Ollama-offline chat message).
Fixes
- Image preview: tall images and long screenshots were stuck centred with their top and bottom cut off, and "Fit" only fitted the width. The zoom box sized itself to the image rather than the pane, and a flex-centred child taller than its parent has an unreachable top half. The box now fills its pane, the image is centred with auto margins (which collapse on overflow, so scrolling starts at the top-left), and the fit is recomputed from a ResizeObserver so the maximize toggle re-fits without a window resize (
static/js/imageZoom.js,styles.css). - Auto-tags came back as "document-kind: exam" / "subject: mobile-game-design" — the model was echoing the prompt's own category hints. The prompt no longer suggests labels, and
normalize_tag()strips a leading "label:" and spaces out hyphen slugs ("mobile-game-design" → "mobile game design"; single-hyphen compounds like "e-learning" are kept). - Sidebar logout hover stopped short of the sidebar edges (the footer carried the horizontal padding); the profile block now carries the same inset as the nav links, and long names/roles truncate instead of wrapping.
- "No preview for this file" and file tiles show the same per-type icon and colour as the row icons — green sheet for XLSX/CSV, orange deck for PPTX, red PDF, blue Word — instead of a text label that only knew PDF/DOC/XLS. The dropzone hint lists CSV, PPT and PPTX, which the picker already accepted.
Version
pyproject.toml/uv.lock:2.0.0a8;/healthreports2.0.0-alpha.8. Test suite: 523 tests (new:test_document_sharing.py,test_chat_feedback_loop.py, feedback endpoint tests intest_chat.py, tag-normalization cases intest_ai_organization.py).
v2.0.0-alpha.7 — September 19, 2026 (pre-release; supersedes alpha.6)
AI Auto-Tagging, Folder Suggestions & Guided Google Drive Setup
Automatic topic tags on upload
- Every upload now gets 2–5 topic tags from the AI as a new Suggesting tags… stage of the processing pipeline, after the summary and before the content screen (
app/services/document_processor.py). Tags the uploader typed themselves are kept; the AI only adds to them, and anyone who can edit the document can remove a tag from the viewer as before. - The model is shown the organization's existing tags (most-used first) and told to reuse those spellings, coining a new tag only when nothing existing fits — so a knowledge base converges on one
networkingtag instead of accumulatingnetwork/networks/networkingacross uploads and making the tag filter useless (app/services/ai_service.py:extract_tags(), which previously existed but was never called). - Output is normalized the same way manual tags are (lowercase, 2–40 characters, at most 4 words) and tolerant of what small local models actually produce — fenced JSON, a
Tags:prefix, or a plain comma list. Tagging is best-effort: if Ollama is down or the model returns junk, the upload still completes normally with no tags.
"Suggested folder" in the document viewer
- Opening a document you own (or any document, as an admin) now shows where the AI thinks it belongs, with a one-click Move here and up to two alternatives. Backed by a new
GET /api/documents/{id}/suggest-foldersendpoint (app/services/folder_suggestions.py). - Folders are ranked by how similar the document is to what's already in them, using the same pgvector embeddings as search:
0.6 × best match + 0.4 × average matchacross the folder's documents — so one very similar file counts, but a large mixed folder that merely contains something similar doesn't automatically beat a small focused one. A folder whose name matches the document's title or tags gets a boost; for an empty folder (or a document that has no embedding yet) that name match is the only signal used. - The document's current folder is never suggested, anything below a 50% match is dropped rather than shown as a weak "maybe", and non-admins are only scored against documents they're allowed to see. The card hides itself while a document is still processing.
Launcher walks you through Google Drive storage
- Picking Google Drive in
start.bat/start.sh's storage menu used to end with "now go fill in.envyourself". Both scripts now ask for the two things Drive needs and write them to.env: the service-account JSON key (paste or drag the downloaded file in — it's copied to the git-ignoredsecrets/google-drive-key.json, and the account'sclient_emailis printed so you know exactly which address to share the folder with) and the Drive folder, as either its URL or bare id (the id is extracted from a pasted URL automatically). - If an existing
.envalready saysgoogle_drivebut either setting is still blank — the state the old flow left every Drive install in — the scripts notice and prompt for what's missing instead of starting an app that can't store anything. The services summary now shows the configured folder, or what's still missing.
Logo-based AI icon and Amber theme
- Everything the app labels as "AI" — the AI Summary and Suggested folder cards, the Analyzing… badge, the chat assistant's avatar and the landing page's "AI Analyzes" step — now uses a monochrome glyph derived from the SmartKMS logo (the five-square mark, filled with
currentColorso it follows the theme like every other icon) instead of the generic four-point sparkle. While the model is actually working — the chat's thinking bubble before the first token arrives, the Analyzing badge, the AI Summary's re-processing state — the mark breathes with a slow quarter-turn (.ai-thinking; reduced-motion users get a fade only), and settles once content starts streaming. - The Amber (yellow) theme preset now takes its yellow and blue from the logo's actual colours (
#E59A18/#2772BD) instead of unrelated placeholder hues, darkened slightly so that its text — now white in both light and dark mode, replacing the near-black that was hard to read on yellow — keeps enough contrast (static/js/app.js:themePresets).
.env.example rewritten
- Every setting now explains what it does, when you'd change it, and what to put for each scenario (native, Docker Desktop, LAN, production). Eight settings that never existed in the code (
DB_POOL_SIZE,DB_TIMEOUT,RATE_LIMIT_PER_MINUTE,LOG_LEVEL,API_DOCS_ENABLED,SESSION_TIMEOUT_MINUTES,DATA_DIR,LOGS_DIR) are gone; seven that did exist but were undocumented (MAX_LOGIN_ATTEMPTS,LOCKOUT_MINUTES,OLLAMA_VISION_MODEL,OLLAMA_MODERATION_MODEL,OLLAMA_MODERATION_VISION_MODEL,S3_PUBLIC_SECURE,MICROSOFT_REDIRECT_URI) are in. The Configuration page here has been brought in line with it. MAX_UPLOAD_SIZE_MBnow actually works. It was defined but never read — the server limit was a hardcoded 100 MB. It's wired through now (app/services/storage_service.py); the upload dialog's own pre-check is still a fixed 100 MB, so raising it above that also means editingDZ_MAX_BYTESinstatic/pages/documents.html.ONLYOFFICE_S3_ENDPOINTis legacy: ONLYOFFICE has fetched documents through the API's/office-downloadendpoint (which is also what makes it work with the Google Drive backend) rather than from MinIO directly for some time. It now has a default, so it can be dropped from.env; an existing value is harmless.- The MinIO placeholders
CHANGE_ME_MINIO_ACCESS_KEY/CHANGE_ME_MINIO_SECRET_KEYnever matched theminioadmin/minioadminthe localdocker-compose.ymlstarts MinIO with, so a fresh local install couldn't upload until someone fixed.envby hand. The example now ships the compose values; production (.env.deploy) still refuses to start on them.
Repository hygiene
- Two loader.io domain-verification tokens that had been committed under
static/verification/were removed and purged from the entire git history (all commit hashes from v1.4.0 onward changed; tags were force-updated to match). The folder stays as an ignored drop location — anything placed in it is still served at the site root by the catch-all route — and.gitignorenow coverssecrets/,*.pem,*.p12,*-key.json,service-account*.jsonandstatic/verification/*. - Logo files renamed to
static/images/logo.svgandlogo.png(previouslylogo-mark.svg/favicon.png); theBRAND_LOGO_URLdefault and every reference follow.
Version
pyproject.toml/uv.lock:2.0.0a7;/healthreports2.0.0-alpha.7. Full test suite: 517 passing (29 new intests/test_ai_organization.pycovering tag normalization, the vocabulary prompt, tag persistence, the pipeline stage, and folder scoring against a real pgvector table).
v2.0.0-alpha.6 — September 17, 2026 (pre-release; supersedes alpha.5)
Dependency Security Patches
GitHub Dependabot fixes
pypdf6.15.0→6.16.1— GHSA-23w6-3w8w-8484 and a related infinite-loop fix: unbounded runtime/memory or an infinite loop from a crafted PDF outline/XForm/tree structure. Directly relevant, since this app extracts text from user-uploaded PDFs via the same outline-walking code path.pytest8.4.2→9.0.3(dev-only) — vulnerable tmpdir handling.pytest-asynciobumped0.24.0→1.4.0alongside it, since0.24.0caps pytest at<9.ecdsa(CVE-2024-23342, Minerva timing attack) documented as an accepted risk rather than patched: a transitive dependency ofpython-josewith no upstream fix (the maintainers consider timing side-channels out of scope), but every JWT this app issues or verifies uses HS256 (HMAC) exclusively — the vulnerable ECDSA signing/keygen/ECDH code path is never reached. Dismissed on GitHub with that justification (pyproject.toml: comment onpython-jose).
Version
pyproject.toml/uv.lock:2.0.0a6;/healthreports2.0.0-alpha.6. Full test suite: 460 passing, now on pytest 9.
v2.0.0-alpha.5 — September 17, 2026 (pre-release; supersedes alpha.4)
Google Drive Storage Backend, Advanced Boolean Search & Sign in with Microsoft
Google Drive as an alternative to MinIO
- Documents can now be stored in an organization's Google Drive instead of running MinIO — pick one in
start.bat/start.sh's setup menu (asked once, remembered in.env), or setSTORAGE_BACKEND=google_drivedirectly. One subfolder per organization is created automatically under a shared root folder authorized to a service account (app/services/storage_backends/google_drive_backend.py). - Drive has no browser-safe presigned URL of its own — unlike a MinIO/S3 signature, Drive's "anyone with the link" sharing never expires, which would make a document permanently public the moment its link leaked. Downloads and previews instead go through a new signed
GET /api/documents/_storage-streamendpoint that fetches the bytes server-side, the same "proxy it ourselves" pattern already used for ONLYOFFICE's document fetch. - A document's
storage_keycarries its own backend (agdrive:prefix vs. a bare MinIO key), so switchingSTORAGE_BACKENDlater only changes where new uploads go — documents already stored under the previous backend keep working. The AI pipeline (extraction, embeddings, summaries) is unaffected either way, since it only ever calls the same dispatcher. - Choosing Google Drive in the setup menu skips starting the MinIO container entirely.
Toggleable advanced search
- New panel on the AI Search page: All / Any / None-of-these-words and an exact-phrase field, compiled to a Postgres
websearch_to_tsqueryexpression server-side (app/schemas/search.py:SearchFilters.boolean_query()); include/exclude fields are color-coded (green/red, dark-mode aware). - Filters for document type, upload date range, uploaded-by, tags and organization; a match-mode selector (AI semantic + keywords / keywords only / AI semantic only) and a sort order (relevance / newest / oldest / title) (
app/services/search_service.py). - The panel sits directly under the search bar now instead of leaving an oversized gap.
Sign in with Microsoft
- Optional Entra ID / Microsoft 365 login button above the e-mail field, hidden until
MICROSOFT_CLIENT_ID/MICROSOFT_CLIENT_SECRETare configured. Supports a domain allowlist and auto-provisioning new accounts into a chosen organization (app/routers/oauth_microsoft.py). - Logging out now asks for confirmation first.
Users & Activity Log
- CSV user import now accepts an optional per-row
organizationcolumn, so one file can populate several organizations at once — blank rows fall back to the dialog's default organization (app/routers/users.py). - Fixed the import/export icons and replaced the native "Choose File" control with a flat file-picker button + filename display.
- Activity Log table columns are now resizable and the widths persist per browser; the oversized gap between the IP address and user-agent columns is fixed.
Fixes
- Drag-and-drop into folders on the Documents page was fully broken — both dragging an existing document onto a folder and dragging a file in from the desktop. The delegated
data-on*event dispatcher's drag handlers readevent.currentTarget, which under that dispatcher is alwaysdocument(the real listener's attachment point), not the folder being dragged over — every drop silently failed before doing anything. Fixed to use the dispatcher's bound element instead, and taught the drop handler to also accept OS files, uploading them straight into that folder (static/pages/documents.html). - Styled the "Signed in as" organization-switcher dropdown, previously an unstyled native
<select>.
Version
pyproject.toml/uv.lock:2.0.0a5;/healthreports2.0.0-alpha.5. Full test suite: 460 passing.
v2.0.0-alpha.4 — September 17, 2026 (pre-release; supersedes alpha.3)
CSV Uploads & Native Table Previews
CSV is now an accepted document type
.csvjoins PDF / Word / Excel / PowerPoint / images in the upload dropzone and the backend allow-list.- Browser mislabelling handled: Windows machines with Excel installed send
.csvasapplication/vnd.ms-excel, others astext/plainorapplication/csv. The extension decides, and files are stored astext/csvregardless. - Text extraction sniffs the delimiter (comma / semicolon / tab / pipe), strips a UTF-8 BOM, falls back to latin-1 for non-UTF-8 exports and caps at 5,000 rows, producing the same row shape as the spreadsheet extractor — so AI summaries, search and chat treat CSVs like Excel files.
Native table preview
- New
GET /documents/{id}/csv-rows(first 500 rows,truncatedflag). Both the Documents page pane and the shared preview modal render a plain table with a sticky header — instant, no Document Server round-trip, and no "Choose CSV options" dialog that ONLYOFFICE's viewer would otherwise put in front of every CSV. - Edit still opens ONLYOFFICE's spreadsheet editor for CSV, and closing drops back to the table.
- CSV shows the spreadsheet icon/color everywhere and falls under the XLS type filter.
Version
pyproject.toml/uv.lock:2.0.0a4;/healthreports2.0.0-alpha.4. Suite: 401 passing.
v2.0.0-alpha.3 — September 17, 2026 (pre-release; supersedes alpha and alpha.2)
Strict Content Security Policy, Security Headers, Named Cloudflare Tunnel & Share Online
Browser Security Headers & Strict CSP
- Every response now carries
Content-Security-Policy,X-Content-Type-Options: nosniff,X-Frame-Options: SAMEORIGIN,Referrer-Policy: strict-origin-when-cross-origin,Cross-Origin-Opener-Policy: same-origin,Cross-Origin-Resource-Policy: same-siteand aPermissions-Policy(camera, microphone, geolocation, payment and USB off), added by a pure-ASGI middleware so streamed chat replies and downloads pass through untouched (app/core/security_headers.py). - The policy is built from settings:
ONLYOFFICE_URL(editor script + iframe), the public MinIO host (PDF/image previews) and Google Fonts are the only external sources;object-src 'none',base-uri 'self',frame-ancestors 'self'(the login page embeds the terms page),upgrade-insecure-requestswhen the public origins are HTTPS./api/docsgets its own policy for Swagger UI's CDN. script-srchas no'unsafe-inline'. Each page's inline<script>blocks are allowed through a per-response nonce stamped on when the page is served, and all ~200 inlineonclick="…"-style handlers across the app were replaced by declarativedata-on<event>="fn"attributes (data-argsJSON,data-arg-from="value",data-pass-event,data-stop, per-eventdata-args-<event>) dispatched by one delegated listener inapp.js— noeval, nothing bound per element, so content rendered later withinnerHTMLworks unchanged.style-srckeeps'unsafe-inline'forstyle=""attributes, which Mozilla Observatory doesn't penalise. Result: Observatory score from 50 to a clean sheet.- A test guards against inline handlers creeping back (
tests/test_security_headers.py); the whole site was driven through a Chrome DevTools harness under the final policy — menus, filters, drag & drop, editor/viewer, chat, settings — with zero violations. - The empty
onmousewheelattribute ONLYOFFICE puts on its editor iframe is stripped after mount so it can't log a violation on scroll.
Named Cloudflare Tunnel — a fixed public hostname from your own machine
- New
.envsettingsCLOUDFLARE_TUNNEL_TOKEN,CLOUDFLARE_APP_HOST,CLOUDFLARE_OFFICE_HOST,CLOUDFLARE_FILES_HOST. With the three hostnames set, the app starts against them (e.g.https://skms.dev,office.skms.dev,files.skms.dev) — through the installedcloudflaredWindows/Linux service when it's running, or by running the tunnel from the token otherwise (scripts/share.py). - Quick Start in
start.bat/start.shnow runsscripts/share.py --auto: named tunnel when configured and the service is up, plain local start otherwise.www.<app host>is included in CORS. - Share Online (launcher option 4, added in alpha) remains for machines without the service: three Cloudflare quick tunnels (app, ONLYOFFICE, MinIO) and one random
trycloudflare.comlink, with the hostnames handed to the API as environment variables so.envis never modified. - Files in
static/verification/are served at the site root by exact name and as/<name>/for ownership checks (loader.io, Search Console).
Fixes
- Related Documents returned 500 on every document open: the raw SQL in
GET /documents/{id}/relatedcomparedvisibilityagainst'global', but the Postgres enum value is'global_'(assearch_service.pyalready used). Surfaced by the CSP test harness's console capture (app/routers/documents.py). start.batpicks up a just-installedcloudflaredthat isn't on the window's PATH yet, or offers towinget-install it.
Version
pyproject.toml/uv.lockcarry2.0.0a3(PEP 440); the tag, GitHub pre-release and/healthsay2.0.0-alpha.3. Everything from 1.9.0 is included.
v1.9.0 — September 16, 2026
Save/Discard Editor Sessions, In-App Office Previews, Server Deployment Stack, Summary-Aware Chat & Mobile Landing Page
Document Editor — Save, Close & Discard
- The ONLYOFFICE editor's top bar now has Save and Close instead of a single "Close Editor" that always saved. Closing with unsaved edits asks Save & close / Discard changes / Keep editing; the viewer's ✕ button and leaving the page are guarded the same way. The plain-text editor for other file types confirms before discarding a modified draft (
static/pages/documents.html). - Dirty tracking latches on ONLYOFFICE's
onDocumentStateChange— its "saved" signal only means "synced to the Document Server", not "written to storage", so only the app's own Save clears it. - New
POST /documents/{id}/office-discard. The Document Server has no discard command and always delivers a session's edits once everyone disconnects, so the session key is recorded as discarded (the save callback acks that delivery without writing it) and rotated viaextra_metadata.office_session, so re-opening loads the stored file rather than the Document Server's cached copy of the thrown-away edits (app/services/onlyoffice_service.py,app/routers/documents.py). - Force-save now targets the key the browser opened the session with, sent back in the request body — a mid-session Save bumps
doc.versionbut the Document Server keeps the session under its original key, so the close-time save used to miss. The callback skips a byte-identical re-save after an explicit Save (SHA-256 kept inextra_metadata) instead of stacking a duplicate version, andGET /documents/{id}/statusnow returnsversionso Save can wait for the write to land. - The in-app History button is gone — Office/PDF history lives in the editor's own File → Version History panel, which stays wired to the same endpoints.
Office Previews Without Opening the Editor
- Word, Excel and PowerPoint files render in ONLYOFFICE's read-only viewer in both the Documents page preview pane and the shared preview modal used by AI Search, chat citations and the Dashboard (
GET /documents/{id}/office-config?mode=view). PDFs and images keep the browser's own preview. The earlier viewer had been removed for reliability, but its root cause — the Document Server mangling MinIO presigned URLs — was since fixed by the/office-downloadproxy, which view mode now goes through too (static/pages/documents.html,static/js/docPreview.js). - Viewer sessions identify the signed-in user and set
customization.anonymous.request: falseandfeatures.featuresTips: false. Without auser, the Document Server treated every viewer as an anonymous guest and blocked spreadsheets and presentations behind an "Enter a name to be used for collaboration" prompt, with what's-new tips on top. - Clicking Edit hands the pane from the viewer to the editor; closing, saving or discarding drops back into the viewer, which reloads the fresh version.
Upload Status — "Analyzing…" vs "Pending review"
- New uploads sit in
pendingonly until the AI content screen finishes and auto-approves them. The Documents page now shows that transient state as Analyzing… (grey badge) and hides Approve/Reject until analysis completes — "Pending review" with review buttons is reserved for documents that genuinely need a human decision (image screen couldn't run, or an explicit re-review).
AI Chat — Summaries & Reply Formatting
- "Summarize X" / "what is X about" now works. The RAG context excerpt is chosen by scoring document windows against the question's words; a summary request shares no vocabulary with the body, so every window scored zero and the model only ever saw the opening 400 characters. When nothing matches, the budget is now spread across windows sampled evenly through the whole document; each document's stored upload-time summary is passed as a
Summary:line; and both RAG prompts state that overview requests are content questions to answer from that text rather than with the "couldn't find a source" line (app/services/ai_service.py,app/routers/chat.py). - Reply rendering rewritten around a list stack: numbered lists no longer restart at 1 after a blank line or a run of sub-bullets (every step of a six-step answer used to render as "1."), indented bullets nest inside their numbered item, un-indented bullets straight after a numbered item are treated as its sub-points, split lists continue numbering via
<ol start>, and fenced code blocks render as their own block instead of inside an empty paragraph (static/pages/chat.html).
Dashboard & Landing Page
- Dashboard: the mostly-empty "Your Account" card (name, email and role already live in the sidebar) is replaced by Recent Conversations — the user's five latest AI chats with time and message count; clicking one opens
chat.html?session=<id>, which now resumes that specific conversation. - Landing page: hamburger navigation below 768px (section links collapse into a panel under the sticky bar; closes on tap, outside click, Escape or resize), tighter hero/section/footer spacing on phones, full-width stacked hero buttons, and anchor links land below the sticky bar with smooth scrolling that honours reduced-motion (
static/pages/index.html,static/css/styles.css).
Server Deployment Stack
docker-compose.deploy.ymland.env.deploy.examplecomplete the launcher's Docker Deployment mode, which previously looked for both and stopped. The standalone compose runs everything on one machine: Postgres viapgvector/pgvector:pg16, MinIO, Redis, Ollama (models pulled on first boot bydeploy/ollama-entrypoint.sh, which now reads theOLLAMA_*_MODELsettings), ONLYOFFICE, NudeNet, a one-shotdb-init, the API (no bind mount, no reload, proxy headers) and Caddy with automatic HTTPS for<DOMAIN>,files.<DOMAIN>andoffice.<DOMAIN>. Public hostnames and CORS are derived from a singleDOMAIN; app/MinIO/ONLYOFFICE ports bind to127.0.0.1only so a host-side Cloudflare Tunnel can front them instead. Every image is multi-arch.deploy/README.mdcovers requirements, first start, updates, backups, the tunnel and Oracle Cloud variants.start.sh/start.batpass--env-file .env.deployso compose interpolates from the deployment file rather than the dev.env.- New
S3_PUBLIC_SECUREsetting: browsers get HTTPS presigned URLs forfiles.<DOMAIN>while the API keeps talking plain HTTP tominio:9000; oneS3_SECUREflag used to cover both, making TLS in front of MinIO impossible (app/config.py,app/services/storage_service.py). scripts/setup_db.py: withSKMS_ADMIN_EMAIL/SKMS_ADMIN_PASSWORDset it creates that single admin instead of the eight demo accounts with published passwords, and underAPP_ENV=productionit refuses to run while anyCHANGE_MEplaceholder secret remains.
Minor Features
- Documents page: PPT/PPTX get their own type category and a PPT option in the type filter alongside PDF, DOC, XLS and Image.
- Document and conversation titles on the Dashboard are HTML-escaped when rendered.
Fixes
- Landing page hamburger opened and closed in the same tap: swapping the icon via
innerHTMLdetached the tapped SVG before the document-level outside-click check ran, soclosest('.navbar')returnednull. Both icons are now rendered once and toggled withhidden. - Spreadsheets and presentations appeared broken in the preview pane — see Office Previews above for the anonymous-guest prompt that was covering them.
Tests
- New
tests/test_office_editor.py(session keys, force-save targeting, discard, callback save/skip/discard paths, view-mode config, cell/slide editor mapping),tests/test_rag_context.py(excerpt skimming vs targeted selection, summary block, prompt rule) andtests/test_deploy_config.py(public/internal S3 scheme, admin seeding, placeholder guard). Suite: 387 passing.
Known Follow-Up
- The full deployment stack needs ~8 GB RAM; Docker Desktop's default VM allocation is below that, so a complete local run of
docker-compose.deploy.ymlrequires raising it under Settings → Resources. - Discarding an editing session while another user is still co-editing the same file also discards the final save of that shared session — co-editing isn't a supported workflow yet.
v1.8.0 — September 14, 2026
uv Package Management, ONLYOFFICE Version History, Deterministic Citation Grounding, AI-Titled Conversations & Reapproval Table View
uv Package Management
- Replaced
venv+pipwith uv.pyproject.tomlis now the single source of dependencies (the CVE and licensing rationale previously kept as comments inrequirements.txtcarries over), anduv.lockpins the fully resolved tree for every platform, so a local.venv, CI, and the Docker image all install byte-identical versions.requirements.txtis removed. start.bat/start.shinstall uv if it's missing (astral.sh installer), runuv syncon Full Install, verify the environment withuv run --no-syncon Quick Start and re-sync only if stale, and launchsetup_db.py/run.pythroughuv run— no more activate/pip steps. Clean removes.venv(and a legacyvenv).Dockerfilecopies the uv binary fromghcr.io/astral-sh/uv:0.12.5and runsuv sync --frozen --no-devin a layer cached onpyproject.toml+uv.lock;--frozenrefuses to re-resolve, so the image can only ever contain what the lockfile says. Added.dockerignoreso local environments and.envnever reach the image.- README and
tests/README_TESTS.mdupdated to theuv sync/uv run …workflow.
ONLYOFFICE Version History
- Office/PDF documents now use ONLYOFFICE's native File → Version History panel instead of the plain in-app list. The editor is created with
onRequestHistory/onRequestHistoryData/onRequestHistoryClose/onRequestRestorehandlers backed by two new endpoints,GET /documents/{id}/office-history(therefreshHistory()payload) andGET /documents/{id}/office-history/{n}(the signedsetHistoryData()payload), both built from the app's owndocument_versionsrows so version numbers agree everywhere (app/routers/documents.py,static/pages/documents.html). - The save callback now stores the
changes.zipandhistoryobject ONLYOFFICE hands back with every save (newoffice_changes_key/office_historycolumns ondocumentsanddocument_versions, added idempotently byscripts/setup_db.py), so the panel can highlight what changed between versions. It also attributes the version to the user who actually edited it (from the callback'suserslist) rather than the original uploader. office-downloadtokens can now be scoped to a specific version and to the changes archive (sign_download_token(version=…, kind=…)), keeping the Document Server's downloads on the same proxied path as the main editor URL (app/services/onlyoffice_service.py).- Restore is now file-aware: restoring a version whose bytes differ from the current file swaps
storage_keyback and re-runs the full extract → embed → summarize pipeline, instead of only restoring the text snapshot and leaving the editor showing the newer file. The History button for Office/PDF types opens the editor with a hint; the plain list remains for text-only types.
Deterministic Citation Grounding
- Added
_lexical_grounding()in front of the LLM citation classifier: the terms an answer introduces that were not in the question are looked up verbatim in each candidate document's text. Proper nouns mid-sentence and numbers weigh double; question words and document-talk vocabulary ("according", "mentioned", "provided"…) are ignored so a paraphrased question can't credit anything. Strong evidence cites the document directly — no classifier round-trip, and no chance of the model overriding hard evidence with NONE — and a weak match now breaks a NONE verdict by citing the single best document rather than nothing (app/services/ai_service.py). - This fixes the live case of a correct answer ("The smallest cat breed mentioned in the documents is the Singapura.") showing no source: "Singapura" appears in exactly one retrieved document, which no model call is needed to see. Grounding scores are logged per candidate for diagnosis.
AI-Titled Conversations
- New conversations are named by the model from their opening exchange (
generate_chat_title()— a 2–6 word title-case label, with quotes / "Title:" / trailing punctuation stripped) instead of echoing the first message back as the title. It runs after the answer and citations so it never delays the reply, is delivered live as a newtitleSSE event, and a failure leaves the first-message placeholder in place (app/services/ai_service.py,app/routers/chat.py). - The conversation history rail was redesigned to match modern chat UIs: long titles fade out at the right edge instead of ending in "…", and the inline pencil/trash buttons are replaced by a single ⋮ on hover that opens a Rename / Delete menu (closes on outside click, Escape, scroll, or re-render; flips upward near the bottom of the rail) (
static/pages/chat.html).
Reapproval Requests — Table View
- The Reapproval Requests page is now a table matching the Documents list — coloured per-type file icons, sortable Document / Request / Requested by / Date / Status columns with ▲/▼ arrows, and a search bar that filters the current tab across document title, request title, description, requester, rejection reason, reviewer and notes. Clicking a row opens a details modal with the full request and, for pending ones, View document / Reject / Approve in its footer; cancelling the reject note returns to the details (
static/pages/reapprovals.html). - User-supplied text on this page is now HTML-escaped (the previous cards injected it raw).
Live Re-Summarize After Edits
- Saving content (text editor, ONLYOFFICE, or a version restore) already re-ran analyze → summarize in the background, but the open document kept showing the old summary until it was reopened. The AI Summary card now shows a spinner with the current stage, keeps the previous summary dimmed underneath, and swaps in the new one the moment the pipeline completes, via a small
/statuspoller that waits until a run has actually started before declaring the summary updated (static/pages/documents.html).
NudeNet as a Standalone Microservice
- NudeNet is AGPL-3.0-licensed, so it no longer runs in the main app's process. It now lives in
nudenet_service/as its own container (skms_nudenetindocker-compose.yml) and the app calls it over HTTP (NUDENET_SERVICE_URL,check_image_nudity_nudenet()), the same way it talks to ONLYOFFICE and MinIO —nudenetis never imported intoapp/(app/services/ai_service.py,nudenet_service/).
Zoomable Image Viewer
- Image previews (Documents, Search, Chat citations, Dashboard) open in a zoomable, pannable viewer — zoom in/out buttons, mouse-wheel zoom, drag-to-pan, and double-click to 1:1 (
static/js/imageZoom.js,static/js/docPreview.js). - Document preview modals gained a maximize toggle that fills the viewport (
DocPreview.toggleMaximize).
Minor Features
- Search-only analytics: chat's retrieval step no longer writes to
search_logs(semantic_search(..., log=False)), so Searches, Avg Search Response Time, Top Search Topics and Knowledge Gaps on the Dashboard and Analytics pages reflect the Search page only — chat prompts like "Hello! what's your name?" no longer appear as knowledge gaps, and the card caption now reads "across document searches" (app/services/search_service.py,app/routers/chat.py). - Reapproval request form: title limited to 120 characters and description to 500, with a live counter, enforced both client-side and in
ReapprovalRequestIn(static/pages/documents.html,app/schemas/reapproval.py). - Chat loading indicator is vertically centred on the assistant avatar while waiting for a reply (
static/pages/chat.html). - Multiline inputs:
textarea.inputno longer inherits the single-line input box — it starts at ~6.5rem with proper padding, resizes vertically only, and can't be shrunk below its starting height. This fixes the squashed description field in the reapproval form and the reviewer's reject-note prompt (static/css/styles.css).
Fixes
- Moderation classifier silently disabled:
MODERATION_MODELresolved toNonebecause the setting exists but defaults to unset, so every content-safety call went out as{"model": null}— an instant 400 from Ollama and a classifier that failed open on every message. It now falls back to the chat model; same fix for the vision moderation model (app/services/ai_service.py). - Model reloaded up to four times per chat message: moderation, the answer, the citation classifier and the title generator each used a different
num_ctx(default/8192/4096/2048), and Ollama keys its loaded runner on (model, context size) — every step tore the model down and reloaded it from disk, ~5s each on CPU. All chat-model calls now shareCHAT_NUM_CTX = 8192and setkeep_alive: 30mso the model stays warm between messages (app/services/ai_service.py,app/services/moderation_service.py). - Documents table double row divider: the global stylesheet gives every
tda bottom border and the table drew its own ontr, producing two lines between rows; the table's cells now drop the global border (static/pages/documents.html,static/pages/reapprovals.html). - Version restore didn't revert the file: restoring an ONLYOFFICE-edited document only swapped the text snapshot, so the editor still showed the newer file (see ONLYOFFICE Version History above).
- Dashboard comment wrongly claimed chat never wrote to
search_logs; corrected alongside the data change.
Known Follow-Up
- Rows already written to
search_logsby past chat prompts are indistinguishable from real searches and will age out of the 30-day analytics window rather than disappear immediately. - ONLYOFFICE change highlighting in the history panel only appears for versions saved after this release — earlier versions have no stored
changes.zip. - Existing local checkouts still have an unused
venv/directory from the pip era; delete it or run the launcher's Clean option. nudenet_service/keeps its ownrequirements.txtand is deliberately excluded from the main image via.dockerignore.
v1.7.0 — September 13, 2026
Dedicated Users Page, Phase-Aware Chat Status, Conversation Ordering Fix & Dark Mode Contrast Overhaul
Dedicated Users Page
- Split user management out of Settings into its own sidebar page — Users now has its own admin-only tab (
static/js/layout.js:SIDEBAR_ADMIN), separate from the Settings/profile page it used to share, so managing accounts no longer means scrolling past appearance and organization settings first (static/pages/users.html). - Added role and status filters alongside the existing search, plus live total/active/inactive/admin counts above the table.
- Added a Reactivate action for deactivated accounts — previously the only way back was the edit modal's Active checkbox, with no dedicated control in the table.
- CSV import now reports per-row errors (bad email, short password, unknown role) in a dialog after the import finishes, instead of a single aggregate pass/fail count that hid which rows actually failed and why.
AI Chat — Phase-Aware Loading Status
- The chat loading indicator now reports what the assistant is actually doing instead of one generic "typing…" state: checking (moderation) → analyzing (embedding the question) → searching (hybrid search) → found:N (documents matched) → reading (RAG path, working through retrieved documents) or generating (small talk / no matches) → citing (source selection after the answer streams) — each stage backed by a real Server-Sent Event from the backend, not a client-side timer (
app/routers/chat.py:send_message(),static/pages/chat.html:STATUS_PHRASES). - Split the previous single "searching" phase into analyzing (embedding the question) and searching (the actual hybrid query) by embedding the question once in the router and passing it into
semantic_search()via a new optionalquery_embeddingparameter, so a caller that's already embedded the query doesn't pay for a second Ollama round trip (app/services/search_service.py:semantic_search()). - Added 52 rotating phrasings across the 7 phases (231 words total) so a long wait doesn't repeat the same line twice in a row, plus "still working…" variants that phase in after 8 seconds in one stage so a cold model or a large archive doesn't leave a stale-looking message on screen (
static/pages/chat.html). - The one-off "citing" phase — which fires after the visible answer has already finished streaming — now shows a small pending indicator where the citation chips will land, instead of vanishing silently until the chips (or nothing) appear.
Conversation Ordering Fix
- Fixed AI replies sometimes rendering above the question that triggered them. The user message and its reply were written in one transaction, and Postgres'
now()stamps both rows with the identical transaction-start timestamp, so the only tie-break was a random UUID — the reply won that tie roughly half the time. - New messages now get distinct Python-side timestamps at write time (
app/routers/chat.py:send_message()), and the sort order falls back to(created_at, role, id)— user before assistant — so conversations already stored with duplicate timestamps also display correctly with no data migration needed (app/routers/chat.py:_MSG_ORDER). - The pagination cursor for loading older messages was updated to the same composite ordering (row-value comparison) so a question/answer pair split across a page boundary can no longer be skipped or duplicated.
Conversation History Rail — Recency & Renaming
- Sending a new message in an old conversation now bumps its
updated_atand moves it to the top of the history rail, matching the behavior of essentially every other chat product — previously only the very first message in a session ever touched that column, so an old conversation stayed buried no matter how much you kept using it (app/routers/chat.py:send_message()). - Added inline conversation renaming — hover a conversation and click the pencil icon, or double-click its title, to edit it in place (Enter saves, Escape cancels, clicking away saves), backed by a new
PATCH /api/chat/sessions/{id}endpoint (app/routers/chat.py:rename_session(),static/pages/chat.html). - Renaming deliberately does not bump
updated_at, so tidying up an old auto-generated title doesn't reshuffle the rail's recency order. - Delete-conversation confirmation now names the conversation and its message count ("Budget questions and its 12 messages will be permanently deleted. This can't be undone.") instead of a generic "are you sure?" (
static/pages/chat.html:deleteSessionFromList()).
Dark Mode Contrast Overhaul
- Fixed dark mode silently rendering several color themes with their light-mode color values.
applyTheme()writes--primary(etc.) as an inline style on<html>, which beats the.dark { }rule in the stylesheet — so Monochrome's dark-grey primary rendered nearly invisible against the dark background, and every other preset carried the wrong contrast in dark mode too. Every theme preset now carries an explicit dark variant plus its own foreground color, and switching theme mode immediately re-resolves the active preset (static/js/app.js:themePresets,applyTheme(),applyThemeMode()). - Computed WCAG contrast ratios for every preset in both modes and retuned Ocean Blue, Teal and Amber where they fell below readable thresholds; Amber and dark-mode Monochrome now use a dark foreground color instead of white text, since white text had insufficient contrast against their lighter primaries.
- Added dark-mode variants for every pastel status/badge/file-icon color that was previously light-mode only — document visibility badges, active/pending/approved status pills, danger-hover states, and the colored file-type icons on Documents, Dashboard and Search — these previously rendered as bright light-mode color blocks sitting on top of dark cards; replaced with translucent tints and light text (
static/css/styles.css,static/pages/documents.html,static/pages/dashboard.html,static/pages/search.html). - Redesigned the chat message scrollbar — thin, rounded, theme-tinted, hidden until the pane is hovered or actively scrolling — with a soft fade at the top and bottom edges so messages scroll under the header and composer instead of being hard-clipped by a line (
static/pages/chat.html). - Applied the same thin scrollbar treatment app-wide (sidebar, tables, modals, the conversation history rail) via one global rule, with brighter thumbs in dark mode for visibility against the darker background (
static/css/styles.css). - Added
color-scheme: light/color-scheme: darkon:root/.dark— this is what actually controls the browser's native widgets (OS scrollbars, date pickers,<select>popups); without it, those kept rendering light even after every custom scrollbar style above was applied (static/css/styles.css). - Moved the Monochrome color theme to the end of the picker row instead of sitting in the middle of the palette, since it's the "no color" option rather than one of the palette choices (
static/js/app.js:themePresets). - Theme preset swatches in Settings now reflect whichever variant (light/dark) is currently active, and refresh immediately when the appearance mode dropdown changes (
static/pages/settings.html:refreshThemeSwatches()).
Minor Features
- Added
Utils.apiErrorMessage()to turn a FastAPI error body into one readable sentence — a 422 response'sdetailis a list of{loc, msg, type}objects, which previously rendered in toasts as literal[object Object](static/js/utils.js). - Added client-side validation mirroring every new server-side rule below — email format, name/short-code length, password byte length, CSV file extension/size, "new password must differ from the current one" — so obvious mistakes are caught before a round trip instead of after (
static/pages/users.html,static/pages/settings.html). - Inactive organizations are now shown but disabled in every organization picker across Users and Settings, rather than silently accepting a user being placed into one.
settings.html's page-load failure state now shows the real server error message instead of a generic "Failed to load settings" regardless of cause (static/pages/settings.html:loadSettings()).
Fixes
- Organization Validation Gap:
organization_idwas never validated on user create/update/import — an unknown id reached the database uncaught and failed as a foreign-key violation (500); it's now checked up front, returning 404 for an unknown organization and 400 for an inactive one (app/routers/users.py:_get_target_org()). - Last-Admin Lockout: the last active admin could demote or deactivate their own account — via
PATCH,DELETE, or their own profile page — which would leave nobody able to reach Users or Settings to undo it. All three paths are now blocked (app/routers/users.py:_ensure_not_last_admin()). - Case-Sensitive Email Matching: emails were compared case-sensitively on create/update/login while CSV import lowercased them, so
Foo@x.eduandfoo@x.educould exist as two separate accounts. Emails are now normalized to lowercase everywhere, and every lookup is case-insensitive so legacy mixed-case rows still match (app/schemas/auth.py:normalize_email(),app/routers/users.py,app/routers/auth.py). - CSV Import Data-Integrity Bugs: a UTF-8 BOM from Excel "CSV UTF-8" exports made every row fail as "missing email" (now decoded with
utf-8-sig); a blank password cell hashed an empty string instead of falling back to the documentedchangeme123default; a duplicate email within the same file hit the unique constraint mid-commit and 500'd the entire import instead of being skipped like a duplicate against the database; an unknown role string (e.g. a typo) silently fell back tostaffinstead of being reported as a row error (app/routers/users.py:import_users_csv()). - Stored XSS in Admin Tables: the HTML-escape helper in Users/Settings only escaped quote characters, so a user's own display name — editable by anyone via their profile — could inject markup that ran in another admin's browser when viewing the user table. Both pages now use a complete HTML-escape (
static/pages/users.html,static/pages/settings.html:esc()). - Malformed-UUID 500s: hitting
/api/users/{id}or/api/orgs/{id}with a non-UUID path parameter crashed with an unhandled 500 instead of a 422 — path parameters on the affected routes are now typeduuid.UUID(app/routers/users.py,app/routers/orgs.py). - Organization PATCH Couldn't Clear Fields:
PATCH /api/orgs/{id}could not cleardescriptionorcolor_hsl— a blank value normalized toNoneand was then treated as "not sent" by the update check. Now uses Pydantic'smodel_fields_setto distinguish "field omitted" from "field sent as blank" (app/routers/orgs.py:update_org()). - Missing Organization Field Limits: organization
name,short_code, andcolor_hslaccepted empty strings, values far exceeding their column lengths, and arbitrary color strings — all reaching the database uncaught and risking a 500. Added field validators enforcing length limits, a character allowlist onshort_code, and an"H S% L%"format/range check oncolor_hsl(app/schemas/organization.py). - Unhandled Constraint Violations: added an
IntegrityError→ 409 exception handler as a last-resort safety net, so any database constraint violation a router doesn't pre-check now returns a readable conflict message instead of a raw SQL error dump (app/main.py). - Broken Test Harness: the test suite could not run at all under the installed
pytest-asyncioversion — theevent_loopfixture override is no longer honored, producing "attached to a different loop" errors on every database test, and thedbfixture didn't actually isolate tests from each other since both fixtures and the application commit for real. Tests are now pinned to one session-scoped event loop, and every table is truncated after each test (tests/conftest.py,pytest.ini).
Known Follow-Up
- The last-admin protection added in this release (
_ensure_not_last_admin()) checks only for another active admin account — an organization with a single admin who also happens to be inactive in the database (e.g. from a prior manual edit) is not specially detected as already being in a locked-out state; it simply blocks any further attempt to remove the remaining active admin, same as normal. - Dark-mode contrast was verified computationally (WCAG ratio) rather than visually confirmed in a running browser, since this environment has no browser tooling available — worth a quick manual check of Settings → Appearance in dark mode, particularly the Monochrome and Amber presets.
v1.6.0 — September 5, 2026
Citation Accuracy Overhaul, View-Only Documents, In-App Assistant Self-Knowledge, Legal Compliance Rewrite & Documentation Corrections
Citation Accuracy — Correct, Grounded Citations
- Reworked
select_used_citations()so the chat assistant cites the documents it actually used, and stops citing ones it didn't. Previously citations were whatever the retrieval step ranked highest, attached before the answer even existed, so a document the model's own answer called irrelevant could still appear as a citation chip underneath it (app/services/ai_service.py). - The classifier is now shown a short content excerpt of each candidate rather than the title alone — a title-only prompt gave qwen2.5:3b nothing concrete to check the answer's claims against, so it defensively answered NONE for almost everything and correct, document-grounded answers showed zero citations (
app/services/ai_service.py). - Added
_citation_excerpt_budget(rank)— per-rank excerpt budgets of 1200/800/500 characters, replacing a flatmax_chars=400. This was a real structural bug:_select_relevant_excerpt()always keeps the document's opening window "at score 0" before spending remaining budget on term-ranked windows, so withmax_chars == window(both 400) the opening window consumed the entire budget and term-ranking never ran — the classifier always saw the first ~400 characters (cover page or intro) no matter where the answer actually lived (app/services/ai_service.py). - Added
_explicit_document_refs()— deterministic extraction of document numbers the answer names outright ("Based on Document 1, …"). When an explicit reference is found, classification is skipped entirely, also removing ~12s of local inference on the clearest-cut case (app/services/ai_service.py). - Explicit-reference extraction counts positive mentions only, with negation scoped to each mention's own clause, so a sentence like "Document 1 covers it, but Document 3 does not mention fees" credits only Document 1 (
app/services/ai_service.py). - Narrowed
_answer_declares_no_source()from a whole-answer substring match to the answer's first sentence, with a bail-out when that sentence contains a contrastive conjunction (but/however/although/though/whereas/while) — matching phrases like "doesn't contain information" anywhere in the answer was zeroing out context_docs for otherwise correct, grounded answers (app/services/ai_service.py). - Raised the classifier's
num_predictfrom 20 to 40 — qwen2.5:3b sometimes leads with a short preamble before the digits, and at 20 tokens that preamble could consume the whole budget and truncate the response before any digit was generated, which parsed as "no citations" (app/services/ai_service.py). - Citation parsing now prefers an isolated answer line (digits/commas only, or exactly NONE) before falling back to scanning the whole response for digits — the permissive fallback is what caused over-citation, since a hedge like "2 might be tangentially related, but the answer really only draws on 1" contains the digit 2 even though the model just rejected it (
app/services/ai_service.py). - The classification prompt now warns that retrieval also matches on title, author, and tag keywords, and asks for fact-level grounding rather than topic overlap (
app/services/ai_service.py). - Restructured the chat stream so the assistant message is persisted before citation classification runs, with citations attached in a second commit; a classifier failure is now non-fatal and can no longer lose an already-generated reply (
app/routers/chat.py).
View-Only Documents — Download Control
- Added a per-document
is_downloadableflag, so a copyrighted or otherwise restricted document can be shared for reading without offering a download (app/models/document.py,app/schemas/document.py). - New
_can_download()check gates bothGET /documents/{id}/downloadandGET /documents/{id}/url?mode=downloadwith a 403 when a document is view-only; the uploader and admins are exempt, andmode=previewstays open since it's what actually renders the document (app/routers/documents.py). - ONLYOFFICE's own toolbar Download/Print buttons and Ctrl+P/Ctrl+S shortcuts now follow the flag via
permissions.download/permissions.printinbuild_editor_config(), instead of both being hardcoded to true. Editing permission stays independent, gated by who may call the endpoint at all (app/services/onlyoffice_service.py). - Download controls are hidden across the UI for a view-only document — grid tile menu, list row action, the document modal footer, and the shared preview modal used by Search and Chat — replaced with a lock icon and "View only" indicator (
static/pages/documents.html,static/js/docPreview.js,static/css/styles.css). - Added a "Make view-only" / "Allow downloads" toggle in the document modal's File menu, shown only to the uploader or an admin, with optimistic update and rollback on failure (
static/pages/documents.html). - PDF previews of view-only documents append
#toolbar=0&navpanes=0to the iframe source to hide the browser's own built-in PDF viewer chrome and its separate download button (static/pages/documents.html,static/js/docPreview.js). - Added the missing unlock icon to the shared icon registry, matching the existing lock icon (
static/js/app.js). - Added
ADD_is_downloadable_COLUMN.sqlfor existing databases, sinceinit_db()'sBase.metadata.create_allcreates missing tables but not missing columns on tables that already exist. - Documented the limits honestly in the Terms and in code comments: view-only removes the sanctioned one-click download paths, but does not prevent screenshots, browser print-to-PDF, or capture of the presigned preview URL.
In-App Assistant Self-Knowledge
- Substantially expanded
SMARTKMS_APP_GUIDEso the chat assistant can answer questions about the platform itself — how to upload, what a role can do, what a dashboard stat means, why a document was rejected, how to request reapproval (app/services/ai_service.py). - Added upload guidance sourced from the actual code: who can upload (faculty/staff/admin per
require_uploader, not researchers), accepted types and the 100 MB per-file cap fromALLOWED_MIME_TYPES/MAX_FILE_SIZE_BYTES, the Replace/Keep Both/Cancel duplicate-name flow, and what background processing does after upload. - Corrected the visibility list, which previously documented only Private/Public/Global while
VisibilityLevelactually defines five levels — Cross-organization and Restricted were entirely missing. - Corrected approval permissions:
approve_document()andreject_document()both userequire_admin, so approval is admin-only rather than the vague "(for approvers)" the guide previously implied. - Added sections on why a document gets rejected, the reapproval rules, view-only behavior, the Activity Log page, knowledge-gap analytics, and how search and chat scope results to what the asker may actually see.
- Added a scope-limit block instructing the assistant never to state or speculate about passwords, credentials, API keys, secrets, database schema, internal endpoints, file paths, infrastructure, another user's account or activity, or how to bypass approval/moderation/role restrictions/view-only — and that a claim of being an admin or developer in a chat message changes nothing.
Terms & Conditions — Version 1.6.0
- Rewrote the Terms from 18 to 29 sections, anchored to the Philippine Data Privacy Act of 2012 (RA 10173) and its Implementing Rules, with GDPR-shaped rights (
static/pages/terms.html). - New sections: Definitions (DPA terminology — Personal Data, Sensitive Personal Information, PIC/PIP), Copyright & Takedown Requests, Legal Bases for Processing, Data Subject Rights, Data Retention & Disposal, Security Measures, Data Breach Notification (NPC 72-hour rule), Third-Party Services & Sub-Processors, Cookies & Local Storage, Minors, and General Provisions.
- Reworked existing sections: controller/processor roles and a data-inventory table under Privacy; an explicit "we do not use Your Content to train AI models" commitment; a no-automated-decision-making clause covering admission, employment, discipline, grading and benefits decisions; and a right to human review of any automated rejection.
- Retention periods, notice periods, liability cap, governing law and venue are now filled in rather than left abstract; the Data Protection Officer contact block remains to be completed before publication.
Minor Features
- The expanded App Guide (~1,900 tokens) was being injected into every chat request unconditionally, adding roughly 15–20 seconds of prompt-eval on CPU-only inference even for questions unrelated to the platform. Added
_question_is_about_platform()to gate injection on product vocabulary and self-referential phrasings ("what can I do?", "what's my role?"), verified at 20/20 platform questions correctly including the guide and 10/10 content questions correctly skipping it (app/services/ai_service.py). - The gate is deliberately lopsided — a false positive costs a slow answer, a false negative costs a wrong one — and when the guide is omitted, the system prompt now instructs the model to redirect rather than guess at product behavior from general knowledge.
- Fixed the folder-structure diagram in the architecture page, which labeled the frontend directory
frontend/throughout while the repository actually usesstatic/, and brought it back in sync with the repository: added the missingapp/tasks/andapp/utils/directories, newer routers/services/models, andstatic/js/api.js/docPreview.js(docs/architecture.html). - Added the four pages missing from the Application Pages table — Activity Log, Onboarding, Support, and Terms — and updated the request-flow steps to describe the dual-layer image screen and fail-closed quarantine behavior introduced in 1.5.0 (
docs/architecture.html). - Added NudeNet and Alembic to the technology stack table; Redis was deliberately left out since it's provisioned but not imported or used anywhere in application code (
docs/index.html).
Chat Citations Lost on Classifier Failure
- The citation classification call ran before the assistant message was persisted, so a failure or timeout in that call could take the already-generated reply down with it; the reply is now committed first and citations attached separately, with the classifier failure logged as non-fatal (
app/routers/chat.py).
Known Follow-Up
- The retention periods now published in the Terms (90-day archived-document purge, 24-month chat and search-log retention, 12-month audit-log retention, 30-day backup rotation) are not yet enforced anywhere in code —
app/tasks/containsanalytics_snapshot.py,process_document.pyandscheduler.py, with no purge job. Either a scheduled purge task should be added, or the retention table should be softened to describe current behavior.
v1.5.0 — August 23, 2026
Dashboard Document Preview, Customization UI Redesign, Second-Logo Sizing Fix, Dark Mode Fix, Credential Hygiene, Duplicate-Filename Handling, Chat UI Refresh & Content Moderation Hardening
Duplicate Filename Handling
- Uploading or renaming a document to a name that already exists in the same folder now shows a Replace / Keep Both / Cancel dialog instead of silently allowing two documents with the same name. "Keep Both" auto-suffixes the new copy, filling the lowest free
(n)slot rather than always incrementing from the highest — e.g. ifsample.docxandsample(2).docxalready exist butsample(1).docxdoesn't, the next copy is namedsample(1).docx(app/routers/documents.py: newGET /documents/check-name,_find_conflict_and_next_name(),on_conflict/replace_idparams on upload and rename;app/schemas/document.py:DocumentUpdate.on_conflict;static/pages/documents.html;static/js/app.js:Modal.duplicateName()). - Matching is scoped to the same folder and organization, and ignores archived (soft-deleted) documents — an archived document's old name is free to reuse, same as it not appearing in the document list.
Dashboard Recent Documents
- Clicking a document under Recent Documents on the dashboard previously navigated away to the Documents page and lost track of which document was clicked. It now opens the same reusable preview modal used on Search and Chat instead (
static/pages/dashboard.html: addeddocPreview.js, wired rows toDocPreview.open(d.id)).
Customization Section Redesign
- Reworked the Settings → Customization layout for clarity: Site Title and the three image assets (Logo, Second Logo, Favicon) are now separated into their own labeled subsections with dividers instead of one cramped grid.
- Each image asset is now a clearly bordered card with a bigger 64×64 preview, a title and description, an accepted-types/max-size line, and a recommended-dimensions line (Logo: square, ≥128×128px; Second Logo: scales to the main logo's height, closer to square or a typical wide logo like 200×60px reads best; Favicon: square, 32×32 or 64×64px), with Upload/Reset actions moved to their own column that stacks cleanly on narrow screens (
static/pages/settings.html).
Second-Logo Pairing
- Removed the vertical divider line between the main logo and the second logo, and pulled them closer together with a small negative margin instead of the default header spacing, so the two read as a paired/"collaboration" mark rather than two unrelated logos separated by a wall (
static/css/styles.css).
Chat — Plain-Text AI Replies & Response Time
- Removed the speech-bubble box (background/border/shadow) from the AI's chat replies — plain text now, matching most assistant chat UIs; the user's own messages keep their bubble (
static/pages/chat.html). - Fixed inconsistent text spacing on short replies (e.g. a one-word "hello") —
static/css/styles.csshas its own, unrelated.chat-bubbleclass left over from an older component, and itsmax-width/padding/white-spacewere leaking onto chat.html's identically-named class since chat.html didn't declare its own values for those. Every property is now explicitly re-declared per role instead of left to inherit (static/pages/chat.html). - Hid the scrollbar on the message input textarea — it still scrolls once content hits max-height, just without a visible track (
static/pages/chat.html). - Each AI reply now shows how long it took (e.g. "450ms" / "2.3s") next to the Copy button, for both live replies and reloaded conversation history — the backend was already computing and returning
response_time_ms, it just wasn't surfaced in the UI (static/pages/chat.html).
Dashboard & Analytics — Stat Label Accuracy
- "Active Users" relabeled to "Users" — the underlying query counts every non-disabled account in the organization, not who's currently online, and the old label implied a live count (
static/pages/dashboard.html,static/pages/analytics.html). - "AI Avg Response Time" relabeled to "Avg Search Response Time" — this number is sourced only from
search_logs, written exclusively bysearch_service.py's semantic search; chat replies time themselves separately and were never included, so the old label overstated its scope (static/pages/dashboard.html,static/pages/analytics.html). - Dropped the redundant "(30 days)" from the "Searches" stat label, keeping the same timeframe info in the sub-line instead (
static/pages/dashboard.html,static/pages/analytics.html). - Dashboard subtitle now reads "SmartKMS" instead of the generic "knowledge base" (
static/pages/dashboard.html).
Dashboard — Recent Documents File-Type Icons
- Recent Documents on the dashboard always showed a blue, docx-style icon regardless of the actual file type — a hardcoded
fileTexticon plus a single fixed-color.doc-iconclass. It now uses the same per-type icon and color mapping as the Documents page (PDF red, Word blue, Excel green, PowerPoint orange, images purple) (static/pages/dashboard.html).
Second Logo Squishing
- Fixed uploaded second logos (e.g. PNG) appearing stretched/squished.
secondaryLogoImg()was setting bothwidthandheightto the same fixed value, forcing a square regardless of the uploaded image's actual aspect ratio. Now onlyheightis set (matching the main logo's height), and width scales naturally from the image's own proportions; amax-width: 120pxcap keeps an unusually wide upload from overflowing the sidebar row (static/js/app.js:secondaryLogoImg();static/css/styles.css).
Dark Mode — Unreadable "New Chat" Button
- Fixed the "New chat" button label and icon staying hardcoded black in dark mode, unreadable against the button's correctly-dark-in-dark-mode background.
.chat-new-btnnever set its owncolor, so it fell back to the browser's default button text color instead of following the theme; addedcolor: hsl(var(--foreground))(static/pages/chat.html).
Credential Hygiene in docker-compose.yml
docker-compose.ymlno longer hardcodes any credential directly in the file. MinIO's root user/password, the Postgres user/password/database, and the ONLYOFFICE JWT secret are all now read from.env(already gitignored) via Compose's${VAR:-default}substitution, falling back to the previous working defaults if.envdoesn't set them.- The ONLYOFFICE JWT secret is now the exact same
${ONLYOFFICE_JWT_SECRET}variable in both theonlyofficeandapiservices, so the two can no longer drift out of sync — that mismatch was the root cause of the "document security token is not correctly formed" editor error from 1.4.0'sstart.batcheck..env.exampledocuments all of the newly-parameterized variables. - Removed
docker-compose.yml.bak, a stray leftover copy of an older compose version carrying its own separately hardcoded Postgres password; added*.bak/*.origto.gitignoreso this class of file can't silently reappear and get committed. - Ran a full repo scan for AWS-style keys, GitHub/Slack-style tokens, and private-key blocks across every tracked file — none found.
Image Moderation — Gore/Violence + Nudity Pre-Check
check_image_sensitive_content()now also screens for graphic violence/gore, not just sexual content. The old flagging prompt was scoped to "pornographic/sexually explicit" only, which let ordinary nude (non-pornographic-looking) photos slip through since the model could reason they weren't "pornographic in intent" — the criteria is now explicitly "any visible nudity," and graphic violence/gore is a new category, with carve-outs for fictional violence (movies, games, sports, costumes) so it doesn't get trigger-happy on normal content (app/services/ai_service.py).- Added a NudeNet pre-check (
check_image_nudity_nudenet()) that runs alongside the vision-model check — free, MIT-licensed, fully local (no GPU, no external API, no model download at runtime), and a deterministic bounding-box classifier rather than a prose reasoner, so it doesn't have the "is this actually pornographic" judgment call that let genuine nudity through the model-only check. A hit from either check flags the image (app/services/ai_service.py;requirements.txt: addednudenet==3.4.2andopencv-python-headless==4.11.0.86— the opencv version is pinned specifically for compatibility with the existingnumpy==1.26.4pin, since newer opencv-python-headless releases require numpy>=2). - Fixed
check_image_nudity_nudenet()crashing on some real-world photos withcannot convert longdouble infinity to integer— a coordinate-scaling edge case in NudeNet's own postprocessing that an unrelated exception handler was silently swallowing as "not sensitive." Images are now re-encoded through Pillow (EXIF-orientation applied and dropped, forced to plain RGB) before being handed to NudeNet, which avoids whatever upstream metadata was triggering the bad math (app/services/ai_service.py). - Fixed the moderation vision-model call silently sending
"model": nullto Ollama (a guaranteed 404) wheneverOLLAMA_MODERATION_VISION_MODEL/OLLAMA_MODERATION_MODELwere left unset.config.pydeclares both asOptional[str] = None, so the attribute always exists —getattr(settings, name, fallback)only substitutes itsfallbackargument when an attribute is missing entirely, not when it exists and isNone, so the intended fallback toOLLAMA_VISION_MODEL/OLLAMA_CHAT_MODELwas never reached. Switched togetattr(settings, name, None) or fallback(app/services/ai_service.py). - Fixed both moderation layers failing open (auto-approved) whenever they errored out, with no distinction from "screened and found clean" — this is what let the two bugs above result in a silent approval instead of a visible failure.
check_image_nudity_nudenet()andcheck_image_sensitive_content()now return an expliciterror/check_failedflag on top ofis_sensitive, andprocess_document()leaves the document inpending(quarantined, not auto-approved) whenever the screen didn't actually complete, logging which layer(s) failed (app/services/ai_service.py,app/services/document_processor.py).
v1.4.0 — August 21, 2026
Global Admin Role, Organization Picker for Users, CSV Import Overhaul, Branding Customization, Unused Image Cleanup & ONLYOFFICE Secret Check
Admin Is Now a Global, Cross-Organization Role
- Admin previously had a mix of full and org-scoped access depending on the endpoint. It's now consistently global everywhere: user management (list/create/update/delete across every organization, no boundary) and document access (unconditional read/approve/reject on any document in any org, regardless of visibility level) (
app/routers/users.py;app/routers/documents.py:_visibility_filter(),_check_access()). - Staff/faculty/researcher access is unchanged by this — still limited to their own org plus public/global-visibility documents.
Branding Customization
- Added runtime branding config fetched by the frontend rather than hardcoded in HTML —
BRAND_TITLE,BRAND_LOGO_URL,BRAND_LOGO_SECONDARY_URL, andBRAND_FAVICON_URLsettings in.env, all optional with defaults matching the current hardcoded look (app/config.py;app/routers/branding.pynew;static/js/app.js:logoImg()reads from config;static/js/layout.js,static/pages/index.htmlrender second logo). - Deliberately unauthenticated public
GET /api/brandingendpoint — login and landing pages need it before anyone's signed in. No in-app PATCH endpoint; this is "admin" in the sense of whoever controls the server's.env, matching the documented approach (app/routers/branding.py). - Every other page showing the primary logo (login, terms, support, etc.) picks up the configured logo/title/favicon automatically via a retroactive DOM patch, without touching those individual files (
static/js/app.js). - Added a secondary logo slot to the left of the main logo in the sidebar and landing page, with a divider line and proper spacing; hides itself when the sidebar is collapsed (
static/css/styles.css). .env.examplenow documents all four new vars with comments.
Unused Image Cleanup
- Scanned every file in
static/images/against the entire codebase (HTML, JS, CSS, Python). Deleted four unused files:favicon-source.svg(byte-identical duplicate oflogo-mark.svg),logo.svg(also identical tologo-mark.svg),placeholder.svg(zero references), andfavicon.png(zero references). - Kept:
favicon.icoandlogo-mark.svg— both actively referenced everywhere.
Organization Picker in Add/Edit User
- The Organization field in both the Add User and Edit User modals is now a real
<select>populated from/api/orgs, replacing the earlier disabled/read-only text input that silently defaulted to the admin's own org (static/pages/settings.html).
CSV Import — Explicit Organization + Downloadable Template
- Since admin is no longer tied to one org, CSV import now requires an explicit
organization_idquery parameter — there's no more "admin's own org" to fall back on. The import flow changed from a bare file picker to a modal with an org dropdown plus the file input (app/routers/users.py:import_users_csv();static/pages/settings.html:openImportCSVModal(),submitCSVImport()). - Added a "Download template" link next to the CSV format hint that generates a starter file client-side, matching the current 4-column format (
email, full_name, role, password) —roleis one ofresearcher/faculty/staff/admin, andpasswordfalls back to a default if left blank.
Documents — Admin-Only Organization Switcher
- The "Signed in as" org picker on the Documents page was previously an unwired prototype — visible to everyone but not actually gated or connected to a refetch. It's now real: admin sees a working dropdown that refetches documents from the backend (
?org=) when switched, while every other role sees static text ("Signed in as CIT — College of Information Technology") reflecting their own organization, since they have no reason to move (static/pages/documents.html). - The secondary "Organization scope" (My Organization / All Visible / per-org) filter is now hidden for non-admins too, since it was dead/misleading UI for a role that can only ever see one org's documents anyway.
ONLYOFFICE JWT Secret Mismatch Check (start.bat)
- Added a
:check_onlyoffice_jwtstep tostart.bat, run right after the existing.envcheck in both Quick Start and Full Install. It comparesONLYOFFICE_JWT_SECRETin.envagainst theonlyofficeservice'sJWT_SECRETindocker-compose.yml; on a mismatch (e.g. after.envreverts to.env.example's placeholder following a freshgit pull) it explains this is exactly what causes the "document security token is not correctly formed" error and offers to auto-fix.envto match, default yes (start.bat). start.sh(macOS/Linux) does not yet have the equivalent check.
Fixes
- Removed the unused
departmentfield from the entire User Management surface — schemas, the create/CSV-import/update endpoints, and the Settings UI (table column, search filter, Edit/Add User modals). The column still exists on theUserDB model itself but is now fully orphaned; nothing in the API or UI reads or writes it (app/schemas/auth.py;app/routers/users.py;static/pages/settings.html). - Fixed the Documents page failing to load anything at all — no search bar, no table, upload zone not hiding for researchers — caused by
documents.htmlredeclaringcurrentUserOrgwithletwhenapp.jsalready declares it as a page-global. Since all non-module<script>tags on a page share one top-level scope, the duplicate declaration threw aSyntaxErrorthat silently aborted the entire inline script beforerender()ever ran, for every role, on every load (static/pages/documents.html).
v1.3.0 — August 8, 2026
Self-Contained Docker Deployment, Push-to-Deploy, Hybrid Search & Relevance-Aware RAG Retrieval
Self-Contained Docker Deployment
- Added
docker-compose.deploy.yml: a fully self-contained stack for hosting SmartKMS online — Postgres+pgvector, MinIO, Redis, ONLYOFFICE, Ollama, the API, and Caddy in front for automatic HTTPS — unlike local dev'sdocker-compose.yml, nothing here depends on services running outside Docker. - The
apicontainer runsscripts/setup_db.pyautomatically on every start (creates the database, enables pgvector, creates tables, seeds demo accounts — skips anything that already exists) before launching uvicorn, so a brand new deployment comes up fully migrated and seeded with zero manual steps. - Ollama runs as its own container with an auto-pull entrypoint (
deploy/ollama-entrypoint.sh) that pulls all three required models on first boot and skips them on every boot after — rather than relying on a host-installed Ollama, which isn't portable to a Linux VPS. - Added
deploy/Caddyfile: automatic Let's Encrypt certificates for three hostnames (main app,files.<domain>for MinIO,office.<domain>for ONLYOFFICE) — both MinIO and ONLYOFFICE need their own public hostname since the browser talks to them directly, not just through the API. - Added
.env.deploy.exampledocumenting every required deployment secret/config value, kept separate from local dev's.envon purpose so dev and deployment credentials can never accidentally mix.
Push-to-Deploy
- Added a GitHub Actions workflow (
.github/workflows/deploy.yml) that redeploys on every push tomain: SSHes into the VM,git reset --hard origin/main, rebuilds just theapiimage, restarts the stack, prunes old images, and polls/healthbefore calling the deploy successful — failing loudly instead of silently reporting success if the app doesn't come back up. - Added
DEPLOY.mdcovering one-time VM setup, DNS records, and the SSH deploy-key setup needed for the workflow above.
Docker Deployment Launcher Mode
- Both
start.batandstart.shgained a 3rd mode — Docker Deployment — that builds and runs the full containerized stack above; creates.env.deployfrom the template and opens it for editing on first run if it doesn't exist yet (start.bat;start.sh). - Quick Start no longer runs
setup_db.pyon every single launch — it's virtually always already done, and the app now shows a clear message if tables genuinely are missing rather than needing a silent safety-net rerun every time. Full Install still runs it, for first-time setup (start.bat;start.sh).
Hybrid Search: Full-Text Body Matching
- Search previously only matched on semantic similarity or literal title/author/tag text — a fact clearly present in a document's body had no way to surface unless it also cleared the semantic similarity threshold. Added a genuine third path: Postgres full-text search (
to_tsvector/plainto_tsquery) over each document's extracted text, surfaced as a distinct "Matched by text found in the document" result reason (app/services/search_service.py;app/schemas/search.py;static/pages/search.html). - Added per-candidate debug logging of every document's semantic/title/author/content/tag scores during a search, for diagnosing future retrieval questions directly from the server logs instead of guessing (
app/services/search_service.py).
Relevance-Aware RAG Retrieval
- Replaced naive per-document 2000-character head-truncation in chat's RAG context with a relevance-aware excerpt selector that searches the whole document — not just its opening — for the passages most related to the question. Previously, a fact located anywhere past the first ~2000 characters (e.g. page 6 of a 36-page PDF) was simply never sent to the model, regardless of relevance (
app/services/ai_service.py:_select_relevant_excerpt()). - Each query word is weighted by how rare it is across the document, not just whether it's present — without this, a dense Table of Contents repeating a generic word many times (e.g. "cat" appearing 11 times in one window of a cat-themed booklet) could outscore the actual answer, which uses a specific word appearing only once. The top-ranked search result also gets a larger share of the context budget (4000 characters) than lower-ranked ones (2500, then 1200), since it's far more likely to actually hold the answer (
app/services/ai_service.py:_excerpt_budget_for_rank()). - Raised the model's context window (
num_ctx) from 4096 to 8192 tokens so it can actually fit the larger, more relevant excerpts instead of silently truncating them.
Minor Features
- Presigned MinIO URLs can now use a different scheme for the browser-facing URL than the internal one (
S3_PUBLIC_SECURE) — needed once MinIO sits behind Caddy's TLS in a real deployment: internalapi→miniotraffic stays plain HTTP, while the browser needs HTTPS (app/config.py;app/services/storage_service.py).
Fixes
- Fixed "Knowledge Gaps" in Analytics flagging queries that matched exactly one relevant document — often the correct outcome, one strong match and a good answer — as "no good answer found." Now only flags genuine zero-result searches, a real gap worth an admin's attention (
app/services/analytics_service.py:get_knowledge_gaps();static/pages/analytics.html). - Simplified document preview: files other than PDFs and images (doc/docx/xls/xlsx/ppt/pptx) previously tried to embed a live ONLYOFFICE viewer, which was unreliable (Document Server reachability, JWT/CORS issues, slow first boot). Now shows a plain file-type icon and "No preview for this file" instead — full editing is still available separately via the Edit button, a different and more reliable ONLYOFFICE integration (
static/js/docPreview.js;static/pages/documents.html).
v1.2.0 — August 6, 2026
Streaming AI Chat, Content Moderation, Image Understanding & Cross-Platform Launcher
AI Moderation Pipeline
- Added a 3-stage screen for chat messages — normalize → keyword/regex first-pass → LLM contextual classifier — that scores every message 0–1 and returns block/escalate/allow (
app/services/moderation_service.py;app/routers/chat.py: wired intosend_message()). - Deterministic matches (SSN, credit card, password strings) block immediately without needing the classifier, while ambiguous keywords like "kill" only seed the classifier's context instead of deciding anything on their own.
Real-Time Token Streaming
- Replaced the single blocking JSON response with Server-Sent Events using Ollama's native
stream:true, so replies appear incrementally instead of only after the full answer finishes generating (app/services/ai_service.py:generate_rag_answer_stream(),generate_plain_chat_reply_stream(),_stream_ollama_chat();app/routers/chat.py:send_message()now returns aStreamingResponse). - Frontend reads the response via
fetch()+ReadableStreamand re-renders markdown per token (static/pages/chat.html).
Cancel In-Progress Chat Messages
- The send button becomes a stop button mid-generation, backed by a cooperative cancellation flag the token loop polls between chunks — partial text already streamed is kept, with a cancelled note appended, instead of being discarded (
app/services/chat_cancel.py;app/routers/chat.py:POST /chat/messages/{client_message_id}/cancel;static/pages/chat.html).
Image Content Understanding
- Standalone image uploads now get a real vision-model description in addition to OCR, instead of relying on OCR alone, which transcribes only literal on-image text and returns nothing for a photo/diagram with no visible text (
app/services/ai_service.py:describe_image_via_ollama_vision();app/services/document_processor.py:_extract_image_content()).
Launcher Scripts
- Added
start.sh, a macOS/Linux counterpart tostart.batcovering the same steps: venv activation, package checks, Docker services (MinIO/Redis/ONLYOFFICE), Ollama, database setup, and app launch (start.sh). start.shopens Ollama in its own terminal window — a new Terminal tab on macOS viaosascript, orgnome-terminal/konsole/xtermon Linux — and falls back to running it in the background with output logged toollama.logif no terminal emulator is found (start.sh).- Both
start.batandstart.shnow open with a mode prompt: Quick Start (launch everything as-is, installing only what's missing) or Full Install (create the venv if missing, force-install/upgrade every package,docker compose pullbefore bringing services up, and pull all three Ollama models). Full Install is meant for first run or making sure everything's current; Quick Start is the day-to-day path (start.bat;start.sh). - Both scripts now check whether Ollama is already running before opening a new window for it, so re-running the launcher no longer stacks duplicate Ollama processes (
start.batviatasklist;start.shvia a check againstlocalhost:11434).
Minor Features
- Blocked chat messages get a distinct, supportive reply for self-harm specifically rather than the same flat refusal used for everything else; escalated-but-still-answered messages are logged to the existing Activity Log for moderator review (
app/routers/chat.py). - Citations are now computed independently of the model's streamed answer text rather than waiting on generation to finish, since they were never actually derived from the model's own output in the first place (
app/services/ai_service.py:build_rag_citations()). - Local development now points at a locally-managed (pgAdmin) Postgres instance instead of a containerized one, reachable from the API container via
host.docker.internal(docker-compose.yml).
Fixes
- Fixed suggested-prompt chips doing nothing when clicked in both chat and search — the inline
onclick="setInput(${JSON.stringify(c)})"broke the HTML attribute whenever the value contained a quote; replaced withdata-promptattributes and a delegated click listener (static/pages/chat.html;static/pages/search.html). - Fixed a raw SQLAlchemy/asyncpg error dump appearing on login, and on every other endpoint, when the database had no tables yet — the global exception handler now recognizes
UndefinedTableError(walking the exception's cause chain) and returns a clear "runpython scripts/setup_db.py" message instead (app/main.py). - Fixed only one of two documents receiving a summary when uploading multiple files at once — traced to the same root cause as the image-description fix above (one image had OCR-able text, the other didn't) rather than a separate concurrency bug (
app/services/document_processor.py). - Fixed dropped/interrupted chat connections mid-stream surfacing a raw exception instead of a plain "this got interrupted, please try again" message (
app/routers/chat.py). - Fixed streaming endpoints touching an already-closed DB session —
Depends(get_db)tears down as soon as the endpoint function returns, which for aStreamingResponsehappens before the generator itself runs; the generator now opens its own session instead of reusing the request-scoped one (app/routers/chat.py: usesAsyncSessionLocaldirectly). - Fixed uvicorn's
--reloadnot picking up code changes when running via Docker Desktop on Windows — OS-level filesystem change events don't reliably propagate across Windows bind mounts, so file watching is now forced to polling instead (docker-compose.yml:WATCHFILES_FORCE_POLLING).
v1.1.0 — August 3, 2026
Cancel Chat & Image Upload Improvements — Real cancellation support, richer image understanding, and more resilient multi-file uploads
Chat Cancellation
- Send button now turns into a red stop button while a reply is generating, and clicking it calls a real server-side cancel endpoint to interrupt the in-flight Ollama request. This is handled in the chat API and cancel service flow (
app/routers/chat.py;app/services/chat_cancel.py;app/schemas/chat_schemas.py). - The cancelled reply is stored as a visibly muted italic bubble: "You cancelled this message before it finished generating." This is surfaced in the chat UI and message render logic (
static/pages/chat.html). - Dropped connections and timeouts now render as "This response was interrupted before it finished…" instead of a raw backend error, so flaky connectivity reads as disruption rather than a crash. The interruption handling is enforced in the chat response path (
app/routers/chat.py;static/pages/chat.html).
Image Uploads
- Added a second Ollama vision pass to describe what an uploaded image actually shows, alongside OCR for text extraction. The image content pipeline now combines both sources before summary generation (
app/services/ai_service.py;app/services/document_processor.py). - Standalone image uploads now combine OCR and visual description instead of relying on text-only extraction. This is implemented in the document processing flow for uploaded images (
app/services/document_processor.py). - PDF page rasterization remains OCR-only for scanned document workflows, preserving the original document-search behavior without treating photos like scanned text documents. This keeps the OCR path intentionally narrow for PDFs while photo uploads get the richer visual description (
app/services/document_processor.py).
Multi-File Upload Reliability
- Fixed the case where only one uploaded document received a summary when another image had no readable text to OCR. The combined extraction flow now keeps the image description path alive even when OCR produces no text (
app/services/document_processor.py;app/services/ai_service.py). - Improved resilience for mixed or multi-file uploads where model swaps or temporary connection drops can interrupt generation, surfacing those results as clear interruption messages rather than hard failures. The request path and interruption handling are tightened across chat generation and upload processing (
app/routers/chat.py;app/services/document_processor.py;app/services/ai_service.py). - Kept the moderation flow intact before generation and search so chat behavior remains consistent and safe. The user-message moderation pipeline remains in place before generation or search operations proceed (
app/services/moderation_service.py;app/routers/chat.py).
v1.0.1 — August 2, 2026
Branding Asset Cleanup and Logo Standardization
Branding
- Added standalone
logo-mark.svg. - Replaced legacy
logo.svg. - Added
logoImg()helper. - Updated all pages to use image-based logo rendering.
- Improved logo sizing and alignment.
v1.0.0 — August 1, 2026
First Stable Release — Redesigned Chat Bubbles, Reliable Conversation Deletion, Clickable Citations & In-Chat Document Preview, Mobile-Responsive Chat, Login/Logout Audit Tracking, Performance Optimizations, Open-Source Landing Page
Audit Log — Login/Logout Tracking
- Logout is now recorded in the audit log alongside login, so a user's session activity shows both halves instead of just the start. Uses the same
log_action()path login already went through, so it shows up automatically in the Activity Log's action filters — no changes needed there (app/routers/auth.py:logout())
Shared Document Preview Modal
- New lightweight, reusable document preview that opens in a modal on top of whatever page you're on (AI Search results, Q&A chat citations) instead of navigating away to the Documents page — so you can keep your place in a search or conversation while looking at a source file. Loads a PDF/image preview or falls back to extracted text, with Download and "Open full view" actions (
static/js/docPreview.js: newDocPreview.open();static/js/app.js:Modal.open()gained asize: 'lg'option;static/css/styles.css) - AI Search results are now clickable and open the preview modal, instead of only offering a download button (
static/pages/search.html) - Citation chips under Q&A chat replies are now clickable and open the same preview modal for that source document, instead of being inert (
static/pages/chat.html)
Open-Source Landing Page
- Removed the Pricing page and nav link entirely — SmartKMS is open source with no paid tiers, so a "Free / Organization / Business" pricing table no longer belongs on the site (
static/pages/pricing.htmlremoved;static/pages/index.html;static/js/auth.js) - Replaced the "Auto-Tagging & Classification" feature card with "In-Browser Document Editing" (a real, shipped feature), and reworded the "AI Analyzes" step description — automatic tagging was never actually implemented; tags in SmartKMS are added manually from the document viewer (
static/pages/index.html) - Removed the remaining references to auto-tagging from the Terms & Conditions (AI Features section, Disclaimers, Limitation of Liability), for the same reason (
static/pages/terms.html) - The footer's "Privacy" and "Support" links, previously dead
#placeholders, now go somewhere real: Privacy links to the existing Privacy & Data Handling section of the Terms page, and Support links to a new dedicated page covering how to file a bug (GitHub Issues), find documentation (project wiki), or get help from your own organization's SmartKMS admin (static/pages/support.htmlnew;static/pages/index.html)
Mobile-Responsive Chat
- The Q&A Assistant page is now usable on phones and tablets: the conversation-history panel becomes a slide-over with a tap-to-dismiss backdrop instead of squeezing in beside the conversation, and starts closed by default on small screens (matching how the app's main sidebar already behaves) instead of covering the screen on first load. Picking a conversation or starting a new one now also closes the panel automatically (
static/pages/chat.html) - Tightened up the topbar, message bubbles, composer, and suggestion chips for narrow screens — the "Delete chat" button collapses to icon-only, the subtitle and keyboard-shortcut hint drop off first when space is tight, and bubbles use more of the available width (
static/pages/chat.html)
Chat Bubble Redesign
- Fixed stray blank space rendering inside user chat bubbles — the bubble had
white-space: pre-wrapapplied to preserve the person's own line breaks, which was also picking up incidental indentation and newlines from the template that builds the bubble's HTML.pre-wrapnow only applies to the message text itself, and the bubble-building template was tightened up to remove that incidental whitespace at the source (static/pages/chat.html) - Chat bubbles now use an asymmetric "tail" corner (flat on the side facing the sender's avatar) instead of a uniform rounded rectangle, with a subtle shadow and a soft fade/slide-in as each message appears (
static/pages/chat.html)
Suggested Prompts
- Clicking a suggested prompt now hides the suggestion row immediately, instead of leaving it visible until the message was actually sent (
static/pages/chat.html:setInput()) - Fixed a race condition where the suggested-prompts request could resolve after a conversation had already loaded, popping the row back into view (
static/pages/chat.html)
Session & Navigation UX
- The landing page's nav/hero button now reads "Go to Dashboard" (and links straight there) instead of "Sign In" when there's already a session — determined locally from storage, so there's no network round trip and nothing to flash the wrong label first (
static/pages/index.html) - Fixed the login page itself briefly flashing the empty sign-in form for someone who's already signed in, right before its own script redirects them to the dashboard — the form now stays hidden behind a lightweight loading state until that check has actually finished (
static/pages/login.html) - Removed the old behavior of forcibly redirecting a signed-in visitor away from the landing page the moment it finished an auth check — that redirect firing mid-read was its own jarring surprise; the page no longer force-navigates on its own (
static/pages/index.html)
Dashboard & Analytics
- Most Searched Topics, Knowledge Gaps, and Top Contributors on the Analytics page are now limited to 5 items each instead of showing everything the backend returns (up to 20 for Knowledge Gaps), so the page no longer runs long and requires scrolling to get through it (
static/pages/analytics.html)
Performance
- Static assets (
app.js,auth.js,layout.js,utils.js,styles.css) now cache for 5 minutes instead of forcing a revalidation round trip on every single request. In this multi-page app, every navigation was re-requesting all of them; a short cache window removes that round trip for typical back-to-back navigation while still picking up an edited file within minutes (app/main.py:NoCacheStaticFiles) - The session-validity check that runs on page load now reads the token's own expiry locally first, and only falls back to a network round trip (
/api/auth/me) when that can't be confirmed (token missing, unreadable, or expiring soon). Previously this check always hit the network before a page was confirmed ready to load its own data (static/js/auth.js:ensureSession()) - Ollama now keeps the embedding and chat models loaded for 30 minutes of inactivity instead of its 5-minute default. Search and Q&A both call into Ollama, and a request arriving after the model had unloaded was paying for a full model reload on top of actually generating the response — the single largest latency spike either path could hit (
app/services/ai_service.py:_embed(),generate_rag_answer(),generate_plain_chat_reply())
Conversation Deletion
- Fixed a deleted chat reappearing after a page refresh — the delete request could fail on the server (see below) while the frontend still removed it from the visible list regardless, because the failure was silently swallowed. Both delete paths ("Delete chat" and the history-list delete button) now check the response status and only remove a conversation from view once the server actually confirms it was deleted; a failed delete now surfaces an error instead of pretending to succeed (
static/pages/chat.html:deleteSessionFromList(),clearChat()) - Fixed deleting a conversation that had existing messages throwing an unhandled 500 (foreign-key violation). This project's schema is created by
Base.metadata.create_all()at startup rather than tracked Alembic migrations, so a database created beforeondelete="CASCADE"was added to the chat models never actually picked up that constraint. Session deletion now explicitly deletes a session's citations and messages before deleting the session itself, rather than relying on the database's cascade behavior, so it works regardless of that constraint's state (app/routers/chat.py:delete_session();app/models/chat.py: added ORM-level cascade as well)
Project Organization
- Renamed
frontend/tostatic/throughout the project, and updated every reference to the old path (app/main.py;README.md)
v0.9.0 — July 29, 2026
Real Suggested Prompts, Working Search Downloads & File Type Icons, Project Housekeeping & Expanded Test Coverage
Real Suggested-Prompt Chips
- The "Try asking" chips on the Search page and the example-question chips on the Chat page were hardcoded fake examples unrelated to any org's actual documents. Both now call a real endpoint that builds chips from this org's own recent successful searches (Search) or the signed-in user's own recent conversation openers (Chat), filled out with prompts grounded in real, currently-accessible document titles when there isn't enough history yet — and the section hides itself entirely rather than showing something fake if there's nothing to ground it in (a brand-new org with no documents or history) (
app/services/search_service.py: newget_suggested_search_prompts(),get_suggested_chat_prompts(),get_recent_document_titles();app/schemas/search.py: newSuggestedPromptsResponse;app/routers/search.py: newGET /api/search/suggested-prompts;app/routers/chat.py: newGET /api/chat/suggested-prompts;frontend/pages/search.html,chat.html)
Testing
- New test suite covering the document-editing feature set: in-app content editing (get/save extracted text, permission checks for owner/staff/other-org), version history and restore (snapshot-before-save, snapshot-before-restore, version ordering), and the ONLYOFFICE live editor integration (editor config generation, editable-type gating, force-save, and the save/close callback across its status codes).
- New tests for sensitive-content screening at approval time: clean documents approve normally, flagged text or images auto-reject instead of approving, an image-screen failure doesn't block approval, rejection reasons include the flagged categories, and a regression test confirming approval screens the document's current text — including any edits made after upload — rather than a stale copy from upload time.
- 45 new tests across 7 test classes in
tests/test_document_editing.py, following the existing suite's conventions (MinIO/Ollama/ONLYOFFICE all mocked, no Docker required to run).
Project Organization
- Moved loose one-off scripts out of the project root into
scripts/—setup_db.pyand the manualtmp_upload_check.pydevelopment utility are now underscripts/, with their imports updated soappstill resolves correctly one directory deeper. - Quarantined three scripts that were fully superseded by
setup_db.py(an older table-creation script, an older org/user seed script, and a seed SQL file written against outdated organization UUIDs and roles) intoscripts/legacy/, each marked with a note pointing to the current replacement instead of deleting them outright. - Updated every reference to the old
setup_db.pyroot path acrossstart.batandREADME.md(setup instructions, Docker section, troubleshooting entries, and both project-structure diagrams) so nothing was left pointing to a file that no longer exists there.
Fixes
- Fixed the Search page's download button doing nothing — it was a plain
<a href="/api/documents/{id}/download">link, and a normal link click sends noAuthorizationheader, so the request 401'd before ever reaching MinIO. Now fetches the presigned download URL with an authenticated request first, following the same pattern already used on the Documents page (frontend/pages/search.html: newdownloadResult()) - Fixed every search result showing the same generic file icon regardless of file type — results now get the correct icon and color treatment for PDF, DOC, XLS, PPT, and image files, matching the Documents page (
frontend/pages/search.html: newtypeIconName(),typeIconClass())
v0.8.0 — July 28, 2026
Reapproval Workflow, Redesigned AI Chat, Modal Forms, Smarter Content Screening, Admin Activity Log, Display Preferences & New Brand Mark
Reapproval Workflow
- Uploaders of a rejected document can now submit a reapproval request explaining why it should be reconsidered — a title, common-reason checkboxes (AI false positive, content updated, context misunderstood), and/or a free-text description, requiring at least one of the two.
- New dedicated review page for admins and staff: a filterable queue (pending/approved/rejected/all) showing the document, its original rejection reason, the requester, selected reasons, and description, with one-click Approve/Reject and a deep link into the full document viewer.
- Rejected documents are no longer visible to researchers or faculty who didn't upload them, even where the document's visibility level would otherwise allow it — only the uploader and admin/staff reviewers can see a rejected document now.
Redesigned AI Chat Experience
- The Q&A page is no longer a single message thread — it now has a collapsible conversation-history rail listing every past conversation with its title, relative timestamp, and message count, so you can switch between conversations or start a new one without losing older ones.
- Assistant replies now render Markdown (bold, italics, inline code, fenced code blocks, headings, ordered/unordered lists, links) instead of dumping raw text with literal
**asterisks**. - Added a hover-revealed "Copy" action under every message bubble that copies the raw text to the clipboard, with a brief "Copied" confirmation.
- Replaced the single-line input with an auto-resizing textarea (grows up to ~11 lines, caps with internal scroll) and added a visible "Enter to send · Shift+Enter for a new line" hint.
- Renamed "Clear chat" to "Delete chat" for clarity now that individual conversations can also be deleted directly from the history rail.
Modal Forms
- Replaced every remaining native browser
prompt()/confirm()/alert()popup — rename/delete document, folder create/rename/delete, share access level, restore version, reject reason, reapproval review note — with the same in-app modal component already used elsewhere, for a consistent look and to get out of the browser's unstyleable default dialogs.
Sidebar Toggle Consistency
- Fixed the sidebar collapse/expand toggle resetting itself whenever you navigated to another page on desktop — every nav link is a full page load rather than an SPA route, so the collapsed state was only ever a runtime class that vanished on the next page. The desktop collapsed/expanded state is now persisted in
localStorageand re-applied before the sidebar renders on each new page, so it stays put until you toggle it again.
Full Terms & Conditions
- Replaced the dead
#placeholder "Terms" footer link with a complete, dedicated Terms & Conditions page covering acceptance, accounts and roles, acceptable use, document ownership and content responsibilities, AI feature disclaimers, content-screening/moderation, privacy and data handling, security, intellectual property, service availability, suspension/termination, warranty disclaimers, liability limits, indemnification, how changes to the Terms are communicated, governing law, and a contact section — with a jump-to-section table of contents.
Smarter Content Screening
- Reworked both the text and image sensitive-content screening prompts to cut down on false positives: the model must now point to concrete evidence rather than just topic-matching, gets explicit negative examples (blank form fields, policies discussing a topic in the abstract with no one named, hypothetical data, ordinary photos), and defaults to not flagging when uncertain. If it claims text is sensitive but can't produce supporting evidence, that flag is now automatically overridden.
- Added separate, independently configurable models for content screening vs. day-to-day chat, so screening can use a slower/stronger model without touching chat's responsiveness.
Admin Activity Log
- New admin-only Activity Log page surfacing the audit trail that was already being recorded but had no UI to actually view. Filterable by user, action, resource type, a resource-id search, and a date range, with pagination.
- CSV export respects every active filter and streams a capped (20,000 row) export so a very wide date range can't tie up the API worker on an unbounded query.
Display Preferences
- Settings → Display now has real controls: density (comfortable/compact), font size (small/medium/large), reduce motion, and whether the sidebar starts collapsed on desktop — all previously not configurable anywhere. Stored in
localStorageand applied globally on every page load, before first paint.
Branding
- Added a favicon and app icon — a modern graduation-cap mark on a teal gradient background.
- Replaced the graduation-cap icon with a geometric faceted-hexagon mark, gradient-filled using three of SmartKMS's own color-theme presets (Ocean Blue → Purple → Crimson). Updated everywhere the old logo appeared: login, landing page header + footer, pricing, terms, and the app sidebar.
- Reworked
README.mdinto a more polished reference: centered logo and version/stack badges, a dedicated ONLYOFFICE setup section, expanded environment-variable reference, and quick-nav links.
Fixes
- Fixed the Q&A chat assistant citing an unrelated (often previously-discussed) document on messages like "hi" or "who are you" — every message, including greetings, was running through document search and getting handed whatever document crossed the similarity threshold; short/vague messages are exactly where semantic similarity is least discriminative, so a generic greeting could spuriously score above threshold against some document. Greetings, thanks, goodbyes, and meta questions about the assistant now get a direct conversational reply with no document search and no citations at all.
v0.7.0 — July 25, 2026
Upload Cancellation, Real Related Documents, Image Content Screening & ONLYOFFICE Fixes
Upload Cancellation
- Uploads can now be cancelled mid-processing: a Cancel button on the locked/processing card (both list and grid view) stops the background extract/analyze/summarize pipeline at its next checkpoint and hard-deletes the document row and its file from MinIO, instead of leaving an orphaned record or file behind.
Related Documents
- "Related Documents" in the document viewer is now computed server-side using the same pgvector semantic-similarity infrastructure as search, instead of a client-side heuristic that only ever looked at whatever page of documents happened to already be loaded in the browser. Falls back to shared-tag/same-folder overlap for documents without an embedding yet.
Sensitive-Content Screening
- Now also covers image content, not just extracted text — a vision-model check flags actual pornographic/sexually explicit images while explicitly not flagging sex-education material, historical photographs, classical/museum artwork, or biographical images of public figures; always flags if a depicted person could plausibly be a minor, regardless of context.
- Refined the text-based prompt to explicitly treat biographical/historical content about public figures as NOT sensitive, even though it names a real person.
UI Cleanup
- Removed the circular initials-avatar from the Owner column in both the folder and document table rows — shows the username only now.
Fixes
- Fixed ONLYOFFICE-based document editing hanging forever on open for PDFs —
documentTypewas mapped to"word"for PDFs, which was correct pre-8.0 but breaks on modern Document Server versions (8.0+), which split PDFs into their own dedicated PDF editor. Now maps to"pdf". - Fixed presigned MinIO URLs handed to the ONLYOFFICE container failing with
SignatureDoesNotMatch— URLs were signed against one host and then string-replaced to a different host afterward, which silently invalidates a SigV4 signature. All three presigned-URL functions now sign directly against the endpoint that will actually make the request.
v0.6.0 — July 23, 2026
Sensitive-Content Screening, Document Editing & Version History
Main Features
- Sensitive-content screening fully integrated into the document workflow — approval status exposed separately from visibility, pending/rejected badges throughout the UI, admins can approve, reject, or re-approve directly from the document viewer.
- Uploaded documents are automatically analyzed for sensitive content during background processing, with an immediate notification if auto-rejected.
- Added extracted-text previews for supported non-PDF/image documents (DOCX, XLSX), and inline document editing with an Edit mode.
- Introduced document versioning with automatic snapshots on every save, version history with restore/undo, and background re-embedding + summary regeneration after a save so search and chat stay synchronized.
Fixes
- Fixed document approval status not reaching the frontend correctly by separating
approval_statusfrom document visibility in the API response. - Reworked document approval workflows across frontend and backend to consistently expose, store, and update approval state.
v0.5.0 — July 20, 2026
Semantic Search & AI Chat Now Fully Functional
Main Features
- Semantic search and AI chat (Q&A) fully functional end-to-end for the first time — real semantic and keyword matches, reliable answers using retrieved document context instead of empty results or Internal Server Errors.
Fixes
- Fixed semantic search silently returning zero results whenever the underlying SQL query failed — the exception handler never rolled back the transaction, leaving PostgreSQL in an aborted state and causing every subsequent query to fail with
PendingRollbackError. - Fixed
asyncpg.exceptions.AmbiguousParameterErrorduring semantic searches by explicitly casting the optional organization filter parameter. - Fixed missing
document_org_access/document_user_accesstables in existing databases — re-runningsetup_db.pynow safely creates newly introduced tables without affecting existing data.
v0.4.0 — July 18, 2026
Account Security, Settings Overhaul, UI/UX Improvements & Database Consolidation
Breaking Changes
- Role model reduced from six roles to four: researcher, faculty, staff, admin.
deanandsuper_adminare gone — both were admin-equivalent, so existing accounts migrate toadminautomatically. Admin is now the single top-level role with full access across every organization, not just its own.
Account Security
- Account lockout: 5 failed login attempts locks the account for 15 minutes, configurable via
MAX_LOGIN_ATTEMPTS/LOCKOUT_MINUTES. - "Remember me" on login: checked survives a closed browser (persistent cookie); unchecked ends the session when the browser closes.
- Login page redesigned as a single centered card instead of the old split-screen layout.
Settings & User Management
- Settings → Profile fully editable (name, email, organization); self-service password change.
- Organizations now have full CRUD from Settings, and admins can edit any user's name, email, organization, and role, or deactivate them — all through modal forms.
- New reusable
Modalcomponent replacing native<dialog>/prompt()/confirm()popups across Settings. - Organization color is now set with a real color picker instead of typing a raw HSL string by hand.
Theme & UI Improvements
- Color theme now applied and persisted globally across every page; replaced "Forest" (nearly identical to "Teal") with "Monochrome".
- Light mode sidebar now actually follows light/dark like the rest of the UI; dark mode colors reworked to a more neutral gray.
- Fixed unreadable dark text in dark mode on the org switcher and theme-picker labels.
- Removed circular avatar placeholders from the sidebar and Settings profile card.
Cache, Performance & Database Setup
- All frontend responses now include
Cache-Control: no-cache, must-revalidate— previously CSS/JS/HTML could be cached indefinitely, which is why fixes sometimes appeared not to take effect. setup_db.pynow the single script for DB creation, pgvector, schema, and seed data — safe to re-run anytime. Newstart.batfor one-double-click startup on Windows.
Fixes
- Fixed Settings loading forever for accounts with a leftover
dean/super_adminrole —setup_db.pynow migrates these automatically. - Fixed a double horizontal line under the sidebar nav.
Cleanup
- Removed obsolete migration scripts (folded into
setup_db.py), a leftover manual test script, four empty unreferenced stub model files, and orphaned hand-written seed files that had drifted out of sync. - Reviewed the schema for normalization issues — already holds up well at 3NF, no structural changes needed beyond the role-enum simplification.
v0.3.0 — July 16, 2026
AI-Powered OCR, Document Management Overhaul & Search Improvements
Main Features
- OCR for scanned PDFs and images via an Ollama vision model (llava), with PyMuPDF rasterization and an optional pytesseract fallback.
- Hybrid search combining vector/semantic similarity with keyword matching, only counting a genuine "semantic" match above a configurable similarity threshold.
- Documents page redesign: List/Grid toggle, sortable columns, breadcrumb navigation, per-item context menu.
- New full-screen document viewer modal: live inline preview, double-click-to-rename, tag management, access-level dropdown, related-documents panel.
- Folder management fully wired to the backend — create, rename, delete, drag-and-drop to move.
- Tag management persisted through new endpoints; removed the admin approval requirement so uploads go live immediately.
Fixes
- Fixed archived documents still showing up in the default list; fixed folder-move requests silently failing to persist.
- Fixed MinIO presigned URLs occasionally failing signature validation by forcing S3v4 signing and an explicit region.
- Fixed PDF text extraction aborting the entire pipeline if a single page failed to parse — now skips just that page.
- Fixed documents with no extractable text getting a meaningless placeholder embedding — now falls back to the document title.
v0.2.0 — July 11, 2026
Real Document Data & Upload Reliability
Main Features
- Documents page now loads and renders real documents from the API instead of static mock data.
- Added status badges covering the full document lifecycle — Pending, Approved, Rejected, Archived.
Fixes
- Fixed uploads being mislabeled when the browser sent a generic
application/octet-streamcontent type — file type now inferred from the filename extension. - Fixed uploads failing when the MinIO bucket didn't exist yet or already existed.
- Fixed a crash in the background processing task from comparing a plain string document ID against a UUID column.
v0.1.0 — July 5, 2026
Initial Release
Main Features
- Document upload & management with an admin approval workflow before documents appear in search.
- AI-powered semantic search: queries embedded with Ollama (
nomic-embed-text), matched via pgvector cosine similarity. - Q&A chat assistant using Retrieval-Augmented Generation with Qwen 2.5 3B, citing source documents.
- Multi-college architecture with five visibility levels: Private, Public, Restricted, Cross-Org, Global.
- Analytics dashboard, role-based access control with six roles, JWT authentication.
Also Included
- 19-table PostgreSQL schema; fully on-premise stack; initial automated test suite scaffold.