Files
Sanctification/docs/card-workspace.md
Daniel 72edcf7cc0 Add approved Matthew through Caleb cards and production fixes
Add 19 approved card packages and Timothy revision v03, storing permanent
binary assets through Git LFS while keeping generated review images local.

Enable harness file polling and verify unchanged used fonts when archiving
a previous approved card whose shared font manifest pin has become stale.
Preserve the original acceptance manifest and archival verification evidence.

Validation: 42 production tests, 9 harness test suites, TypeScript type check,
Vite production build, and integrity checks for all 20 card packages passed.
2026-10-04 18:08:11 -07:00

139 lines
12 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Card work and approval
Card production lives in `in-progress/cards/`. Pipeline, font, material, branding, and harness experiments live in `spikes/`. Explicitly approved card revisions live in `artifacts/cards/`; shared tier layers remain in `artifacts/layers/` and fonts remain in `fonts/`.
## Working layout
```text
in-progress/cards/BE-002-the-fall/
card.json # Stable ID, title, selected revision and stage
README.md
history/legacy/ # Migrated historical packages, not new work
revisions/v01/
card.json # This revision's actual content/build inputs
manifest.json # Stage, approval, input/export hashes
build.py # Revision-specific assembly entry point
source/ # Native art, prompts, fit and text authoring data
review/ # Review images, validation and assessments
low/manifest.json # 500 × 700
med/manifest.json # 1000 × 1400
high/manifest.json # 2000 × 2800
high/normal/
card.png
finish-mask.png
text-mask.png
card.svg # Optional editable master
high/boundless/
high/borderless/
high/textless/
```
Every local assembly has the same four printing directories. Normal and Borderless include applicable glyph masks; Textless and Boundless need no glyph protection, though an explicit zero map may be retained. Source/build records describe the whole revision and belong outside resolution folders. Resolution manifests contain exact dimensions and hashes for their own exports.
The entire `in-progress/` tree is local and ignored by Git. A local build still writes and validates all resolutions. Back up active native artwork and prompts through the normal workspace backup; they are not protected by a Git push while work remains here. On approval, source inputs, text records, resolution manifests and complete production exports move to `artifacts/cards/`. Permanent binary assets use Git LFS. Review rasters, review SVGs and rendering caches remain available locally but are excluded from new commits; textual assessments, provenance, approval wording and validation reports remain tracked. The exported low Normal card is the small durable visual reference.
Use the exact master-catalogue ID for `cardId` (for example **BE-002**). Keep the catalogue display title in `title` and a readable **ID-title** directory name in `folderName` (for example **BE-002-the-fall**). Build/application references select by `cardId` and revision through the progress index; they do not reconstruct the directory from the title. Folder names are generated when a card is first scaffolded and stay stable across later title edits unless an explicit rename updates the profile/index. Number new revisions explicitly (`v01`, `v02`, …); do not infer selection or approval from file timestamps. A card's root `card.json` selects its revision. [The progress index](../in-progress/index.json) resolves selected revisions in either location.
## Accepted layout
```text
artifacts/cards/BE-002-the-fall/
card.json # Content/build inputs and acceptance metadata
manifest.json # Exact accepted revision, e.g. v01, and hashes
build.py
source/
review/
low/ # 500 × 700, with its resolution manifest
normal/
boundless/
borderless/
textless/
med/ # 1000 × 1400, same printing directories
high/ # 2000 × 2800, same printing directories
```
The accepted directory holds one current approved card. Its manifest retains the revision number; there is no revision folder under `artifacts/cards/`. When a newer revision is approved, the replacement remains self-contained and the previous acceptance becomes a compact record at `in-progress/cards/[ID-title]/history/accepted-[revision]/`. Superseded working revisions similarly move to `history/revisions/[revision]/`.
Before compaction removes any originals or production exports, it creates and verifies an immutable snapshot in `artifacts/asset-archive/`. Snapshots retain all source inputs, exact production exports, original manifests, prompts and text evidence, excluding temporary review renders and caches. Content is stored once per SHA-256 and versioned through LFS. A previous acceptance is captured before relocation changes any manifest or SVG paths. Native artwork must never rely on a prompt for recreation.
Compact local history keeps the original full manifest as `full-manifest.json`, content/build and textual source/review records, and one 500 × 700 `card.png` for each available printing. Art-only iterations keep one 500 × 700 art reference. Medium/high exports, masks, source rasters and extra review images are removed from this local history only after archival verification. A `record.json` links the durable snapshot and records its SHA-256; compact records are historical references, not buildable canonical revisions. Archive creation failure blocks compaction.
## Git and asset storage
Install Git LFS before working with this repository. On an existing checkout:
```sh
git lfs install --local
git lfs pull
```
The existing Git server supplies the LFS endpoint; no separate bucket or asset URL is required. Native images, selected masters, accepted low/med/high exports and archive objects stay lossless. JSON, prompts, build code, shared SVG sources, fonts and text evidence remain ordinary Git files. LFS keeps binary data out of ordinary Git history; retaining every candidate in LFS would still consume storage, so use the local workspace for iteration and review renders.
Keep accepted packages at their existing paths so builds and the card harness continue to work. Complete current exports stay under LFS in this first storage change. Replacing exports with an on-demand cache is a separate change that requires verified rebuilds; an original generated image or exact approved printing must not be discarded on the assumption that it can be regenerated.
Archive snapshots and objects must be committed together. The LFS pre-push hook uploads the referenced objects to the Git server. Local archive verification establishes integrity; commit and push to publish the server copy. Server backups must include LFS objects alongside Git repositories. Do not rewrite old Git history or prune LFS objects as part of routine retention.
To preserve an active local revision without approving it, or recover an archived revision:
```sh
python3 tools/card-production/asset_archive.py archive \
--package in-progress/cards/ID-title/revisions/v02
python3 tools/card-production/asset_archive.py verify \
--snapshot artifacts/asset-archive/snapshots/ID/v02/SNAPSHOT.json
python3 tools/card-production/asset_archive.py restore \
--snapshot artifacts/asset-archive/snapshots/ID/v02/SNAPSHOT.json \
--output in-progress/recovered/ID-v02
```
Use the snapshot path printed by `archive` or recorded under `assetArchive` in compact history. Restore requires an empty destination and verifies every object before writing. File symlinks restore as their archived bytes, so deleted historical link targets cannot lose source art; the snapshot retains original link text as provenance. Shared fonts/layers remain centrally pinned, and a restored package still needs the appropriate shared versions and build validation before reuse.
## New work
From `sanctification/`:
```sh
python3 tools/card-production/card_workspace.py new \
--card BE-002 --title 'The Fall' --rarity Extraordinary --revision v02
python3 tools/card-production/card_workspace.py status
```
The scaffold starts at **art-review** with empty printing folders. During illustration prototyping, retain native art, prompt and recorded fit under `source/`, with review images under `review/`; do not generate final printing exports or masks. Once the artwork is explicitly approved, assemble using the pinned shared layers/fonts and the pipeline's finish contract, set the revision and card profile to **assembly-review**, then refresh and validate its manifests:
```sh
python3 tools/card-production/card_workspace.py refresh --card BE-002 --revision v02
python3 tools/card-production/card_workspace.py validate --card BE-002 --revision v02
```
`refresh` records current working inputs/exports; it does not generate card art or printings. `validate` checks recorded hashes, dimensions, opaque faces, grayscale maps, linked SVG inputs and pinned shared assets. Imported proofs retain their original validation records; migration is not a new rendering or GPU validation.
The four imported `v01` revisions have wrapper builds that call the retained tier comparison builder and refresh their manifests. The comparison's `cards.json` now references canonical card IDs/revisions rather than duplicating their content records. New cards should have their own subject-specific builders and no dependency on the four-card comparison.
## Final card approval
Artwork approval and final card approval are separate. Only after the user explicitly approves an exact complete card revision should a production session run:
```sh
python3 tools/card-production/card_workspace.py approve \
--card BE-002 --revision v02 --approval-note 'Exact user approval wording'
```
The tool validates the assembled revision, internalizes any live input borrowed from older work, moves the entire revision to `artifacts/cards/BE-002-the-fall/`, records the approval, updates the index and compatibility links, and adjusts linked SVG/input paths for the new directory depth. It then compacts superseded working and accepted revisions using the retention rule above. It does not install harness fixtures. Approved revisions are frozen; revisions to them begin in a new working revision.
When archiving a previous user-approved acceptance, a stale shared-font manifest pin may be verified against its original passed build report instead: every recorded used font must retain its exact shared path, role, weight and SHA-256, with no fallback or missing glyphs, and current shared font assets must match their manifest. The old package's file, layer and export checks still run. This exception applies only to the previous acceptance being archived during replacement; working revisions and ordinary `validate` remain strict. The archive retains the exact original acceptance manifest and the verification evidence under `review/` before its relocation metadata is refreshed. Missing evidence or changed used fonts blocks promotion rather than repinning an active or frozen card in place.
To apply the same cleanup once to a card accepted before this policy:
```sh
python3 tools/card-production/card_workspace.py compact --card BE-002
```
## Existing work migration
The September 14, 2026 migration moved 24 historical packages into per-card `history/legacy/` and organized the existing four-tier comparison exports as `v01`. None of these cards was promoted or given final approval. Original spike paths are compatibility symlinks so earlier documentation, recorded hashes, source references and historical builders continue to resolve. Historical packages and reports keep their original internal layout and paths; new production follows the standardized layout above. Archived font/harness compatibility links belong only to history, not new card authoring.
The follow-up [catalogue identity migration](../in-progress/catalogue-id-migration-2026-09-14.json) assigns the four user-supplied master IDs and renames their card folders. Old title-only card paths remain compatibility links. Revision `title` is catalogue metadata; existing `name` values remain the previously typeset display titles. Imported comparison records use `exportPrefix` solely for legacy fixture filenames, never as the catalogue identity.
[Migration record](../in-progress/migration-2026-09-14.json) records preserved historical hashes, canonical export hashes and editable SVG path adjustments. Images were moved without regeneration, resampling or grading. The tier comparison remains a pipeline experiment in `spikes/`, referencing the standardized cards.
The later accepted-layout migration flattens the accepted BE-002 and BE-010 packages, retaining their `v01` manifest identities and every PNG byte. [Layout validation](../artifacts/cards/layout-migration-2026-09-14.json) records the preserved hashes. Legacy files and compatibility links subsequently deleted by the user are not restored.