fivetech commited on
Commit
e31946e
·
verified ·
1 Parent(s): 6acb2bb

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +38 -8
index.html CHANGED
@@ -1100,7 +1100,7 @@ async function runConsensus() {
1100
  else if (si + votes.filter(v => v.vote === 'PARCIAL').length >= Math.ceil(votes.length / 2) && no === 0) { status = 'Consenso parcial'; cls = 'partial'; icon = '\u{1F7E1}'; }
1101
  else { status = 'Desacuerdo fundamentado'; cls = 'disagree'; icon = '\u{1F534}'; }
1102
  doneNote(note, 'Consenso evaluado: ' + status);
1103
- return { conclusion, votes, status, cls, icon };
1104
  }
1105
 
1106
  /* ================= An\u00e1lisis: evaluador ================= */
@@ -1122,6 +1122,28 @@ function blockUsable(b) {
1122
  if (present.every(v => v === 0)) return false;
1123
  return true;
1124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1125
  async function runEvaluation() {
1126
  const note = analysisNote('Evaluador analizando intervenciones\u2026');
1127
  const view = transcriptText(4500);
@@ -1268,7 +1290,9 @@ function renderAnalysis() {
1268
  // --- Consenso ---
1269
  html += `<div class="consensus-hero ${c.cls}"><div class="ci">${c.icon}</div><div>` +
1270
  `<div class="cs">${esc(c.status)}</div>` +
1271
- `<div class="muted">Conclusi\u00f3n: ${esc(c.conclusion)}</div></div></div>`;
 
 
1272
  html += `<div class="panel" style="background:var(--panel2)"><h3>\u{1F5F3}\uFE0F Votaci\u00f3n de los agentes</h3><div class="vote-list">`;
1273
  c.votes.forEach(v => {
1274
  const cls = v.vote === 'SI' ? 'si' : v.vote === 'NO' ? 'no' : 'parcial';
@@ -1309,7 +1333,11 @@ function renderAnalysis() {
1309
  });
1310
  html += '</div>';
1311
  }
1312
- if (e.relations) {
 
 
 
 
1313
  html += `<h3 style="margin-top:14px;color:var(--accent);font-size:13px;letter-spacing:1px">MAPA DE RELACIONES</h3><div class="relchips">`;
1314
  e.relations.split(';').map(x => x.trim()).filter(Boolean).forEach(rel => {
1315
  const cls = /contradice|ataca|rebate/i.test(rel) ? 'con' : 'sup';
@@ -1318,9 +1346,9 @@ function renderAnalysis() {
1318
  html += '</div>';
1319
  }
1320
  const extras = [];
1321
- if (e.extra.contradicciones) extras.push(['\u{1F500} Contradicciones', e.extra.contradicciones]);
1322
- if (e.extra.falacias) extras.push(['\u26A0\uFE0F Falacias l\u00f3gicas', e.extra.falacias]);
1323
- if (e.extra.sinJustificar) extras.push(['\u2753 Afirmaciones sin justificar', e.extra.sinJustificar]);
1324
  if (extras.length) {
1325
  html += `<h3 style="margin-top:14px;color:var(--accent);font-size:13px;letter-spacing:1px">DETECTORES</h3>`;
1326
  extras.forEach(([t, v]) => {
@@ -1355,7 +1383,9 @@ function renderAnalysis() {
1355
  html += '</div>';
1356
  if (analysis.devil) {
1357
  html += `<h3 style="margin-top:16px;color:var(--red);font-size:13px;letter-spacing:1px">\u{1F47F} DEVIL'S ADVOCATE</h3>` +
1358
- `<div class="panel" style="background:#f8717110;border-color:var(--red)"><div class="muted" style="color:var(--text)">${esc(analysis.devil).replace(/\n/g, '<br>')}</div></div>`;
 
 
1359
  }
1360
  out.innerHTML = html;
1361
  }
@@ -1376,7 +1406,7 @@ function saveToLibrary() {
1376
  lsSet(K.library, lib.slice(0, 25));
1377
  }
1378
  function saveToMemory(consensus) {
1379
- if (!consensus || !consensus.conclusion) return;
1380
  const mem = lsGet(K.memory, []);
1381
  mem.unshift({ topic, conclusion: consensus.conclusion, status: consensus.status, ts: Date.now() });
1382
  lsSet(K.memory, mem.slice(0, 12));
 
1100
  else if (si + votes.filter(v => v.vote === 'PARCIAL').length >= Math.ceil(votes.length / 2) && no === 0) { status = 'Consenso parcial'; cls = 'partial'; icon = '\u{1F7E1}'; }
1101
  else { status = 'Desacuerdo fundamentado'; cls = 'disagree'; icon = '\u{1F534}'; }
1102
  doneNote(note, 'Consenso evaluado: ' + status);
1103
+ return { conclusion, votes, status, cls, icon, artifact: textArtifacts(conclusion, topic) };
1104
  }
1105
 
1106
  /* ================= An\u00e1lisis: evaluador ================= */
 
1122
  if (present.every(v => v === 0)) return false;
1123
  return true;
1124
  }
1125
+
1126
+ // Detecta artefactos de generación: eco del tema pegado al inicio ("ches autEl debate…")
1127
+ // o palabra de contenido repetida a muy corta distancia ("el peatón es el peatón").
1128
+ function textArtifacts(text, topicStr) {
1129
+ if (!text) return false;
1130
+ const words = text.toLowerCase().match(/[a-z\u00e0-\u00fc]{5,}/g) || [];
1131
+ for (let i = 0; i < words.length - 1; i++) {
1132
+ if (words.slice(i + 1, i + 4).includes(words[i])) return true;
1133
+ }
1134
+ if (topicStr) {
1135
+ const t = topicStr.toLowerCase();
1136
+ const head = text.slice(0, 24).toLowerCase();
1137
+ for (let k = Math.min(head.length, 16); k >= 4; k--) {
1138
+ const idx = t.indexOf(head.slice(0, k));
1139
+ if (idx < 0) continue;
1140
+ // Solo es eco si el prefijo engancha a media palabra dentro del tema ("…coches aut…" -> "ches aut").
1141
+ if (idx > 0 && /[a-z\u00e0-\u00fc]/.test(t[idx - 1])) return true;
1142
+ break;
1143
+ }
1144
+ }
1145
+ return false;
1146
+ }
1147
  async function runEvaluation() {
1148
  const note = analysisNote('Evaluador analizando intervenciones\u2026');
1149
  const view = transcriptText(4500);
 
1290
  // --- Consenso ---
1291
  html += `<div class="consensus-hero ${c.cls}"><div class="ci">${c.icon}</div><div>` +
1292
  `<div class="cs">${esc(c.status)}</div>` +
1293
+ `<div class="muted">Conclusi\u00f3n: ${esc(c.conclusion)}</div>` +
1294
+ (c.artifact ? `<div class="muted" style="margin-top:4px">\u26A0\uFE0F La conclusi\u00f3n muestra artefactos de generaci\u00f3n (eco o repetici\u00f3n del modelo); interpr\u00e9tala con cautela.</div>` : '') +
1295
+ `</div></div>`;
1296
  html += `<div class="panel" style="background:var(--panel2)"><h3>\u{1F5F3}\uFE0F Votaci\u00f3n de los agentes</h3><div class="vote-list">`;
1297
  c.votes.forEach(v => {
1298
  const cls = v.vote === 'SI' ? 'si' : v.vote === 'NO' ? 'no' : 'parcial';
 
1333
  });
1334
  html += '</div>';
1335
  }
1336
+ const evalOk = e.unavailable === undefined ? e.blocks.some(blockUsable) : !e.unavailable;
1337
+ if (!evalOk) {
1338
+ html += `<div class="panel" style="background:var(--panel2);margin-top:10px"><div class="muted" style="color:var(--text)">Relaciones y detectores no disponibles: la salida del evaluador no fue utilizable; no se presentan coincidencias de texto como detecciones.</div></div>`;
1339
+ }
1340
+ if (evalOk && e.relations) {
1341
  html += `<h3 style="margin-top:14px;color:var(--accent);font-size:13px;letter-spacing:1px">MAPA DE RELACIONES</h3><div class="relchips">`;
1342
  e.relations.split(';').map(x => x.trim()).filter(Boolean).forEach(rel => {
1343
  const cls = /contradice|ataca|rebate/i.test(rel) ? 'con' : 'sup';
 
1346
  html += '</div>';
1347
  }
1348
  const extras = [];
1349
+ if (evalOk && e.extra.contradicciones) extras.push(['\u{1F500} Contradicciones', e.extra.contradicciones]);
1350
+ if (evalOk && e.extra.falacias) extras.push(['\u26A0\uFE0F Falacias l\u00f3gicas', e.extra.falacias]);
1351
+ if (evalOk && e.extra.sinJustificar) extras.push(['\u2753 Afirmaciones sin justificar', e.extra.sinJustificar]);
1352
  if (extras.length) {
1353
  html += `<h3 style="margin-top:14px;color:var(--accent);font-size:13px;letter-spacing:1px">DETECTORES</h3>`;
1354
  extras.forEach(([t, v]) => {
 
1383
  html += '</div>';
1384
  if (analysis.devil) {
1385
  html += `<h3 style="margin-top:16px;color:var(--red);font-size:13px;letter-spacing:1px">\u{1F47F} DEVIL'S ADVOCATE</h3>` +
1386
+ `<div class="panel" style="background:#f8717110;border-color:var(--red)"><div class="muted" style="color:var(--text)">${esc(analysis.devil).replace(/\n/g, '<br>')}</div>` +
1387
+ (textArtifacts(analysis.devil, topic) ? `<div class="muted" style="margin-top:4px">\u26A0\uFE0F Texto con artefactos de generaci\u00f3n (eco o repetici\u00f3n); interpr\u00e9talo con cautela.</div>` : '') +
1388
+ `</div>`;
1389
  }
1390
  out.innerHTML = html;
1391
  }
 
1406
  lsSet(K.library, lib.slice(0, 25));
1407
  }
1408
  function saveToMemory(consensus) {
1409
+ if (!consensus || !consensus.conclusion || consensus.artifact) return;
1410
  const mem = lsGet(K.memory, []);
1411
  mem.unshift({ topic, conclusion: consensus.conclusion, status: consensus.status, ts: Date.now() });
1412
  lsSet(K.memory, mem.slice(0, 12));