# Features — silicon_security

Evidence date: 2026-10-03.

Source: `git@bitbucket.org:overdrive/silicon_security.git`, `main` at `514489a` (2025-12-15).

Status labels: **Current** (present and reachable in this tree), **Incomplete** (route, view, or dependency without the matching class), **Documented only**, **Not a product feature**.

Full git history before the tip was not retrieved. "Recently changed" follows `docs/CHANGELOG.md`, migration filenames, and the tip commit.

## Current

### Authentication and account access

- Login form, inactive-account refusal, password verify, email 2FA, logout, forgot-password and reset. `app/Controllers/Welcome.php`. Routes `/`, `GetLogin`, `2fa-validation`, `ConfirmCode`, `forgot-password`, `reset-password`.
- Login history write on success and failure. `app/Controllers/LoginHistory.php`, table from migration `2024-09-18-132105_AddLoginHistoryTable.php`.
- Blocked IP flag at login construction. `BlockedUsersModel`, migration `2024-09-20-084946_AddBlockedUsersListTable.php`.
- Registration actions on `Welcome`. Whether the UI exposes them in production is **Unknown**.

### Authorisation shell

- Roles, menu categories, menus, submenus, and role grants. Seeders `UserRole`, `UserMenuCategory`, `UserMenu`, `UserAccess`. Filters `isLoggedIn` and `isGranted`.
- Seeded menus: Dashboard (`home`), Users (`users`), Menu Management, CRUD Generator, Media Files (`media`), System Settings.
- User list, create, update, delete, role access editor. `app/Controllers/Users.php`.
- Viewer-oriented profile: session-selected user, profile fields, password reset, activity log, document list, session timer. Routes under `users/profile`, `users/setSelectedUser`, `users/getActivityLogs`, `users/getDocuments`, `users/getSessionInfo`. Views `app/Views/users/userProfileDetail.php`. Changelog section "Viewer User Profile".
- System user admin screen. `app/Controllers/SystemUsers.php`, route `system_users`.

### Document management

- Landing page with types and categories. `Documents::index`, view `documents/index`.
- Two-step upload, OCR, metadata, file stored under `writable/uploads/documents/`. Allowed extensions pdf, jpg, jpeg, png.
- List, search, view, display, edit, update, delete, download. `app/Config/Routes.php` group `documents`.
- Types seeded: Legislation, Labels, Minutes. `app/Database/Seeds/DocumentTypes.php`.
- Categories CRUD under `admin/documents`. `app/Controllers/Admin/Documents.php`.
- Audit log list `admin/documents/auditLogs`. Model `AuditLogModel`. Migration `2025-01-15-100005_CreateAuditLogsTable.php`.
- Share to viewer and bulk assign. `Documents::shareToViewer`, `Users::assignDocumentToUser`, `Users::bulkAssignDocuments`, `Users::revokeDocumentAccess`.
- Per-document access types `time_limit`, `login_active_time`, `permanent`. `UserDocumentModel`.
- User-level weekly time window on `documents*`. `TimeAccessFilter`.
- RAG index and semantic search when OpenAI is configured. `app/Helpers/document_helper.php`, `app/Neuron/DocumentRAG.php`.
- RAG status page and reindex. `app/Controllers/RagStatus.php`.
- Search result cache table. Migration `2025-01-15-100007_CreateDocumentSearchCacheTable.php`. Call sites were not fully traced.

### Chat and AI settings

- Document chat: send, stream (SSE), history, conversation list, memory extraction, document context. `app/Controllers/Chat.php`. Migrations `2025-11-10-100000_CreateChatMemoriesTable.php`, `2025-11-10-100001_CreateDocumentContextsTable.php`, `2025-11-09-142917_CreateVectorEmbeddingsTable.php`.
- Conversation ownership check. `docs/CHAT_SECURITY_AUDIT.md`.
- Older ChatGPT page and `chatGPT/sent`. `app/Controllers/ChatGPT.php`. Settings screen `system_settings/getChatGPTSettings`. Migration `2025-11-07-064733_CreateChatGPTSettingsTable.php`.
- Vector stores: memory (default), MySQL (`app/Libraries/VectorStore/MySQLVectorStore.php`), Pinecone.

### Email, cron, and tracking

- Queue table `sent_queue`. Migrations `2024-01-18-092523_SentQeue.php`, send date, and November 2025 extra fields.
- Cron runner `GET cronJobs` with scheduled send, immediate send, and `checkServerLogs`. `app/Controllers/CronJobs.php`.
- Templates and template types. Migrations `2024-07-09-081109_SystemEmailTemplates.php`, `2024-07-09-110123_AddTableEmailTemplateTypes.php`.
- Open pixel `tracking-pixel`. `EmailPixelTracking`.
- Public holidays. Migration `2024-03-19-101249_AddPublicHolidaysTable.php`.

### Operations screens

