{
 "notes": "EPISODE 4 of 5. STATE FOUND: trunk null, nothing has landed in three episodes. paint-foundation's 10 items were all accepted and all say the same thing: the checkout was the empty commit, the baseline was missing, so each stopped and changed nothing (wave: nothing to merge). No image model was called, so whether workers can reach one is still unknown. Episode 3's target batch was refused because one target was 8,152 characters once goal, brief, check and scope were filled (limit 8,000); its reads and wake fell with it. 10 of 50 items used.\n\nDECIDED: one code TARGET batch, kekborn-v2-build, 33 targets, attempts 3, the whole pipeline ordered by `needs`. Nothing else: no reads, no cancel, no children. Wake on it, or after 1,440 minutes.\n\nWHY ONLY THAT: (1) a refused decision seems to start the next episode at once (episode 3 began while paint-foundation's items still waited), and episode 5 is the last, so this file holds nothing that could be refused apart from the batch itself. Results of a code batch are handed without asking, so no `read`. (2) A child that ends or is refused also wakes the next episode, which would burn episode 5 while the batch runs, so none of the 10 prepaid media children is opened now.\n\nSIZES (measured): objective 2,869 chars; filled briefs under 2,300; checks under 500; objective+brief+check+scope+needs at most 5,434 a target; variables under 1,000; at most 16 scope patterns and 16 needs. Wording asks for nothing a command wrote and for no exact copying of text, since two earlier batches were refused by that screen.\n\nBASELINE (cloned and run this episode): https://github.com/identity-md-launches/goal-3401-create-kekborn-portrait-style at 9ab5835fd20d740eafc029416b163dce239d55f8: 153 files, 80 layer PNGs all 2048x2560 RGBA8 (largest 4.6 MB), plain Node, `node --test test/*/*.test.cjs` passes 51 tests in about 35 s. test/raster/foundation.test.cjs pins the sha256 of moss.png and frames/common.png from catalog/foundation.json. Every check of the batch was tried under sh on this clone: each fails on an unchanged layer and passes on a changed one.\n\nTHE 33 TARGETS (key: scope; needs):\n- bootstrap: imports the 153 files and writes provenance/baseline.json {commit, files:{path: sha256}}; none.\n- guide: style-guide.md v2 with sections 'Locked prompt' and 'Negative prompt' (texts I supplied), Court black #16120F, Cream #E9DFC6; bootstrap.\n- contract: docs/painting.md, seven painter rules; bootstrap.\n- master: template/master-reference.png (+.json), layers/skins/moss.png, catalog/foundation.json, provenance/master.json; bootstrap, guide, contract. The first real test of image-model access.\n- compositor: src/compositor/**, test/compositor/**: `tone` (3x4 matrix on a skin), `skinPaint` (a PNG drawn beneath an asset after recolouring by the skin's tone), `explicitOnly`; bootstrap.\n- finish: src/raster/**: glaze, brush texture, varnish, craquelure, frame shadow in raster.finish(image, seed); bootstrap.\n- harmonise: bin/harmonise.cjs (request, apply), src/harmonise/**, test/harmonise/**; strength 0.22, at most 0.30, fixed seed 1536, blend inside the aperture only; bootstrap, guide.\n- approval: tools/**, src/jpeg/**, test/approval/**: preview, sheet, manifest, verify; bootstrap.\n- skins (lichen, peat, slate, ivory rare, oxblood rare, each with tone in catalog/skin-<name>.json); bootstrap, master, compositor.\n- eyes (8, layers/eyes/**); bootstrap, master.\n- expr-a (melancholy, smug, serene), expr-b (paranoid-side-eye, startled), expr-c (dim-grin, scowl), expr-d (regal, sly, weeping): each <name>.png and <name>.skin.png; bootstrap, master, compositor.\n- attire-scholar, attire-antiquary, attire-knight-artisan, attire-seer, attire-council: layers/attire/<cat>/** and catalog/attire-<cat>.json; bootstrap, master.\n- tier-common, tier-uncommon, tier-rare, tier-epic, tier-legendary: headwear, regalia, frame and the tier's catalog files (tier-common also the common frame's hash in catalog/foundation.json); bootstrap, master.\n- backdrops (5), banners (3), heraldry (18 value maps, alpha kept); bootstrap, guide, contract.\n- catalog: catalog/expressions-court.json and -gaze.json with the ten ids plus explicitOnly legacy ids (wistful to melancholy, resolute to regal, amused to sly, dubious to weeping), deletes the four old PNGs; needs compositor, eyes, the four expr targets, skins.\n- integrate: test/library/**, README.md, provenance/integration.json; needs bootstrap, catalog, finish and all 13 attire, tier, backdrop, banner and heraldry targets (16 needs, the limit).\n- previews-a (01-04), previews-b (05-08), previews-c (09-12): samples/NN-plain.jpg, NN-harmonised.jpg, NN.json; need integrate, harmonise, approval, compositor.\n- package: contact-sheet.jpg and manifest.json; needs the three previews and approval. Last, because any later byte stales the manifest.\nEach painter writes provenance/<key>.json (model, settings, seed, what it saw) and is told to change nothing if no image model answers.\n\nWEAKNESS TO KNOW: previews wait on integrate, and integrate on every painter, so one painter stuck after three attempts stops previews, sheet and manifest. A target batch has no way to wait for a target that failed.\n\nEPISODE 5, the last counted one:\n1. Read goal.json first: refusals, the batch's board (landed, stuck, open, notes), items used. If the batch was refused, read why, mend exactly that and send it again under a new name (the generator's shape is described above); that is the only useful decision then.\n2. If it ran, clone the trunk goal.json names into test/scratch/ and LOOK: run `node --test test/*/*.test.cjs` and `node tools/approval.cjs verify`; turn contact-sheet.jpg and several samples/*.jpg into small images and view them; read provenance/master.json, provenance/integration.json and a few painters' files for the model each used. Checks only prove files changed, decode at 2048x2560, stay under 7.9 MB and tests pass; they do not prove an image model painted anything or that it looks right: judge by eye.\n3. If package landed and the sheet is fit to show, set finish true. In the write-up state plainly what the owner is approving, what is weak, and that owner approval has not been given.\n4. If master is stuck for want of an image model, every painter is stuck behind it and the goal as written cannot be met by code items: say so, with what the workers reported. Then the media children are worth opening: a `job.open` create-image order for the master bust from the locked prompt would give a real painting to register, which needs another episode to use.\n5. If painters landed but some are stuck, spawn a small target batch (about 7 items are left): the stuck painters again with their notes, or previews and package without them, since the baseline layer of any slot still renders. Do not set finish while it runs.\n6. Children: 10 media bought, 0 opened. A goal about to be written up with children unopened is given one more episode with a budget.unspent wake. Use it to finish after a repair batch, and say why the children stay unopened if they do: a child is built from its order's words alone and cannot read the trunk, so it cannot paint registered layers or render the compositor's samples.\n\nDESIGN DECISIONS (keep): face layering is skin (bust with opaque dark socket beds, lipless muzzle), eyes (fill the sockets, no lids), expression (<name>.skin.png in moss colours recoloured by the skin's tone, plus <name>.png with lips, teeth, tears, glazes). Wearables and props are inpainted on template/master-reference.png and cut out. Full-size masters are never committed; previews are 1024x1280 JPEG quality 90 under 4,000,000 bytes, every file under 8,000,000. Schema kekborn-assets@1, accepted rarities, ivory and oxblood rare.\n\nNothing was deployed, minted or spent. Owner approval of the contact sheet is the purpose of the goal and has not been given.",
 "spawn": [
  {
   "name": "kekborn-v2-build",
   "mode": "code",
   "targets": {
    "attempts": 3
   },
   "brief": "Kekborn portraits v2: this repository's code-drawn layer PNGs are being repainted by an image model as one Tudor court oil painting, then rendered for owner approval. Plain Node, no dependencies. Read style-guide.md, docs/painting.md and earlier runs' notes first. Your target: {{task}} {{detail}} Change only files in your scope; throwaway work goes in test/scratch/. No new dependency, no submodule, every file under 7.9 MB; deploy, mint and spend nothing; copy no existing artwork. Paint only with an image model, never with drawing code; if none answers, change nothing and say what stopped you. In your result say in your own words what you made, each file written or removed, the model and settings, what you saw looking at it, and what is undone.",
   "items": [
    {
     "key": "bootstrap",
     "vars": {
      "task": "Import the baseline (no painting here). Copy every tracked file of https://github.com/identity-md-launches/goal-3401-create-kekborn-portrait-style at commit 9ab5835fd20d740eafc029416b163dce239d55f8 into this repository unchanged, at the same paths: 153 files under bin, catalog, docs, layers, sample-inputs, src, template, test and tools, and style-guide.md. Leave no .git folder or submodule of it.",
      "detail": "Then write provenance/baseline.json as {\"commit\": \"<that commit>\", \"files\": {\"<path>\": \"<sha256 hex>\"}} with one entry for every imported file; later checks read files[path] to tell a repainted layer from an imported one. node --test test/*/*.test.cjs passes all 51 tests on the import."
     },
     "scope": [
      "bin/**",
      "catalog/**",
      "docs/**",
      "layers/**",
      "sample-inputs/**",
      "src/**",
      "template/**",
      "test/**",
      "tools/**",
      "style-guide.md",
      "provenance/baseline.json"
     ],
     "needs": [],
     "check": "test -f layers/skins/moss.png && test -f sample-inputs/12.json && node -e \"require('./provenance/baseline.json').files['layers/skins/moss.png']=='98b4c9283db6896b61642a6b7cbb43645aaa644858d8e1fbc550b2c5a44b44bd'||process.exit(1)\" && node --test test/*/*.test.cjs"
    },
    {
     "key": "guide",
     "vars": {
      "task": "Rewrite style-guide.md as v2 (no painting here). Keep its grid, landmarks, reserves, layer stack and palette numbers; replace what describes the old flat look with the v2 look and its own face design, which copies no existing frog character or painting. Add Court black #16120F and Cream #E9DFC6 to the palette, name template/bust.svg and template/master-reference.png as the bust template, and add sections 'Locked prompt' and 'Negative prompt' holding the two texts below unchanged; every layer and portrait is painted from them unchanged, with only a layer suffix added.",
      "detail": "Locked prompt: Hand-painted 16th-century Tudor court oil portrait on oak panel of an anthropomorphic frog noble, half-length, three-quarter view facing left, 4:5. Own character design: large heavy-lidded eyes with clear irises, wide mouth with full muted-red lips, smooth green skin, very expressive. Visible brushstrokes, impasto on jewels and gold thread, glazed shadows, soft light from upper left, warm varnish, fine craquelure. Brocade and damask doublets, slashed sleeves, fur trim, pearl and gem chains, velvet hats. Deep greens, oxblood, black, ochre, cream, gold leaf. Dark damask backdrop with a heraldic banner. Negative prompt: photograph, 3D render, vector art, flat digital colour, cel shading, cartoon outline, anime, pixel art, airbrush, neon colour, modern dress, text, signature, watermark, human face, extra eyes or limbs, facing right, front view, any existing frog meme character, any recognisable existing painting."
     },
     "scope": [
      "style-guide.md"
     ],
     "needs": [
      "bootstrap"
     ],
     "check": "grep -q \"Locked prompt\" style-guide.md && grep -q \"Negative prompt\" style-guide.md && grep -q 16120F style-guide.md && grep -q heavy-lidded style-guide.md && node --test test/approval/*.test.cjs"
    },
    {
     "key": "contract",
     "vars": {
      "task": "Write docs/painting.md, the contract every painter of this goal follows (no painting here). State these rules, numbered, each with its reason: 1 Paint with an image model from the style guide's locked and negative prompts plus a layer suffix; never draw a layer by code. 2 Every layer is a 2048x2560 straight-alpha RGBA8 PNG that src/raster decodePNG reads, under 7.9 MB (soften noise, recompress; fine texture comes from the finishing pass), with no varnish, craquelure, vignette or frame shadow baked in. 3 Light from the upper left everywhere.",
      "detail": "4 Attire, headwear, regalia and props are inpainted onto template/master-reference.png, then cut out to a soft-edged transparent layer holding none of the bust; hands are gloved. 5 Face: the skin is the bust with opaque dark socket beds and a lipless muzzle; eyes fill the sockets, no lids; an expression is <name>.skin.png (lids, brow, cheeks in moss skin colours, recoloured per skin by the compositor) plus <name>.png (lips, teeth, tears, shadow glazes). 6 The registration in style-guide.md and template/master-reference.json holds on every layer. 7 Each painter writes provenance/<target>.json: model, settings, seed, prompt suffix, edit reference, cut-out method, each file's bytes and sha256, and what a preview-size render showed."
     },
     "scope": [
      "docs/painting.md"
     ],
     "needs": [
      "bootstrap"
     ],
     "check": "grep -q master-reference docs/painting.md && grep -q skin.png docs/painting.md && grep -q provenance docs/painting.md && grep -q decodePNG docs/painting.md"
    },
    {
     "key": "master",
     "vars": {
      "task": "Paint the master bust, which every other layer hangs on. With an image model, from the locked prompt, paint the moss-green frog noble's bare bust (head, neck, plain shoulders; no clothes, hat or jewels) with a calm face on a plain dark ground, registered to the grid: far eye centre (680,936), near eye (1040,912), crown seat (969,680), inside the frame aperture, facing left. Save it opaque as template/master-reference.png, and write template/master-reference.json with the measured boxes of the head, each eye socket (the eyes are large), the mouth, the neck and the shoulders.",
      "detail": "Then edit it with the model into layers/skins/moss.png: both sockets repainted as opaque dark umber beds (darker than RGB 80,65,60 at the eye centres), the muzzle smooth with no lips, everything outside the bust transparent, alpha 0 at (969,680) and 255 at (969,720). Put its new sha256 in catalog/foundation.json. Render sample 01 and look: it must read as a Tudor oil painting with a Pepe-like face of its own design. Write provenance/master.json."
     },
     "scope": [
      "template/master-reference.png",
      "template/master-reference.json",
      "layers/skins/moss.png",
      "catalog/foundation.json",
      "provenance/master.json"
     ],
     "needs": [
      "bootstrap",
      "guide",
      "contract"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" '' layers/skins/moss template/master-reference && test -s template/master-reference.json && test -s provenance/master.json && node --test test/raster/foundation.test.cjs"
    },
    {
     "key": "compositor",
     "vars": {
      "task": "Extend the compositor for the painted face (code only, no painting). In src/compositor: (a) a skin asset may carry `tone`, a 3x4 matrix mapping moss RGB (0..255, with a constant column) to that skin's RGB; (b) any asset may carry `skinPaint`, the path of a PNG drawn just beneath the asset's own PNG after its RGB is passed through the chosen skin's tone (alpha kept; no tone leaves it unchanged); (c) an asset with `explicitOnly: true` is never drawn by chance, only when an input names it; (d) the render record lists each skinPaint file with its sha256.",
      "detail": "A malformed tone or a missing skinPaint file is an E_CATALOG error. Add fixture tests for each in test/compositor, keep every existing test and the bin/render.cjs usage as they are, and document the fields in docs/render.md. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "src/compositor/**",
      "test/compositor/**",
      "bin/render.cjs",
      "docs/render.md"
     ],
     "needs": [
      "bootstrap"
     ],
     "check": "grep -rq skinPaint src/compositor && grep -rq explicitOnly src/compositor && grep -rq tone test/compositor && grep -q skinPaint docs/render.md && node --test test/*/*.test.cjs"
    },
    {
     "key": "finish",
     "vars": {
      "task": "Extend the finishing pass, raster.finish(image, seed) in src/raster/index.cjs, so the stacked layers read as one oil painting (procedural code; no image model, no layer painting). In this order: a warm glaze that deepens the shadows; a seeded brush-texture overlay (canvas weave and stroke relief, moving lightness a few percent); the warm varnish; fine craquelure; the frame's inner shadow from the upper-left rails. Only where paint already is; the same seed gives the same bytes; the two-argument call keeps working; a 2048x2560 pass takes under about ten seconds.",
      "detail": "Export the strengths as named constants, write docs/finish.md (order, strengths, why), and extend test/raster/finish.test.cjs: the same seed repeats, each stage changes pixels measurably, transparent pixels stay untouched, the rails keep their shadow rule. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "src/raster/**",
      "test/raster/finish.test.cjs",
      "test/raster/core.test.cjs",
      "docs/finish.md"
     ],
     "needs": [
      "bootstrap"
     ],
     "check": "test -s docs/finish.md && grep -qi glaze src/raster/index.cjs && grep -qi brush src/raster/index.cjs && grep -qi glaze test/raster/finish.test.cjs && node --test test/*/*.test.cjs"
    },
    {
     "key": "harmonise",
     "vars": {
      "task": "Add the optional harmonisation pass (code only, no layer painting). bin/harmonise.cjs has two commands. `request <plain.png> <request.json>` writes what an image-to-image model must be given: the locked and negative prompts read from style-guide.md, strength 0.22 (never above 0.30), the fixed seed 1536, and the frame aperture box. `apply <plain.png> <model.png> <out.png>` takes the model's output for that request, requires 2048x2560, and blends it over the plain render inside the aperture only, at a weight feathered to zero at the rails, so frame, plaque and rail arms stay byte-identical.",
      "detail": "Put the logic in src/harmonise/, offline tests in test/harmonise/ (a stand-in model image; rails untouched, the strength limit enforced, the same inputs give the same bytes), and write docs/harmonise.md: how to run a model on a request, and that plain rendering never needs one. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "bin/harmonise.cjs",
      "src/harmonise/**",
      "test/harmonise/**",
      "docs/harmonise.md"
     ],
     "needs": [
      "bootstrap",
      "guide"
     ],
     "check": "test -s docs/harmonise.md && test -f bin/harmonise.cjs && test -d src/harmonise && ls test/harmonise/*.test.cjs && node --test test/*/*.test.cjs"
    },
    {
     "key": "approval",
     "vars": {
      "task": "Rework the approval tooling for v2 (code only). tools/approval.cjs gains: `preview <master.png> <out.jpg>`, a 2048x2560 PNG box-averaged to a 1024x1280 baseline JPEG at quality 90; `sheet`, which reads samples/NN-plain.jpg and samples/NN-harmonised.jpg for 01 to 12 and writes contact-sheet.jpg, four columns by three rows, each cell the plain portrait beside the harmonised one with its number drawn on it; `manifest`, which writes manifest.json with the path, bytes and sha256 of every file but itself; `verify`, which fails on a missing, extra or changed file, a preview that is not 1024x1280, a missing sheet, a preview or sheet of 4,000,000 bytes or more, or any file of 8,000,000 or more.",
      "detail": "Both walks skip root entries whose names start with a dot, and artifacts/, node_modules/, out/ and test/scratch/. Write or vendor with its licence, as plain files in src/jpeg/, a pure-JS JPEG encoder and decoder. Keep test/approval/sample-inputs.test.cjs passing without weakening it, test the new commands in test/approval/, rewrite docs/approval.md. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "tools/**",
      "src/jpeg/**",
      "test/approval/**",
      "docs/approval.md"
     ],
     "needs": [
      "bootstrap"
     ],
     "check": "test -d src/jpeg && grep -q contact-sheet.jpg tools/approval.cjs && grep -q harmonised tools/approval.cjs && grep -q preview docs/approval.md && node --test test/*/*.test.cjs"
    },
    {
     "key": "skins",
     "vars": {
      "task": "Paint the five other skins from the master: lichen (pale grey-green), peat (dark brown-green), slate (blue-grey), ivory (rare, pale cream) and oxblood (rare, deep red-brown). For each, repaint layers/skins/moss.png with the image model at low strength, so brushwork, socket beds, lipless muzzle, outline and alpha stay registered and only the skin colour and its glazes change, and write layers/skins/<name>.png.",
      "detail": "For each, fit a 3x4 `tone` matrix (least squares, from moss RGB with a constant term to that skin's RGB, over the opaque skin outside the sockets) and store it on the skin's entry in catalog/skin-<name>.json, keeping id, slot, path, schema kekborn-assets@1 and rarity (ivory and oxblood rare, the others common). Render one sample per skin and look: each face stays as readable as moss. Write provenance/skins.json."
     },
     "scope": [
      "layers/skins/lichen.png",
      "layers/skins/peat.png",
      "layers/skins/slate.png",
      "layers/skins/ivory.png",
      "layers/skins/oxblood.png",
      "catalog/skin-lichen.json",
      "catalog/skin-peat.json",
      "catalog/skin-slate.json",
      "catalog/skin-ivory.json",
      "catalog/skin-oxblood.json",
      "provenance/skins.json"
     ],
     "needs": [
      "bootstrap",
      "master",
      "compositor"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" layers/skins/ lichen peat slate ivory oxblood && grep -q tone catalog/skin-ivory.json && test -s provenance/skins.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "eyes",
     "vars": {
      "task": "Paint the eight eye layers into the master's sockets. Inpaint on template/master-reference.png with the image model: large wet eyeballs filling each socket measured in template/master-reference.json, a clear luminous iris, a dark pupil, a catch-light from the upper left, and no eyelids (expressions paint the lids). Seven share one gaze, toward the viewer's left, and differ in iris colour: amber, brass, hazel, olive, sienna, silver, umber. side-eye has both irises pushed hard to one side, for the paranoid look.",
      "detail": "Cut each out to layers/eyes/<name>.png: only the eyeballs, soft-edged, a few pixels larger than the socket so no bed shows, everything else transparent. Keep catalog/eyes.json valid with the same eight ids. Render the eyes on moss and look at preview size. Write provenance/eyes.json."
     },
     "scope": [
      "layers/eyes/**",
      "catalog/eyes.json",
      "provenance/eyes.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" eyes && test -s provenance/eyes.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "expr-a",
     "vars": {
      "task": "Paint these expressions: melancholy, smug, serene. Each must differ strongly from the others at preview size and is two registered layers painted with the image model on template/master-reference.png: layers/expressions/<name>.skin.png holds the heavy eyelids, brow, cheek and muzzle modelling in moss skin colours (the compositor recolours it per skin), and layers/expressions/<name>.png holds the full muted-red lips, mouth interior, teeth, tears and shadow glazes. Lids sit over the eye layers and leave the irises readable; the mouth is wide and fully painted; nothing else of the bust is in either layer.",
      "detail": "melancholy: lids low, brows lifted at the centre, mouth drawn down, gaze cast down. smug: one lid lower than the other, a closed lopsided smirk, chin up. serene: lids half closed, a soft closed smile, relaxed cheeks. Try each with a throwaway catalog entry carrying `skinPaint` in test/scratch/, on moss and on one other skin, and look. Write provenance/expr-a.json."
     },
     "scope": [
      "layers/expressions/melancholy.png",
      "layers/expressions/melancholy.skin.png",
      "layers/expressions/smug.png",
      "layers/expressions/smug.skin.png",
      "layers/expressions/serene.png",
      "layers/expressions/serene.skin.png",
      "provenance/expr-a.json"
     ],
     "needs": [
      "bootstrap",
      "master",
      "compositor"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" layers/expressions/ melancholy melancholy.skin smug smug.skin serene serene.skin && test -s provenance/expr-a.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "expr-b",
     "vars": {
      "task": "Paint these expressions: paranoid-side-eye, startled. Each must differ strongly from the others at preview size and is two registered layers painted with the image model on template/master-reference.png: layers/expressions/<name>.skin.png holds the heavy eyelids, brow, cheek and muzzle modelling in moss skin colours (the compositor recolours it per skin), and layers/expressions/<name>.png holds the full muted-red lips, mouth interior, teeth, tears and shadow glazes. Lids sit over the eye layers and leave the irises readable; the mouth is wide and fully painted; nothing else of the bust is in either layer.",
      "detail": "paranoid-side-eye (drawn over the side-eye eyes): lids narrowed and tense, brow pinched, mouth pressed thin and pulled to one side. startled: lids pulled wide open, brows high, mouth a round open O showing its dark interior. Try each with a throwaway catalog entry carrying `skinPaint` in test/scratch/, on moss and on one other skin, and look. Write provenance/expr-b.json."
     },
     "scope": [
      "layers/expressions/paranoid-side-eye.png",
      "layers/expressions/paranoid-side-eye.skin.png",
      "layers/expressions/startled.png",
      "layers/expressions/startled.skin.png",
      "provenance/expr-b.json"
     ],
     "needs": [
      "bootstrap",
      "master",
      "compositor"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" layers/expressions/ paranoid-side-eye paranoid-side-eye.skin startled startled.skin && test -s provenance/expr-b.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "expr-c",
     "vars": {
      "task": "Paint these expressions: dim-grin, scowl. Each must differ strongly from the others at preview size and is two registered layers painted with the image model on template/master-reference.png: layers/expressions/<name>.skin.png holds the heavy eyelids, brow, cheek and muzzle modelling in moss skin colours (the compositor recolours it per skin), and layers/expressions/<name>.png holds the full muted-red lips, mouth interior, teeth, tears and shadow glazes. Lids sit over the eye layers and leave the irises readable; the mouth is wide and fully painted; nothing else of the bust is in either layer.",
      "detail": "dim-grin: heavy sleepy lids at uneven heights, a wide slack open grin with a row of blunt teeth. scowl: brows driven down over the eyes, lids hooded, mouth a hard downturned arch with the lower lip thrust out. Try each with a throwaway catalog entry carrying `skinPaint` in test/scratch/, on moss and on one other skin, and look. Write provenance/expr-c.json."
     },
     "scope": [
      "layers/expressions/dim-grin.png",
      "layers/expressions/dim-grin.skin.png",
      "layers/expressions/scowl.png",
      "layers/expressions/scowl.skin.png",
      "provenance/expr-c.json"
     ],
     "needs": [
      "bootstrap",
      "master",
      "compositor"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" layers/expressions/ dim-grin dim-grin.skin scowl scowl.skin && test -s provenance/expr-c.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "expr-d",
     "vars": {
      "task": "Paint these expressions: regal, sly, weeping. Each must differ strongly from the others at preview size and is two registered layers painted with the image model on template/master-reference.png: layers/expressions/<name>.skin.png holds the heavy eyelids, brow, cheek and muzzle modelling in moss skin colours (the compositor recolours it per skin), and layers/expressions/<name>.png holds the full muted-red lips, mouth interior, teeth, tears and shadow glazes. Lids sit over the eye layers and leave the irises readable; the mouth is wide and fully painted; nothing else of the bust is in either layer.",
      "detail": "regal: lids lowered in composure, brows level, lips closed and firm, chin a little raised. sly: one eye narrowed almost shut, the other half lidded, a long closed smile curling up at one corner. weeping: brows crumpled, lids swollen, mouth open and pulled down, two painted tears on the cheeks. Try each with a throwaway catalog entry carrying `skinPaint` in test/scratch/, on moss and on one other skin, and look. Write provenance/expr-d.json."
     },
     "scope": [
      "layers/expressions/regal.png",
      "layers/expressions/regal.skin.png",
      "layers/expressions/sly.png",
      "layers/expressions/sly.skin.png",
      "layers/expressions/weeping.png",
      "layers/expressions/weeping.skin.png",
      "provenance/expr-d.json"
     ],
     "needs": [
      "bootstrap",
      "master",
      "compositor"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;[d,...n]=process.argv.slice(1);for(x of n){p=d+x+'.png';k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" layers/expressions/ regal regal.skin sly sly.skin weeping weeping.skin && test -s provenance/expr-d.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "attire-scholar",
     "vars": {
      "task": "Paint the attire of scholar, replacing each PNG its catalog file registers at the same path and slot. scholar: a black damask gown with a brown fur collar over a cream shirt (attire-front), its folded hood lying behind the shoulders (attire-back), and round brass-rimmed spectacles on the muzzle (accessory). Inpaint each piece onto template/master-reference.png with the image model so edges and light match the bust, then cut it out: a transparent 2048x2560 layer holding only the garment or prop, soft-edged, no skin, its neck opening sitting on the master's neck, the head left free.",
      "detail": "Remove the old drawing scripts and review files in the folder, which no longer describe the layers. Keep the catalog file valid (same ids, schema kekborn-assets@1). Render a sample of the category on two skins and look at the fit. Write provenance/attire-scholar.json."
     },
     "scope": [
      "layers/attire/scholar/**",
      "catalog/attire-scholar.json",
      "provenance/attire-scholar.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" attire-scholar && test -s provenance/attire-scholar.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "attire-antiquary",
     "vars": {
      "task": "Paint the attire of antiquary, replacing each PNG its catalog file registers at the same path and slot. antiquary: an ochre and oxblood brocade doublet with slashed sleeves (attire-front), a gold-rimmed monocle on a ribbon (accessory), and a rolled parchment scroll with a wax seal in a gloved hand (prop-front). Inpaint each piece onto template/master-reference.png with the image model so edges and light match the bust, then cut it out: a transparent 2048x2560 layer holding only the garment or prop, soft-edged, no skin, its neck opening sitting on the master's neck, the head left free.",
      "detail": "Remove the old drawing scripts and review files in the folder, which no longer describe the layers. Keep the catalog file valid (same ids, schema kekborn-assets@1). Render a sample of the category on two skins and look at the fit. Write provenance/attire-antiquary.json."
     },
     "scope": [
      "layers/attire/antiquary/**",
      "catalog/attire-antiquary.json",
      "provenance/attire-antiquary.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" attire-antiquary && test -s provenance/attire-antiquary.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "attire-knight-artisan",
     "vars": {
      "task": "Paint the attire of knight and artisan, replacing each PNG its catalog file registers at the same path and slot. knight: a blackened steel gorget and breastplate with gilt edging over a mail collar (attire-front) and a steel gauntlet raised at the lower edge (prop-front); artisan: a deep green wool jerkin with a leather apron and cream linen collar (attire-front) and a bundle of paint-tipped brushes in a gloved hand (prop-front). Inpaint each piece onto template/master-reference.png with the image model so edges and light match the bust, then cut it out: a transparent 2048x2560 layer holding only the garment or prop, soft-edged, no skin, its neck opening sitting on the master's neck, the head left free.",
      "detail": "Remove the old drawing scripts and review files in the folder, which no longer describe the layers. Keep the catalog file valid (same ids, schema kekborn-assets@1). Render a sample of the category on two skins and look at the fit. Write provenance/attire-knight-artisan.json."
     },
     "scope": [
      "layers/attire/knight/**",
      "layers/attire/artisan/**",
      "catalog/attire-knight.json",
      "catalog/attire-artisan.json",
      "provenance/attire-knight-artisan.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" attire-knight attire-artisan && test -s provenance/attire-knight-artisan.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "attire-seer",
     "vars": {
      "task": "Paint the attire of seer, replacing each PNG its catalog file registers at the same path and slot. seer: a midnight-green velvet robe embroidered with gold stars (attire-front, seer-robe), its deep hood rising behind the head (attire-back, seer-hood), and a glass orb in a gold mount held in a gloved hand (prop-front, seer-orb). Inpaint each piece onto template/master-reference.png with the image model so edges and light match the bust, then cut it out: a transparent 2048x2560 layer holding only the garment or prop, soft-edged, no skin, its neck opening sitting on the master's neck, the head left free.",
      "detail": "Remove the old drawing scripts and review files in the folder, which no longer describe the layers. Keep the catalog file valid (same ids, schema kekborn-assets@1). Render a sample of the category on two skins and look at the fit. Write provenance/attire-seer.json."
     },
     "scope": [
      "layers/attire/seer/**",
      "catalog/attire-seer.json",
      "provenance/attire-seer.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" attire-seer && test -s provenance/attire-seer.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "attire-council",
     "vars": {
      "task": "Paint the attire of council, replacing each PNG its catalog file registers at the same path and slot. council: a black velvet councillor's coat with broad sable fur lapels and slashed oxblood sleeves (attire-front) and a gold-fringed oxblood sash across the chest (accessory). Inpaint each piece onto template/master-reference.png with the image model so edges and light match the bust, then cut it out: a transparent 2048x2560 layer holding only the garment or prop, soft-edged, no skin, its neck opening sitting on the master's neck, the head left free.",
      "detail": "Remove the old drawing scripts and review files in the folder, which no longer describe the layers. Keep the catalog file valid (same ids, schema kekborn-assets@1). Render a sample of the category on two skins and look at the fit. Write provenance/attire-council.json."
     },
     "scope": [
      "layers/attire/council/**",
      "catalog/attire-council.json",
      "provenance/attire-council.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" attire-council && test -s provenance/attire-council.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "tier-common",
     "vars": {
      "task": "Paint the common tier, visibly richer than the tier below it. layers/headwear/common.png: a plain black wool flat cap. layers/regalia/common.png: a simple cream linen collar with a dark cord tie. Inpaint both onto template/master-reference.png with the image model, then cut out to transparent 2048x2560 layers, soft-edged, no skin; headwear sits on the crown seat (969,680) and stays out of the banner-arms clear space. layers/frames/common.png: plain dark wood, lightly moulded, painted with the model as a straight-on picture frame: opaque rails, the aperture (144,144)-(1904,2368) fully transparent, the rail-arms clear space (962,2392)-(1086,2536) opaque and plain.",
      "detail": "The common frame is a foundation layer: put its new sha256 in catalog/foundation.json and change nothing else there. Keep the tier's catalog entries valid with the same ids and update their descriptions. Run test/raster/foundation.test.cjs for the frame rule, render a sample of this tier and look. Write provenance/tier-common.json."
     },
     "scope": [
      "layers/headwear/common.png",
      "layers/regalia/common.png",
      "layers/frames/common.png",
      "catalog/tier-common.json",
      "catalog/foundation.json",
      "provenance/tier-common.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" tier-common foundation && test -s provenance/tier-common.json && node --test test/raster/foundation.test.cjs"
    },
    {
     "key": "tier-uncommon",
     "vars": {
      "task": "Paint the uncommon tier, visibly richer than the tier below it. layers/headwear/uncommon.png: a deep green velvet bonnet with a small feather. layers/regalia/uncommon.png: a brass chain of plain links with a small medallion. Inpaint both onto template/master-reference.png with the image model, then cut out to transparent 2048x2560 layers, soft-edged, no skin; headwear sits on the crown seat (969,680) and stays out of the banner-arms clear space. layers/frames/uncommon.png: carved oak with a leaf-and-rosette moulding, painted with the model as a straight-on picture frame: opaque rails, the aperture (144,144)-(1904,2368) fully transparent, the rail-arms clear space (962,2392)-(1086,2536) opaque and plain.",
      "detail": "Keep the tier's catalog entries valid with the same ids and update their descriptions. Run test/raster/foundation.test.cjs for the frame rule, render a sample of this tier and look. Write provenance/tier-uncommon.json."
     },
     "scope": [
      "layers/headwear/uncommon.png",
      "layers/regalia/uncommon.png",
      "layers/frames/uncommon.png",
      "catalog/tier-uncommon.json",
      "catalog/frame-uncommon.json",
      "provenance/tier-uncommon.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" tier-uncommon frame-uncommon && test -s provenance/tier-uncommon.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "tier-rare",
     "vars": {
      "task": "Paint the rare tier, visibly richer than the tier below it. layers/headwear/rare.png: an oxblood velvet cap with a silver jewel and pearls on its brim. layers/regalia/rare.png: a silver chain with pearl drops across the shoulders. Inpaint both onto template/master-reference.png with the image model, then cut out to transparent 2048x2560 layers, soft-edged, no skin; headwear sits on the crown seat (969,680) and stays out of the banner-arms clear space. layers/frames/rare.png: chased silver, cool grey with soft highlights, painted with the model as a straight-on picture frame: opaque rails, the aperture (144,144)-(1904,2368) fully transparent, the rail-arms clear space (962,2392)-(1086,2536) opaque and plain.",
      "detail": "Keep the tier's catalog entries valid with the same ids and update their descriptions. Run test/raster/foundation.test.cjs for the frame rule, render a sample of this tier and look. Write provenance/tier-rare.json."
     },
     "scope": [
      "layers/headwear/rare.png",
      "layers/regalia/rare.png",
      "layers/frames/rare.png",
      "catalog/tier-rare.json",
      "catalog/frame-rare.json",
      "provenance/tier-rare.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" tier-rare frame-rare && test -s provenance/tier-rare.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "tier-epic",
     "vars": {
      "task": "Paint the epic tier, visibly richer than the tier below it. layers/headwear/epic.png: a black velvet hat with gold aglets, a jewelled band and a white plume. layers/regalia/epic.png: a broad gold collar of linked esses set with rubies and pearls. Inpaint both onto template/master-reference.png with the image model, then cut out to transparent 2048x2560 layers, soft-edged, no skin; headwear sits on the crown seat (969,680) and stays out of the banner-arms clear space. layers/frames/epic.png: gilded gold, burnished on the high points with red bole in the hollows, painted with the model as a straight-on picture frame: opaque rails, the aperture (144,144)-(1904,2368) fully transparent, the rail-arms clear space (962,2392)-(1086,2536) opaque and plain.",
      "detail": "Keep the tier's catalog entries valid with the same ids and update their descriptions. Run test/raster/foundation.test.cjs for the frame rule, render a sample of this tier and look. Write provenance/tier-epic.json."
     },
     "scope": [
      "layers/headwear/epic.png",
      "layers/regalia/epic.png",
      "layers/frames/epic.png",
      "catalog/tier-epic.json",
      "catalog/frame-epic.json",
      "provenance/tier-epic.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" tier-epic frame-epic && test -s provenance/tier-epic.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "tier-legendary",
     "vars": {
      "task": "Paint the legendary tier, visibly richer than the tier below it. layers/headwear/legendary.png: a gold coronet set with emeralds and rubies over an ermine-trimmed velvet cap. layers/regalia/legendary.png: a heavy jewelled gold chain of office with a great pendant gem and pearl ropes, thick impasto on the stones. Inpaint both onto template/master-reference.png with the image model, then cut out to transparent 2048x2560 layers, soft-edged, no skin; headwear sits on the crown seat (969,680) and stays out of the banner-arms clear space. layers/frames/legendary.png: jewelled gold, with cabochon gems at the corners and mid-rails and a blank engraved plaque in the plaque box (640,2420)-(940,2508), painted with the model as a straight-on picture frame: opaque rails, the aperture (144,144)-(1904,2368) fully transparent, the rail-arms clear space (962,2392)-(1086,2536) opaque and plain.",
      "detail": "Keep the tier's catalog entries valid with the same ids and update their descriptions. Run test/raster/foundation.test.cjs for the frame rule, render a sample of this tier and look. Write provenance/tier-legendary.json."
     },
     "scope": [
      "layers/headwear/legendary.png",
      "layers/regalia/legendary.png",
      "layers/frames/legendary.png",
      "catalog/tier-legendary.json",
      "catalog/frame-legendary.json",
      "provenance/tier-legendary.json"
     ],
     "needs": [
      "bootstrap",
      "master"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" tier-legendary frame-legendary && test -s provenance/tier-legendary.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "backdrops",
     "vars": {
      "task": "Paint the five backdrops with the image model as full-canvas opaque layers: the dark wall behind the sitter and nothing else, no figure, frame or banner. green-arras: a deep green woven arras with a large damask pomegranate pattern. oak-gallery: dark oak linenfold panelling. oxblood-chamber: oxblood damask hangings with a heavy fold at one side. stone-apse: a shadowed grey stone niche with a carved arch. umber-hall: a warm umber plastered wall, darkest in the corners. Light from the upper left, dark and quiet so the sitter stands out; the upper right stays plain enough to carry a banner.",
      "detail": "Write layers/backgrounds/<name>.png at the registered paths, remove the old drawing script layers/backgrounds/paint.cjs, and keep catalog/backgrounds.json valid with the same ids. Flat paint under the frame rails keeps the files small. Render two samples and look. Write provenance/backdrops.json."
     },
     "scope": [
      "layers/backgrounds/**",
      "catalog/backgrounds.json",
      "provenance/backdrops.json"
     ],
     "needs": [
      "bootstrap",
      "guide",
      "contract"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" backgrounds && test -s provenance/backdrops.json && node --test test/compositor/real-catalog.test.cjs"
    },
    {
     "key": "banners",
     "vars": {
      "task": "Paint the three banners with the image model: heraldic cloth hanging in the upper right behind the sitter, each on a transparent 2048x2560 layer. vert-pennon: a long swallow-tailed deep green silk pennon with a gold fringe. oxblood-standard: a broad oxblood damask standard with gold tasselled cords. ochre-gonfalon: an ochre gonfalon hung from a crossbar, its lower edge cut into three tails. Painted folds, light from the upper left. Each keeps the place and size of the layer it replaces and leaves the banner-arms box (1500,340)-(1740,628) and its 24 px clear space as flat, evenly lit opaque cloth: the compositor paints the coat of arms there.",
      "detail": "Cut each out soft-edged to layers/banners/<name>.png, keep catalog/banners.json valid with the same ids and selectors, keep the heraldry tests passing, render the three on two backdrops and look: the arms sit on cloth, not on folds. Write provenance/banners.json."
     },
     "scope": [
      "layers/banners/**",
      "catalog/banners.json",
      "provenance/banners.json"
     ],
     "needs": [
      "bootstrap",
      "guide",
      "contract"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(x of process.argv.slice(1))for(a of require('./catalog/'+x+'.json').assets){p=a.path;k=f.readFileSync(p);i=r.decodePNG(k);if(i.width-2048||i.height-2560||k.length>79e5||b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" banners && test -s provenance/banners.json && node --test test/compositor/real-catalog.test.cjs test/heraldry/arms.test.cjs"
    },
    {
     "key": "heraldry",
     "vars": {
      "task": "Repaint the eighteen heraldry parts under layers/heraldry/ (fields, divisions, ordinaries, and the charges with their keylines and fimbriations). They are value maps the heraldry code tints: R=G=B brush lightness centred on 176, with alpha carrying the shape. Keep every part's alpha, size and path exactly and replace its lightness with real painted brushwork: have the image model paint swatches of flat heraldic paint on cloth in the locked style (stroke direction, slight impasto, worn gilding for the charges), turn them into lightness centred on 176 with a gentle range, and lay them inside each part's alpha, following its shape.",
      "detail": "The legibility tests fix the contrast the arms must keep at banner and rail size: keep node --test test/heraldry/*.test.cjs passing without changing the tests. Render arms for three seeds at both sizes and look. Write provenance/heraldry.json."
     },
     "scope": [
      "layers/heraldry/**",
      "provenance/heraldry.json"
     ],
     "needs": [
      "bootstrap",
      "guide",
      "contract"
     ],
     "check": "node -e \"f=require('fs');r=require('./src/raster/index.cjs');b=require('./provenance/baseline.json').files;for(p in b)if(/^layers.heraldry.*png$/.test(p)){k=f.readFileSync(p);r.decodePNG(k);if(b[p]==require('crypto').createHash('sha256').update(k).digest('hex'))throw p}\" && test -s provenance/heraldry.json && node --test test/heraldry/arms.test.cjs test/heraldry/legibility.test.cjs"
    },
    {
     "key": "catalog",
     "vars": {
      "task": "Register the painted faces (no painting here). Rewrite catalog/expressions-court.json and catalog/expressions-gaze.json, schema kekborn-assets@1, so that between them they hold ten expressions, each with id expression.<name>, path layers/expressions/<name>.png and skinPaint layers/expressions/<name>.skin.png: melancholy, smug, paranoid-side-eye (requiresEyes eyes.side-eye), dim-grin, scowl, serene, startled, regal, sly, weeping. Add the four legacy ids the sample inputs name, each explicitOnly and pointing at the new files: expression.wistful at melancholy, expression.resolute at regal, expression.amused at sly, expression.dubious at weeping. Then delete the old layers/expressions/wistful.png, resolute.png, amused.png and dubious.png.",
      "detail": "Register only files that exist. Render all twelve sample inputs into test/scratch/ and look at each face on its skin: lids recoloured to the skin, eyes readable, the ten expressions clearly different. Write provenance/catalog.json: what you saw, and each layer that needs repainting, by path. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "catalog/expressions-court.json",
      "catalog/expressions-gaze.json",
      "layers/expressions/wistful.png",
      "layers/expressions/resolute.png",
      "layers/expressions/amused.png",
      "layers/expressions/dubious.png",
      "provenance/catalog.json"
     ],
     "needs": [
      "bootstrap",
      "compositor",
      "eyes",
      "expr-a",
      "expr-b",
      "expr-c",
      "expr-d",
      "skins"
     ],
     "check": "node -e \"c=require('./src/compositor/catalog.cjs').loadCatalog(process.cwd());for(n of process.argv.slice(1))require('fs').statSync(c.get('expression.'+n).absPath)\" melancholy smug paranoid-side-eye dim-grin scowl serene startled regal sly weeping wistful resolute amused dubious && grep -q skinPaint catalog/expressions-gaze.json && test ! -e layers/expressions/wistful.png && test -s provenance/catalog.json && node --test test/*/*.test.cjs"
    },
    {
     "key": "integrate",
     "vars": {
      "task": "Prove the repainted library whole (no painting here). Add test/library/library.test.cjs: every catalog asset's path and skinPaint exists; every layer PNG decodes at 2048x2560; no file of the repository is 8,000,000 bytes or more; six skins with ivory and oxblood rare; the ten named expressions, eight eyes, five backdrops, three banners, five frames, and headwear and regalia for every tier are registered; every layer PNG still present that provenance/baseline.json lists differs from its imported sha256; all twelve sample inputs render. Write README.md: what the repository is and how to render, harmonise, build previews and verify.",
      "detail": "Render the twelve inputs into test/scratch/ and look at each as one painting. Write provenance/integration.json: for each sample what reads well and what does not, and every layer misregistered or not convincingly painted, by path. If the library test fails on a file outside your scope, say which and why rather than loosening the test. node --test test/*/*.test.cjs passes."
     },
     "scope": [
      "test/library/**",
      "README.md",
      "provenance/integration.json"
     ],
     "needs": [
      "bootstrap",
      "catalog",
      "finish",
      "attire-scholar",
      "attire-antiquary",
      "attire-knight-artisan",
      "attire-seer",
      "attire-council",
      "tier-common",
      "tier-uncommon",
      "tier-rare",
      "tier-epic",
      "tier-legendary",
      "backdrops",
      "banners",
      "heraldry"
     ],
     "check": "test -s README.md && test -s provenance/integration.json && test -s test/library/library.test.cjs && node --test test/*/*.test.cjs"
    },
    {
     "key": "previews-a",
     "vars": {
      "task": "Render sample portraits 01, 02, 03, 04 for owner approval. For each NN: render sample-inputs/NN.json with bin/render.cjs to a 2048x2560 plain master in test/scratch/out/; write the harmonise request with bin/harmonise.cjs; run a real image-to-image model on the plain master with that request's prompts, strength and fixed seed; apply its output with bin/harmonise.cjs to get the harmonised master; then write samples/NN-plain.jpg and samples/NN-harmonised.jpg with tools/approval.cjs preview (1024x1280, quality 90, under 4,000,000 bytes each) and samples/NN.json: the input, the render record's layers, the sha256 of both masters and both previews, and the harmonise model, strength and seed.",
      "detail": "Masters are not committed. Look at each pair: the harmonised one is the same portrait, more unified, with frame, plaque and arms untouched; if the model changes the face or the design, lower the strength and say so. If no image-to-image model answers, write nothing and say what stopped you."
     },
     "scope": [
      "samples/01-plain.jpg",
      "samples/01-harmonised.jpg",
      "samples/01.json",
      "samples/02-plain.jpg",
      "samples/02-harmonised.jpg",
      "samples/02.json",
      "samples/03-plain.jpg",
      "samples/03-harmonised.jpg",
      "samples/03.json",
      "samples/04-plain.jpg",
      "samples/04-harmonised.jpg",
      "samples/04.json"
     ],
     "needs": [
      "integrate",
      "harmonise",
      "approval",
      "compositor"
     ],
     "check": "for n in 01 02 03 04; do test -s samples/$n-plain.jpg && test -s samples/$n-harmonised.jpg && test -s samples/$n.json || exit 1; done"
    },
    {
     "key": "previews-b",
     "vars": {
      "task": "Render sample portraits 05, 06, 07, 08 for owner approval. For each NN: render sample-inputs/NN.json with bin/render.cjs to a 2048x2560 plain master in test/scratch/out/; write the harmonise request with bin/harmonise.cjs; run a real image-to-image model on the plain master with that request's prompts, strength and fixed seed; apply its output with bin/harmonise.cjs to get the harmonised master; then write samples/NN-plain.jpg and samples/NN-harmonised.jpg with tools/approval.cjs preview (1024x1280, quality 90, under 4,000,000 bytes each) and samples/NN.json: the input, the render record's layers, the sha256 of both masters and both previews, and the harmonise model, strength and seed.",
      "detail": "Masters are not committed. Look at each pair: the harmonised one is the same portrait, more unified, with frame, plaque and arms untouched; if the model changes the face or the design, lower the strength and say so. If no image-to-image model answers, write nothing and say what stopped you."
     },
     "scope": [
      "samples/05-plain.jpg",
      "samples/05-harmonised.jpg",
      "samples/05.json",
      "samples/06-plain.jpg",
      "samples/06-harmonised.jpg",
      "samples/06.json",
      "samples/07-plain.jpg",
      "samples/07-harmonised.jpg",
      "samples/07.json",
      "samples/08-plain.jpg",
      "samples/08-harmonised.jpg",
      "samples/08.json"
     ],
     "needs": [
      "integrate",
      "harmonise",
      "approval",
      "compositor"
     ],
     "check": "for n in 05 06 07 08; do test -s samples/$n-plain.jpg && test -s samples/$n-harmonised.jpg && test -s samples/$n.json || exit 1; done"
    },
    {
     "key": "previews-c",
     "vars": {
      "task": "Render sample portraits 09, 10, 11, 12 for owner approval. For each NN: render sample-inputs/NN.json with bin/render.cjs to a 2048x2560 plain master in test/scratch/out/; write the harmonise request with bin/harmonise.cjs; run a real image-to-image model on the plain master with that request's prompts, strength and fixed seed; apply its output with bin/harmonise.cjs to get the harmonised master; then write samples/NN-plain.jpg and samples/NN-harmonised.jpg with tools/approval.cjs preview (1024x1280, quality 90, under 4,000,000 bytes each) and samples/NN.json: the input, the render record's layers, the sha256 of both masters and both previews, and the harmonise model, strength and seed.",
      "detail": "Masters are not committed. Look at each pair: the harmonised one is the same portrait, more unified, with frame, plaque and arms untouched; if the model changes the face or the design, lower the strength and say so. If no image-to-image model answers, write nothing and say what stopped you."
     },
     "scope": [
      "samples/09-plain.jpg",
      "samples/09-harmonised.jpg",
      "samples/09.json",
      "samples/10-plain.jpg",
      "samples/10-harmonised.jpg",
      "samples/10.json",
      "samples/11-plain.jpg",
      "samples/11-harmonised.jpg",
      "samples/11.json",
      "samples/12-plain.jpg",
      "samples/12-harmonised.jpg",
      "samples/12.json"
     ],
     "needs": [
      "integrate",
      "harmonise",
      "approval",
      "compositor"
     ],
     "check": "for n in 09 10 11 12; do test -s samples/$n-plain.jpg && test -s samples/$n-harmonised.jpg && test -s samples/$n.json || exit 1; done"
    },
    {
     "key": "package",
     "vars": {
      "task": "Close the approval package (no painting here). With all 24 previews in samples/, run tools/approval.cjs sheet to write contact-sheet.jpg (all twelve portraits, numbered, plain beside harmonised, under 4,000,000 bytes) and look at it; run the whole suite; run manifest to write manifest.json with the sha256 of every delivered file; then run verify. Nothing may change after the manifest is written.",
      "detail": "If verify or the suite fails for a reason outside your scope, do not work around it: name the file and the rule that failed. In your result give the number of files in the manifest, the size of the sheet and of the largest file, and what the sheet shows: which portraits read as finished Tudor oil paintings and which do not."
     },
     "scope": [
      "contact-sheet.jpg",
      "manifest.json"
     ],
     "needs": [
      "previews-a",
      "previews-b",
      "previews-c",
      "approval"
     ],
     "check": "test -s contact-sheet.jpg && test -s manifest.json && node tools/approval.cjs verify && node --test test/*/*.test.cjs"
    }
   ]
  }
 ],
 "wake": {
  "batches": [
   "kekborn-v2-build"
  ],
  "afterMinutes": 1440
 },
 "finish": false
}