Implementeaza planul claude-master-plan-discord-bridge-20260830 (15 taskuri, 3 lane-uri paralele) — un bot subtire discord.py peste CLI-ul `claude`, cu proces persistent per fir alimentat pe stdin cu --input-format stream-json. Nucleu: runner (proces persistent + reaper 20min + respawn --resume), stream (parser tolerant), session_store (scriere atomica, lock per fir, detectare PID reuse, recovery), limits (max 4 procese, timeout tur, rate per user, plafon cost pe zi), render (un loop de editare per canal, interval adaptiv). Adaptor: allowlist guild/canal/user fail-closed cu respingerea webhook-urilor, comenzi !new/!cd/!model/!status/!stop/!cleanup, cost si model in subsolul fiecarui raspuns. Mesajul sosit in timpul unui tur devine steering, nu tur nou. Securitate: hook PreToolUse fail-closed care cere confirmare in Discord pentru operatiuni ireversibile, wrapper `infra` cu lista explicita de hosturi. Deny rules raman strat cosmetic, nu bariera (verificat: /usr/bin/ssh trece pe langa). Ops: alerte email pe conventia repo-ului, !cleanup pentru orfani, unit systemd user cu KillMode=control-group si limite de memorie, install.sh idempotent. Verificat: 275 teste fara retea/Discord/API (10.8s), identic cu si fara discord.py instalat; e2e pe CLI real confirma steering-ul mid-tur (mesaj la 6s intr-un tool call de 25s schimba raspunsul final). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B29CApsP1JkSdjYaGaHpE7
6.4 KiB
6.4 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
ROMFASTSQL is an infrastructure and database management project for ROMFAST, featuring:
- Proxmox virtualization cluster (3 nodes: pve1, pvemini, pveelite)
- Oracle Database XE 21c with migration support from Oracle 10g
- AI chatbot system (Flowise + Claude)
- Disaster recovery infrastructure
Repository Structure
proxmox/ # Main infrastructure documentation
├── README.md # Master index - START HERE
├── cluster/ # Proxmox cluster, UPS, storage management
├── lxc102-docker/ # Docker + Portainer + Docker Sandboxes (sbx)
├── lxc104-flowise/ # AI Chatbot (Flowise on port 3000)
├── lxc108-oracle/ # Oracle XE 21c/18c Database (port 1521/1522)
├── lxc110-moltbot/ # MoltBot AI Telegram Bot
├── lxc171-claude-agent/ # Claude Code development environment
├── vm109-windows-dr/ # Windows Disaster Recovery VM
├── vm201-windows/ # Windows 11 (IIS reverse proxy)
└── vm302-oracle-test/ # Windows 11 + Oracle 21c test VM (ROA setup validation)
system_instructions/ # SQL migration guidelines and knowledge base
├── system_prompt.md # SQL migration rules - READ BEFORE WRITING SQL
└── knowledge_base/ # Example scripts and PACK_MIGRARE.pck
scripts/ # Utilities
├── generare_proces_verbal.py # Generate assembly minutes (DOCX)
├── verificare_voturi_AG.py # Verify assembly votes
└── ups-monitor/ # UPS monitoring for production Oracle server 10.0.20.36
input/ # Oracle DMP files for import
Key Documentation Entry Points
- Infrastructure overview:
proxmox/README.md - Oprire planificată a clusterului (lucrări electrice) — fără failover HA / fence:
proxmox/cluster/docs/oprire-planificata-cluster.md - SQL migration guidelines:
system_instructions/system_prompt.md(always read before generating migration SQL) - Oracle database setup:
proxmox/lxc108-oracle/README.md - Migration orchestration:
proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.sh - Chatbot architecture:
proxmox/lxc104-flowise/docs/prd.md - Docker Sandboxes (sbx) — agenți AI izolați:
proxmox/lxc102-docker/README.md - Punte Discord → Claude Code (comandă LXC 171 de pe telefon, dintr-un guild privat):
proxmox/lxc171-claude-agent/discord-bridge/README.md - Disaster recovery:
proxmox/vm109-windows-dr/README.md - Instalare/migrare Oracle — care director se folosește:
proxmox/lxc108-oracle/docs/instalare-si-migrare-oracle.md - ROA Windows setup scripts (XE/SE 21c):
proxmox/lxc108-oracle/roa-windows-setup/README.md - Conectarea clienților vechi (Instant Client 10/11) la 21c — ORA-28040 / ORA-01017 / ORA-12514:
docs/lectii-conectare-client-oracle.md - Aliasul TNS lipsă pe server — eșecuri tăcute (actualizarea ROA „SUCCEEDED" fără să aplice nimic; exportul zilnic
backupora.exescrie „DONE" cu directorul gol):docs/lectii-actualizare-roa-alias-tns.md - Kit de instalare pentru client (DMP-uri șablon + scripturi, gata de dus la client):
proxmox/lxc108-oracle/scripts/build-client-kit.ps1 - VM 302 test environment for ROA setup:
proxmox/vm302-oracle-test/README.md - Diagnostic spațiu Oracle la clienți (job zilnic + emailuri):
docs/diagnostic-spatiu-clienti.md - Monitorizare UPS pe serverul Oracle de producție 10.0.20.36 (înlocuiește ViewPower):
docs/ups-server36-monitorizare.md - Acces SSH la clienți cu chei publice (angajați noi):
docs/acces-ssh-chei-angajati.md - Acces administrativ la server client prin Tailscale + SSH (fără forward pe router):
docs/acces-client-tailscale-ssh.md - Cazuri clienți (depanare DB):
proxmox/lxc108-oracle/clienti/README.md- ROMPETROL ENERGY — recreare PDB Oracle XE 21c după ORA-12954:
proxmox/lxc108-oracle/clienti/oracle-xe-21c/README.md
- ROMPETROL ENERGY — recreare PDB Oracle XE 21c după ORA-12954:
Infrastructure Commands
Proxmox Cluster
ssh root@10.0.20.201 "pvecm status" # Cluster status
ssh root@10.0.20.201 "pct list" # List LXC containers
ssh root@10.0.20.201 "qm list" # List VMs
Oracle Database (LXC 108)
pct exec 108 -- docker exec -it oracle-xe sqlplus / as sysdba
pct exec 108 -- docker restart oracle-xe
Flowise Chatbot (LXC 104)
pct exec 104 -- systemctl status flowise
pct exec 104 -- systemctl restart flowise
pct exec 104 -- journalctl -u flowise -f
Validation Scripts
# UPS monthly test
proxmox/cluster/ups/scripts/ups-monthly-test.sh
# SSL certificate monitoring
proxmox/vm201-windows/scripts/monitor-ssl-certificates.sh
# Oracle backup monitoring
proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh
Network Layout
| Service | IP Address | Port | Purpose |
|---|---|---|---|
| pvemini (main host) | 10.0.20.201 | 8006 | Proxmox GUI |
| Oracle XE 21c | 10.0.20.121 | 1521 | Production database |
| Oracle XE 18c | 10.0.20.121 | 1522 | Export compatibility (TSTZ 31) |
| Flowise | 10.0.20.161 | 3000 | Chatbot UI |
| Gitea | 10.0.20.165 | 3000 | Git server |
| Docker + Portainer + sbx | 10.0.20.113 | 9000/9443 | Docker host, sandbox-uri agenți AI |
| Claude Agent | 10.0.20.171 | 22 | Development (also via Tailscale: 100.95.55.51) |
| MoltBot | 10.0.20.173 | 22 | AI Telegram Bot (also via Tailscale: 100.120.119.70) |
| Primary Oracle | 10.0.20.36 | 1521 | Windows production |
| DR Oracle | 10.0.20.37 | 1521 | Disaster recovery |
SQL Migration Conventions
When writing Oracle migration scripts, follow the naming convention:
ff_YYYY_MM_DD_##_TYPE.sql
Where TYPE is: DDL, DML, VIEW, PACK, TRIG, etc.
Always reference system_instructions/system_prompt.md for:
- Oracle 10g compatibility requirements
- PACK_MIGRARE package usage
- Migration script patterns and examples
Custom Claude Code Commands
/ultimate_validate_command- Generate comprehensive validation commands/plan-handover- Save implementation plan for session handover/branch-plan-handover- Create branch and save plan/context-handover- Save context for next session
Git Workflow
- Remote:
http://gitea:3000/romfast/ROMFASTSQL.git - Main branch:
master - Feature branches merged directly to master