Elffuss BraidHub

utopia-ia/elffuss-code public

Mind: "Reprogram" no longer switches the autonomous brain on

The ⚙ brain panel's Reprogram button called ceo.enable() whenever the
brain was off, and enable() persists the choice. It did so in Basic mode
and also after the user had paused the brain on purpose, while the label
said nothing about switching anything on. Only ▶ turns the brain on now;
Reprogram saves mission, soul folder and profiles, repaints the button and
returns focus to ⚙.

mind-consent.mjs: pause with the button, Reprogram, and the brain stays
paused with "resume" on the button. Fails on the previous tree.
Changeset88b3f553b4fcdd3955a38a3a9bde61d8f80afaffab295856dc66f00f04dbfcbc
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-10 19:24 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-11 14:15 +02:00
Parents48bc21c757fd

Browse the files at this changeset

2 files changed

modified tests/mind-consent.mjs +8 −0
@@ -75,6 +75,14 @@
7575 ok('2 · …y con el motor de reglas no se escribe ninguna propuesta', r2.forzado === false && r2.nombres.length === 1, JSON.stringify(r2));
7676 await p.click('#cfg-x');
7777
78+// 2 · «Reprogramar» no enciende el cerebro: ni en Básico ni si lo pausaste
79+await p.click('#mind-playstop'); // pausarlo a propósito
80+const pausado = await p.evaluate(async () => (await import('/js/ceo.js')).isEnabled());
81+await p.click('#mind-config');
82+await p.click('#cfg-save');
83+const r2b = await p.evaluate(async () => ({ on: (await import('/js/ceo.js')).isEnabled(), boton: document.getElementById('mind-playstop').textContent }));
84+ok('2 · «Reprogramar» no enciende un cerebro pausado (y el botón no cambia)', !pausado && !r2b.on && !/pausar/i.test(r2b.boton), JSON.stringify({ pausado, ...r2b }));
85+
7886 // 3 · etiqueta de propuesta pulsable
7987 await p.waitForSelector('.mind-node-label', { timeout: 10000 });
8088 const r3 = await p.evaluate(() => {
modified web/js/mind.js +4 −1
@@ -411,9 +411,12 @@
411411 ceo.setMission(cfg.querySelector('#cfg-mission').value);
412412 ceo.setSoulDir(cfg.querySelector('#cfg-dir').value);
413413 ceo.setProfiles(rows);
414- if (!ceo.isEnabled()) ceo.enable();
414+ // Reprogramar NO enciende el cerebro: solo ▶ lo hace. Antes lo encendía
415+ // (y lo dejaba guardado), también en modo Básico y también si lo habías
416+ // pausado a propósito, sin que el botón dijera nada de encender.
415417 paintPlay();
416418 cfg.classList.remove('show');
419+ root.querySelector('#mind-config')?.focus();
417420 };
418421 wireRows();
419422 function wireRows() { cfg.querySelectorAll('.cp-del').forEach(b => { b.onclick = () => b.closest('.cfg-prof').remove(); }); }