feat(autonomy): wire Cognitive Opus 4.6 (118 fns) + opus-master-system prompt 10KB - bootstrap wrapper + 1 line require_once - GOLD before, 0 collision, syntax OK, all fns loaded - cause racine manque autonomie WEVIA
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
This commit is contained in:
42
api/wevia-cognitive-opus46-bootstrap.php
Normal file
42
api/wevia-cognitive-opus46-bootstrap.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
// ╔═══════════════════════════════════════════════════════════════════════════╗
|
||||||
|
// ║ WEVIA COGNITIVE OPUS 4.6 BOOTSTRAP — wires 118 advanced fns ║
|
||||||
|
// ║ Created 2026-04-21 — Opus session ║
|
||||||
|
// ║ Effect: makes self-correction, tool planning, ethical reasoning, etc. ║
|
||||||
|
// ║ available to wevia-master-api.php ║
|
||||||
|
// ║ ║
|
||||||
|
// ║ ROLLBACK: just delete this file — master-api uses @require_once ║
|
||||||
|
// ║ so absence is silently ignored, zero regression. ║
|
||||||
|
// ╚═══════════════════════════════════════════════════════════════════════════╝
|
||||||
|
|
||||||
|
// Guard: idempotent (safe to include multiple times)
|
||||||
|
if (defined('WEVIA_COGNITIVE_OPUS46_BOOTSTRAPPED')) return;
|
||||||
|
define('WEVIA_COGNITIVE_OPUS46_BOOTSTRAPPED', 1);
|
||||||
|
|
||||||
|
// Wire core cognitive modules (silent if missing)
|
||||||
|
@require_once '/opt/wevia-brain/cognitive-opus46-advanced.php';
|
||||||
|
@require_once '/opt/wevia-brain/cognitive-opus46.php';
|
||||||
|
|
||||||
|
// Optional advanced modules (auto-load if present)
|
||||||
|
@require_once '/opt/wevia-brain/modules/chain-of-thought.php';
|
||||||
|
@require_once '/opt/wevia-brain/modules/opus-orchestrator.php';
|
||||||
|
@require_once '/opt/wevia-brain/modules/rag-engine.php';
|
||||||
|
@require_once '/opt/wevia-brain/modules/tool-use-engine.php';
|
||||||
|
|
||||||
|
// Load Opus master system prompt (10KB master directives)
|
||||||
|
$GLOBALS['OPUS46_SYSTEM_PROMPT'] = @file_get_contents('/opt/wevia-brain/prompts/opus-master-system.md') ?: '';
|
||||||
|
|
||||||
|
// Load master directives
|
||||||
|
$_dir_json = @file_get_contents('/opt/wevia-brain/master-directives.json');
|
||||||
|
$GLOBALS['OPUS46_MASTER_DIRECTIVES'] = $_dir_json ? @json_decode($_dir_json, true) : [];
|
||||||
|
|
||||||
|
// Status flags accessible by other modules
|
||||||
|
$GLOBALS['OPUS46_LOADED'] = function_exists('selfCorrectionShouldActivate');
|
||||||
|
$GLOBALS['OPUS46_FNS_AVAILABLE'] = [
|
||||||
|
'self_correction' => function_exists('selfCorrectionPipeline'),
|
||||||
|
'tool_planning' => function_exists('selectBestGPUModel'),
|
||||||
|
'ollama_inventory' => function_exists('getOllamaModelInventory'),
|
||||||
|
'detect_hallucination' => function_exists('detectHallucinatedNumbers'),
|
||||||
|
'detect_contradiction' => function_exists('detectLogicalContradiction'),
|
||||||
|
'detect_truncation' => function_exists('detectTruncatedResponse'),
|
||||||
|
];
|
||||||
@@ -431,6 +431,11 @@ if (!empty($_mam)) {
|
|||||||
// V26-SURGICAL normalizer prehook (Opus 17avr 17h50) — fix "combien j'ai de leads" → route correct
|
// V26-SURGICAL normalizer prehook (Opus 17avr 17h50) — fix "combien j'ai de leads" → route correct
|
||||||
@require_once __DIR__ . "/wevia-nl-normalizer-prehook.php";
|
@require_once __DIR__ . "/wevia-nl-normalizer-prehook.php";
|
||||||
|
|
||||||
|
// ═══ COGNITIVE OPUS 4.6 BOOTSTRAP (added 2026-04-21) ═══
|
||||||
|
// Wires 118 advanced cognitive functions: self-correction, tool planning,
|
||||||
|
// ethical reasoning, hallucination detection, etc. Silent fail if missing.
|
||||||
|
@require_once __DIR__ . "/wevia-cognitive-opus46-bootstrap.php";
|
||||||
|
|
||||||
// === OPUS_BUSINESS_COUNT_GUARD_17AVR (natural language → SQL real) ===
|
// === OPUS_BUSINESS_COUNT_GUARD_17AVR (natural language → SQL real) ===
|
||||||
if (!empty($_mam)) {
|
if (!empty($_mam)) {
|
||||||
$__bm = $_mam;
|
$__bm = $_mam;
|
||||||
|
|||||||
Reference in New Issue
Block a user