A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
tools: generate the manifest AI-disclosure review text (#45) (#176)
agamrafaeli-instinct26d79f03308c
diff --git a/docs/ai-disclosure.md b/docs/ai-disclosure.mdnew file mode 100644index 000000000..ffd2d5dff--- /dev/null+++ b/docs/ai-disclosure.md@@ -0,0 +1,16 @@+# AI-content disclosure (manifest review text)++Generated from ASSETS.yaml and ASSETS.portraits.yaml. Only rows explicitly marked ai_generated: true are listed.++Nothing is generated live while you play.++This is not a licence clearance or a completed store content survey. owner-verify rows still need their recorded review. It does not decide whether AI-assisted script drawings should be flagged, expand globs into files, or infer flags from source wording.++## Images++| Asset pattern | Manifest | Recorded source | Review status |+| --- | --- | --- | --- |+| docs/images/hero-concept-1936.jpg | ASSETS.yaml | Web copy of promo/final/03-gameplay-1936.png (published 2026-10-10); same provenance as promo/final | owner-verify |+| promo/final/0[1-8]-*.png | ASSETS.yaml | ElevenLabs Image API /v1/flows/image (GPT Image 2.5, Nano Banana Pro), prompts in promo/shots.json, generated 2026-10-08/09 by promo/gen.py; text fixes by promo/patch.py | owner-verify |+| promo/ref/*-src.jpg | ASSETS.yaml | Earlier promo/gen.py outputs used as edit inputs for the *_fix shots in promo/shots.json (commit d42bd6b) | owner-verify |+| unity/Assets/WebGLTemplates/Statecraft/favicon.ico | ASSETS.yaml | Original geometric drawing for the WebGL page's tab icon (issue #47): a gold hexagon with a cream serif I on navy, in the loading page's colours; 16, 32 and 48 px; made 2026-10-11 for PR #169 | verified |diff --git a/scripts/oss/ai_disclosure.py b/scripts/oss/ai_disclosure.pynew file mode 100644index 000000000..616af5606--- /dev/null+++ b/scripts/oss/ai_disclosure.py@@ -0,0 +1,78 @@+#!/usr/bin/env python3+# /// script+# requires-python = ">=3.11"+# dependencies = ["pyyaml==6.0.3"]+# ///+"""Generate review text only from explicit AI flags in the two asset manifests."""+from __future__ import annotations+import argparse+from pathlib import Path+import yaml++KINDS = {+ 'Images': {'.png', '.jpg', '.jpeg', '.webp', '.gif', '.ico', '.svg', '.tif', '.tiff'},+ 'Video': {'.mp4', '.mov', '.webm'},+ 'Audio': {'.wav', '.mp3', '.ogg', '.flac'},+ '3D models': {'.fbx', '.obj', '.blend', '.gltf', '.glb'},+}+++def read_manifests(root: Path):+ rows = []+ for name in ('ASSETS.yaml', 'ASSETS.portraits.yaml'):+ data = yaml.safe_load((root / name).read_text(encoding='utf-8'))+ if not isinstance(data, dict) or not isinstance(data.get('rules'), list):+ raise ValueError(f'{name}: rules must be a list')+ rows.extend((name, row) for row in data['rules'])+ return rows+++def plain(value):+ return str(value).replace('|', '\\|').replace('\n', ' ')+++def render(rows):+ groups = {key: [] for key in [*KINDS, 'Other']}+ for manifest, row in rows:+ if not isinstance(row, dict):+ raise ValueError(f'{manifest}: each rule must be a mapping')+ if 'ai_generated' in row and not isinstance(row['ai_generated'], bool):+ raise ValueError(f'{manifest}: ai_generated must be a boolean')+ if row.get('ai_generated') is not True:+ continue+ for field in ('glob', 'source', 'status'):+ if not isinstance(row.get(field), str) or not row[field].strip():+ raise ValueError(f'{manifest}: flagged rule requires {field}')+ suffix = Path(row['glob']).suffix.lower()+ kind = next((k for k, extensions in KINDS.items() if suffix in extensions), 'Other')+ groups[kind].append((row['glob'], manifest, row['source'], row['status']))+ lines = ['# AI-content disclosure (manifest review text)', '',+ 'Generated from ASSETS.yaml and ASSETS.portraits.yaml. Only rows explicitly marked ai_generated: true are listed.', '',+ 'Nothing is generated live while you play.', '',+ 'This is not a licence clearance or a completed store content survey. owner-verify rows still need their recorded review. It does not decide whether AI-assisted script drawings should be flagged, expand globs into files, or infer flags from source wording.', '']+ if not any(groups.values()):+ lines += ['No asset rows are marked ai_generated: true.', '']+ for kind, entries in groups.items():+ if not entries:+ continue+ lines += [f'## {kind}', '', '| Asset pattern | Manifest | Recorded source | Review status |',+ '| --- | --- | --- | --- |']+ lines += ['| ' + ' | '.join(plain(x) for x in entry) + ' |' for entry in sorted(entries)]+ lines.append('')+ return '\n'.join(lines)+++def main():+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('--root', type=Path, default=Path(__file__).resolve().parents[2])+ parser.add_argument('--output', type=Path)+ args = parser.parse_args()+ text = render(read_manifests(args.root))+ if args.output:+ args.output.write_text(text, encoding='utf-8')+ else:+ print(text, end='')+++if __name__ == '__main__':+ main()diff --git a/scripts/oss/tests/test_ai_disclosure.py b/scripts/oss/tests/test_ai_disclosure.pynew file mode 100644index 000000000..2dd0bb0f0--- /dev/null+++ b/scripts/oss/tests/test_ai_disclosure.py@@ -0,0 +1,57 @@+"""Manifest-driven AI disclosure, not an inferred licence or store-policy verdict."""+import importlib.util+from pathlib import Path+import pytest++ROOT = Path(__file__).resolve().parents[3]+SPEC = importlib.util.spec_from_file_location('ai_disclosure', ROOT / 'scripts/oss/ai_disclosure.py')+++def module():+ m = importlib.util.module_from_spec(SPEC)+ SPEC.loader.exec_module(m)+ return m+++def test_only_explicit_true_rows_from_both_manifests():+ rows = [+ ('ASSETS.yaml', {'glob': 'b.png', 'ai_generated': True, 'source': 'model', 'status': 'owner-verify'}),+ ('ASSETS.portraits.yaml', {'glob': 'a.jpg', 'ai_generated': True, 'source': 'portrait model', 'status': 'verified'}),+ ('ASSETS.yaml', {'glob': 'script.png', 'source': 'AI-assisted script'}),+ ('ASSETS.yaml', {'glob': 'false.png', 'ai_generated': False}),+ ]+ text = module().render(rows)+ assert 'a.jpg' in text and 'b.png' in text+ assert 'script.png' not in text and 'false.png' not in text+ assert 'ASSETS.portraits.yaml' in text and 'owner-verify' in text+ assert 'Nothing is generated live while you play.' in text+ assert 'not a licence clearance' in text+++def test_grouped_by_kind_and_deterministic():+ rows = [('A', {'glob': x, 'ai_generated': True, 'source': 's', 'status': 'verified'})+ for x in ['z.mp4', 'a.wav', 'x.fbx', 'b.png', 'x.xyz']]+ m = module()+ assert m.render(rows) == m.render(list(reversed(rows)))+ for heading in ['Images', 'Video', 'Audio', '3D models', 'Other']:+ assert '## ' + heading in m.render(rows)+++def test_invalid_ai_flag_fails_instead_of_silently_omitting():+ with pytest.raises(ValueError, match='ai_generated must be a boolean'):+ module().render([('A', {'glob': 'a.png', 'ai_generated': 'true'})])+++def test_empty_disclosure_is_honest():+ assert 'No asset rows are marked' in module().render([])+++def test_checked_in_output_matches_current_manifests():+ m = module()+ assert (ROOT / 'docs/ai-disclosure.md').read_text(encoding='utf-8') == m.render(m.read_manifests(ROOT)), \+ 'docs/ai-disclosure.md is stale: run uv run scripts/oss/ai_disclosure.py --output docs/ai-disclosure.md'+++def test_incomplete_flagged_rule_fails():+ with pytest.raises(ValueError, match='requires source'):+ module().render([('A', {'glob': 'a.png', 'ai_generated': True, 'status': 'verified'})])diff --git a/tools/README.md b/tools/README.mdindex a1501091b..bd113f987 100644--- a/tools/README.md+++ b/tools/README.md@@ -62,3 +62,10 @@ Rain-gauge data: Israel Meteorological Service (השירות המטאורולוCHELSA is CC0 (no attribution required); both are credited here and should be credited in the game credits alongside theCopernicus notice.++## Manifest AI-disclosure review text (#45)++`uv run scripts/oss/ai_disclosure.py --output docs/ai-disclosure.md` regenerates the checked-in review text from+`ASSETS.yaml` and `ASSETS.portraits.yaml`. It groups only explicit `ai_generated: true` rows by media kind,+keeps source/status and manifest names, and includes the README's no-live-generation statement. It does not+change flags, clear licences, expand asset patterns into filenames, or answer the store content survey.