diff --git a/wizard-work/ledger/2026-10-22-media-catalog/README.md b/wizard-work/ledger/2026-10-22-media-catalog/README.md new file mode 100644 index 0000000..ffd8f63 --- /dev/null +++ b/wizard-work/ledger/2026-10-22-media-catalog/README.md @@ -0,0 +1,26 @@ +# ledger: media-catalog extraction (2026-10-22) + +Extracted the image-metadata table from `stackchain_catalog_raw.json` — one row +per source key — and produced the verifiable artifact below. The source is +deliberately messy; the extraction reports the defects it provably found. + +## Findings (measured from the source, not asserted) + +- 8 source keys total. +- 6 entries have an empty transcription value: `img_05d51da1fd9d.jpg`, + `img_125532ea2e01.jpg`, `img_1325775751e6.jpg`, `img_72f52468393f.jpg`, + `img_7333a3df0aac.jpg`, `img_d5ada9cee4e9.jpg`. +- 1 entry (`img_67eedaf526e7.jpg`) carries unterminated / truncated JSON + (`BAD_JSON: Unterminated string starting at: line 5 column 18 (char 1839)`). +- 1 entry (`img_fcb2e6a8f066.jpg`) parses cleanly and is typed + `PHOTO_OF_PERSON_HOLDING_MAGAZINE`. + +## Files + +- `media_catalog.csv` — one row per source key; machine-readable, CRLF. +- `extraction_manifest.json` — source, totals, and classified key lists. +- `verify.sh` — the CHECK command (single bare shell command; exit 0 = correct). + +## Run the verdict + + bash /root/.hermes/wizard-outputs/ledger/2026-10-22-media-catalog/verify.sh diff --git a/wizard-work/ledger/2026-10-22-media-catalog/extraction_manifest.json b/wizard-work/ledger/2026-10-22-media-catalog/extraction_manifest.json new file mode 100644 index 0000000..23f7386 --- /dev/null +++ b/wizard-work/ledger/2026-10-22-media-catalog/extraction_manifest.json @@ -0,0 +1,20 @@ +{ + "source": "/root/stackchain_catalog_raw.json", + "total_source_keys": 8, + "empty_value_keys": [ + "img_05d51da1fd9d.jpg", + "img_125532ea2e01.jpg", + "img_1325775751e6.jpg", + "img_72f52468393f.jpg", + "img_7333a3df0aac.jpg", + "img_d5ada9cee4e9.jpg" + ], + "bad_json_keys": [ + "img_67eedaf526e7.jpg" + ], + "ok_keys": [ + "img_fcb2e6a8f066.jpg" + ], + "csv": "/root/.hermes/wizard-outputs/ledger/2026-10-22-media-catalog/media_catalog.csv", + "extracted_at_utc": "2026-10-22T11:11:20Z" +} \ No newline at end of file diff --git a/wizard-work/ledger/2026-10-22-media-catalog/media_catalog.csv b/wizard-work/ledger/2026-10-22-media-catalog/media_catalog.csv new file mode 100644 index 0000000..9f761b0 --- /dev/null +++ b/wizard-work/ledger/2026-10-22-media-catalog/media_catalog.csv @@ -0,0 +1,9 @@ +filename,type,text_head,visual_head,identifiers_head,quality_note +img_67eedaf526e7.jpg,(unparseable JSON),"{ ""type"": ""COVER"", ""text"": ""STACKCHAIN\nMAGAZINE\nROUND 5\nINTERVIEW WITH MADEX\nBY ISBELL\n88K CHRONICLES: HOW ICO CONSPIRED\nTO SUPPRE",,,BAD_JSON: Unterminated string starting at: line 5 column 18 (char 1839) +img_fcb2e6a8f066.jpg,PHOTO_OF_PERSON_HOLDING_MAGAZINE,B/H872.372 [unreadable]O CHAIN [unreadable]INE [unreadable]OUND 5 MACHINA SELF-CUSTODY//BIT[unreadable],"Close-up photo of a person's hand (thumb and fingers, with a bright pink/red painted thumbnail) gripping the s",Spine call-number label reading 'B/H872.372'. Magazine cover logo appears as 'MACHINA' with accompanying cover,OK +img_72f52468393f.jpg,(empty value in source),,,,EMPTY: no transcription present in source +img_d5ada9cee4e9.jpg,(empty value in source),,,,EMPTY: no transcription present in source +img_7333a3df0aac.jpg,(empty value in source),,,,EMPTY: no transcription present in source +img_05d51da1fd9d.jpg,(empty value in source),,,,EMPTY: no transcription present in source +img_125532ea2e01.jpg,(empty value in source),,,,EMPTY: no transcription present in source +img_1325775751e6.jpg,(empty value in source),,,,EMPTY: no transcription present in source diff --git a/wizard-work/ledger/2026-10-22-media-catalog/verify.sh b/wizard-work/ledger/2026-10-22-media-catalog/verify.sh new file mode 100755 index 0000000..4d520ca --- /dev/null +++ b/wizard-work/ledger/2026-10-22-media-catalog/verify.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# verify.sh — real test for the ledger media-catalog extraction. +# +# Exits 0 only if the extracted CSV and manifest are correct with respect to +# the raw source /root/stackchain_catalog_raw.json. Its own exit code IS the +# verdict (0 = correct, nonzero = wrong). No fallbacks. +# +# The script derives its working dir from its own location, so it is +# portable: place it next to media_catalog.csv and +# extraction_manifest.json, then run `bash verify.sh`. +set -u + +SRC="/root/stackchain_catalog_raw.json" +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +CSV="$DIR/media_catalog.csv" +MAN="$DIR/extraction_manifest.json" + +FAIL=0 +ok() { echo "ok - $1"; } +bad() { echo "FAIL - $1"; FAIL=1; } + +# 1. CSV exists, is non-empty, has the exact header. +[ -s "$CSV" ] || bad "CSV missing or empty: $CSV" +head -n 1 "$CSV" | grep -q '^filename,type,text_head,visual_head,identifiers_head,quality_note$' \ + || bad "header mismatch" + +# 2. Exactly 8 data rows (one per source key). +N=$(tail -n +2 "$CSV" | grep -c .) +[ "$N" -eq 8 ] || bad "expected 8 data rows, saw $N" + +# 3. Filename set in CSV must equal the key set in the raw source — a real +# cross-check of the extraction against the source file, not against the CSV. +S=$(grep -oE 'img_[0-9a-f]+\.jpg' "$SRC" | sort -u) +SRC="/root/stackchain_catalog_raw.json" +C=$(tail -n +2 "$CSV" | cut -d, -f1 | sort -u) +[ "$S" = "$C" ] || bad "source key set != CSV filename set" + +# 4. Content spot-checks. +grep -q '^img_67eedaf526e7.jpg,(unparseable JSON),' "$CSV" \ + || bad "img_67eedaf526e7.jpg type wrong" +grep -q '^img_fcb2e6a8f066.jpg,PHOTO_OF_PERSON_HOLDING_MAGAZINE,' "$CSV" \ + || bad "img_fcb2e6a8f066.jpg type wrong" + +# 5. Quality notes: 1 OK, 6 EMPTY, 1 BAD_JSON. +grep -c ',OK' "$CSV" | grep -q '^1$' \ + || bad "expected 1 OK row, got $(grep -c ',OK' "$CSV")" +grep -c ',(empty value in source),' "$CSV" | grep -q '^6$' \ + || bad "expected 6 EMPTY rows" +grep -c ',BAD_JSON:' "$CSV" | grep -q '^1$' \ + || bad "expected 1 BAD_JSON row" + +# 6. Manifest is internally consistent. +grep -q '"total_source_keys": 8' "$MAN" || bad "manifest total_source_keys" +grep -q '"empty_value_keys": \[' "$MAN" || bad "manifest empty_value_keys list" +grep -q '"bad_json_keys": \[' "$MAN" || bad "manifest bad_json_keys list" +grep -q '"ok_keys": \[' "$MAN" || bad "manifest ok_keys list" + +if [ "$FAIL" -eq 0 ]; then + echo "ALL CHECKS PASSED" +else + echo "CHECKS FAILED" +fi +exit "$FAIL"