fix(infra): relocate mana-ai from 3066 to 3067 — port clash with news-ingester

news-ingester already owns 3066 (see docker-compose.macmini.yml:1620).
Moving mana-ai to 3067 — the next free slot in the 306x services block
(credits 3061, user 3062, subscriptions 3063, analytics 3064,
events 3065, news-ingester 3066, mana-ai 3067).

Updated: Dockerfile EXPOSE + HEALTHCHECK, config.ts default,
compose service/healthcheck/port mapping, webapp getManaAiUrl()
fallback, root CLAUDE.md service list, mana-ai/CLAUDE.md, and
COMPANION_BRAIN_ARCHITECTURE.md §20 file map.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-15 14:32:07 +02:00
parent 6acb044230
commit f0f5b7dcf6
7 changed files with 16 additions and 16 deletions

View file

@ -8,7 +8,7 @@ Design context: [`docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md` §20](../..
What works end-to-end:
- [x] Boots as a Hono/Bun service on port `3066`
- [x] Boots as a Hono/Bun service on port `3067`
- [x] Exposes `/health` and service-key-gated `/internal/tick`
- [x] Replays `sync_changes` for `appId='ai' / table='aiMissions'` into live Mission records via field-level LWW (`src/db/missions-projection.ts`)
- [x] Lists due missions (`state='active' && nextRunAt <= now()`)
@ -59,7 +59,7 @@ Was offen ist (Phase 3, Frontend):
- [ ] Feature-Flag `PUBLIC_AI_MISSION_GRANTS=false` default + Rollout (till → beta → alpha).
- [ ] Produktions-Keypair generieren + in Mac-Mini Secrets ablegen.
## Port: 3066
## Port: 3067
## Tech Stack
@ -78,14 +78,14 @@ cd services/mana-ai
bun run dev
# Smoke test
curl http://localhost:3066/health
curl -X POST -H "X-Service-Key: dev-service-key" http://localhost:3066/internal/tick
curl http://localhost:3067/health
curl -X POST -H "X-Service-Key: dev-service-key" http://localhost:3067/internal/tick
```
## Environment Variables
```env
PORT=3066
PORT=3067
SYNC_DATABASE_URL=postgresql://mana:devpassword@localhost:5432/mana_sync
MANA_LLM_URL=http://localhost:3020
MANA_SERVICE_KEY=dev-service-key
@ -98,7 +98,7 @@ TICK_ENABLED=true # flip to false to boot HTTP-only (for Docker health-check)
```
┌────────────────────┐
│ mana-ai (Bun) │
│ :3066
│ :3067
│ │ 60s interval
│ ┌─────────────┐ │────────────────┐
│ │ tick loop │ │ │

View file

@ -29,9 +29,9 @@ COPY services/mana-ai/tsconfig.json ./services/mana-ai/
WORKDIR /app/services/mana-ai
EXPOSE 3066
EXPOSE 3067
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD bun -e "fetch('http://localhost:3066/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
CMD bun -e "fetch('http://localhost:3067/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
CMD ["bun", "run", "src/index.ts"]

View file

@ -43,7 +43,7 @@ function requireEnv(key: string, fallback?: string): string {
export function loadConfig(): Config {
return {
port: parseInt(process.env.PORT ?? '3066', 10),
port: parseInt(process.env.PORT ?? '3067', 10),
syncDatabaseUrl: requireEnv(
'SYNC_DATABASE_URL',
'postgresql://mana:devpassword@localhost:5432/mana_sync'