Files
DemonGatanjieuandClaude Opus 5.5 54facc44c1 Record the 1.63 standard exam and fix two things it found
Gemini 3.8 Flash took all 8 standard questions the 1.63 way (the
question in the task's message, the new task page's sentence to the
AI, a blank canvas each): 128 calls, 16% failed (21% last time), no
detours. Written into docs/architecture/tool-exam.md.

- A task's picture count counted a picture twice when the AI's report
  showed the one its run had made; pictures are counted once each now.
- After a switch of language the AI workbench kept rows drawn in the
  old one until a reload: syncRows makes a row again when the language
  it was drawn in is not the one shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 19:18:06 +08:00

34 lines
1.5 KiB
JavaScript

import assert from 'node:assert/strict';
import { syncRows } from '../web/modules/sync_rows.js';
// A list's children as the page has them: enough of the DOM for syncRows.
function parent() {
const list = {
children: [],
insertBefore(node, before) {
if (node.parent) node.parent.children.splice(node.parent.children.indexOf(node), 1);
node.parent = list;
const at = before ? list.children.indexOf(before) : -1;
list.children.splice(at < 0 ? list.children.length : at, 0, node);
},
};
return list;
}
let made = 0;
const row = (key) => ({ key, make: () => ({ dataset: {}, name: `${key} ${++made}`, remove() { this.parent.children.splice(this.parent.children.indexOf(this), 1); } }) });
const list = parent();
globalThis.anomalous_browser_lang = 'zh';
syncRows(list, [row('a'), row('b')]);
const [a, b] = list.children;
syncRows(list, [row('b'), row('a'), row('c')]);
assert.deepEqual(list.children.map(node => node.name), ['b 2', 'a 1', 'c 3'], 'rows with the same key are kept and moved');
syncRows(list, [row('a')]);
assert.deepEqual(list.children, [a], 'rows no longer asked for go');
globalThis.anomalous_browser_lang = 'en';
syncRows(list, [row('a'), row('b')]);
assert.equal(list.children.length, 2);
assert.notEqual(list.children[0], a, 'a row drawn in the other language is made again');
assert.notEqual(list.children[1], b);
console.log('sync_rows: kept rows, moved rows and a switch of language passed');