feat: prepare DB for shared access (WAL, service partitioning)

Phase 0-2 of data unification:
- Enable WAL mode + busy_timeout for safe concurrent access
- router_state: keys prefixed with SERVICE_ID (lazy migration)
- sessions: composite PK (group_folder, agent_type)
- registered_groups: filtered by SERVICE_AGENT_TYPE on load
- Logger: service name tag for unified log streams

All changes are backward-compatible with the current split setup.
Actual directory merge (Phase 3-4) is a separate step.
This commit is contained in:
Eyejoker
2026-03-15 18:45:56 +09:00
parent 26783e520e
commit 6f4b6f8df7
5 changed files with 115 additions and 26 deletions

View File

@@ -1,7 +1,10 @@
import pino from 'pino';
const serviceName = (process.env.ASSISTANT_NAME || 'claude').toLowerCase();
export const logger = pino({
level: process.env.LOG_LEVEL || 'info',
name: serviceName,
transport: { target: 'pino-pretty', options: { colorize: true } },
});