SOURCE EXPLORER / 資料ブラウザー
collect-generation.py
実装と資料を、行ごとに確かめる。
日常訳はAIを用いて作成された翻訳です。人間の聖書学・原語の専門家による全訳の検証は確認されていません。既存の翻訳や原語資料と照らし合わせてお読みください。
1"""Read-only extraction: stdout is a public metadata record; no verse text/logs."""2import argparse3import collections4import hashlib5import json6from pathlib import Path78parser = argparse.ArgumentParser()9parser.add_argument('--source-output', type=Path, required=True)10args = parser.parse_args()11root = Path(__file__).resolve().parents[3]12audit_path = root / 'cli/translate-bible/reports/nichijo-v1-numbering-alignment.json'13raw_audit = audit_path.read_bytes()14audit = json.loads(raw_audit)15models = collections.Counter()16dates = []17matched = missing = changed = records = undated = 018for name, expected in audit['input_files'].items():19path = args.source_output / name20if not path.is_file():21missing += 122continue23raw = path.read_bytes()24if hashlib.sha256(raw).hexdigest() != expected:25changed += 126continue27matched += 128for verse in json.loads(raw)['verses'].values():29records += 130models[verse.get('model', 'unrecorded')] += 131if verse.get('timestamp'):32dates.append(verse['timestamp'])33else:34undated += 135usage = audit['usage']36stages = [37('initial_alignment', usage['initial_alignment']['batches']),38('repair_proposals', usage['repair_round']['batches']),39('repair_verification', usage['repair_round']['independent_verification']['usage']),40]41fields = ['input_tokens', 'cache_creation_input_tokens', 'cache_read_input_tokens', 'output_tokens']42rows = []43for stage, batches in stages:44entries = []45for batch in batches:46entry = {'record': batch.get('batch', batch.get('file')),47'response_sha256': batch.get('response_sha256', batch.get('sha256')),48'model_labels': [batch['model']] if 'model' in batch else list(batch['modelUsage']),49'tokens': {field: batch['usage'][field] for field in fields},50'is_error': batch.get('is_error'),51'terminal_reason': batch.get('terminal_reason')}52entries.append(entry)53totals = {field: sum(e['tokens'][field] for e in entries) for field in fields}54rows.append({'stage': stage, 'requests': len(entries), 'tokens': totals,55'total_tokens': sum(totals.values()), 'records': entries})56print(json.dumps({57'captured_at': '2026-10-03',58'audit_sha256': hashlib.sha256(raw_audit).hexdigest(),59'generation': {'scope': 'Only local source chapter files whose SHA-256 matches the release audit input_files.',60'matched_chapter_files': matched, 'missing_chapter_files': missing, 'changed_chapter_files': changed,61'source_records': records, 'models': dict(models), 'earliest_record_timestamp': min(dates),62'latest_record_timestamp': max(dates), 'records_without_timestamp': undated,63'timezone': 'Not recorded in timestamp strings; do not infer UTC.',64'total_generation_tokens': None,65'limitations': 'Saved verse timestamps, not a complete run start/end log. Source records are not final aligned release verses. No whole-project model or token claim.'},66'review_usage': {'stages': rows, 'total_tokens': sum(r['total_tokens'] for r in rows),67'scope': 'Recorded alignment, repair-proposal and repair-verification requests only; includes unsuccessful recorded requests. Excludes original generation, Codex work and unrecorded calls.',68'counting': 'Sum top-level input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens once per recorded request. Do not add nested iterations, modelUsage or thinking tokens again.',69'dates': None, 'model_label_note': 'Labels as recorded in the audit, not independently verified vendor model identities.'},70'website': {'created_on': '2026-10-03', 'tool': 'Codex', 'model': None, 'tokens': None,71'note': 'Exact underlying model and session token total are not supplied in the site evidence.'}72}, ensure_ascii=False, indent=2))73