{
 "title": "Ready to Re-mix",
 "date": "2026-10-24",
 "question": "After so many new costumes, are the drawing routines ready to be re-mixed with other code down the line: the ninja's gems in the king's crown, in treasure chests, on fancy swords and shields, on the king's throne and in the throne room, and fourteen more scenarios like them? For each, what does the code make easy or hard today, and what re-organising would make it easy? And what re-organising can be done now, with no change to any picture?",
 "asked": [
  {
   "at": "2026-10-22",
   "words": "mint and enqueue tonight--- recover from so many feature extensions to MUDU --- refactor code and make a report about other ways to improve --- E.g., maybe we want to draw gems in the kings crown in the future --- are the routines we have for ninja gems going to be ready to re-mix with other code down the line? ^ Please consider 17 different scenarios like this, of your choosing, and propose and perform any code re-org that you choose --- just report it as a report, so I can review later and we can discuss later."
  },
  {
   "at": "then",
   "words": "Gems for treasure chests, etc."
  },
  {
   "at": "then",
   "words": "Gems to decorate very fancy swords and sheilds, and the kinds thrown and thrown room, etc."
  },
  {
   "at": "2026-10-24",
   "words": "564 --- yes, redo the remix preparation/reorg -- and file a fresh report with a fresh number."
  }
 ],
 "answers": [
  "**Mostly yes, now.** The ninja's gem was a general gem in all but its name: a stone, a shape, a middle, a size and its lights. This ticket gave it a home of its own and general names ({fn:gemSvg} and {fn:gemSideSvg} in js/02-helpers.js; its stones and shapes {fn:GEMSTONES} and {fn:GEMSTONE_SHAPES}), a `look` for whoever calls it (what to mark it, how to name its clip, the gold it sits in, or none), and widths in proportion to its size. The ninja is drawn exactly as before, and its settings keep their names, as saved files have them.",
  "**Of Matthew's three, the crown and the chest are ready:** a few calls each, shown below as a demonstration (not in the game). **Swords, shields and thrones need a small change:** each held thing is four drawings (toward us, from the side, from behind, on the floor), so a gem needs its place in each; and a throne room full of glimmering gems would cost frames, so in a place their lights should be still or share one animation (the 60 frames a second rule).",
  "**Of the seventeen scenarios, 5 are ready, 8 need a small change and 4 need a re-organisation.** The four: two costumes at once; animal suits made of named parts; the friend's drawing as plain text, for portraits and postcards; and one entry per costume for its settings, which today are written in four places.",
  "**Three re-organisations were done, each its own commit, and no picture changed:** one namer for ids made from content; the gem; and a table of what each costume wears for the shirt and pants, the first step toward two costumes at once. Each commit was proved by drawing the friend 12,570 ways on the release and on the commit: every drawing identical, byte for byte.",
  "**The proof is a tool now,** `tools/same_friend.mjs`: it draws the friend in node on the laptop, with no browser, both pages in about nine minutes, and it found no noise: the release drawn twice is the same text every time."
 ],
 "top_pictures": [
  {
   "file": "ninja.svg",
   "alt": "The ninja facing us and facing our right, as the game draws them, the ruby on the forehead",
   "caption": "Figure 1. The 🥷 ninja at the defaults, facing us and facing our right, as the game draws them: the text {fn:drawNow} writes, caught in node from this branch, the same text as the release's. The ruby where the gold bands meet is now drawn by the shared gem, {fn:gemSvg} and {fn:gemSideSvg}."
  },
  {
   "file": "ninja-gem.svg",
   "alt": "The ninja's head band and its ruby, close up",
   "caption": "The same drawing close up: the gold bands' inverted T and the ruby where they meet, cut as a gemstone with its white cuts (ticket 560), the part of the friend that ticket 564 re-organised."
  }
 ],
 "scenarios_intro": "Matthew named three (the first three); the other fourteen are chosen from what the code shows is likely next: what the last weeks of tickets added, and what tickets 562 and 563 tried since (two costumes at once). Each says what the code makes easy or hard today (each function named with its part and line on this branch: 02:120 is js/02-helpers.js, line 120), what would make it easy, and what this ticket did for it. The verdicts: **ready**, a few calls to code that exists; **needs a small change**, a change to one or two drawings or tables; **needs a re-org**, a change of shape across many places, worth a ticket and a proof of its own.",
 "scenarios": [
  {
   "id": "s1",
   "his": true,
   "title": "Gems in the king's and the queen's crown",
   "verdict": "ready",
   "before": "reorg",
   "touches": "{fn:crownSvg}, {fn:gemSvg}, {fn:GOLD}",
   "today": "The crown, {fn:crownSvg}, draws jewels of its own: three small diamonds on the band (squares turned on a corner, in one colour, 💎 the jewels' color, `crownJewel`, the side ones mixed toward blue) and pearls on its points. Before this ticket the cut gem was the ninja's: named for it, kept with its costume, always set in the ninja's gold and marked as the ninja's piece (`data-ninja=\"gem\"`, which the ninja's check counts), with its outlines a fixed width, right only at the forehead's size.",
   "easy": "Now {fn:gemSvg} takes a stone, a shape, a middle and a size in the caller's own units (the crown's are the round head's), its lights, and a `look`: its mark, its clip's name, the metal it sits in. The crown and the gem share one gold, {fn:GOLD}. A crown with cut gems is three calls on the band and five on the points (the demonstration). Two things remain, and both are the feature, not the code: the crown has no view from the side (in profile {fn:crownSvg} draws its front), so a gem from the side ({fn:gemSideSvg}) waits for one, a drawing of its own by Matthew's rule for new angles; and the crown's jewels are a colour, where cut gems want a choice of stones, a new setting.",
   "done": "the gem's home, its general names, its `look` and its widths in proportion (commit 2); the crown's gold is {fn:GOLD}.",
   "pictures": [
    {
     "file": "demo-crown.svg",
     "demo": true,
     "alt": "The king's crown as the game draws it, and the same crown with cut gems",
     "caption": "The king's crown as the game draws it ({fn:crownSvg}, left), and the same crown with {fn:gemSvg} called on its band (a sapphire, a ruby and an emerald, glimmering) and on its points (small diamonds, loose). Drawn by `drivers/demo564.mjs`."
    }
   ]
  },
  {
   "id": "s2",
   "his": true,
   "title": "Gems in treasure chests",
   "verdict": "ready",
   "before": "reorg",
   "touches": "{fn:seaChestSvg}, {fn:kingRoomSvg}, {fn:gemThingSvg}, {fn:gemSvg}",
   "today": "The placeable treasure chest, {fn:seaChestSvg}, with 💎 gems in it (`CHEST_TREASURE`) heaps seven five-sided gems in the cave's colours (`GEM_COLORS`), drawn by a little `gem` of its own. The king's room draws its chest of gold again, inline in {fn:kingRoomSvg}, not with {fn:seaChestSvg}: two chests, two drawings. And the cave's 💎 gem thing, {fn:gemThingSvg}, has six styles of its own (cut, a cluster, a geode, a point, rough, a heart).",
   "easy": "{fn:gemSvg} with `set: null` draws a loose stone, with no gold rim, at any size: the chest's seven gems become seven calls (the demonstration). One chest for the sea and the king's room is a small change of its own, and changes the king's room's picture a little.",
   "done": "`set: null`, a loose stone, and widths in proportion (commit 2).",
   "pictures": [
    {
     "file": "demo-chest.svg",
     "demo": true,
     "alt": "The treasure chest with gems as the game draws it, and with loose cut stones",
     "caption": "The treasure chest with 💎 gems as the game draws it ({fn:seaChestSvg}, left), and the chest of gold with seven loose cut stones from {fn:gemSvg} in the same seven places (no setting: `set: null`), some glimmering."
    }
   ]
  },
  {
   "id": "s3",
   "his": true,
   "title": "Gems on fancy swords and shields, the king's throne and the throne room",
   "verdict": "small",
   "before": "reorg",
   "touches": "{fn:swordSvg}, {fn:swordSideSvg}, {fn:shieldSvg}, {fn:heldSvg}, {fn:throneSvg}, {fn:kingThrones}",
   "today": "A held thing is drawn once for each view (Matthew's rule: each angle its own drawing): the sword toward us is the trap room's ({fn:swordSvg}), then {fn:swordSideSvg}, {fn:swordBackSvg} and {fn:swordFloorSvg}; the shield toward us carries the knight's arms ({fn:shieldSvg}, {fn:armsFill}), then {fn:shieldSideSvg}, {fn:shieldPlainSvg}, {fn:shieldFloorSvg}; {fn:heldSvg} picks one. A throne, {fn:throneSvg}, has three jewel dots on its crown and a crest; a king's room holds up to six of them ({fn:kingThrones}), crossed swords and shields on its walls and crowned banners ({fn:kingRoomSvg}).",
   "easy": "With the shared gem each view can carry its gems: a pommel, a crossguard, a shield's corners, a throne's crown and crest (the demonstrations). Two things to settle first. Each held thing has four drawings, so a gem needs its place in each, or it vanishes when the friend turns. And in a place, many gems with their lights on are many SMIL animations of opacity, the cost ticket 118 measured with the fumes: the friend wears one gem, a throne room could hold twenty. So in a place, draw the gems still, or give them one shared animation, and measure with 📏.",
   "done": "the gem at any size, in any units, set or loose (commit 2).",
   "pictures": [
    {
     "file": "demo-sword-shield.svg",
     "demo": true,
     "alt": "The trap room's sword with gems in its pommel and crossguard, and the knight's shield with three gems",
     "caption": "The trap room's sword ({fn:swordSvg}) with a ruby in its pommel and a sapphire in its crossguard, and the knight's shield ({fn:shieldSvg}, his arms) with an emerald at each top corner and a ruby heart below the emblem, its shine on."
    },
    {
     "file": "demo-throne.svg",
     "demo": true,
     "alt": "A throne as the game draws it, and with cut gems on its crown and a big gem for its crest",
     "caption": "One of the king's room's thrones ({fn:throneSvg}, in its room's own units, left) and the same throne with cut gems on its crown's three dots and a big sapphire for its crest, glimmering, its stars on."
    },
    {
     "file": "demo-catalogue.svg",
     "demo": true,
     "alt": "Six stones in six shapes, big, and each shape from the side",
     "caption": "One gem at any size: the six stones in the six shapes at twice the forehead's size, facing us, and each shape from the side ({fn:gemSideSvg}); every outline in proportion (commit 2), so a big gem looks like the small one."
    }
   ]
  },
  {
   "id": "s4",
   "title": "Two costumes at once, one over the other",
   "verdict": "reorg",
   "touches": "{fn:drawNow}, {fn:COSTUME_CLOTHES}, {fn:costumeOn}",
   "today": "The settings could hold two already: every costume's settings live side by side in the one `costume` part, each under its own name (`ninjaGem`, `knightA`, `robotStyle`, 154 keys), so a second costume needs only one more key to name it. The drawing cannot: {fn:drawNow} works out about twenty flags from the one `costume.kind` (`witch`, `knight`, `ninja` and the rest, most in its first hundred lines, the moth's at line 249), and each costume's pieces are drawn where its flag is read, at fixed places in the order of layers: the shirt and pants, what is worn over them, the hat, what is on the back. Two hats, two shirts or two hoods need a rule for which is worn. Tickets 562 and 563 have since drawn the pair (a cat over the ninja, the ninja over a cat) and mocked up its controls, in a draft report not yet published (on the branch `report-017`).",
   "easy": "A list of what is worn, under to over, in place of one kind: each flag read from the list, and a rule per layer (the outer costume's hat and clothes are worn; pieces that do not meet, a mantle and a tail, both show). This ticket made the first layer a table: {fn:COSTUME_CLOTHES} says what each costume wears for the shirt and pants, where each was an `if` of its own in drawNow, so there the rule is one line.",
   "done": "{fn:COSTUME_CLOTHES} (commit 3)."
  },
  {
   "id": "s5",
   "title": "A costume's pieces on other people in a place",
   "verdict": "small",
   "touches": "{fn:peopleDrawMissing}, {fn:helperSvg}, {fn:crownSvg}",
   "today": "People placed in a place ({fn:peopleDrawMissing}, ticket 439) are drawn by {fn:drawNow} itself with their look swapped in, so a placed person wears any whole costume today. The castle's helpers, the cooks and the smith ({fn:helperSvg}), are drawn from a short description of their own, as the healer is, with no head frame: a crown ({fn:crownSvg}), a hat or the ninja's mask is drawn in the friend's round head's units, and cannot go on a helper's head.",
   "easy": "Give a helper's head a frame the hats understand (its middle and size in the round head's units), or make the helpers people (ticket 439's templates); then any hat or crown goes on them."
  },
  {
   "id": "s6",
   "title": "A new animal suit from the suit parts",
   "verdict": "reorg",
   "touches": "{fn:ANIMALS}, {fn:hoodBack}, {fn:hoodSide}, {fn:hoodFront}, {fn:tailSvg}",
   "today": "{fn:ANIMALS} holds each suit's colours only. Its shapes are tests of the suit's name inside the hood and tail drawings ({fn:hoodBack}, {fn:hoodSide}, {fn:hoodFront}, {fn:tailSvg}): 49 tests of `kind === …` between them, and the sets `FELINE` and `BIRDS`. A fox made of the wolf's ears, the cat's nose and a bushy tail would add a case to each of them.",
   "easy": "Name the parts in the table: each suit's ears, nose, muzzle, tail, feet and fur as words (`ears: \"pointed\"`, `tail: \"bushy\"`), with the drawings testing those, so a new suit made of known parts is one entry. A re-org with a byte-for-byte proof: every suit in every view is in `tools/same_friend.mjs`'s cases already."
  },
  {
   "id": "s7",
   "title": "A held thing put down in a place",
   "verdict": "small",
   "touches": "{fn:HOLDABLES}, {fn:THING_KINDS}, {fn:thingSvg}, {fn:helmetSvg}",
   "today": "{fn:HOLDABLES} (8 things a hand holds) and {fn:THING_KINDS} (50 things to place) are separate tables. The 🪖 helmet is the model: one drawing, {fn:helmetSvg}, worn by the knight and placed as a thing. The sword, shield, staff, broom, bow, scepter and lasso already have a drawing lying on the floor, for crawling with them (ticket 529: {fn:swordFloorSvg}, {fn:shieldFloorSvg}), but placed by a hand's point, not standing at 0, 0 as {fn:thingSvg} places a thing.",
   "easy": "A thing for each holdable whose drawing is its floor view moved to 0, 0: a line in each table and a case in {fn:thingSvg}."
  },
  {
   "id": "s8",
   "title": "The ninja's braided bands on other costumes",
   "verdict": "small",
   "touches": "{fn:ninjaShin}, {fn:NINJA}",
   "today": "{fn:ninjaShin} draws bands along any limb's joints (the shin and, since ticket 561, the forearm), braided or wrapped, with the skin between them or not; but its colours are the ninja's (`NINJA.bandA`, `bandB`, `bandLine`), read inside it, and its name says ninja.",
   "easy": "Pass the colours in (a look, as the gem now takes one) and give it a general name: a Roman sandal's straps, a mummy's wrappings or a gladiator's greaves are then a call. The same proof covers it (the ninja's bands in every pose)."
  },
  {
   "id": "s9",
   "title": "A fabric shared by clothes and furniture",
   "verdict": "small",
   "touches": "{fn:patternDef}, {fn:personOwnIds}, {fn:shapeId}",
   "today": "{fn:patternDef} makes a fabric (stripes, dots, hearts, stars, a spider web, ermine, leaves, the gnome's skirt, gingham) that any drawing could use, but only the friend does: {fn:drawNow} defines `pat-shirt`, `pat-pants` and the rest under fixed ids, which {fn:personOwnIds} renames for each placed person. A couch, a rug or a tent draws stripes of its own.",
   "easy": "Name a fabric's id by what it is ({fn:shapeId}, as the clips now are), so a place can define the same fabric once and two never clash; then a couch in gingham is a call."
  },
  {
   "id": "s10",
   "title": "A place's things in another place",
   "verdict": "ready",
   "touches": "{fn:liftedThing}, {fn:thingSvg}, {fn:THING_PARAMS}",
   "today": "Ready: any object of any place can be lifted into another (📦, {fn:liftedThing}, ticket 284), and every placeable thing is a drawing standing at 0, 0 ({fn:thingSvg}), its settings in {fn:THING_PARAMS}.",
   "easy": "Nothing is needed. One gap: a lifted object is drawn at its place's defaults, not with settings of its own."
  },
  {
   "id": "s11",
   "title": "The friend's drawing at another size, or as a picture on a wall",
   "verdict": "reorg",
   "touches": "{fn:drawNow}, {fn:peopleDrawMissing}",
   "today": "{fn:drawNow} draws into the page's picture, reading and setting shared values as it goes: the joints, the face's frame, the figure's transform, the pieces shown. {fn:peopleDrawMissing} gets a placed person's drawing by swapping their look into the state, calling {fn:drawNow} on a hidden picture and putting six values back after. This report's proof catches the text drawNow writes, in node: the drawing is text already, but only drawNow can make it.",
   "easy": "Split drawNow in two: one function that turns a look into the friend's drawing as text, sharing nothing, and the page's part that puts it in. A portrait of the friend in the throne room, a postcard, a placed person and the proof would all call the first."
  },
  {
   "id": "s12",
   "title": "Scenery from the shared helpers",
   "verdict": "ready",
   "touches": "{fn:leafyTree}, {fn:pineTree}, {fn:bushSvg}, {fn:rockSvg}, {fn:farLayers}",
   "today": "Ready, by the design rule: trees, pines, bushes and rocks ({fn:leafyTree}, {fn:pineTree}, {fn:bushSvg}, {fn:rockSvg}), and far mountains, forest and beach as layers any place can call ({fn:farLayers}, ticket 212).",
   "easy": "Keep to the rule; the older crossing backdrops are the exception the instructions name."
  },
  {
   "id": "s13",
   "title": "Animations on the picture's clock",
   "verdict": "small",
   "touches": "{fn:gemLights}, {fn:lfoTimed}, {fn:sceneLfo}, {fn:picClock}",
   "today": "On the friend, ready: the gem's glimmer, stars and shine ({fn:gemLights}) begin before 0 on the picture's clock, so drawing the friend again never restarts them. In a place they would not follow the music's LFOs ({fn:lfoTimed} and {fn:sceneLfo} are how a place's animations do), and their SMIL animates opacity, which in many copies costs frames (ticket 118).",
   "easy": "When a place draws gems, time their lights with {fn:lfoTimed} and the place's options, and keep them few: a small change where they are called."
  },
  {
   "id": "s14",
   "title": "Settings rows made from data",
   "verdict": "reorg",
   "touches": "{fn:DEFAULTS}, {fn:TABS}, {fn:SHOWN_WHEN}, {fn:TAB_BOXES}, {fn:RESIDENTS}",
   "today": "A costume's settings are written in four places: their defaults ({fn:DEFAULTS}, 154 keys in `costume`), their rows in the 🐯 Costume tab ({fn:TABS}, 155 rows), when each shows ({fn:SHOWN_WHEN}, 151 rules) and which box holds it ({fn:TAB_BOXES}, 154 keys listed again, in 27 boxes). Some rows are made from data already (each style's colour row, from its style table), and the castle's residents are made from one entry each ({fn:RESIDENTS}: keys, defaults, rows, show-when rules and the mixing board's names).",
   "easy": "One entry per costume, as a resident's: its settings (key, default, kind of row, label), its box and when its rows show, and the four lists made from it. A re-org whose proof is the structure check: `tools/same_friend.mjs` compares the defaults, the tabs' rows and the show-when rules too."
  },
  {
   "id": "s15",
   "title": "The settings file decides the picture",
   "verdict": "ready",
   "touches": "{fn:picClock}, {fn:seeded}, {fn:shapeId}, {fn:shapeClip}",
   "today": "Ready (ticket 274): a drawing reads the time through {fn:picClock} and chance through seeds kept in the settings ({fn:seeded}); `Math.random` is used only where settings are made (🎲 Surprise me, a new seed). An id that only has to be unique is named by its content, and since this ticket by one namer, {fn:shapeId} and {fn:shapeClip}, where the ninja's clips and drawNow's door clips each had their own copy of the hash.",
   "easy": "Keep new ids on {fn:shapeId}. The proof shows the rule holding: the friend drawn twice from the same settings is the same text, 12,570 times out of 12,570.",
   "done": "one namer for ids (commit 1)."
  },
  {
   "id": "s16",
   "title": "A gem necklace or a brooch on any costume",
   "verdict": "small",
   "touches": "{fn:gemSvg}, {fn:drawNow}",
   "today": "The gem is ready; where to put it is not. The neck's width, the collar and the shirt's outline are worked out inside {fn:drawNow} (`nw`, the collar styles), and what is worn over the shirt is drawn there costume by costume (the witch's belt, the gnome's bodice, the wizard's cord), in each view.",
   "easy": "A few named points from drawNow (the collar's middle, the chest, the belt, each hand), in every view, handed to whatever is worn; a brooch is then a gem at the chest's point."
  },
  {
   "id": "s17",
   "title": "The dragon's fire from things in a place",
   "verdict": "small",
   "touches": "{fn:fireSvg}, {fn:FIRE_DEFS}, {fn:FIRE_STYLES}",
   "today": "{fn:fireSvg} draws any of the six fires ({fn:FIRE_STYLES}) from a point, side on, toward us or away (ticket 499's mock-up, drawn from every side), each shape moved by a CSS animation in style.css, so a place could use it as the friend does. Its gradients have fixed ids and are made once in the picture they are drawn in ({fn:FIRE_DEFS}), and that is the friend's picture.",
   "easy": "Make the fire's gradients in the place's picture once when it draws a fire (or name them by content), and a torch, a cauldron or a dragon statue breathing fire is a call (report 15 noted fire from things in a place as not built yet: ^du_report(15))."
  }
 ],
 "reorg_intro": "Three commits on the branch `ticket-564-redo`, off the release 0.0.428 (`fad0545`): the three made on 2026-10-22 on `ticket-564-reorg` (off 0.0.411), replayed onto today's code (the gem's code had changed under them once: its glimmer is off at first since 0.0.427, and the moved gem keeps that), each one re-organisation, with the agent instructions brought along in the same commit (the house rule) and the code's notes moved with the code they describe. None adds a feature; none changes a picture.",
 "commits": [
  {
   "title": "One namer for ids made from content, and the proof as a tool",
   "short": "one namer for ids",
   "why": "A drawing's clip paths need ids, and ticket 274's rule names them by what they hold, never by chance, so the same settings draw the same text. The hash that makes such a name was written twice: in the ninja's clips and in drawNow's clips for walking through a door. A crown's gem with a shine, or any new drawing with a clip, would have needed a third copy.",
   "moved": [
    "{fn:shapeId} (an id from a prefix and a hash of the text) and {fn:shapeClip} (a clip path of one path, named so) are new in js/02-helpers.js, with ticket 274's note;",
    "`ninjaClip` in js/06-costumes.js is gone: the ninja's slit, band and shine clips call {fn:shapeClip};",
    "the door clips (`fig-clip-…`) in {fn:drawNow}, js/18-drawing.js, call {fn:shapeId} in place of their own copy of the hash;",
    "`tools/same_friend.mjs` is new, the proof below; the agent instructions (The safety net; Testing: without a browser; The settings decide the picture; the ninja's clips) and tools/README.md say where both are."
   ],
   "proofNote": "The door clips are set on the page's own elements, outside drawNow's text, so the new namer was also checked against the old hash on 20,000 strings: the same ids, all 20,000."
  },
  {
   "title": "The gem, any drawing's",
   "short": "the gem",
   "why": "The ninja's gem (tickets 557 and 560) was a general gem in all but its name: a stone, a shape, a middle, a size and its lights. Its functions were named and kept as the ninja's, set in the ninja's gold, marked as the ninja's piece, with outline widths right only at the forehead's size. Matthew's three scenarios all want it elsewhere.",
   "moved": [
    "the stones and shapes, `NINJA_GEMS` and `NINJA_GEM_SHAPES` in js/01-state.js, are {fn:GEMSTONES} and {fn:GEMSTONE_SHAPES}, in a section of their own just before the ninja's, with a new {fn:GOLD} (the gold, its outline and its light), which the ninja's gold ({fn:NINJA}) and the crown ({fn:crownSvg}) now read: the same three colours as before;",
    "the gem's code, 120 lines in js/06-costumes.js, is a section of its own at the end of js/02-helpers.js, GEMS, under general names: `ninjaGemSvg` is {fn:gemSvg}, `ninjaGemSide` {fn:gemSideSvg}, `ninjaGemLights` {fn:gemLights}, `ninjaCut` {fn:gemCut}, `ninjaGemPath` {fn:gemstonePath}, `NINJA_GEM_CUTS` {fn:GEMSTONE_CUTS}, `ninjaGemTones` {fn:gemstoneTones}, `NINJA_GEM_REACH` {fn:GEMSTONE_REACH}, `ninjaRing` {fn:gemRing}, `ninjaStar` {fn:gemStarPath}, and the constants `GEM_CUT_PX`, `GEM_GLIMMER_S`, `GEM_SHINE_S`; its notes, Matthew's words from tickets 557 and 560 among them, moved with it;",
    "a `look` says how a caller names and sets its gem ({fn:GEM_LOOK}: `mark`, the attribute on its group; `ids`, its clip's prefix; `set`, the metal it sits in, or null for a loose stone); the ninja's is {fn:NINJA_GEM_LOOK} (`data-ninja=\"gem\"`, \"ninja-\", the band's gold), and {fn:ninjaGemFx} still turns the ninja's settings into its lights, beside its head band in js/06-costumes.js;",
    "the outline's width and the side view's widths and offsets are in proportion to the gem's size (at the ninja's sizes, 10 facing us and 11 from the side, they are the very numbers it drew before), so the same gem can be small on a forehead or big on a chest;",
    "the 🐯 Costume tab's two rows read the new tables; the ninja's settings keep their names (`ninjaGem`, `ninjaGemShape`, `ninjaGlimmer`, `ninjaGemStars`, `ninjaGemShine`), as saved files have them; `tools/checks/ninja557.mjs` reads the new table names; the agent instructions' ninja section names the new functions, and a recipe, **A gem**, says how to call it."
   ],
   "proofNote": "Of the 12,570, 5,184 draw the ninja's gem: every stone, shape and mix of lights, in six views, on three heads."
  },
  {
   "title": "What each costume wears for the shirt and pants",
   "short": "COSTUME_CLOTHES",
   "why": "A costume worn in the friend's own clothes replaces the shirt and pants, so every pose, facing and animation draws it (the gnome's recipe, ticket 431). Fourteen costumes did so with an `if` each, in the middle of the costume flags in {fn:drawNow}. Two costumes at once (ticket 562) needs one place to say whose clothes are worn, and a new costume's clothes should be one entry.",
   "moved": [
    "the fourteen `if`s in {fn:drawNow} (js/18-drawing.js) are one line, which looks the costume up in {fn:COSTUME_CLOTHES};",
    "{fn:COSTUME_CLOTHES} is new in js/06-costumes.js, beside the costumes' other tables: an entry per costume (the witch, the queen, the king, the knight, Robin Hood, the monk or dryad, the wizard, the gnome, the fairy, the scuba suit, the old diving suit, the robot, the cowgirl, the cowboy, the ninja), each taking the costume's settings and the friend's own shirt and pants and giving the two it wears, each with a note of its ticket;",
    "drawNow keeps the flags and values it uses later (the robot's `R`, the cowboy's `W`, the fairy's tunic, the witch's few webs); the robot's and the cowboy's entries work out their own, a few object lookups more per drawing;",
    "the agent instructions (how a costume is built; the ninja) say where a costume's clothes are now."
   ],
   "proofNote": "Every costume with clothes of its own is in the cases, in every view, pose and animation, and each of its rows in turn (the witch's few webs, the gnome man and woman, the dryad, each fairy tunic, every robot and cowboy style)."
  }
 ],
 "improve_intro": "Ranked by what they would open up, against what they cost; plain, not urgent. Each is a ticket of its own, with the same kind of proof.",
 "improve": [
  [
   "The friend's drawing as text, sharing nothing",
   "Split {fn:drawNow} (about 1,400 lines) into a function that makes the friend's drawing from a look and the page's part that shows it. It opens portraits, postcards and placed people without swapping the state, and it is what the proof already does by catching drawNow's text (S11)"
  ],
  [
   "One entry per costume",
   "Write each costume's settings once (default, row, label, box, when it shows) and make the four lists from it, as the residents are (S14). A new costume's settings are then one entry, not four lists, and a whole kind of slip goes: a key added to one list and not another"
  ],
  [
   "What is worn as a list",
   "After the entry per costume, read the costume's flags from a list of what is worn, under to over, with a rule per layer (S4). Two costumes at once in the game (after tickets 562 and 563), built on {fn:COSTUME_CLOTHES}"
  ],
  [
   "Animal suits by named parts",
   "Name each suit's ears, nose, tail and feet in {fn:ANIMALS}, so the 49 tests of a suit's name in the hood and tail drawings become tests of its parts (S6)"
  ],
  [
   "Named metals",
   "Gold is written out 35 times in six parts, in four shades (`#e0b030`, the crown's and the ninja's, now {fn:GOLD}; `#e8b923`, the throne's; `#e8c33a`, the chest's; `#d4a52a`, the scepter's back). Naming each shade where it is (it changes no picture) shows which ones mean the same metal; making them one would change pictures, Matthew's call"
  ],
  [
   "One treasure chest",
   "The king's room draws its chest of gold inline; the placeable chest is {fn:seaChestSvg}. One drawing for both (S2) keeps the connected views alike"
  ],
  [
   "Ids by content everywhere",
   "Fabrics (`pat-shirt`) and the fire's gradients (`fi-g-glow`) still have fixed ids, which is why placed people need theirs renamed ({fn:personOwnIds}); naming them with {fn:shapeId} lets any drawing use them twice (S9, S17)"
  ],
  [
   "A held thing is a thing",
   "Link each of {fn:HOLDABLES} to a placeable thing drawn from its floor view (S7), as the helmet already is"
  ],
  [
   "Prove every refactor of the friend on the laptop",
   "Run `tools/same_friend.mjs` before committing a refactor of the friend, and grow it to the places (it draws the friend only; the browser sweep on GitHub covers the places)"
  ]
 ],
 "next": [
  [
   "Read the three commits and decide each",
   "merge, keep or drop each of `ticket-564-redo`'s three commits (one namer for ids; the gem; what each costume wears for the shirt and pants). The third meets two costumes at once (tickets 562 and 563 drew and mocked it up; putting it in the game is a ticket still to make): merge it before that work, or let that work take it in. No picture changes, so none needs a version of its own"
  ],
  [
   "Gems in the crown",
   "if Matthew wants it: a 💎 choice of stone for the queen's and king's crown, drawn with gemSvg on the band, and a view of the crown from the side so the gems show in profile (a feature: the crown's picture changes)"
  ],
  [
   "Gems in the treasure chest",
   "if wanted: the chest's 💎 gems as loose cut stones (gemSvg, set: null), and the king's room's chest of gold drawn by seaChestSvg, one chest for both"
  ],
  [
   "Gems on swords, shields and thrones",
   "if wanted: a place for gems in each view of the sword and the shield (toward us, side, back, floor), and on a throne's crown and crest; in a place, the gems' lights still or shared, measured with 📏 at 60 frames a second"
  ],
  [
   "The friend's drawing as text",
   "split drawNow into the drawing (a look in, the friend's SVG text out) and the page's part, proved with tools/same_friend.mjs"
  ],
  [
   "One entry per costume, then what is worn as a list",
   "the costume's settings written once, the four lists made from it (proved by the structure check), then the flags read from a list of worn costumes, for ticket 562"
  ],
  [
   "Animal suits by named parts",
   "ears, nose, tail and feet named in ANIMALS, the hood and tail drawings testing those, every suit proved byte for byte"
  ],
  [
   "Keep the proof",
   "run tools/same_friend.mjs on the laptop before every refactor of the friend, and add the places to it"
  ]
 ],
 "proof": {
  "intro": "`tools/same_friend.mjs` (committed in commit 1) loads each page's parts (29 now) in a node vm of its own, the page a stand-in that answers anything, as `tools/check_load.mjs` does. {fn:drawNow} ends by writing the friend's whole drawing into a new picture element, as text; the stand-in document keeps that text. The same cases are drawn on both pages in the same order, each from the defaults, with the settings set through the game's own {fn:set} (so a costume goes on as the 🐯 Costume tab puts it on, with its colours, beard and hat), and compared byte for byte. The cases:",
  "cases": [
   "every costume (36, with none) facing us, to our left, to our right, away, and turned partway either way, in each of the six poses: 1,296 drawings;",
   "every costume in each of the eleven animations (walking, running, swimming, crawling, climbing, the jumps…), facing us, to our left and away: 1,188;",
   "every row of the 🐯 Costume tab shown for that costume (each choice, each colour, each toggle flipped, each slider at its ends), one at a time, facing us, to our left and away;",
   "each of the 8 things a hand holds, in each hand, toward us and in profile, with every costume, and the horse led and ridden;",
   "the ninja's gem: every stone (6) by every shape (6) by every mix of its three lights (8), in the six views, on three heads (the usual, a tall face, an alien one): 5,184 drawings.",
   "and, once per page, the structure: the defaults, every tab's rows (their data) and the names of the show-when rules."
  ],
  "noise": "The noise floor is 0: the release drawn twice, 12,570 cases each, gives the same text every time (Math.random is seeded alike on both sides before each case, as a dance picks its moves by chance, and the picture's clock is held at 0).",
  "limits": "What it does not cover: the places (the friend is drawn with no background; the gem and the clothes are the friend's alone, and the places' code was not touched, but a refactor of a place needs the browser sweep); anything drawn outside drawNow's text (the door clips, `fig-clip-…`, are set on the page's own elements, so commit 1's change there was checked by comparing the old hash with the new namer on 20,000 strings: all the same); and the panel itself (its rows' data is compared, not how they look)."
 },
 "how": [
  "Written on 2026-10-22 by Claude, for Matthew, from ticket 564, as ^du_report(18) on the branch `ticket-564-reorg` off 0.0.411; brought up to date on 2026-10-24 at his word (\"redo the remix preparation/reorg -- and file a fresh report with a fresh number\"): the three commits replayed onto `main` at `fad0545` (0.0.428) as `ticket-564-redo`, in the worktree `~/kcg-564b`, the proof run again on today's code, and the report numbered 19, since ^du_report(18) is now the Story Scripts Guide. A draft, not pushed: it is published on Matthew's word.",
  "The code was read at the release, and the scenarios' functions are looked up in this branch's parts when the page is built (`drivers/build.py`), so every line number is the branch's. The three re-organisations were made one at a time; after each, `python3 tools/check_script.py dress-up/index.html` and `node tools/check_load.mjs dress-up/index.html` passed, and `tools/same_friend.mjs` compared the release with the commit, one run each, in node under `nice`, one heavy job at a time (the laptop shuts down under load; no browser ran).",
  "The pictures in the scenarios are a demonstration, not the game: `drivers/demo564.mjs` loads the branch's parts in node and calls the re-organised gem beside drawings the game already has (the crown, the chest, the sword, the shield, a throne), to show what Matthew's three scenarios would look like. Figure 1 is the game's own drawing of the ninja, caught the same way. They were looked at as PNGs made by ffmpeg's librsvg; in the page they are the SVGs, their lights moving."
 ]
}