[art] GardenerLayers: The gardener in layered parts, painted over one guide in register, checked on accept
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { findForbidden } from '@rosea/content';
|
||||
import { boardData } from '../src/board.js';
|
||||
import { expandLayers } from '../src/manifest.js';
|
||||
import { cellBoxes, cutLines, soloCanvas } from '../src/prompt.js';
|
||||
import { reviewPoints, stylePrompt } from '../src/style.js';
|
||||
import { clone, readManifest, readStyle } from './fixtures.js';
|
||||
|
||||
const style = stylePrompt(readStyle());
|
||||
const data = boardData(readManifest(), readStyle());
|
||||
const allPrompts = data.assets.flatMap((a) => [a.prompt, ...(a.cells ?? []).map((c) => c.prompt)]);
|
||||
// A layer's pictures have no prompts of their own (STYLE.md §3b): their prompt is ''.
|
||||
const allPrompts = data.assets.flatMap((a) => [a.prompt, ...(a.cells ?? []).map((c) => c.prompt)]).filter((p) => p !== '');
|
||||
|
||||
describe('STYLE.md', () => {
|
||||
it('§1 is the quoted system prompt, line breaks kept and the markers gone', () => {
|
||||
@@ -23,9 +25,10 @@ describe('STYLE.md', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('§7 has the twelve review points, a point split over two lines read as one', () => {
|
||||
it('§7 has the thirteen review points, a point split over two lines read as one', () => {
|
||||
const points = reviewPoints(readStyle());
|
||||
expect(points).toHaveLength(12);
|
||||
expect(points).toHaveLength(13);
|
||||
expect(points[12]).toBe('A gardener layer holds only its part, in register with the guide: stacked with the other layers of a look, it makes one child, with nothing doubled, missing or shifted.');
|
||||
expect(points[8]).toBe("It reads as one young red-orange fox with a cream mask and a ringed tail, shy and gentle, and nothing like the book's sandy, long-eared fox.");
|
||||
expect(points[3]).toBe('Nothing from the book: no glass dome, screen, tiny planet, desert, child or scarf, and no look of its drawings.');
|
||||
});
|
||||
@@ -37,18 +40,19 @@ describe('STYLE.md', () => {
|
||||
});
|
||||
|
||||
describe('the prompts', () => {
|
||||
it('every one starts with STYLE.md §1 word for word, then says what to make: 40 cards and 74 one-at-a-time prompts', () => {
|
||||
expect(allPrompts).toHaveLength(40 + 74);
|
||||
it('every one starts with STYLE.md §1 word for word, then says what to make: 95 cards (55 of them gardener layers) and 74 one-at-a-time prompts', () => {
|
||||
expect(data.assets.filter((a) => a.over)).toHaveLength(55);
|
||||
expect(allPrompts).toHaveLength(95 + 74);
|
||||
for (const p of allPrompts) expect(p.startsWith(style + '\n\nMake: ')).toBe(true);
|
||||
});
|
||||
|
||||
it('every one ends with the shared avoid list and its board id', () => {
|
||||
const m = readManifest();
|
||||
const m = expandLayers(readManifest());
|
||||
for (const a of data.assets) {
|
||||
const allowed = m.assets.find((x) => x.id === a.id)?.allow ?? [];
|
||||
expect(a.prompt).toContain(m.avoid.filter((l) => !allowed.includes(l)).join('; '));
|
||||
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);
|
||||
for (const c of (a.cells ?? []).filter((x) => x.prompt !== '')) expect(c.prompt.endsWith(`\nBoard id: ${c.id} (one picture of ${a.id})`)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user