Library GDPR classification controls (feature 057)
Library GDPR classification controls (feature 057)
Section titled “Library GDPR classification controls (feature 057)”Summary: Adds GDPR classification selection for document uploads in the library and team documents surfaces, using the existing backend support.
What this feature is
Section titled “What this feature is”Feature 057 (name: library-gdpr-controls) provides GDPR classification controls for documents uploaded via Ajutant’s document library and related upload surfaces.
The published spec states that feature 056 already enforced GDPR classification for the chat upload flow only. Feature 057 extends classification prompting to other upload surfaces that previously uploaded documents without a classification level or without enforcing team clearance.
Why it matters
Section titled “Why it matters”The spec identifies a GDPR compliance gap: certain surfaces still upload documents without prompting for a classification level or enforcing team clearance.
Feature 057 targets these surfaces:
- Document Library page (
app/(app)/documents/page.tsx), uploads viaPOST /api/documents - Team Documents tab (
TeamDocumentsSection.tsx), direct file upload and “Paste Text” dialog, uploads viaPOST /api/documents - Assistant Knowledge Base (
KnowledgeBaseTab.tsx), uploads documents to assistants
Scope and behavior (from the spec)
Section titled “Scope and behavior (from the spec)”Backend capability already exists
Section titled “Backend capability already exists”The spec states that the backend POST /api/documents route:
- accepts an optional
classificationLevelform field - computes retention based on the classification
It also states that the following already exist from feature 056:
- a
ClassificationPickercomponent - a
validateClearance()function
Session 2026-03-05 decisions
Section titled “Session 2026-03-05 decisions”- Assistant Knowledge Base uploads are in scope for classification (add a user story for Knowledge Base upload classification).
- User-scoped document uploads require classification selection, but no team clearance check applies.
User scenarios covered
Section titled “User scenarios covered”User story 1: document library upload classification (P1)
Section titled “User story 1: document library upload classification (P1)”Goal: When a user uploads through the main Document Library page, they must select a confidentiality classification before the upload begins.
Acceptance scenarios (as specified):
- Given a user is on the Document Library page, When they click “Browse” or drag-and-drop a file, Then a classification picker is shown before the upload begins
- Given a user has selected a file and the classification picker is shown, When they select a classification level and confirm, Then the file is uploaded with that classification level in the form data
- Given a user has selected a file and the classification picker is shown, When they cancel, Then the file is not uploaded and the picker is dismissed
- Given a user selects multiple files at once, When the classification picker is shown, Then one classification level applies to all files in the batch
- Given a user drags and drops a file onto the upload zone, When the file is dropped, Then the classification picker appears before upload proceeds
- Given a user is uploading to “My Documents” (user scope), When the classification picker is shown, Then all classification levels are available (no team clearance restriction applies)
User story 2: team documents upload classification (P1)
Section titled “User story 2: team documents upload classification (P1)”Goal: When an admin uploads through the Team Documents tab, they must select a classification, and the server must enforce that the chosen classification does not exceed the team’s clearance level.
Acceptance scenarios (as specified):
- The spec includes an independent test and starts listing acceptance scenarios, including blocking selection above the team’s clearance level.
Note: The provided spec excerpt cuts off mid-way through the Team Documents acceptance scenarios. Reviewers should use the full spec text (if available) to complete any remaining acceptance criteria.
How the classification is expected to be sent
Section titled “How the classification is expected to be sent”From the spec’s backend description and user story 1 acceptance criteria:
- The selected classification level should be sent to the server as
classificationLevelin thePOST /api/documentsform data. - The server then applies the classification to the created document and computes retention.
Testing checklist (based on the spec)
Section titled “Testing checklist (based on the spec)”Document Library page
Section titled “Document Library page”- Upload a document via the Document Library page.
- Verify the classification picker appears before upload.
- Confirm a level is selected and the document is created with the correct classification.
- Cancel the picker and verify the file is not uploaded.
- Upload multiple files in one batch and verify one classification level applies to all.
- Drag-and-drop a file and verify the picker appears before upload proceeds.
- Upload to “My Documents” (user scope) and verify all classification levels are available (no team clearance restriction).
Team Documents tab
Section titled “Team Documents tab”- Upload via the Team Documents tab.
- Verify the classification picker appears.
- Confirm a valid classification is accepted and the document is created with that classification.
- Attempt to select a classification above the team’s clearance and verify it is blocked.
Assistant knowledge base
Section titled “Assistant knowledge base”- The spec states Knowledge Base uploads are in scope for classification.
- Verify the classification picker is shown for Knowledge Base uploads and that the selected classification is applied when the document is uploaded.
Status
Section titled “Status”- Feature status: partial (as published in the feature catalogue entry).
Implementation notes for reviewers (grounded in the spec)
Section titled “Implementation notes for reviewers (grounded in the spec)”- The surfaces listed in the spec currently upload without prompting for classification or enforcing clearance.
- The UI should use the existing
ClassificationPickerand the existingvalidateClearance()logic (from feature 056) where team clearance enforcement is required. - Ensure
POST /api/documentsreceivesclassificationLevelfrom the UI.
If you have the complete Team Documents acceptance criteria text (the excerpt ends mid-sentence), add it to this document so the testing checklist fully matches the spec.