# Extracted Descriptors · Layer J Source of Truth Generated by `v3-audit/bin/extract_descriptors.py` from the prototype JSX snapshot at `docs/prototypes/super-app-v1/mobile-source-snapshot/`. **Path D · backend 100% from prototype** — Layer J `layout_composer` consumes these JSON files instead of hardcoding component trees. ## Contents | File | Purpose | |---|---| | `_manifest.json` | Index · per-screen extraction summary · regen timestamp | | `sc-1-home.json` | Home dashboard · 10 SVC bindings · 8 journeys · 29 obj_paths · 11 mode-sections · 25 events | | `sc-2-discover-map.json` | Discover map · filters · place grids | | `sc-3-content-detail.json` | POI detail · J-CONTENT-BROWSE-DETAIL | | `sc-4-booking-flow.json` | Booking wizard | | `sc-5-cockpit.json` | Trip cockpit · J-TRIP-MANAGE | | `sc-6-wizard-premium.json` | AI auto-plan · J-AI-PLAN | | `sc-hotel.json` | Hotel detail | | `sc-journey.json` | Saved journeys | | `sc-mice.json` | MICE event hub | | `sc-news.json` | News feed | | `sc-prep.json` | Trip prep | | `sc-profile*.json` | Profile + analytics | | `sc-wallet.json` | Wallet | | `sc-shortcuts.json` | Quick actions | | `sc-chats.json` | AI chat | | `sc-appts.json` | Appointments | | `sc-connectors.json` | Connectors | | `sc-sitemap.json` | Sitemap | | `sc-13-media-player.json` | Media overlay | | `sc-14-embed-host.json` | Embed iframe host | | `sc-15-immersive-scene.json` | VR/AR scene | | `sc-avenue.json` | Souvenir market iframe | | `sc-map-navigate.json` | Map navigation | ## Per-screen descriptor shape ```jsonc { "_meta": { "version": "1.0.0", "extracted_at": "", "source_file": "docs/prototypes/super-app-v1/mobile-source-snapshot/mobile/.jsx", "source_line_start": , "source_line_end": , "source_block_hash_16": "", "block_line_count": }, "id": "root", "type": "Surface", "obj_path": "/root", "screen_id": "", "version": "1.0.0", "_extracted": { "tier_1_screen_id": "", "tier_2_svc_ids": ["SVC-..."], "tier_2_svc_canonical": ["SVC-..."], "tier_3_journeys": ["J-..."], "tier_4_obj_paths": ["sc-.../..."], "tier_5_mode_sections": ["..."], "tier_5_mode_emphasis_values": ["hero", "primary", "secondary", ...], "tier_6_events": ["..."], "i18n_strings_inline": [{"th": "...", "en": "...", "zh": "..."}, ...], "color_vars_referenced": ["--brand", "--accent", "..."], "hex_colors_inline": ["#..."], "section_comments_observed": ["..."] }, "_composer_hints": { "default_lang": "th", "modes_visible_via_emphasis": ["hero", "primary", ...], "permissions_default": ["anonymous", "member", ...] } } ``` ## Consumer integration · Session C `layout_composer` ```python # server/mgt-api/layout/composer.py · replace hardcoded sc-1-home import json from pathlib import Path DESCRIPTORS_ROOT = Path(__file__).parent.parent.parent.parent / "docs/architecture/extracted_descriptors" _cache = {} def load_descriptor(screen_id: str) -> dict: if screen_id in _cache: return _cache[screen_id] path = DESCRIPTORS_ROOT / f"{screen_id}.json" if not path.exists(): raise ValueError(f"Descriptor missing for {screen_id}") _cache[screen_id] = json.loads(path.read_text()) return _cache[screen_id] def compose(surface: str, tenant: str, user: dict, lang: str, ctx: dict) -> dict: base = load_descriptor(surface) # apply 4D resolution: tenant theme + persona filter + lang resolve + trust mode # (see PRIMARY_MECHANISM_SPEC.md § A.3 + Book B P6 page template inheritance) return _apply_4d_resolution(base, tenant, user, lang, ctx) ``` REQ-014 filed against Session C for swap-in (open). ## Drift detection Each descriptor `_meta.source_block_hash_16` is sha256[:16] of the source JSX block. CI can compare current snapshot hash to extracted descriptors: ```bash # Re-run · diff python3 v3-audit/bin/extract_descriptors.py git diff docs/architecture/extracted_descriptors/ \ || echo "DRIFT · snapshot changed · re-extract committed" ``` ## Update flow 1. New prototype patch lands at Hostinger (P501+, P502+, ...) 2. Session A bundle pulls via `EXTRACT_BUNDLE.sh` 3. V3-AUDIT pulls into snapshot: `cp ~/Downloads/design-handoff/...` → `mobile-source-snapshot/` 4. Re-run extractor: `python3 v3-audit/bin/extract_descriptors.py` 5. Review diff · commit with `snap-YYYY-MM-DD-rN` bump 6. Session C composer picks up new descriptors on next deploy