docs: record verified Drive archive of closed P23 diagnostic streams

This commit is contained in:
Takeshi
2026-10-15 11:24:36 +09:00
parent bc0cf3a4a1
commit 206cdb9c80
9 changed files with 84008 additions and 0 deletions
@@ -0,0 +1,11 @@
{
"cloud_id": "1RID5ModFGinXTSH-2XQaLWy2eSZFs71T",
"cloud_url": "https://drive.google.com/file/d/1RID5ModFGinXTSH-2XQaLWy2eSZFs71T/view?usp=drivesdk",
"parent_id": "1Xa2b6rQmwBFq4jWIDFcJgiCbcNYfWXsK",
"manifest_id": "1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K",
"manifest_url": "https://drive.google.com/file/d/1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K/view?usp=drivesdk",
"remote_bytes": 30061832,
"readback_bytes": 30061832,
"readback_sha256": "2b44c59686f10f8b5e25b9d423f9f39802aa1c136418f5f86caefb1bfe0d727b",
"actual_authenticated_readback": true
}
@@ -0,0 +1,23 @@
{
"all_unchanged": true,
"pins": [
{
"path": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p08-03-native-os-d369d1c-r19-calibrated/index.json",
"expected_sha256": "fc66a95ab228e70fd1e1aa40b92f8cb6890f8c9879c2be79940e969cb9a3521b",
"actual_sha256": "fc66a95ab228e70fd1e1aa40b92f8cb6890f8c9879c2be79940e969cb9a3521b"
},
{
"path": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p08-03-native-d369d1c-r17/index.json",
"expected_sha256": "16c3577ca226173fea65df8595ab42a8b257ba50166da1a8564e6eda126694a1",
"actual_sha256": "16c3577ca226173fea65df8595ab42a8b257ba50166da1a8564e6eda126694a1"
},
{
"path": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p08-03-final-regression-d369d1c-r01/runner-ended.json",
"expected_sha256": "0dbe71e589113088bd37be42fef583b8f6da86a15542f4900ed97fa957fc1264",
"actual_sha256": "0dbe71e589113088bd37be42fef583b8f6da86a15542f4900ed97fa957fc1264"
}
],
"scope": "Current P08 accepted native/OS/full receipts retained unchanged; no new game acceptance",
"checked_at_unix": 1792031007.0414379,
"free_bytes_current": 1431257088
}
@@ -0,0 +1,13 @@
# 終了済みP23検証証拠のGoogle Drive退避(2026-10-15)
作業用に保持する必要がない旧native検証8ディレクトリ(r05〜r08、各layout-A/B)を、非共有のGoogle Driveへ退避した。現在の作業版336a8cd、通常OS操作の生記録・画像、受入済みP08、最新Windows基準版、保存データ、素材、Git履歴は保持している。ゲームの受入状態・30パッケージ/88成果単位の完了数は変更しない。
- 元証拠: 10,456ファイル、887,222,239バイト。
- 圧縮退避: 30,061,832バイト。Driveから実際に読み戻し、元アーカイブとSHA-256が一致した。
- 全メンバーの内容・パス・モード・mtime_nsを照合してからローカルを撤去した。旧r06読取専用ミラーの重複2,622ファイルも、退避済み元データとのSHA一致確認後に撤去した。ミラー索引は保持した。
- 撤去前の空き788,090,880バイト、撤去直後1,768,083,456バイト。後続確認の空きはFINAL_LOCAL_CHECK.jsonに記録した。他プロセスの書込みにより現在値は変動する。
- 退避用一時ファイルは残っていない。受入済みP08の主要証拠3点は再計算したSHAが一致した。
[退避ファイル](https://drive.google.com/file/d/1RID5ModFGinXTSH-2XQaLWy2eSZFs71T/view)、[全ファイル目録](https://drive.google.com/file/d/1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K/view)、[クラウド上の復元手順](https://drive.google.com/file/d/1aMi_UCFwjKxs6sRQwwVONfGxZiNibyiC/view)。ローカルのRESTORE.mdにも復元方法がある。各退避元にはCLOUD_ARCHIVE.jsonを残した。
照合記録はCLOUD.json、RETIREMENT.json、MANIFEST.json、VERIFIED_DRIVE_LISTING.json、FINAL_LOCAL_CHECK.jsonに保存した。Google Driveの3ファイルはいずれも非共有であることを一覧から確認した。
@@ -0,0 +1,8 @@
P23 closed diagnostic streams archive
Archive: https://drive.google.com/file/d/1RID5ModFGinXTSH-2XQaLWy2eSZFs71T/view?usp=drivesdk
Manifest: https://drive.google.com/file/d/1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K/view?usp=drivesdk
Download the single tar.gz, verify SHA256 2b44c59686f10f8b5e25b9d423f9f39802aa1c136418f5f86caefb1bfe0d727b and bytes30061832, then extract selected original relative paths into the artifacts base recorded in MANIFEST.json. Do not overwrite current proof. Embedded __P23_NATIVE_STREAM_ARCHIVE__.json and local MANIFEST.json preserve every member SHA, mode and exact mtime_ns. Restore ns times with os.utime only after verifying every file.
Retired only eight closed native layout-A/B directories from r05-r08 and the redundant r06 read-only mirror payload. Current336a8cd code, failed OS raw input/screens/state, all accepted P08 proof, latest Windows baseline, saves/assets/git retained. All cloud readback and member hashes verified before retirement. No original30/88 credit change.
@@ -0,0 +1,18 @@
{
"state": "cloud_archived_closed_diagnostic",
"cloud_id": "1RID5ModFGinXTSH-2XQaLWy2eSZFs71T",
"cloud_url": "https://drive.google.com/file/d/1RID5ModFGinXTSH-2XQaLWy2eSZFs71T/view?usp=drivesdk",
"archive_sha256": "2b44c59686f10f8b5e25b9d423f9f39802aa1c136418f5f86caefb1bfe0d727b",
"local_manifest": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/docs/plans/original-completion-2026-10-02/execution/drive-offload-p23-20261015/MANIFEST.json",
"cloud_manifest_url": "https://drive.google.com/file/d/1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K/view?usp=drivesdk",
"restore": "Download archive; verify SHA; extract its original relative paths into the recorded base. Embedded JSON preserves exact member SHA/mode/mtime_ns.",
"accepted_current_evidence_affected": false,
"retired_original_files": 10456,
"retired_logical_bytes": 887222239,
"retired_redundant_mirror_files": 2622,
"mirror_index_retained": true,
"free_before_bytes": 788090880,
"free_after_bytes": 1768083456,
"scratch_files": 0,
"time_unix": 1792029993.551488
}
@@ -0,0 +1,26 @@
[
{
"id": "1aMi_UCFwjKxs6sRQwwVONfGxZiNibyiC",
"name": "p23-closed-native-streams-r05-r08.RESTORE.md",
"bytes": "1013",
"shared": false,
"visibility": "not_shared",
"url": "https://drive.google.com/file/d/1aMi_UCFwjKxs6sRQwwVONfGxZiNibyiC/view?usp=drivesdk"
},
{
"id": "1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K",
"name": "p23-closed-native-streams-r05-r08.manifest.json",
"bytes": "3450515",
"shared": false,
"visibility": "not_shared",
"url": "https://drive.google.com/file/d/1_XZhusnYMBK-1OZCaZTLVuWyhOOLX22K/view?usp=drivesdk"
},
{
"id": "1RID5ModFGinXTSH-2XQaLWy2eSZFs71T",
"name": "p23-closed-native-streams-r05-r08.tar.gz",
"bytes": "30061832",
"shared": false,
"visibility": "not_shared",
"url": "https://drive.google.com/file/d/1RID5ModFGinXTSH-2XQaLWy2eSZFs71T/view?usp=drivesdk"
}
]
@@ -0,0 +1,81 @@
"""Lossless cloud preparation for eight explicitly closed diagnostic streams."""
from pathlib import Path
import datetime, hashlib, io, json, shutil, tarfile
ROOT = Path(__file__).resolve().parents[5]
BASE = ROOT / 'artifacts/original-completion-2026-10-02'
DOC = Path(__file__).resolve().parent
SCRATCH = Path('/private/tmp/the-tree-p23-closed-streams-20261015')
TRIALS = ('p23-03-native-cellfix-r05', 'p23-03-native-drawfix-r06',
'p23-03-native-os-0b7727a-r07', 'p23-03-native-os-trafficfix-r08')
NAME = 'p23-closed-native-streams-r05-r08'
def sha(path):
digest = hashlib.sha256()
with Path(path).open('rb') as stream:
for block in iter(lambda: stream.read(1048576), b''):
digest.update(block)
return digest.hexdigest()
def inventory():
rows = []
for name in TRIALS:
ended = json.loads((BASE/name/'runner-ended.json').read_text())
assert not ended['cleanup_errors']
assert all(row['engine_ended'] for row in ended['cleanup'])
for label in ('layout-A', 'layout-B'):
root = BASE/name/label
assert root.is_dir() and not root.is_symlink()
for path in [root] + sorted(root.rglob('*')):
assert not path.is_symlink()
stat = path.stat()
row = dict(path=path.relative_to(BASE).as_posix(),
mode=stat.st_mode & 0o7777, mtime_ns=stat.st_mtime_ns)
if path.is_file():
row.update(type='file', bytes=stat.st_size, sha256=sha(path))
else:
assert path.is_dir()
row['type'] = 'directory'
rows.append(row)
return rows
def build():
assert shutil.disk_usage(BASE).free > 512*1024**2
SCRATCH.mkdir(exist_ok=True)
archive = SCRATCH/(NAME+'.tar.gz')
assert not archive.exists()
rows = inventory()
metadata = dict(schema='p23-closed-streams-cloud-v1', name=NAME,
base=str(BASE), roots=[f'{n}/{v}' for n in TRIALS for v in ('layout-A', 'layout-B')],
members=rows, files=sum(r['type']=='file' for r in rows),
logical_bytes=sum(r.get('bytes', 0) for r in rows),
selection='Ended native A/B diagnostics only; current source/OS/raw accepted P08 evidence retained',
created_at=datetime.datetime.now(datetime.timezone.utc).isoformat())
payload=(json.dumps(metadata, ensure_ascii=False, indent=2)+'\n').encode()
with tarfile.open(archive, 'w:gz', compresslevel=6, format=tarfile.PAX_FORMAT) as output:
for row in rows:
output.add(BASE/row['path'], arcname=row['path'], recursive=False)
info=tarfile.TarInfo('__P23_NATIVE_STREAM_ARCHIVE__.json')
info.size=len(payload)
output.addfile(info, io.BytesIO(payload))
with tarfile.open(archive, 'r:gz') as source:
assert len(source.getnames()) == len(rows)+1
assert source.extractfile('__P23_NATIVE_STREAM_ARCHIVE__.json').read() == payload
for row in rows:
member=source.getmember(row['path'])
if row['type']=='directory':
assert member.isdir()
continue
digest=hashlib.sha256()
with source.extractfile(member) as stream:
for block in iter(lambda: stream.read(1048576), b''):
digest.update(block)
assert member.isfile() and member.size==row['bytes'] and digest.hexdigest()==row['sha256']
assert inventory()==rows
metadata.update(archive=str(archive), archive_bytes=archive.stat().st_size,
archive_sha256=sha(archive), archive_members_verified=True)
(DOC/'MANIFEST.json').write_text(json.dumps(metadata, ensure_ascii=False, indent=2)+'\n')
print(json.dumps({k:v for k,v in metadata.items() if k!='members'}), flush=True)
if __name__=='__main__':
build()
@@ -0,0 +1,59 @@
"""Retire only manifest-bound closed streams after actual Drive readback."""
import importlib.util, json, pathlib, shutil, subprocess, time
DOC=pathlib.Path(__file__).resolve().parent
spec=importlib.util.spec_from_file_location('closed_archive', DOC/'archive_closed_streams.py')
archive=importlib.util.module_from_spec(spec)
spec.loader.exec_module(archive)
manifest=json.loads((DOC/'MANIFEST.json').read_text())
cloud=json.loads((DOC/'CLOUD.json').read_text())
readback=archive.SCRATCH/'cloud-readback.tar.gz'
assert cloud['cloud_id']=='1RID5ModFGinXTSH-2XQaLWy2eSZFs71T'
assert cloud['parent_id']=='1Xa2b6rQmwBFq4jWIDFcJgiCbcNYfWXsK'
assert archive.sha(readback)==archive.sha(manifest['archive'])==manifest['archive_sha256']
assert readback.stat().st_size==cloud['readback_bytes']==manifest['archive_bytes']
assert manifest['archive_members_verified']
assert archive.inventory()==manifest['members']
opened=subprocess.run(['lsof','-n','-F','n'],capture_output=True,text=True).stdout.splitlines()
roots=[archive.BASE/name for name in manifest['roots']]
assert all(not any(line.startswith('n'+str(root)+'/') for line in opened) for root in roots)
# The old native mirror is no longer a working input. Retain its exact index;
# every mirrored payload must be proved to be in the cloud archive first.
mirror=pathlib.Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p23-03-code/.runtime/P23-03/offline-evidence-55c29f1-r06')
mirror_index=json.loads((mirror/'MIRROR_INDEX.json').read_text())
pins={r['path']:r for r in manifest['members'] if r['type']=='file'}
for row in mirror_index['files']:
original='p23-03-native-drawfix-r06/'+row['path']
assert pins[original]['sha256']==row['sha256']==archive.sha(mirror/row['path'])
assert not any(line.startswith('n'+str(mirror)+'/') for line in opened)
before=shutil.disk_usage(archive.BASE).free
for row in manifest['members']:
if row['type']=='file':
(archive.BASE/row['path']).unlink()
for row in sorted(manifest['members'],key=lambda r:len(pathlib.Path(r['path']).parts),reverse=True):
if row['type']=='directory':
(archive.BASE/row['path']).rmdir()
pointer=dict(state='cloud_archived_closed_diagnostic',cloud_id=cloud['cloud_id'],
cloud_url=cloud['cloud_url'],archive_sha256=manifest['archive_sha256'],
local_manifest=str(DOC/'MANIFEST.json'),cloud_manifest_url=cloud['manifest_url'],
restore='Download archive; verify SHA; extract its original relative paths into the recorded base. Embedded JSON preserves exact member SHA/mode/mtime_ns.',
accepted_current_evidence_affected=False)
for root in roots:
root.mkdir()
(root/'CLOUD_ARCHIVE.json').write_text(json.dumps(dict(pointer,original_root=str(root)),indent=2)+'\n')
for row in mirror_index['files']:
(mirror/row['path']).unlink()
for root in (mirror/'layout-A',mirror/'layout-B'):
for directory in sorted([p for p in root.rglob('*') if p.is_dir()],key=lambda p:len(p.parts),reverse=True):
directory.rmdir()
(root/'CLOUD_ARCHIVE.json').write_text(json.dumps(dict(pointer,regenerate_read_only_mirror=True),indent=2)+'\n')
assert archive.sha(readback)==manifest['archive_sha256']
pathlib.Path(manifest['archive']).unlink()
readback.unlink()
result=dict(pointer,retired_original_files=manifest['files'],retired_logical_bytes=manifest['logical_bytes'],
retired_redundant_mirror_files=len(mirror_index['files']),mirror_index_retained=True,
free_before_bytes=before,free_after_bytes=shutil.disk_usage(archive.BASE).free,
scratch_files=len(list(archive.SCRATCH.iterdir())),time_unix=time.time())
(DOC/'RETIREMENT.json').write_text(json.dumps(result,indent=2)+'\n')
print(json.dumps(result),flush=True)