- System settings hub: cron, holidays, email logs, sent queue, templates, login history, blocked users, general settings, ChatGPT settings, transport methods, fault types. `app/Controllers/SystemSettings.php`.
- Server monitoring UI and `php spark monitor:system`. `ServerMonitoring`, `MonitorSystemUsage`.
- Media and generic upload. `UploadedFile`, `Upload`, `File`, `Csv` (League CSV).
- Developer menu builder and CRUD generator. `app/Controllers/Developers/MenuManagement.php`, `CRUDGenerator.php`, `DbTableDataView.php`.
- DB admin and site health views. `DbAdmin`, `SiteHealth`.
- Language and settings tables. Migrations `2023-06-04-182128_Language.php`, `2023-06-04-181945_Settings.php`.
- Organisations table and a resource route. Migration `2022-11-20-124016_Organisations.php`. Controller class not in the tree (see Incomplete).

## Incomplete or leftover

These are in the tree and are not a working vertical slice.

| Item | Evidence | Gap |
|---|---|---|
| Products | Routes `products`, `products/getCompanyProducts`, `products/addProduct`, `products/updateProduct` | No `Products` controller |
| Orders | Route `orders/getOrders`. Report views for uninvoiced orders | No `Orders` controller or `OrdersModel` |
| Invoices | Invoice report views. `Reports.php` imports `InvoicesModel` | No `Invoices` controller or model. Get-invoices route is commented out |
| Labels | Routes `labels/status`, `labels/groups`, `labels/email-templates` | No `LabelStatus`, `LabelUserGroups`, or `LabelEmailTemplates` controllers |
| Fault finder | Routes under `faultfinder`. Settings routes for fault types and company fault processing | No `FaultFinder` controller |
| Company vendor numbers | Routes under `company/` | No `Company` controller |
| XML pull | Route `getXMLData` | No `GetXMLData` controller. Sample XML under `writable/orders_xml_templates` and `writable/invoice_xml_templates` |
| Store API | Routes `store-api` to `StoreApiController`. Login filter exempts it | No `StoreApiController`. `app/Controllers/Store.php` exists and is a different class |
| Organisations API | `$routes->resource('organisations')` with a comment that describes bearer-token CRUD | No `Organisations` controller. `JwtLibrary` exists |
| Reports | `Reports::index` returns `reports/reportsList` | Imports missing order, invoice, and product models. Those classes are not referenced inside `index`, so the use statements alone do not load them |
| Salesforce | `app/Helpers/salesforce_helper.php` | No caller under `app/` |
| SMS (Africa's Talking) | `app/Helpers/africastalking_helper.php` | No caller under `app/` |
| AWS, mPDF, PhpSpreadsheet | `composer.json` | No call sites found under `app/` |
| SOAP and REST order confirmation | `app/Controllers/Soap.php`, `app/Controllers/Rest.php` | Methods exist. No route in `Routes.php` points at them. **Requires Confirmation** that nothing else invokes them |

`app/Views/projects/adminer.php` is an Adminer page in the views tree. Sonar excludes `app/Views/projects/**/*.php`. Whether it is linked from a menu is data-dependent. **Requires Confirmation.**

## Planned

No roadmap file. The only explicit future exclusions are in `scope/Task_viewer_user_profile.md`:

- Email when a document is assigned. **Not implemented.**
- Notification when document access expires. **Not implemented.**
- Access analytics dashboard. **Not implemented.**

`docs/README.md` points at Jira board `SI` / 12 for development todos. Contents **Unknown**.

`DocumentRAG` treats memory vector store as development and Pinecone as a configured alternative. MySQL vector store is implemented in code. Which store production uses is **Unknown** (`VECTOR_STORE_TYPE`, default `memory`).

## Recently changed

| When | What | Evidence |
|---|---|---|
| 2025-12-15 | Git workflow and browser-testing rules | Commit `514489a` |
| 2025-11-11 | Chat must not append to another user's conversation | `docs/CHAT_SECURITY_AUDIT.md` |
| 2025-11-10 | Chat memories and document contexts | Migrations and `docs/IMPLEMENTATION_SUMMARY.md` |
| 2025-11-09 | Vector embeddings table; ChatGPT log reference fields | Migration filenames |
| 2025-11-08 | More `sent_queue` columns | Migration filenames |
| 2025-11-07 | DMS, OCR, RAG, CSRF fixes, `.env` email settings, project rules | `docs/CHANGELOG.md`, `docs/README.md` |
| Changelog date `2025-01-XX` | Viewer profile, per-document sharing, JS null checks in `rag-chat.js` and `global.js` | `docs/CHANGELOG.md`. Migration file date `2025-01-15` for `user_documents` conflicts with the November DMS narrative. **Requires Confirmation** of the real order |

## Deprecated or removed

- `app/Config/Routes_old.php` and `app/Config/Filters_old.php` are previous copies. Not loaded by the current `Routes.php` except the environment override file.
- Commented routes: `GET /upload` (POST `/upload` remains), `invoices/getInvoices`, `reports/uninvoicedOrders`.
- `Kint_old.php` sits beside `Kint.php`.

Nothing in the changelog is marked removed. Whether the missing order and invoice controllers were deleted on purpose is **Unknown / Requires Confirmation**.

## Not a product feature

- `overview.md` recommendations (API docs, backups, caching) are advice, not behaviour.
- `tests/` contains CodeIgniter example tests (`HealthTest`, example database and session tests), not DMS tests. `tests/README.md` is the framework test readme.
- `sonar-project.properties` turns coverage off and excludes most of `app/` from analysis. That is scanner configuration, not a user feature.
- `test_cookies.txt` at the repo root is not an application feature. It was not opened. **Human review:** it may hold session material.
