Skip to content

Claude/read spec n6efu#167

Merged
yellowman merged 8 commits intomainfrom
claude/read-spec-n6efu
Dec 26, 2025
Merged

Claude/read spec n6efu#167
yellowman merged 8 commits intomainfrom
claude/read-spec-n6efu

Conversation

@yellowman
Copy link
Copy Markdown
Owner

@yellowman yellowman commented Dec 26, 2025

Note

Highlights

  • Switch runtime entrypoint to uvicorn liminallm.app:app (Dockerfile, OpenBSD rc.d); simplify uvicorn flags
  • Add QA/testing toolchain: Makefile (lint/test/qa/dev/docker/smoke), docker-compose.test.yml, scripts/bootstrap_admin.py, scripts/smoke_test.sh
  • Expand docs: updated README.md (quick start, acceptance criteria), new docs/DEPLOYMENT.md, docs/CONFIGURATION.md, docs/QA_RUNBOOK.md, and TESTING.md
  • Broaden test suite: new/updated pytest modules (auth, admin, rate limits, idempotency, clustering, performance, post-smoke), test fixtures, and add python-multipart dependency
  • Minor runtime/auth/storage fixes: DB-backed rag_chunk_size resolution, safer session IP parsing, logging fix; deployment configs updated accordingly

Written by Cursor Bugbot for commit 0b3a3bd. This will update automatically on new commits. Configure here.

- Fix Dockerfile entrypoint to use liminallm.app:app (correct module)
- Remove uvloop/httptools flags from uvicorn CMD (not installed)
- Add python-multipart to dependencies for file uploads
- Fix RAG init to read rag_chunk_size from system settings
- Remove duplicate /admin/settings endpoints, keep system settings version
- Fix missing Request import in routes.py
- Fix liminallm.errors import (use service.errors)
- Fix Session.new() to handle invalid IP addresses (e.g., "testclient")
- Fix JWT_SECRET test value to meet complexity requirements
- Fix rate limit mock tests to return 3-tuple (allowed, remaining, reset)
- Add missing json import in schemas.py
- Add bootstrap_admin.py script for creating admin users
  - Supports env vars (ADMIN_EMAIL, ADMIN_PASSWORD) and CLI args
  - Validates password complexity requirements
  - Can promote existing users to admin
  - Includes --dry-run mode

- Add docker-compose.test.yml for integration testing
  - PostgreSQL 15 on port 5433
  - Redis 7 on port 6380
  - Pre-configured test credentials (admin@test.local)
  - Automatic migration and admin bootstrap

- Add smoke_test.sh QA script that verifies:
  - Health check endpoint
  - User signup/login flow
  - Admin login
  - Conversation creation
  - Chat endpoint
  - File upload
  - Admin settings access control (403 for users, 200 for admins)

- Add TESTING.md with comprehensive documentation
Document the three configuration sources (env vars, system settings,
runtime config) to prevent future confusion about which to use.

Clarifies:
- Resolution order (DB first, env var fallback)
- When to use each source
- Common pitfalls to avoid
- How to add new settings
- Add clear Quick Start section with three options:
  - Docker (recommended for QA)
  - Local development (memory store)
  - Full PostgreSQL + Redis setup

- Add explicit acceptance criteria table matching QA gates:
  - Health check
  - Chat UI loads
  - User signup/login
  - Send message
  - Admin settings protection (403/200)
  - Tests pass
  - Bootstrap works

- Reference new docs (TESTING.md, CONFIGURATION.md)
- Consolidate testing section with smoke test command
- Simplify API endpoints documentation
- Create docs/QA_RUNBOOK.md with comprehensive testing documentation
- Create Makefile with qa, test, lint, security targets
- Fix undefined variable 'node_id' in workflow.py
- Fix undefined 'self.logger' reference in memory.py
- Remove duplicate close() method in voice.py
- Add missing 'timedelta' import in routes.py
- Add ConfigPatchAudit to TYPE_CHECKING imports in training_worker.py
- Add _get_cached_idempotency_record export from routes.py
- Fix test import in test_idempotency_guard.py

QA procedure verified:
- Health endpoint returns healthy status
- Signup returns access token
- Chat endpoint returns status ok (mock mode)
- Admin integration tests pass (18/18)
- Create tests/test_post_smoke.py with comprehensive post-smoke tests:
  - Idempotency/repeat tests (3x signup, login, conversation creation)
  - File extension upload tests (.txt, .md, .json, .csv, .tsv)
  - Logout and token invalidation tests
  - Password reset flow tests
  - Tenant isolation tests (2 users cannot access each other's data)

- Update docs/QA_RUNBOOK.md with post-smoke run procedure:
  - Step 9: Repeat Smoke Test (3x)
  - Step 10: File Extension Upload Test
  - Step 11: Logout and Token Invalidation
  - Step 12: Password Reset Flow
  - Step 13: Tenant Isolation Test
README.md:
- Restructured quick start with clear "Native Deployment" option
- Added in-memory mode quick start for development
- Added production setup with PostgreSQL/Redis
- Added native test running instructions

docs/DEPLOYMENT.md:
- Complete 11-step native deployment guide:
  - System dependencies (Debian/Ubuntu and RHEL)
  - Service user creation
  - PostgreSQL setup with pgvector/citext
  - Redis configuration with password
  - Application installation in venv
  - Environment configuration with .env file
  - Database migrations
  - Admin bootstrap
  - Systemd service with security hardening
  - Nginx reverse proxy with TLS (Let's Encrypt)
  - Deployment verification
- Added in-memory mode section for testing
- Added native test running section

docs/QA_RUNBOOK.md:
- Reorganized with native-first approach
- Split prerequisites: Native vs Docker
- Added "Native Testing Quick Start" section
- Marked Docker-only steps as optional
- Added native PostgreSQL alternative for Step 5
Change postgres image from postgres:15-alpine to pgvector/pgvector:pg16
to support the vector extension required by sql/002_knowledge.sql.
@yellowman yellowman merged commit 828de00 into main Dec 26, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants