Skip to content

Commit 59ce350

Browse files
authored
Merge pull request #51 from Daren9m/codex/issue-28-visual-pipeline
Add complete bestiary visual description pipeline
2 parents 8d181dd + 2db75e2 commit 59ce350

29 files changed

Lines changed: 44582 additions & 1 deletion

docs/bestiary-image-pipeline.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Bestiary image pipeline
2+
3+
The bestiary image workflow is deliberately split into description, review, and image stages. An image prompt cannot be compiled until its monster visual record is approved.
4+
5+
## Source and attribution
6+
7+
The monster index includes material from the *System Reference Document 5.2.1* by Wizards of the Coast LLC, [available from D&D Beyond](https://www.dndbeyond.com/srd) and licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode). The visual sidecar preserves that attribution and the pinned source commit in `src/data/monster-visuals.json`. Generated descriptions and images must remain original expressions; do not copy third-party prose or artwork.
8+
9+
## Files
10+
11+
- `src/data/monster-visuals.json` is the editable sidecar keyed by `monsterId`. It contains source facts, description fields, review/image status, prompt version, and a hash of visual-relevant monster inputs.
12+
- `src/data/monster-visual-batches.json` assigns every monster exactly once to the pilot or one of 11 production batches.
13+
- `src/lib/monster-visuals.ts` defines the schema, art bible, validation, hashing, batching, and prompt compiler.
14+
- `scripts/enrich-bestiary-visuals.ts` synchronizes records after a bestiary import without replacing authored descriptions.
15+
16+
## Workflow
17+
18+
1. Run `npm run import:bestiary` when the pinned SRD source changes.
19+
2. Run `npm run visuals:sync`. New monsters receive pending records populated only with structured source facts.
20+
3. Author the physical description fields for a batch. Record distinguishing anatomy, silhouette, surface materials, palette, pose, environment, required elements, forbidden elements, and accessible alt text. Stage the 14-monster pilot with `npm run visuals:seed-pilot` and the remaining 317 descriptions with `npm run visuals:seed-production`. Both commands preserve matching reviewed records and refuse to replace any description that has subsequently been edited.
21+
4. Review against the licensed source and set `reviewStatus` to `approved`. Set `imageStatus` to `ready` only when the description is ready for generation.
22+
5. Compile the prompt through `compileMonsterImagePrompt`, generate candidate images, and track review through `draft` and `approved`.
23+
6. Run `npm run visuals:audit`, `npm run visuals:check`, `npm test`, and `npm run typecheck` before merging.
24+
25+
If a monster's visual-relevant inputs or the prompt version changes, synchronization preserves its authored text but marks approved work `needs-revision`. Duplicate or orphaned records stop synchronization rather than being silently discarded.
26+
27+
Run `npm run visuals:export-review` to create a batch-by-batch Markdown review packet under `docs/visual-review`. Those files are generated views; make corrections in the sidecar or authored seed source and export again.
28+
29+
## Batch contract
30+
31+
The pilot contains one representative of each creature type in a fixed order. After removing those 14 monsters, the remaining 317 are sorted by challenge rating, then name, then ID. Production batches 1–9 contain 29 monsters each; batches 10–11 contain 28 each. The manifest contains no timestamps, so repeated generation is byte-stable.

docs/visual-review/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Monster visual review
2+
3+
These files are generated from `src/data/monster-visuals.json`. Edit the sidecar or authored seed source, not these review files.
4+
5+
Source: *System Reference Document 5.2.1* by Wizards of the Coast LLC, CC-BY-4.0.
6+
7+
| Batch | Monsters | Pending | Approved | Needs revision |
8+
| --- | ---: | ---: | ---: | ---: |
9+
| [14-type style pilot](./pilot.md) | 14 | 14 | 0 | 0 |
10+
| [Production batch 1](./production-01.md) | 29 | 29 | 0 | 0 |
11+
| [Production batch 2](./production-02.md) | 29 | 29 | 0 | 0 |
12+
| [Production batch 3](./production-03.md) | 29 | 29 | 0 | 0 |
13+
| [Production batch 4](./production-04.md) | 29 | 29 | 0 | 0 |
14+
| [Production batch 5](./production-05.md) | 29 | 29 | 0 | 0 |
15+
| [Production batch 6](./production-06.md) | 29 | 29 | 0 | 0 |
16+
| [Production batch 7](./production-07.md) | 29 | 29 | 0 | 0 |
17+
| [Production batch 8](./production-08.md) | 29 | 29 | 0 | 0 |
18+
| [Production batch 9](./production-09.md) | 29 | 29 | 0 | 0 |
19+
| [Production batch 10](./production-10.md) | 28 | 28 | 0 | 0 |
20+
| [Production batch 11](./production-11.md) | 28 | 28 | 0 | 0 |

0 commit comments

Comments
 (0)