@openlife/cli 1.7.9 → 1.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +32 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -568,15 +568,41 @@ program
|
|
|
568
568
|
program
|
|
569
569
|
.command('phase1-check')
|
|
570
570
|
.description('Roda os checks mínimos da Fase 1 para validar o runtime principal')
|
|
571
|
-
.
|
|
571
|
+
.option('--deep', 'inclui checks vivos de LLM/TTS/Gateway (pode demorar e depender de credenciais/quota)', false)
|
|
572
|
+
.action(async (options) => {
|
|
572
573
|
let exitCode = 0;
|
|
573
|
-
const
|
|
574
|
+
const deep = Boolean(options.deep);
|
|
575
|
+
const MASTER_TIMEOUT_MS = Number(process.env.OPENLIFE_PHASE1_TIMEOUT_MS || (deep ? 120000 : 30000));
|
|
574
576
|
const masterTimeout = new Promise((_, reject) => setTimeout(() => reject(new Error(`PHASE1_CHECK_TIMEOUT after ${MASTER_TIMEOUT_MS}ms — provavelmente Gatekeeper/Brain/Gateway constructor ou check travou esperando LLM/recurso externo`)), MASTER_TIMEOUT_MS));
|
|
575
577
|
try {
|
|
576
|
-
//
|
|
577
|
-
//
|
|
578
|
+
// Default smoke mode avoids live LLM/TTS/Gateway calls so this command stays deterministic.
|
|
579
|
+
// Use --deep for the original live harness behavior.
|
|
578
580
|
const results = await Promise.race([
|
|
579
581
|
(async () => {
|
|
582
|
+
if (!deep) {
|
|
583
|
+
const { ModelManager } = require('./orchestrator/ModelManager');
|
|
584
|
+
const { RuntimePolicy } = require('./orchestrator/RuntimePolicy');
|
|
585
|
+
const modelManager = new ModelManager();
|
|
586
|
+
const runtimePolicy = new RuntimePolicy();
|
|
587
|
+
const config = modelManager.getModelConfig();
|
|
588
|
+
const chain = [config.primary, ...config.fallbacks].map((m) => m.raw);
|
|
589
|
+
const research = runtimePolicy.decide('RESEARCH_ANALYSIS');
|
|
590
|
+
const engineering = runtimePolicy.decide('ENGINEERING_BUILD');
|
|
591
|
+
return [
|
|
592
|
+
{
|
|
593
|
+
name: 'model-config',
|
|
594
|
+
ok: chain.length > 0 && chain.every(Boolean) && chain.length === new Set(chain).size,
|
|
595
|
+
detail: `Primário: ${config.primary.raw} | Fallbacks: ${config.fallbacks.map((f) => f.raw).join(', ') || 'nenhum'}`,
|
|
596
|
+
},
|
|
597
|
+
{ name: 'runtime-executors', ok: true, detail: 'SKIPPED: probe real pulado em modo smoke. Use --deep para testar executores externos.' },
|
|
598
|
+
{
|
|
599
|
+
name: 'runtime-policy-chain',
|
|
600
|
+
ok: research.preferred.length > 0 && engineering.preferred.length > 0,
|
|
601
|
+
detail: `research=${research.preferred.join('>')} | engineering=${engineering.preferred.join('>')}`,
|
|
602
|
+
},
|
|
603
|
+
{ name: 'live-llm-gateway', ok: true, detail: 'SKIPPED: pulados em modo smoke. Use --deep para validar LLM/TTS/Gateway reais.' },
|
|
604
|
+
];
|
|
605
|
+
}
|
|
580
606
|
const { TestHarness } = require('./orchestrator/TestHarness');
|
|
581
607
|
const harness = new TestHarness();
|
|
582
608
|
return await harness.runPhase1Checks();
|
|
@@ -597,9 +623,8 @@ program
|
|
|
597
623
|
console.error('phase1-check failed:', errMsg(error));
|
|
598
624
|
exitCode = 1;
|
|
599
625
|
}
|
|
600
|
-
// Force deterministic exit
|
|
601
|
-
// event-loop handles open
|
|
602
|
-
// Override timeout via OPENLIFE_PHASE1_TIMEOUT_MS (default 30s).
|
|
626
|
+
// Force deterministic exit. In --deep mode TestHarness can instantiate Gateway/Telegraf,
|
|
627
|
+
// leaving event-loop handles open; smoke mode exits the same way for a stable CLI contract.
|
|
603
628
|
process.exit(exitCode);
|
|
604
629
|
});
|
|
605
630
|
const systemCmd = program.command('system').description('Instalação, bootstrap e status do OpenLife');
|