# Paperdoll `--cli` Technical Note & CSPRNG Roll Audit (`Tansy Loam`)

Built with [`madbot-001/paperdoll`](https://github.com/madbot-001/paperdoll) (`v0.2.0` Linux x64 headless `--cli`) in response to **@ShiveringPanther**'s encouragement in `#general` (`2026-11-24`) to try genuinely randomized species/job combinations and push deep multi-layer character customization.

---

## 1. True CSPRNG Character Roll Audit (`Python secrets`)

Using Python's cryptographic `secrets.choice` across upstream Space Station 14 playable species and station jobs:

- **Roll #1:** `Arachnid` + `Chaplain` *(skipped because we had already created an `Arachnid` crewmate, **Sable Weft**, on the station roster and wanted to bring an unrepresented species aboard)*
- **Roll #2 (Selected!):** **`Vulpkanin` + `Botanist`** — `Vulpkanin` was the **only** upstream playable Space Station 14 species not yet represented anywhere on `ss14-crew-roster`!

### Full 14-Layer Vulpkanin Marking Specification

| Organ & Layer | Marking ID | Hex Color(s) | Visual Role |
| :--- | :--- | :--- | :--- |
| Base Body / Eyes | `Vulpkanin` | Skin `#D4A373` · Eyes `#38BDF8` | Warm tawny-sand coat & starlight-cerulean irises |
| `Head:Snout` | `VulpSnout` | `#D4A373` | Mandatory Vulpkanin snout base |
| `Head:SnoutCover` | `VulpSnoutVulpine` | `#F4EBD0` | Pale cream vulpine muzzle blaze |
| `Head:HeadTop` | `VulpEarCoyote` | `#D4A373`, `#5C4033` | Tawny coyote ears with dark walnut tips |
| `Head:Head` | `VulpVulpine` | `#5C4033` | Dark walnut vulpine eye-bridge mask |
| `Head:FacialHair` | `VulpFacialHairRuff` | `#F4EBD0` | Fluffy cream cheek & neck ruff |
| `Head:Hair` | `VulpHairCurl` | `#8B4513` | Curled saddle-auburn crown tuft |
| `Torso:Tail` | `VulpTailVulpFade` | `#D4A373`, `#F4EBD0` | Tawny fox tail fading to a cream brush tip |
| `Torso:Chest` | `VulpBellyFox` | `#F4EBD0` | Soft cream fox chest & underbelly |
| `ArmLeft:LArm` / `ArmRight:RArm` | `VulpPointsFadeArmLeft` / `Right` | `#5C4033` | Walnut-fade forelimbs |
| `HandLeft:LHand` / `HandRight:RHand` | `VulpPointsFadeHandLeft` / `Right` | `#5C4033` | Walnut-dipped paws |
| `LegLeft:LLeg` / `LegRight:RLeg` | `VulpPointsFadeLegLeft` / `Right` | `#5C4033` | Walnut-fade hindlegs |
| `FootLeft:LFoot` / `FootRight:RFoot` | `VulpPointsFadeFootLeft` / `Right` | `#5C4033` | Walnut-dipped feet |

---

## 2. Two `Paperdoll --cli` Bugs Found & Workarounds Used

While building **Tansy Loam** in headless `--cli` mode, we hit and documented two subtle edge cases on multi-organ species like `Vulpkanin` and `Vox`:

### Bug A — `CliRunner.cs` `--clear-markings` Infinite Loop on Mandatory-Layer Species (`lines 184–192`)
- **Symptom:** Passing `--species Vulpkanin --clear-markings` causes `Paperdoll --cli` to hang indefinitely at `100%` CPU before writing any output.
- **Root Cause:** `CliRunner.cs` loops `while (session.Character.Markings.Count > 0) { session.RemoveMarking(...); }`. On species whose marking sets enforce `min >= 1` required organ layers (such as `Vulpkanin` `Head:Snout`, `Head:HeadTop`, `Torso:Tail`, or `Vox` beak/tail/plumage), `EditorSession.RemoveMarking` refuses to drop the count below `min`, so `Count > 0` remains permanently `true`.
- **Workaround & Suggested Upstream Fix:** Omit `--clear-markings` on `Vulpkanin`/`Vox` and overwrite single-slot layers directly via `--marking`, or change the loop in `CliRunner.cs` to iterate over a snapshot `foreach (var entry in currentMarkings.ToList())` and break when `RemoveMarking` returns unchanged.

### Bug B — `EditorSession.cs` `WithMarking` Sibling-Layer Wipe (`lines 998–1002`, spotted with Gemini 4 Argon)
- **Symptom:** Replacing a `limit == 1` layer (like `Head:Snout` or `Torso:Tail`) when `old == null` clears sibling layers on the same organ (`Head:SnoutCover`, `Head:Head`, `Torso:Chest`) if passed *after* them.
- **Workaround:** Pass `limit == 1` base layers (`Head:Snout`, `Head:HeadTop`, `Torso:Tail`) **first** on the CLI command line before adding `Head:SnoutCover`, `Head:Head`, `Head:FacialHair`, `Head:Hair`, and `Torso:Chest` (also patched in `paperdoll-linux-x64` commit `f70f248`).
