utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | dad4d49e20636fee2a6a68002909fa023bbd879a697104811baf6b3da7b1e110 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 17:35 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 17:35 +02:00 |
| Parents | f97f74b2d94c |
4 files changed
added tests/texto-plano.mjs +38 −0
| @@ -0,0 +1,38 @@ | ||
| 1 | +// Los ficheros de texto del repo son texto para git: ninguno lleva un byte NUL | |
| 2 | +// literal. Con uno dentro, git trata el fichero entero como binario: `git diff` | |
| 3 | +// solo dice «Binary files differ» y `git grep -I` se lo salta, así que nada de lo | |
| 4 | +// que cambia en él se ve al revisar ni al barrer el diff antes de publicar. Pasó | |
| 5 | +// con md.js y arch.js (un centinela '\0' escrito tal cual); dentro de una cadena | |
| 6 | +// se escribe '\u0000', que es lo mismo para JavaScript. | |
| 7 | +// | |
| 8 | +// node tests/texto-plano.mjs | |
| 9 | +import { readdirSync, readFileSync, statSync } from 'node:fs'; | |
| 10 | +import { join, relative, extname } from 'node:path'; | |
| 11 | +import { fileURLToPath } from 'node:url'; | |
| 12 | + | |
| 13 | +const RAIZ = fileURLToPath(new URL('..', import.meta.url)); | |
| 14 | +const TEXTO = new Set(['.js', '.mjs', '.cjs', '.css', '.html', '.json', '.md', '.py', '.sh', '.go', '.txt', '.svg', '.webmanifest', '.yml', '.yaml']); | |
| 15 | +const FUERA = new Set(['node_modules', '.git']); | |
| 16 | + | |
| 17 | +let fallos = 0, vistos = 0; | |
| 18 | +const ok = (n, c, e = '') => { console.log(`${c ? '✅' : '❌'} ${n}${e ? ' — ' + e : ''}`); if (!c) fallos++; }; | |
| 19 | + | |
| 20 | +const conNul = []; | |
| 21 | +function recorre(dir) { | |
| 22 | + for (const nombre of readdirSync(dir)) { | |
| 23 | + if (FUERA.has(nombre)) continue; | |
| 24 | + const ruta = join(dir, nombre); | |
| 25 | + const st = statSync(ruta, { throwIfNoEntry: false }); | |
| 26 | + if (!st) continue; | |
| 27 | + if (st.isDirectory()) { recorre(ruta); continue; } | |
| 28 | + if (!TEXTO.has(extname(nombre).toLowerCase())) continue; | |
| 29 | + vistos++; | |
| 30 | + if (readFileSync(ruta).includes(0)) conNul.push(relative(RAIZ, ruta)); | |
| 31 | + } | |
| 32 | +} | |
| 33 | +recorre(RAIZ); | |
| 34 | + | |
| 35 | +ok(`se revisan los ficheros de texto del repo (${vistos})`, vistos > 50, `${vistos} ficheros`); | |
| 36 | +ok('ninguno lleva un byte NUL literal (git lo trataría como binario)', conNul.length === 0, conNul.join(', ')); | |
| 37 | +console.log(fallos ? `\n❌ ${fallos} FALLO(S)` : '\n✅ TEXTO PLANO: git ve todos los ficheros de texto como texto'); | |
| 38 | +process.exit(fallos ? 1 : 0); |
modified web/js/arch.js +0 −0
Binary content is not shown. View the file.
modified web/js/goal.js +1 −1
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | // Modo Objetivo (🎯 Goal): mismo patrón planificador/ejecutor que clonagent |
| 2 | -// (~/work2026/clonagent) — un PLANIFICADOR descompone el objetivo en una | |
| 2 | +// — un PLANIFICADOR descompone el objetivo en una | |
| 3 | 3 | // lista de tareas con estado (pending/in-progress/done/failed/skipped), y un |
| 4 | 4 | // EJECUTOR las va ejecutando una a una hasta que no queda ninguna pendiente, |
| 5 | 5 | // marcando el resultado de cada una. Si una tarea falla, las siguientes se |
modified web/js/md.js +0 −0
Binary content is not shown. View the file.