viberadar 0.3.199 → 0.3.200
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/scanner/index.d.ts +4 -0
- package/dist/scanner/index.d.ts.map +1 -1
- package/dist/scanner/index.js +48 -6
- package/dist/scanner/index.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +85 -4
- package/dist/server/index.js.map +1 -1
- package/dist/ui/dashboard.html +45 -37
- package/package.json +1 -1
package/dist/ui/dashboard.html
CHANGED
|
@@ -3006,7 +3006,7 @@ function showObsCopyToast() {
|
|
|
3006
3006
|
t.style.cssText = 'position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#238636;color:#fff;padding:8px 20px;border-radius:8px;font-size:13px;z-index:9999;pointer-events:none;transition:opacity 0.3s';
|
|
3007
3007
|
document.body.appendChild(t);
|
|
3008
3008
|
}
|
|
3009
|
-
t.textContent = '📋
|
|
3009
|
+
t.textContent = '📋 Prompt для ревизии скопирован';
|
|
3010
3010
|
t.style.opacity = '1';
|
|
3011
3011
|
clearTimeout(t._to);
|
|
3012
3012
|
t._to = setTimeout(() => { t.style.opacity = '0'; }, 2500);
|
|
@@ -4617,8 +4617,14 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4617
4617
|
// Store catalog for buttons to reference by index (avoids inline JSON in onclick)
|
|
4618
4618
|
window.__obsCatalog = catalog;
|
|
4619
4619
|
|
|
4620
|
-
// Store noisy patterns data for confirmation flow
|
|
4621
|
-
window.__noisyPatterns = topNoisy.map(i => ({
|
|
4620
|
+
// Store noisy patterns data for confirmation/copy flow.
|
|
4621
|
+
window.__noisyPatterns = topNoisy.map(i => ({
|
|
4622
|
+
pattern: i.pattern,
|
|
4623
|
+
recommendation: i.recommendation,
|
|
4624
|
+
confidence: i.confidence || 'review',
|
|
4625
|
+
safety: i.safety || 'needs_review',
|
|
4626
|
+
reasonHints: i.reasonHints || [],
|
|
4627
|
+
}));
|
|
4622
4628
|
|
|
4623
4629
|
const noisyRows = topNoisy.map((i, idx) => {
|
|
4624
4630
|
// Find related modules from catalog that contain this pattern in noisyMessages.
|
|
@@ -4635,14 +4641,17 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4635
4641
|
);
|
|
4636
4642
|
const moduleCount = relatedModules.length;
|
|
4637
4643
|
|
|
4638
|
-
const expandBtn =
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
const
|
|
4642
|
-
const
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
const
|
|
4644
|
+
const expandBtn = `<button class="obs-expand-btn" onclick="event.stopPropagation();toggleNoisyDetail(${idx})">▼</button>`;
|
|
4645
|
+
const confidence = i.confidence || 'review';
|
|
4646
|
+
const confLabels = { high: 'доверие высокое', medium: 'доверие среднее', review: 'спорно' };
|
|
4647
|
+
const confColors = { high: 'var(--green)', medium: 'var(--yellow)', review: 'var(--red)' };
|
|
4648
|
+
const reasonHints = (i.reasonHints || []).slice(0, 4);
|
|
4649
|
+
const confidenceBadge = `<span title="${escapeHtml(reasonHints.join('; ') || 'нужна проверка контекста')}" style="font-size:10px;color:${confColors[confidence] || 'var(--yellow)'};border:1px solid ${confColors[confidence] || 'var(--yellow)'};border-radius:999px;padding:1px 6px;flex-shrink:0">${confLabels[confidence] || 'спорно'}</span>`;
|
|
4650
|
+
const actionLabel = '\u{1F916} Отдать агенту';
|
|
4651
|
+
const btn = hasAgent
|
|
4652
|
+
? `<button class="obs-action-btn" onclick="event.stopPropagation();showNoisySuppressConfirm(${idx})">${actionLabel}</button>`
|
|
4653
|
+
: '';
|
|
4654
|
+
const copyBtn = `<button class="obs-copy-btn" title="Скопировать промпт для ревизии" onclick="event.stopPropagation();obsCopyPrompt('obs-suppress-pattern',window.__noisyPatterns[${idx}])">📋 Промпт</button>`;
|
|
4646
4655
|
|
|
4647
4656
|
// Module list for detail section
|
|
4648
4657
|
const moduleRows = relatedModules.map(c => {
|
|
@@ -4651,28 +4660,27 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4651
4660
|
}).join('');
|
|
4652
4661
|
|
|
4653
4662
|
// Confirmation block
|
|
4654
|
-
const confirmDesc = i.
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
<
|
|
4660
|
-
<
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
</div>
|
|
4666
|
-
</div>` : '';
|
|
4663
|
+
const confirmDesc = `Агент получит prompt на ревизию паттерна «${escapeHtml(i.pattern)}»: сначала классифицировать каждый лог, затем менять только очевидно безопасные случаи.`;
|
|
4664
|
+
const confirmBlock = hasAgent ? `
|
|
4665
|
+
<div id="obs-noisy-confirm-${idx}" class="obs-noisy-confirm">
|
|
4666
|
+
<p>${confirmDesc}</p>
|
|
4667
|
+
<p>Затронуто модулей: <strong>${moduleCount}</strong></p>
|
|
4668
|
+
<div class="obs-confirm-safe">⛔ warn / error / fatal не трогать; спорные INFO оставить на ручную проверку</div>
|
|
4669
|
+
<div class="obs-noisy-confirm-btns">
|
|
4670
|
+
<button class="obs-noisy-cancel" onclick="event.stopPropagation();hideNoisySuppressConfirm(${idx})">Отмена</button>
|
|
4671
|
+
<button class="obs-noisy-apply" onclick="event.stopPropagation();confirmNoisySuppress(${idx})">Запустить с prompt</button>
|
|
4672
|
+
</div>
|
|
4673
|
+
</div>` : '';
|
|
4667
4674
|
|
|
4668
4675
|
const moduleLabel = moduleCount > 0 ? `<span style="color:var(--dim);font-size:11px;flex-shrink:0">${moduleCount} мод.</span>` : '';
|
|
4669
4676
|
|
|
4670
4677
|
return `
|
|
4671
4678
|
<div>
|
|
4672
4679
|
<div class="obs-list-item">
|
|
4673
|
-
<span class="obs-priority-${i.priority}" style="flex-shrink:0">[${i.priority}]</span>
|
|
4674
|
-
|
|
4675
|
-
<
|
|
4680
|
+
<span class="obs-priority-${i.priority}" style="flex-shrink:0">[${i.priority}]</span>
|
|
4681
|
+
${confidenceBadge}
|
|
4682
|
+
<span style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap" title="${escapeHtml(i.pattern)}">${escapeHtml(i.pattern)}</span>
|
|
4683
|
+
<strong style="flex-shrink:0;color:var(--red)">×${i.count} → ${recLabels[i.recommendation] || i.recommendation}</strong>
|
|
4676
4684
|
${moduleLabel}
|
|
4677
4685
|
${btn}
|
|
4678
4686
|
${copyBtn}
|
|
@@ -4971,11 +4979,11 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4971
4979
|
<span class="obs-hint-chevron">▼</span>
|
|
4972
4980
|
</button>
|
|
4973
4981
|
<div class="obs-hint-body">
|
|
4974
|
-
<p
|
|
4982
|
+
<p>VibeRadar подсвечивает подозрительные INFO/DEBUG/TRACE логи эвристически. Это не команда на удаление: каждый паттерн нужно проверить в контексте кода и бизнес-сценария.</p>
|
|
4975
4983
|
<ul style="margin:8px 0 0 16px;display:flex;flex-direction:column;gap:4px">
|
|
4976
|
-
<li><strong style="color:var(--red)">Топят сигнал.</strong>
|
|
4977
|
-
<li><strong style="color:var(--yellow)">Стоят деньги.</strong> Datadog, New Relic, Elastic
|
|
4978
|
-
<li><strong style="color:var(--muted)"
|
|
4984
|
+
<li><strong style="color:var(--red)">Топят сигнал.</strong> Реальная ошибка теряется среди lifecycle-строк и фоновых сообщений.</li>
|
|
4985
|
+
<li><strong style="color:var(--yellow)">Стоят деньги.</strong> Datadog, New Relic, Elastic и Loki часто тарифицируются по объёму ingest/storage.</li>
|
|
4986
|
+
<li><strong style="color:var(--muted)">Требуют ревизии.</strong> INFO может быть бизнес-событием, аудитом или reconciliation-сигналом, поэтому спорные случаи нельзя удалять автоматически.</li>
|
|
4979
4987
|
</ul>
|
|
4980
4988
|
<div class="obs-hint-section">
|
|
4981
4989
|
<div class="obs-hint-section-title">До / После</div>
|
|
@@ -4987,21 +4995,21 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4987
4995
|
<span class="hl-red">logger.info('Using API key from env') // каждый запрос</span></div>
|
|
4988
4996
|
</div>
|
|
4989
4997
|
<div>
|
|
4990
|
-
<div class="obs-hint-label after">СТАЛО —
|
|
4991
|
-
<div class="obs-hint-code"><span class="hl-green">// строки удалены или понижены до debug</span>
|
|
4992
|
-
<span class="hl-dim">// В production debug-логи выключены</span>
|
|
4993
|
-
<span class="hl-green">//
|
|
4998
|
+
<div class="obs-hint-label after">СТАЛО — после ревизии</div>
|
|
4999
|
+
<div class="obs-hint-code"><span class="hl-green">// строки удалены или понижены до debug</span>
|
|
5000
|
+
<span class="hl-dim">// В production debug-логи выключены</span>
|
|
5001
|
+
<span class="hl-green">// Спорные бизнес/audit/security логи оставлены</span></div>
|
|
4994
5002
|
</div>
|
|
4995
5003
|
</div>
|
|
4996
5004
|
</div>
|
|
4997
5005
|
<div class="obs-hint-section">
|
|
4998
5006
|
<div class="obs-hint-section-title">Как использовать</div>
|
|
4999
|
-
<p
|
|
5007
|
+
<p>Используй <strong>«📋 Промпт»</strong> как основной сценарий: VibeRadar отдаёт агенту список паттернов, guardrails и просьбу сначала классифицировать каждый лог. Запуск агентом остаётся вторичным действием.</p>
|
|
5000
5008
|
</div>
|
|
5001
5009
|
</div>
|
|
5002
5010
|
</div>
|
|
5003
5011
|
<div class="obs-card">
|
|
5004
|
-
<div class="obs-title">Шумные
|
|
5012
|
+
<div class="obs-title">Шумные паттерны · prompt для ревизии</div>
|
|
5005
5013
|
<div class="obs-list" style="gap:4px">${noisyRows}</div>
|
|
5006
5014
|
</div>
|
|
5007
5015
|
</div>
|