A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Give every stage its turn, even one done while a card waited
AdamPlatin1233590e3456128
diff --git a/app/src/start/whale.js b/app/src/start/whale.jsindex 8d5ae4b2..26065861 100644--- a/app/src/start/whale.js+++ b/app/src/start/whale.js@@ -567,17 +567,16 @@ export function createDirector({ start, resume, act, label, announce, onCheck, oconst i = D.at// A copy can be done before the card has landed in its arc: the arc fills after that.if (phases[i] === 'import' && D.flying) return- if (!ran) {- // The data stage is usually done before the page has painted: its arc still turns- // active once the whale has surfaced and holds there, the folder in view, before it- // fills. No loop starts for that short wait: a loop's own hold would add another 400 ms.- if (i === 0 && !resume && ['boot', 'moving'].includes(want.view) && stationEl(0).dataset.state === 'pending') {- clearTimeout(activeTimer)- showActive(0)- }- await hold(Math.max(D.activeAt[i] ? D.activeAt[i] + HOLD : 0, D.loopAt ? D.loopAt + HOLD : 0))- if (want.view === 'handoff') break+ // A stage done while nobody could see it (the data folder before the page painted, the+ // engine while the import card waited or the copy ran) still turns active and holds there,+ // its prop in view, before it fills. No loop starts for that short wait: a loop's own hold+ // would add another 400 ms. A stage that was seen running fills at once.+ if (!resume && !failure() && stationEl(i).dataset.state === 'pending') {+ clearTimeout(activeTimer)+ showActive(i)}+ await hold(Math.max(D.activeAt[i] ? D.activeAt[i] + HOLD : 0, !ran && D.loopAt ? D.loopAt + HOLD : 0))+ if (want.view === 'handoff') breakawait leg(i, ran > 0)ran += 1}@@ -749,8 +748,18 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o// closes into one circle (html[data-ring=closed]), and the whale goes. Every path shows the// team window well inside the main process's fallback (start-window.mjs fallbackMs).async function handoff() {- if (D.handed) return+ if (D.handed || D.handing) returnclearTimeout(activeTimer)+ // The team's arc gets its turn too when the team view was ready before the arc turned active+ // (it loaded while a card waited, or in a moment): on a first start, whose fallback leaves+ // the time (start-window.mjs fallbackMs, 2.5 s).+ const t = last()+ if (!resume && first && D.checks === t && stationEl(t).dataset.state === 'pending') {+ D.handing = true+ showActive(t)+ await sleep(HOLD)+ D.handing = false+ }stopHop()petEnd()for (let i = D.checks; i < phases.length; i += 1) popCheck(i)diff --git a/app/test/start-page.test.mjs b/app/test/start-page.test.mjsindex ded1a7a0..9f81e354 100644--- a/app/test/start-page.test.mjs+++ b/app/test/start-page.test.mjs@@ -152,12 +152,22 @@ test('an empty or hidden arc leaves no dot: no dash touches its path', () => {assert.equal(touches(dashes(base), offsetOf(base)), true)})-// The data stage is usually done before the page has painted; its arc (and the folder) still turns-// active once the whale has surfaced and holds for HOLD before it fills.-test('the first stage is seen active before it fills, even when it was done before the page painted', () => {+// A stage done while nobody could see it still gets its turn: the data folder, usually done before+// the page has painted, and the engine, which warms up while the import card waits (or comes up+// while the copy runs). Its arc turns active, its prop in view, and holds for HOLD before it+// fills; a stage seen running fills at once. While the import card waits, the ring holds after+// the first arc.+test('every stage is seen active before it fills, even one done before the page painted or while a card waited', () => {const whale = code['whale.js']const legs = whale.slice(whale.indexOf('async function runLegs()'), whale.indexOf('function failStation()'))- assert.match(legs, /if \(i === 0 && !resume && \['boot', 'moving'\]\.includes\(want\.view\) && stationEl\(0\)\.dataset\.state === 'pending'\) \{\s*clearTimeout\(activeTimer\)\s*showActive\(0\)/u)+ assert.match(legs, /while \(D\.at < want\.station && want\.view !== 'handoff'\) \{[\s\S]*?if \(!resume && !failure\(\) && stationEl\(i\)\.dataset\.state === 'pending'\) \{\s*clearTimeout\(activeTimer\)\s*showActive\(i\)/u)+ assert.doesNotMatch(legs, /if \(!ran\) \{/u, 'only the first stage gets its turn')+ assert.match(whale, /if \(holding\(\)\) station = Math\.min\(station, 1\)/u)+ assert.match(whale, /\(holding\(\) && i >= 1\)\) return/u)+ // The team's arc, when the team view was ready before it turned active: at the hand-off of a+ // first start, inside the main process's 2.5 s fallback.+ const handoff = whale.slice(whale.indexOf('async function handoff()'), whale.indexOf('root.dataset.ring = \'closed\''))+ assert.match(handoff, /if \(!resume && first && D\.checks === t && stationEl\(t\)\.dataset\.state === 'pending'\) \{\s*D\.handing = true\s*showActive\(t\)\s*await sleep\(HOLD\)/u)assert.match(legs, /await hold\(Math\.max\(D\.activeAt\[i\] \? D\.activeAt\[i\] \+ HOLD : 0/u)assert.match(whale, /const HOLD = 420\b/u)// The reconcile waits for the entrance first, so the arc turns active on a whale that has surfaced.diff --git a/docs/plans/2026-10-26-start-window.md b/docs/plans/2026-10-26-start-window.mdindex 64009272..aab28be1 100644--- a/docs/plans/2026-10-26-start-window.md+++ b/docs/plans/2026-10-26-start-window.md@@ -67,7 +67,7 @@- 复制失败:这段线和已经画到的部分变成 `--bt-danger`,重试时回到进行中,从 0 重画。- 复制完了这一段画满,之后一直是四段;复制停下、「先不带团队开始」:回到三段(上面)。- 预热好的引擎为复制停下,引擎那一段回到没开始,等复制好的团队的引擎起来才画满;复制完到引擎起来这段时间是引擎那一段在进行中。-- 道具:鲸鱼面前(x 413–459,底边在水线上)一个 46 px 的小道具,画的是进行中那一段在做的事:「准备数据文件夹」一个文件夹,里面的纸一张接一张翻起来(1.5 s);「复制以前的团队」左边一个浅色的旧箱子,右边一个新箱子,中间一条点线:一个箱子从旧的上面被拿起,沿点线往前倾着飞过去,压扁一下落到新箱子上,停一下再淡掉(1.6 s 一趟);「启动本机引擎」两个咬合的齿轮反向转(9 齿和 6 齿,2.7 s 和 1.8 s 一圈,所以一直咬着),整组 1.35 s 鼓一下;「打开团队」三个小成员一个接一个跳一下(1.8 s)。只在那段弧进行中时有:出现用 `SPRING_POP` 从 .6 倍弹到原大、淡入 .2 s,离开淡出 .16 s;没进行中就完成的阶段(一般的首次启动里的数据阶段)不出道具。颜色是 `--bt-ink-deepseek` 和它的淡色,纸和成员的眼睛是 `--bt-card`。道具在水塘里,出卡片时跟着缩小上移;失败、卡片等回答(那段弧不是进行中)和交接时没有。+- 道具:鲸鱼面前(x 413–459,底边在水线上)一个 46 px 的小道具,画的是进行中那一段在做的事:「准备数据文件夹」一个文件夹,里面的纸一张接一张翻起来(1.5 s);「复制以前的团队」左边一个浅色的旧箱子,右边一个新箱子,中间一条点线:一个箱子从旧的上面被拿起,沿点线往前倾着飞过去,压扁一下落到新箱子上,停一下再淡掉(1.6 s 一趟);「启动本机引擎」两个咬合的齿轮反向转(9 齿和 6 齿,2.7 s 和 1.8 s 一圈,所以一直咬着),整组 1.35 s 鼓一下;「打开团队」三个小成员一个接一个跳一下(1.8 s)。只在那段弧进行中时有:出现用 `SPRING_POP` 从 .6 倍弹到原大、淡入 .2 s,离开淡出 .16 s;没人看见就已经完成的阶段也有它的一拍:页面画出来以前就建好的数据文件夹、导入卡等回答或复制进行时就起来的引擎,等轮到它时照样先进行中,道具出来,至少停 420 ms 再画满;真在进行中的阶段不多等。「打开团队」也一样:团队界面在这一段进行中以前就好了(卡片等回答时、或者一下子就加载完),首次启动在交接前先让它进行中 420 ms(首次启动的兜底是 2.5 s,够用)。颜色是 `--bt-ink-deepseek` 和它的淡色,纸和成员的眼睛是 `--bt-card`。道具在水塘里,出卡片时跟着缩小上移;失败、卡片等回答(那段弧不是进行中)和交接时没有。- 圆环、水道、水线、鲸鱼的点击区和涟漪是一块,下面叫水塘。没有卡片时,水塘、鲸鱼的话和提示行整组比有卡片时低 45 px,鲸鱼在窗口的视觉中心稍上一点。要出卡片时,整组用 `SPRING_SHAPE` 上移 45 px,水塘在同一个弹簧里以圆心为准缩到 .62 倍、再上移 60 px,圆环落在卡片上面,卡片出现在下面的纸面里;卡片收回后,水塘回到原大,整组回到低处。位置行不动。页面不能滚动(第 11 节)。- 鲸鱼的话和提示行直接写在 Mica 上。没有卡片时它们在纸面的位置上:纸面空着时点击穿过它。- 卡片是不透明的 `--bt-card`:1 px `--bt-line` 边,圆角 12,内边距 16 × 20。卡片正文比纸面高时,正文在卡片里滚动,按钮行固定在卡片底部。@@ -412,6 +412,7 @@- 2026-11-01 不写字,加道具:用户要求「启动窗口轻易不写文字,除非出现空间不足或者报错,后者并提供一键复制/下载日志的选项」,并且「加载的时候应当有相关组件,例如放在鲸鱼面前一个正在翻动的文件夹,脉冲转动的两个齿轮」。所以去掉 45 秒的两句(「有点久,可能是杀毒软件在查新文件」「比平时慢,请再等一会儿」)、搬数据时的「正在搬 DeepSeek Bot 的数据…」和 45 秒的〔打开日志文件夹〕,慢只靠鲸鱼的姿势;位置行在首次启动也只在盘不够时有(推翻 2026-10-31「首次启动照旧显示」那一条,首次启动在盘够时就没有选位置的入口了);出错的每一页都有〔复制详细信息〕和新的〔保存日志…〕(`saveLog`,系统保存框,最后 5000 行),代替〔打开日志文件夹〕(`openLogs` 不再是启动页的动作);鲸鱼面前加每个阶段的道具:翻纸的文件夹、咬合的齿轮、跳的小成员(第 2、3、4、5、6、7、9、11 节)。另外加了开发用的三种进度画法(`DS_BOT_START_PROGRESS`,第 11 节),只为比较,不给用户。依据:启动页和启动窗口的单元测试;无头 Chrome 加替身桥录的整次启动(浅色、深色)和各阶段、失败页、180 秒、盘不够的截图;减少动态效果时道具和三种画法都没有循环动画。还没有在桌面应用里真机跑,〔保存日志…〕也还没有真点过。这次改的是已定的设计,要维护者确认。- 2026-11-01(待维护者确认):动画只有一个来源。启动窗口的卡片和团队窗口里代替系统对话框的卡片(`app/src/page-card.css`)用同一组颜色和弹簧,都由 `scripts/start-assets.mjs` 从插件的 `themes.js` 和 `motion.js` 生成:卡片出现走 `SPRING_SHAPE`,收起用启动窗口卡片的退场(下沉 6 px、缩到 .975、模糊 3px,.16 s),减少动态效果时只淡入 .12 s、淡出 .16 s(第 9 节)。导入的几张卡(第 6 节)由主进程的 `import-flow.mjs` 发快照,页面照旧只按快照画。- 2026-11-01 交接的露面:在桌面应用里录了交接(真的 Electron 44、真的 `StartWindow`、替身团队页、ffmpeg 60 帧录屏),看到三个问题:长大用 `cubic-bezier(.2,.7,.2,1)`,前 40% 就走完了大半,窗口很早看着就长完了,鲸鱼落下后在一大块空的深色窗口里等 200 多毫秒;主窗口用 `show()` 露面时 Windows 自己的打开过渡压在启动窗口上,有一两帧整窗发灰、鲸鱼和头像错开成两个,然后深色一下跳成浅色;长大前 160 ms 的等待让鲸鱼停在跳的最高点。改成:主窗口在 `ready()` 时就以不透明度 0 显示在启动窗口下面(打开过渡看不见地走完,也不卡长大的第一步);长大 `handoffShow` + 40 ms 开始,260 ms,缓入缓出;鲸鱼长到位 60 ms 后落下,主进程等 `handoffDone` 才让主窗口变成不透明,再把启动窗口 180 ms 淡出,鲸鱼化进头像。减少动态效果和页面没发 `handoffShow` 时不长大,同样淡出。依据:录屏前后对比(首次启动就绪到主窗口露出 1.24 秒带一帧发灰,变成 1.09 秒开始淡、1.29 秒淡完;以后的启动 0.58 秒开始);启动窗口的单元测试(主窗口在 `ready()` 时透明地显示在下面、等落下或 300 ms、淡出后才给焦点、失败时收回)。Mica 窗口用 `setOpacity` 淡出在 Windows 11 上正常。+- 2026-11-02 每段都有它的一拍:答〔先不复制〕的录屏里看不到齿轮,引擎在卡片等回答时就预热好了,答完圆环直接跳到「打开团队」。第 2 节:没人看见就完成的阶段(不只是数据文件夹)轮到时照样进行中至少 420 ms、道具出来再画满,首次启动的「打开团队」在交接前也一样。- 2026-11-02 先三段,答了再变四段:用户看了四段的录屏,说预想的是「一开始是3条,第一条转完扫出来问要不要,要的话跳上去,重新排布为4条,并开始导入,搬箱子动画优化一下,不要的话继续3条启动」。第 2 节:每次启动都从三段开始,复制开始时才长出复制那一段,其他三段让位,复制停下就缩回三段;搬箱子的道具重画(旧箱子、新箱子和点线,箱子倾着飞、压扁落下)。第 6 节:导入卡等第一段画满才出来,答之前圆环停在第一段;圆点落在第一段后面的空隙。- 2026-11-02 导入并进圆环:用户看了导入的录屏,要求「尽可能减少,导入改为一个进度条点击后向上跳转变形将(3段圆环改为四段圆环」。第 2 节:从 DSH 复制团队的首次启动圆环四段,多出「复制以前的团队」,按复制的真实进度画满,复制时道具是搬箱子,预热的引擎为复制停下时引擎那一段回到没开始;其他启动仍三段。第 6 节:导入卡只剩一行和两个按钮,大小、模型设置、勾选框和脚注收进「详细」,找到的名字、段数、会复制什么去掉;「正在搬过来」的分步卡去掉,〔复制过来〕后卡片缩成一个点跳进复制那一段;停止复制改成圆环下的图标按钮加一张确认卡;复制失败那一段变红。第 9 节:减少动态效果时卡片不飞。不到 1 MB 写「不到 1 MB」。依据:桌面应用里对着替身 DSH 家录的导入(`app/dist-recordings/`,不进仓库)。