Files
Sanctification/docs/card-workspace.md
Daniel 57202b90b1 Move card binaries to Git LFS and preserve archived revisions
Keep permanent image assets and accepted exports in Git LFS at their existing paths. Stop tracking temporary card review renders and caches while preserving local files.

Archive source inputs, exact exports and text evidence by SHA-256 before compacting superseded revisions, with integrity verification and restoration support. Keep existing Git history and pending card/harness work separate.

Validation: 35 production tests passed against an isolated checkout of the staged migration; local image checksums and LFS pointers were verified.
2026-10-04 17:46:31 -07:00

12 KiB
Raw Blame History

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

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 resolves selected revisions in either location.

Accepted layout

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:

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:

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/:

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:

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:

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.

To apply the same cleanup once to a card accepted before this policy:

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 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 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 records the preserved hashes. Legacy files and compatibility links subsequently deleted by the user are not restored.