- Created governance-service application structure - Added pyproject.toml with FastAPI, SQLModel, asyncpg, and aitbc-core dependencies - Implemented main.py with basic governance service structure - Created systemd service file for governance-service (port 8105) - Added README.md with installation and configuration instructions This starts Phase 4.6: Extract Governance Service (foundation created)
1.2 KiB
1.2 KiB
AITBC Governance Service
Manages governance operations.
Installation
cd /opt/aitbc
poetry install --with governance-service
Database Setup
Create a separate database for the governance service:
CREATE DATABASE aitbc_governance;
CREATE USER aitbc_governance WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE aitbc_governance TO aitbc_governance;
Running
# Development
python -m governance_service.main
# Production (systemd)
sudo systemctl start governance-service
sudo systemctl enable governance-service
Endpoints
GET /health- Health checkGET /governance/status- Get governance status
Migration Status
Foundation Created:
- Application structure (pyproject.toml, main.py)
- Systemd service configuration
- Basic health and status endpoints
Remaining:
- Extract governance domain models from coordinator-api
- Extract governance services from coordinator-api
- Extract governance routers from coordinator-api
- Setup separate database session management
- Update coordinator-api to remove governance code
- End-to-end testing with gateway
Service Configuration
- Port: 8105
- Database: aitbc_governance
- Gateway route: /governance/*