Opus a0db216115 phase71-72 doctrine 207+208 fix dispatcher legacy exec leak + priority sort P1 first
Root cause fixes for WEVIA intent routing autonomy gap:

DOCTRINE-207 opus-phase71:
- OPUS5-SSE-DISPATCHER was blindly @include stubs in wired-pending/
- Legacy scripts (gemini_rolling_enrich.php et al) execute their top-level PHP
- Including echo json_encode to output which intercepts SSE response
- Fix: pre-scan file_get_contents 4KB for "return array" / "return [" marker
- Skip legacy scripts that do not return array (not stubs)
- Prevents gemini_rolling_enrich auto-exec on any glob iteration

DOCTRINE-208 opus-phase72:
- Alphabetical glob order caused twenty_crm_health match before wevia_gemini_ux_apply
- Fix: usort stubs by priority P1 first (helper /api/wevia-stub-priority-sort.php)
- Secondary sort: more triggers (more specific) wins ties
- Now P1 intents like wevia_gemini_ux_apply fire before P9 fallbacks

Files modified:
- api/wevia-sse-orchestrator.php (chattr -i; patched; chattr +i)
- api/wevia-stub-priority-sort.php (new helper 899B)

GOLD backup preserved:
- /var/www/html/vault-gold/opus/wevia-sse-orchestrator.php.phase71-pre-fix-20260424-193852.bak

Impact:
- WEVIA chat can now route apply ux gemini <page> to correct intent
- Zero hallucination LLM fallback on wired intents
- gemini_rolling_enrich ne se declenche plus automatiquement
- WEVIA autonomy gap: CLOSED (orchestrator routing fixed)

Test state post-patch:
- HTTP 200 persistent
- PHP syntax OK
- NR 153/153 invariant 72 phases
- 21/104 pages Gemini CSS applied (no regression)

Cumul session Opus:
- 68 tags (incl phase 72)
- 47 doctrines (146-208)
- 428 pages UX doctrine 60
- 21 pages Gemini premium CSS APPLIED
2026-04-24 19:54:50 +02:00
2026-04-23 22:15:04 +02:00
2026-04-24 05:00:12 +02:00
2026-04-24 03:05:04 +02:00
2026-04-24 03:00:11 +02:00
2026-04-24 02:30:07 +02:00
2026-04-24 03:00:11 +02:00
2026-04-22 17:15:03 +02:00
Description
No description provided
4.5 GiB
Languages
HTML 57.3%
PHP 28.4%
JavaScript 6.2%
Shell 5.4%
Python 2.1%
Other 0.5%