Architect runs: a skipped review that passes still ends with the monkey's cheer

This commit is contained in:
Frederic Jung 2026-10-30 11:42:34 +01:00
parent b04e1e22c1
commit 87364af55d
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View file

@ -13,7 +13,8 @@ function mkRun(l,dur,bad){const m=UI.mk;if(!m)return;const [x,y]=mkMid(l);m.fx=m
function mkSpray(m){for(let i=0;i<(m.bad?26:16);i++){const a=Math.PI*2*i/(m.bad?26:16)+((i*37)%10)/10,v=0.05+((i*53)%10)/180;
m.spray.push({x:m.tx,y:m.ty,vx:Math.cos(a)*v,vy:Math.sin(a)*v-0.06,c:m.bad?(i%3?'#FF4D5E':'#FFD23F'):MK_COLS[i%MK_COLS.length],t:animT,s:i%4===0?(m.bad?'💥':'✂️'):null});}}
// The review is over: a cheer when everything held, a tantrum where it broke.
function mkEnd(ok){const m=UI.mk;if(!m)return;m.mood=ok?'cheer':'dance';m.t0=animT;}
function mkEnd(ok){const m=UI.mk;if(!m)return;// a pending spray (the review was skipped mid-run) would override the cheer
m.sprayAt=null;m.mood=ok?'cheer':'dance';m.t0=animT;}
function mkStop(){UI.mk=null;}
function mkDraw(ks){const m=UI.mk;if(!m)return;
const p=Math.min(1,(animT-m.t0)/m.dur),e=p<0.5?2*p*p:1-Math.pow(-2*p+2,2)/2;

View file

@ -23,6 +23,7 @@ test('architect runs: every reference passes each brief, on plan and within budg
plan.forEach((steps, i) => {
for (const s of steps) if (s[0] === '@rm') ev(`ACT.pzRmPop({city:'${s[1]}'})`); else lay(ev, ...s);
assert.equal(review(ev), true, `${id} brief ${i + 1}: ${ev('arEval().why')} ${ev('JSON.stringify(UI.arFail)')}`);
assert.deepEqual(JSON.parse(ev('JSON.stringify([UI.mk.mood,UI.mk.sprayAt])')), ['cheer', null], `${id}: a skipped review that passes still ends in a cheer`);
if (i < plan.length - 1) { ev('ACT.pzArNext()'); assert.equal(ev('UI.mk'), null, `${id}: the monkey leaves with the next brief`); }
});
assert.equal(ev('arOver()'), 0, `${id}: never over a brief's tubes`);