File size: 1,555 Bytes
fb15d01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const env = require('../src/config/env');
const inferenceEngine = require('../src/domain/Inference_Engine');
const { sendTelegramOutbound } = require('../src/interfaces/webhook');

(async () => {
  console.log('πŸš€ Memulai Manual Trigger Weekly Cognitive Sunday Pass...');
  try {
    const result = await inferenceEngine.runWeeklyIdentityInference();
    console.log('βœ… Selesai:', result);

    if (result.success && result.saved > 0) {
      const summaryMsg = [
        `🧠 <b>Weekly Identity Inference Selesai</b>`,
        `<i>(Siklus Pemahaman Mingguan N.E.X.A β€” Manual Trigger)</i>`,
        '',
        `πŸ“Š Hipotesis yang dianalisis : <b>${result.totalHypotheses}</b>`,
        `βœ… Proposal baru tersimpan   : <b>${result.saved}</b>`,
        `πŸ“¨ Dikirim untuk review      : <b>${result.pendingSent}</b>`,
        `πŸ“‚ Di-stage (bukti kurang)   : <b>${result.staged}</b>`,
        `⚑ Diabaikan (duplikat/lemah): <b>${result.skipped}</b>`,
        '',
        result.pendingSent > 0
          ? `πŸ’‘ Silakan review proposal identitas di atas, Tuan.`
          : `πŸ“ Semua hipotesis minggu ini di-stage untuk observasi lanjutan.`
      ].join('\n');
      await sendTelegramOutbound(summaryMsg, true);
    } else {
      await sendTelegramOutbound(`🧠 <b>Weekly Identity Inference Selesai</b>\n\nTidak ada hipotesis baru (atau observasi belum cukup untuk menarik kesimpulan baru). Model identitas stabil.`, true);
    }
  } catch (err) {
    console.error('❌ Error:', err.message);
  } finally {
    process.exit(0);
  }
})();