TorbatYar/docs/experience-phase-11-5.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

105 lines
4.3 KiB
Markdown

# Phase: Experience Localization, RTL/LTR & Media (11.5)
| Field | Value |
| --- | --- |
| Identifier | `experience-11.5` |
| Status | Complete |
| Owner | Platform |
| Module(s) | Site Locale Bindings, Localizations, Media Refs |
| Service(s) | `experience` (Torbat Pages) |
| Depends On | `experience-11.4` |
| ADR(s) | [ADR-016](architecture/adr/ADR-016.md), [ADR-008](architecture/adr/ADR-008.md) |
| Manifest | [phase-manifest.yaml](ai-framework/phase-manifest.yaml) |
## Enterprise Phase Discovery Record
| Input | Finding |
| --- | --- |
| Roadmap / manifest | Next unfinished Experience phase = `experience-11.5` Localization, RTL/LTR & Media |
| Prior handover | [phase-11-4.md](phase-handover/phase-11-4.md) — templates complete; no localization/media pipeline |
| Boundaries | Experience owns locale bindings + localization shells + media **refs**; binaries only via File Storage; no Core DB access |
| Existing codebase | Foundation `ExperienceLocaleProfile` (11.0) provides language/direction catalogs; themes already expose `DirectionMode` shells; StorageProvider contract exists |
| Missing vs DoD | No site↔locale bindings, no target localizations, no media-ref aggregates/APIs, capabilities still at 11.4 |
Derived capabilities: bind locale profiles (with concrete RTL/LTR) to sites; upsert multi-locale content shells for experience targets; attach media via Storage file refs only. **Not** forms, surveys, appointments, SEO/PWA — those remain Phase 11.6+.
## Objective
Deliver Localization, first-class RTL/LTR directionality beyond foundation locale profiles, and media references that store Storage refs only (no binaries in `experience_db`) on the Experience Platform.
## Scope
### In Scope
- `SiteLocaleBinding` (site ↔ locale profile, locale_code, text_direction rtl/ltr, default flag)
- `ExperienceLocalization` (target_type/target_id/locale/text_direction + title/summary/content_json shells)
- `ExperienceMediaRef` (`storage_file_ref` only; kind/alt/caption/locale; reject data-URI / binary metadata keys)
- Policies, specifications, commands, queries
- Pagination / filter / sort / search on list APIs
- Permissions `experience.locales.*` and `experience.media_refs.*`
- Events `experience.site_locale.*` / `experience.localization.*` / `experience.media_ref.*`
- Alembic `0006_phase_115_localization_media` (head); version `0.11.5.0`
- `/capabilities` flags: `site_locale_bindings`, `localizations`, `rtl_ltr`, `media_refs`, `storage_media_refs_only`
### Out of Scope
- Forms / surveys / appointment page shells — Phase 11.6
- SEO metadata / sitemap / PWA — Phase 11.7
- Owning File Storage blobs or binary columns in `experience_db`
- Form submission / booking engines
### Models
| Entity | Soft delete | Audit | Tenant | Optimistic lock |
| --- | --- | --- | --- | --- |
| SiteLocaleBinding | Yes | Yes | Yes | Yes |
| ExperienceLocalization | Yes | Yes | Yes | Yes |
| ExperienceMediaRef | Yes | Yes | Yes | Yes |
### Permissions
`experience.locales.view|create|update|delete|manage`
`experience.media_refs.view|create|update|delete|manage`
### Events
`experience.site_locale.assigned|updated|replaced|unassigned`
`experience.localization.upserted|updated|archived`
`experience.media_ref.created|updated|archived`
### APIs
| Method | Path |
| --- | --- |
| * | `/api/v1/site-locale-bindings` |
| * | `/api/v1/localizations` (upsert + list/get/patch/delete) |
| * | `/api/v1/media-refs` |
### Artifact coverage (DoD)
| Artifact | Status |
| --- | --- |
| Discovery | This record |
| Policies / Specs / Commands / Queries | Implemented |
| Soft delete / Optimistic lock / Audit / Tenant | Yes |
| Pagination / Filter / Sort / Search | Yes |
| Background jobs | N/A |
| Forms / Surveys | Explicitly out of scope |
### Tests
- [x] Health / capabilities reflect phase 11.5
- [x] Site locale binding + localization upsert lifecycle
- [x] Media ref create + reject data-URI / binary metadata
- [x] Tenant isolation + no binary columns on media model
- [x] Architecture / permission / migration / docs
## Completion Criteria
- [x] Localization and media-ref APIs + isolation tests green
- [x] No form/survey/appointment engines
- [x] Docs + handover + manifests updated to `0.11.5.0`