TorbatYar/docs/experience-phase-11-10.md
Mortezakoohjani 203671a7bf feat(experience): ship Experience Platform phases 11.0-11.10
Add the experience service with sites through analytics/AI hooks, migrations through 0011, and phase docs/manifests marking the track complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 11:43:10 +03:30

63 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Experience Phase 11.10 — Analytics, AI Content & Enterprise Validation
| Field | Value |
| --- | --- |
| Identifier | `experience-11.10` |
| Status | Complete |
| Owner | Platform |
| Module(s) | Analytics Reports/Snapshots, AI Content Hook Registrations/Dispatches |
| Service(s) | `experience` (Torbat Pages) |
| Depends On | `experience-11.9` |
| ADR(s) | [ADR-016](architecture/adr/ADR-016.md) |
| Manifest | [phase-manifest.yaml](ai-framework/phase-manifest.yaml) |
## Enterprise Phase Discovery Record
| Input | Finding |
| --- | --- |
| Roadmap / manifest | Final Experience track phase = `experience-11.10` Analytics, AI Content & Enterprise Validation |
| Prior handover | [phase-11-9.md](phase-handover/phase-11-9.md) — connectors/widgets/notify complete; analytics and AI deferred |
| Boundaries | Analytics = local COUNT on `experience_db` only; AI via `AIProvider` contract — no model inference ownership |
| Existing codebase | Health advertised `analytics=False`, `ai_content=False`; permissions placeholders absent for analytics/ai_hooks |
| Missing vs DoD | No analytics report/snapshot aggregates, no AI hook registration/dispatch shells, no enterprise validation audit |
Derived capabilities: tenant-scoped analytics report definitions with validated local metric keys; snapshot refresh via COUNT queries; AI content hook registrations and dispatches with mock `generate_content`; forbidden ownership keys in config/metadata/payload; full quality-gate validation and Experience track closure.
## Objective
Close the Experience Platform track (11.011.10) with analytics shells, optional AI content hooks, and enterprise validation — core flows work when AI is off.
## Scope
### In Scope
- `ExperienceAnalyticsReportDefinition` + `ExperienceAnalyticsSnapshot` on `experience_db`
- `ExperienceAiContentHookRegistration` + `ExperienceAiContentDispatch` (registration_id UUID only, no ORM relationship)
- Local `METRIC_TABLE_MAP` COUNT metrics (workspaces, sites, pages, components, templates, forms, submissions, surveys, publish releases, widgets, connectors, notify, bundles)
- Permissions `experience.analytics.*`, `experience.ai_hooks.*`
- Events for create/update/delete + `analytics_snapshot.refreshed` + `ai_content_dispatch.generated`
- `MockAIProvider.generate_content` returning `ai:content:{uuid}`
- Alembic `0011_phase_1110_analytics_ai_hooks`; version `0.11.10.0`
### Out of Scope
- Cross-service analytics DB reads
- Model inference / LLM provider ownership
- New Experience phases beyond 11.10
### APIs
| Path | Permission |
| --- | --- |
| `/api/v1/analytics-report-definitions` | `experience.analytics.*` |
| `/api/v1/analytics-snapshots` (+ `POST /refresh`) | `experience.analytics.*` |
| `/api/v1/ai-content-hook-registrations` | `experience.ai_hooks.*` |
| `/api/v1/ai-content-dispatches` (+ `POST /{id}/generate`) | `experience.ai_hooks.*` |
## Completion Criteria
- [x] Analytics/AI shells documented and tested
- [x] Core flows work when AI is off (analytics independent of AI)
- [x] Quality gates + phase handover per AI framework
- [x] Experience track 11.011.10 complete