[DOCS] CLAUDE.md aggiornato: FeedbackService, controller, endpoint, contatore file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
DevEnv nis2-agile 2026-03-10 09:07:20 +01:00
parent c52766953d
commit a0fc0bd042

View File

@ -2,8 +2,8 @@
## PRIMA DI INIZIARE
- Leggi sempre questo file prima di iniziare qualsiasi lavoro
- Il progetto e' al **100% di completamento + Sprint Simulazioni + Audit Chain** (~32.000 righe, 80+ file sorgente)
- 11 commit su main, tutto deployato e testato su Hetzner
- Il progetto e' al **100% di completamento + Sprint Simulazioni + Audit Chain + Sistema Feedback AI** (~34.000 righe, 85+ file sorgente)
- 15 commit su main, tutto deployato e testato su Hetzner
- E2E test completati, bug fixing, Docker verificato, UI polished
> 3. `docs/CONTEXT_LAST_SESSION.md` - **Contesto ultima sessione (continuita cross-browser)**
>
@ -130,13 +130,15 @@ nis2.agile/
│ │ ├── ServicesController.php # Services API (read-only, API Key + scope)
│ │ ├── WebhookController.php # CRUD api_keys + webhook_subscriptions
│ │ ├── WhistleblowingController.php # Segnalazioni anonime Art.32 NIS2
│ │ └── NormativeController.php # Feed NIS2/ACN/DORA con ACK tracciato
│ │ ├── NormativeController.php # Feed NIS2/ACN/DORA con ACK tracciato
│ │ └── FeedbackController.php # Sistema segnalazioni bug/UX con risoluzione AI autonoma
│ ├── services/ # 6 servizi
│ │ ├── AIService.php # Anthropic Claude API (gap, risk, policy, incident)
│ │ ├── EmailService.php # Email CSIRT, training, welcome, invite
│ │ ├── RateLimitService.php # Rate limiting file-based
│ │ ├── ReportService.php # Report esecutivo HTML, export CSV
│ │ ├── WebhookService.php # Delivery webhook HMAC-SHA256, retry 3x
│ │ └── FeedbackService.php # createReport, classifyWithAI, broadcastResolution
│ │ └── VisuraService.php # AI extraction PDF visura + CertiSource API
│ ├── models/ # (vuoto - logica nei controller)
│ └── data/
@ -258,6 +260,12 @@ Schema: `docs/sql/` (9 migrazioni: 001→009)
- Delivery HMAC-SHA256 Stripe-like, header X-NIS2-Signature
- Retry 3x backoff (0s/5min/30min), log in webhook_deliveries
### FeedbackService.php (NUOVO)
- `createReport()`: INSERT + classifyWithAI() sincrono (10s timeout)
- `classifyWithAI()`: chiama AIService::classifyFeedback(), aggiorna DB silenziosamente
- `broadcastResolution()`: email a tutti i membri org via EmailService::sendFeedbackResolved()
- Worker autonomo: `scripts/feedback-worker.php` (cron 30min, docker exec nis2-agile-devenv + Claude Code CLI)
### simulate-nis2.php (ROOT — NUOVO)
- Script simulazione demo 3 aziende × 5 scenari (CLI + SSE streaming)
- Aziende: DataCore (IT/Essential), MedClinic (Sanità/Important), EnerNet (Energia/Critical)
@ -319,6 +327,7 @@ Base: `/api/{controller}/{action}/{id?}` (su subdomain https://nis2.agile.softwa
### Webhooks: GET api-keys, subscriptions, deliveries | POST api-keys, subscriptions, subscriptions/{id}/test, retry | PUT subscriptions/{id} | DELETE api-keys/{id}, subscriptions/{id}
### Whistleblowing: POST submit, {id}/assign, {id}/close | GET list, {id}, stats, track-anonymous | PUT {id}
### Normative: GET list, {id}, pending, stats | POST {id}/ack, create
### Feedback: POST submit | GET mine, list, {id} | PUT {id} | POST {id}/resolve
## Stato Completamento
Tutti i moduli sono implementati e testati:
@ -347,20 +356,34 @@ Tutti i moduli sono implementati e testati:
| **Password IDE** | Nis2AgileDev2026! |
| **Produzione** | https://nis2.agile.software/ |
## Documentazione Commerciale
## Documentazione Commerciale AgentAI (aggiornato 2026-03-09)
> Standard grafici e workflow: `/opt/devenv/COMMERCIAL_STANDARDS.md`
> QUESTO ANNULLA LE ISTRUZIONI PRECEDENTI sulla documentazione commerciale.
> Standard completo: /opt/devenv/COMMERCIAL_STANDARDS.md
> Stato prodotti: /opt/agent-ai/hub/AGENTAI_SPECS.md
5 documenti per il catalogo Agent AI:
1. Landing Page - `/opt/agent-ai/hub/landing/nis2-agile.html`
2. Scheda Funzionale - `products.json -> detail.funzionale`
3. Scheda Tecnica - `products.json -> detail.tecnica`
4. Presentazione - `/opt/agent-ai/hub/presentations/nis2-agile.html`
5. Link Demo - `products.json -> links.demo`
### Regole NUOVE (in vigore)
- Landing page e presentazione vanno nel TUO repo (docs/agentai/ o dove preferisci)
- products.json (/opt/agent-ai/hub/products.json) e SOLO un indice con URL assoluti
- Aggiorna products.json con https://tuo-dominio/path-al-file.html
- La landing DEVE includere un link/bottone per registrazione o richiesta informazioni
- mktg.agile.software legge products.json per campagne marketing
### Regole OBSOLETE (non fare piu)
- NON scrivere file in /opt/agent-ai/hub/landing/
- NON scrivere file in /opt/agent-ai/hub/presentations/
- NON usare path relativi in products.json
- Le directory landing/ e presentations/ nel hub sono VUOTE
### Workflow
1. Scrivi landing/presentazione nel tuo repo
2. Commit + push (webhook aggiorna /var/www/)
3. Chiedi conferma utente
4. Aggiorna products.json con URL assoluto
5. Verifica URL raggiungibile
### REGOLA
> SEMPRE chiedere conferma utente PRIMA di generare documenti commerciali.
## REGOLA: Sincronizzazione CLAUDE.md
- Dopo QUALSIASI modifica a: URL produzione, dominio, porta, path, schema DB, architettura -> **AGGIORNARE CLAUDE.md IMMEDIATAMENTE**
- CLAUDE.md e la "single source of truth" del progetto