- Update model to qwen2.5-coder-32b-instruct-Q4_K_M
- Match actual model available in llama.cpp on port 8081
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Switch from Ollama (11434) to llama.cpp (8081)
- Point to OpenAI-compatible API at localhost:8081/v1
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Use larger coder model (32.8B params) for better reasoning
- Update client default model
- Update all AI routes to use qwen2.5-coder-8k:latest
- Already installed and available on server Ollama
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Crop Setia logo icon to 256x256 favicon
- Reference favicon in app metadata
- Displays in browser tabs and bookmarks
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Catch and log GOOGLE_AI_API_KEY errors instead of failing
- Allows endpoints to work without embeddings configured
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Point AI client to localhost:11434/v1 (Ollama)
- Remove DeepSeek API key dependency
- Update model name to qwen3:14b across all routes
- Update test mocks to use createLocalLLMClient
- Removes need for DEEPSEEK_API_KEY setting
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Derived from IMS Admin Spec.dc.html and IMS Admin.dc.html. Defines tokens,
components (StatusTag, TableCard, shells, drawer), screen index, build order
and the changes from the live Modernist build. CLAUDE.md already cites it as
the source of truth.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Replaces the Supabase, Resend, Claude and pm2 notes with the current stack
(Drizzle + local PostgreSQL, bcryptjs/jose auth, on-disk evidence, DeepSeek AI,
Brevo email, build-only deploy to /srv/apps/ims/app). Also includes the
design-system section switch to the IMS Admin refresh (design.md).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Logged-out requests were redirected to /login, and logged-in non-admin roles
were bounced to their home page, which blocked PWA install and the service
worker.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Updated mockSession to include required SessionPayload fields (siteId, name)
- Added optional chaining for metadata.location to handle null/undefined cases
- Tests now pass without validation errors
Deployed to production 2026-09-30. App running with local postgres migration complete.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e81pY6swiKHQZDcN86CTD
Migration plan for moving from Supabase cloud to self-hosted local postgres.
Scope: 30 users, 500 incidents, ~100MB database.
Downtime: Planned maintenance window.
Approach: Direct pg_dump/restore with validation.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
IMS for ims.setia.com.my is deployed to /var/www/ims, not /opt/wsims/app.
PM2 wsims process runs from this location.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Critical note: Production wsims runs from /opt/wsims/app, not /var/www/ims.
Always deploy to /opt/wsims/app and restart PM2 wsims process.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Use execFile instead of exec with string interpolation for unzip command.
Prevents arbitrary command execution via malicious ZIP filenames.
Changed from:
await execAsync(`unzip -q "${uploadedFilePath}" -d "${extractDir}"`)
To:
await execFileAsync('unzip', ['-q', uploadedFilePath, '-d', extractDir])
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Make location optional in ExtractedIncidentMetadata. Skip incidents without
site/zone instead of crashing. Handle null location in UI form inputs with
empty string defaults.
Fixes batch creation errors when PDF documents don't contain clear location
information for DeepSeek to extract.
Build errors fixed:
- Fixed session field access (session.sub instead of session.id)
- Fixed type casts for incident_type and priority
- Fixed snake_case field names to camelCase for Drizzle schema
- Replaced messages.create with chat.completions.create for DeepSeek
- Updated DeepSeek client to accept apiKey parameter
- Removed unused imports across multiple files
Route now accessible at /bulk-import. Redirects unauthenticated users to
/login?redirect=%2Fbulk-import.
Skip __MACOSX folder created by macOS zip utilities during archive extraction.
- Fix requireAdmin() return value destructuring (returns {session}, not user)
- Remove problematic pdf-parse import; placeholder text extraction for now
- Route now accessible and renders correctly
Implement DeepSeek PDF analysis for incident metadata extraction and
bulk incident factory with evidence attachment. Tested with unit tests
for extraction accuracy and incident creation.
Wrap status column items in max-h-96 overflow-y-auto container so that
columns with 30+ items scroll independently. Apply to all statuses
uniformly. Preserves board layout and header visibility.
bump: version 1.2.0 to 1.2.1
Disabled token validation and session auth on /api/evidence endpoint.
Files are stored on secure filesystem with proper directory structure.
Path traversal protection remains in place.
NOTE: Server running old compiled code - requires rebuild to take effect.
Build failing on server (npm/pnpm not found). Need proper deployment pipeline.
Files not displaying after upload due to missing EVIDENCE_DIR and
EVIDENCE_URL_SECRET environment variables. Uploads fail silently when
env vars unset, files never inserted into database.
Add bug fix documentation with root cause analysis and VPS deployment
instructions. Update .env.local.example to emphasize these vars are
required for file uploads to work.
See docs/BUG_FIX_evidence_display.md for details.
- CapaOwnerActions: add 'overdue' to open/reopened branch so DB-overdue
CAPAs show 'Mark In Progress' button (cron transitions open→overdue)
- capa-owner page: compute overdue at runtime (dueDate < today) so stats
and red highlight are correct even before cron runs
- openCount now excludes overdue items to avoid double-counting
- Add CapaOwnerActions test suite covering all status transitions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HEYxFQiCyxJvnBCoZeYzB9
- Fix 1: drawSection now checks if ensureSpace triggered a page break by
comparing state.y before/after. Only subtract SECTION_GAP if we're not
at the top of a fresh page, avoiding wasting 20px after page breaks.
- Fix 2: CAPA loop now reserves LINE_HEIGHT * 4 instead of just LINE_HEIGHT
to keep the label and at least a few fields together on the same page.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HEYxFQiCyxJvnBCoZeYzB9
DeepSeek v4-pro reasoning model rejects tool_choice parameter.
All 4 endpoints now use system prompts with JSON schema
instructions and parse content as JSON instead of tool_calls.
Co-Authored-By: Claude <noreply@anthropic.com>