[art] BoardV2: Prompts lead with the look, say the grid in words, and stop naming the book's motifs

This commit is contained in:
2026-11-07 15:38:30 +01:00
parent e415d1ed29
commit 5f2a5f3cfc
3 changed files with 173 additions and 125 deletions
+50 -21
View File
@@ -11,10 +11,16 @@ const allPrompts = data.assets.flatMap((a) => [a.prompt, ...(a.cells ?? []).map(
describe('STYLE.md', () => {
it('§1 is the quoted system prompt, line breaks kept and the markers gone', () => {
expect(style.startsWith('Soft, hand-made 2D storybook illustration painted in matte gouache')).toBe(true);
expect(style.startsWith('A hand-painted picture in opaque, matte gouache on warm off-white paper')).toBe(true);
expect(style).toContain('\n');
expect(style).not.toMatch(/^>/m);
expect(style.endsWith('book, illustrator or film.')).toBe(true);
expect(style.endsWith('in the manner of no existing artist, book or film.')).toBe(true);
});
it('§1 says the look positively and asks for grown-ups, not a sticker (the 2026-11-07 rewrite)', () => {
for (const words of ['dry-brush', 'paper showing through', 'plum-brown', 'from the left', 'for grown-ups', 'never a children\'s sticker', 'painted directly on them', 'Not watercolour']) {
expect(style.replace(/\n/g, ' ')).toContain(words);
}
});
it('§7 has the ten review points, a point split over two lines read as one', () => {
@@ -31,13 +37,28 @@ describe('STYLE.md', () => {
});
describe('the prompts', () => {
it('every one starts with STYLE.md §1 word for word: 18 cards and 45 one-at-a-time prompts', () => {
expect(allPrompts).toHaveLength(18 + 45);
for (const p of allPrompts) expect(p.startsWith(style + '\n\nAsset: ')).toBe(true);
it('every one starts with STYLE.md §1 word for word, then says what to make: 35 cards and 66 one-at-a-time prompts', () => {
expect(allPrompts).toHaveLength(35 + 66);
for (const p of allPrompts) expect(p.startsWith(style + '\n\nMake: ')).toBe(true);
});
it('every one carries the shared avoid list, so the likeness guard is never left out', () => {
for (const p of allPrompts) expect(p).toMatch(/Must avoid: .*a glass dome or bell jar; a folding screen; a tiny round planet/);
it('every one ends with the shared avoid list and its board id', () => {
const shared = readManifest().avoid.join('; ');
for (const a of data.assets) {
expect(a.prompt).toContain(shared);
expect(a.prompt.endsWith(`\nBoard id: ${a.id}`)).toBe(true);
for (const c of a.cells ?? []) expect(c.prompt.endsWith(`\nBoard id: ${c.id} (one picture of ${a.id})`)).toBe(true);
}
});
it("never names the book's motifs, even to forbid them: naming one invites it; review checks them instead", () => {
const motifs = /glass dome|bell jar|folding screen|tiny round planet|scarf|desert|golden hair|wheat/i;
for (const p of allPrompts) expect(p).not.toMatch(motifs);
expect(data.checklist[3]).toMatch(/glass dome, screen, tiny planet, desert, child or scarf/);
});
it('carries no pixel coordinates a generator cannot use; the grid is said in words', () => {
for (const p of allPrompts) expect(p).not.toMatch(/starts at \(|safe box|Cut lines|centre the drawing on/);
});
it('none names the book, Tolkien, or a medical or unnamed word', () => {
@@ -47,26 +68,35 @@ describe('the prompts', () => {
it('a rose picture asks for the rose sheet as its reference; the sheet itself does not', () => {
const by = new Map(data.assets.map((a) => [a.id, a]));
expect(by.get('rose-sheet')?.attach).toEqual([]);
expect(by.get('rose-sheet')?.prompt).not.toContain('Attach the character sheet');
for (const id of ['rose-stages-sheet', 'rose-care-sheet', 'rose-moments-sheet', 'app-icon']) {
expect(by.get('rose-sheet')?.prompt).not.toContain('Reference:');
for (const id of ['rose-stages-sheet', 'rose-care-sheet', 'rose-moments-sheet', 'rose-touch-sheet', 'app-icon', 'app-icon-maskable']) {
expect(by.get(id)?.attach).toEqual(['rose-sheet']);
expect(by.get(id)?.prompt).toContain('Attach the character sheet rose-sheet as the reference picture');
expect(by.get(id)?.prompt).toContain('Reference: attach the image rose-sheet');
}
for (const id of ['care-props-sheet', 'favicon-mark', 'letter-header']) expect(by.get(id)?.attach).toEqual([]);
});
it('every rose prompt puts her face on the petals, never on a round head', () => {
for (const a of data.assets.filter((x) => x.attach.includes('rose-sheet') || x.id === 'rose-sheet')) {
for (const p of [a.prompt, ...(a.cells ?? []).map((c) => c.prompt)]) {
expect(p).toContain('Her face is painted directly on the inner petals');
expect(p).toContain('There is no round face, ball or bare patch inside the petals');
}
}
expect(by.get('care-props-sheet')?.attach).toEqual([]);
});
it('a fox picture asks for the fox sheet, never the rose sheet, and every one-at-a-time fox prompt does too', () => {
const by = new Map(data.assets.map((a) => [a.id, a]));
expect(by.get('fox-sheet')?.attach).toEqual([]);
for (const id of ['fox-trust-sheet', 'fox-moments-sheet']) {
for (const id of ['fox-trust-sheet', 'fox-moments-sheet', 'foxes-meeting']) {
const a = by.get(id);
expect(a?.attach).toEqual(['fox-sheet']);
for (const p of [a?.prompt ?? '', ...(a?.cells ?? []).map((c) => c.prompt)]) {
expect(p).toContain('Attach the character sheet fox-sheet as the reference picture');
expect(p).toContain('Reference: attach the image fox-sheet');
expect(p).not.toContain('rose-sheet');
}
}
for (const id of ['berries-sheet', 'berry-bush-sheet', 'paths-sheet', 'lanterns-sheet']) expect(by.get(id)?.attach).toEqual([]);
for (const id of ['berries-sheet', 'berry-bush-sheet', 'paths-sheet', 'lanterns-sheet', 'visitors-sheet', 'planet-king']) expect(by.get(id)?.attach).toEqual([]);
});
it('a manifest with a forbidden name never reaches the board', () => {
@@ -91,13 +121,12 @@ describe('the grid', () => {
}
});
it("a sheet's prompt gives each cell the numbers cellBoxes computes", () => {
it("a sheet's prompt says its grid in words and lists its pictures in reading order", () => {
const props = data.assets.find((a) => a.id === 'care-props-sheet');
expect(props?.prompt).toContain('Cut lines down the image at x = 512, 1024. Cut lines across the image at y = 512.');
expect(props?.prompt).toContain('- Cell 5, petal-folded: starts at (512, 512), ends at (1024, 1024); centre the drawing on (768, 768); safe box x 573–963, y 573–963.');
expect(props?.prompt).toContain('Layout: 3 columns × 2 rows of equal, invisible cells, read left to right, top row first.');
expect(props?.prompt).toContain('\n5. one large rose petal folded over itself');
const stages = data.assets.find((a) => a.id === 'rose-stages-sheet');
expect(stages?.prompt).toContain('each 384 × 1024 px');
expect(stages?.prompt).not.toContain('Cut lines across');
expect(stages?.prompt).toContain('Layout: 4 columns × 1 row of equal');
});
it('a tall cell made on its own is made on the tall canvas, a square one on the square', () => {
@@ -105,7 +134,7 @@ describe('the grid', () => {
expect(soloCanvas(m.assets.find((a) => a.id === 'rose-stages-sheet')!)).toEqual({ width: 1024, height: 1536 });
expect(soloCanvas(m.assets.find((a) => a.id === 'care-props-sheet')!)).toEqual({ width: 1024, height: 1024 });
const bud = data.assets.find((a) => a.id === 'rose-stages-sheet')?.cells?.[0];
expect(bud?.prompt).toContain('Canvas: 1024 × 1536 px, fully transparent background. One subject, centred on (512, 768)');
expect(bud?.prompt).toContain('This picture: a tight bud');
expect(bud?.prompt).toContain('Canvas: 1024 × 1536 px, transparent background. One subject, whole and centred');
expect(bud?.prompt).toContain('Subject: a tight bud');
});
});