Retire duplicated verification stages with verified source archives

This commit is contained in:
Takeshi
2026-10-14 17:32:33 +09:00
parent 9a84df6be1
commit 42c4a74923
16 changed files with 5272 additions and 0 deletions
@@ -0,0 +1,7 @@
{
"passed": true,
"archived_stage_manifests": 580,
"preserved_file_references": 752079,
"unique_contents_verified": 1955,
"free_now_bytes": 7938166784
}
@@ -0,0 +1,12 @@
[
{
"cache_path": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p08-03-full-regression-1f0a2bcd-r01/stage/.godot",
"cache_removed": true,
"noncache_files_verified": 1335
},
{
"cache_path": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p08-03-targeted-ui-4f3b42df-r01/stage/.godot",
"cache_removed": true,
"noncache_files_verified": 1328
}
]
@@ -0,0 +1,12 @@
{
"time": "2026-10-14T16:17:43.952776",
"observation": "App Store package open during cleanup; preserve active installer; cannot attribute historical entire 20GB",
"packages": [
{
"path": "/private/var/folders/41/j8fq6vqj2993cmyprl6p76pw0000gn/C/com.apple.appstoreagent/com.apple.appstore/F1DB49A5-4874-4A4A-B7D5-D4983ABFF672/aou1065395529036859153.pkg",
"bytes": 1604403200,
"allocated_bytes": 3076165632,
"mtime": 1791962263.9522676
}
]
}
@@ -0,0 +1,16 @@
{
"time": "2026-10-14T17:32:33.563598",
"free_before_bytes": 381820928,
"free_after_bytes": 7939096576,
"net_free_increase_bytes": 7557275648,
"project_allocated_kib_before": 93312544,
"project_allocated_kib_after": 25324316,
"artifact_allocated_kib_before": 88050120,
"artifact_allocated_kib_after": 20062388,
"archive_allocated_kib": 74636,
"archived_stages": 580,
"preserved_file_references": 752079,
"verified_unique_contents": 1955,
"note": "Physical free increase is net observation while system downloads also run; summed du allocations count shared APFS extents repeatedly.",
"game_acceptance_changed": false
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
# 2026-10-14 容量整理
ユーザーは容量回収と、必要時の旧証跡の要約保存を明示許可した。今回は原本・完成素材・保存・有効な試験結果・生ログを保持し、閉じた検証用ソースコピーを損失なく重複除去した。
- STAGE_RETIREMENT.json / OTHER_STAGE_RETIREMENT.json: 整理済みのコピーと元の表示容量。表示容量の合計はAPFS共有領域を重複計上するため、物理的な回収量ではない。
- 各コピーの隣にある *-retired-source-manifest.json: ファイル名、内容SHA、バイト数、権限と圧縮保管先。
- ALL_ARCHIVE_INTEGRITY_CHECK.json: 全一覧が参照する全固有内容の解凍SHA検証。
- RESTORATION_CHECK.json: 1コピーを新しい場所へ実際に復元して全内容を検証。
- CACHE_RETIREMENT.json: ソース・ログを変更せず再生成可能なGodot生成キャッシュを整理。
- RECREATABLE_APP_CACHE_CLEANUP.json / XCODE_DERIVED_CACHE_CLEANUP.json: 使用中または直近書込を除外した再生成可能なキャッシュの整理。
- CONCURRENT_APPSTORE_DOWNLOAD.json: 整理中に観測したApp Storeの書込。更新を止めず、インストーラは保持。
復元例: `python3 -B restore_stage.py /絶対パス/stage-retired-source-manifest.json /新しい復元先`。復元先は未作成の場所を指定する。各ファイルのSHAを照合してから書き込む。Godotキャッシュは再生成する。
今後の保管方針: 終了した検証でソース一式を毎回常設しない。同じ候補・設定・入力は一つの凍結参照を使う。独立した実行結果と生入力・計測は残す。旧コピーを整理する際はこの方式で内容保持を先に検証し、原路径からの復元一覧を残す。最新の受入証跡は要約だけで置換しない。
30パッケージ/88成果単位と受入条件は変更しない。容量整理はゲームの受入完了ではない。
@@ -0,0 +1,42 @@
{
"free_before": 2348527616,
"free_after": 4474433536,
"rows": [
{
"cache": "/Users/korizatou114/Library/Caches/Microsoft Edge",
"removed_files": 27496,
"allocated_bytes_before": 1002180608,
"open_or_recent_files_skipped": 6
},
{
"cache": "/Users/korizatou114/Library/Caches/Google",
"removed_files": 10158,
"allocated_bytes_before": 503844864,
"open_or_recent_files_skipped": 1
},
{
"cache": "/Users/korizatou114/Library/Caches/Firefox",
"removed_files": 1579,
"allocated_bytes_before": 192233472,
"open_or_recent_files_skipped": 0
},
{
"cache": "/Users/korizatou114/Library/Caches/antigravity-updater",
"removed_files": 3,
"allocated_bytes_before": 365252608,
"open_or_recent_files_skipped": 0
},
{
"cache": "/Users/korizatou114/Library/Caches/pip",
"removed_files": 21,
"allocated_bytes_before": 21549056,
"open_or_recent_files_skipped": 0
},
{
"cache": "/Users/korizatou114/Library/Caches/org.swift.swiftpm",
"removed_files": 101,
"allocated_bytes_before": 175796224,
"open_or_recent_files_skipped": 0
}
]
}
@@ -0,0 +1,6 @@
{
"restoration_verified": true,
"manifest": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p23-02-access-bound-candidate-r08/stage-retired-source-manifest.json",
"files_verified": 1299,
"stdout": "Verified source files restored: 1299\n"
}
@@ -0,0 +1,20 @@
{
"timestamp": "2026-10-14T16:07:58.460313",
"baseline": {
"free_bytes": 381820928,
"project_allocated_kib": 93312544,
"artifacts_allocated_kib": 88050120,
"runner_worktrees_allocated_kib": 15354332,
"codex_allocated_kib": 3138820,
"os_vm_bytes": 13434892288
},
"findings": {
"artifact_godot_cache_count": 570,
"artifact_godot_cache_allocated_bytes": 29495209984,
"artifact_png_allocated_bytes": 34313584640,
"artifact_wav_allocated_bytes": 8507625472,
"interpretation": "Repeated isolated stage copies hold the same assets and generated caches. APFS clone sharing makes summed allocation exceed physical reclaim. Current evidence does not apportion the historical 20GB increase exactly."
},
"policy": "Keep result reports, raw measurements, logs, original assets, saves, active worktree, R09 native evidence. Archive closed P23 staged source content losslessly with SHA and per-stage locator; retire reproducible generated Godot caches only.",
"current_free_bytes": 2336800768
}
@@ -0,0 +1,16 @@
{
"free_before": 4716486656,
"free_after": 5802799104,
"rows": [
{
"path": "/Users/korizatou114/Library/Developer/Xcode/DerivedData/App-avcppcbnncigkfbbumdxywznykxt",
"allocated_bytes_before": 1148080128,
"status": "regenerable derived build cache removed"
},
{
"path": "/Users/korizatou114/Library/Developer/Xcode/DerivedData/CompilationCache.noindex",
"allocated_bytes_before": 28672,
"status": "regenerable derived build cache removed"
}
]
}
@@ -0,0 +1,13 @@
import pathlib,json,gzip,hashlib,os,argparse
p=argparse.ArgumentParser(); p.add_argument("manifest"); p.add_argument("destination"); a=p.parse_args()
m=json.loads(pathlib.Path(a.manifest).read_text()); dest=pathlib.Path(a.destination)
assert not dest.exists(),"destination must be new"
dest.mkdir(parents=True)
for row in m["files"]:
rel=pathlib.PurePosixPath(row["path"]); assert not rel.is_absolute() and ".." not in rel.parts
f=dest/rel; f.parent.mkdir(parents=True,exist_ok=True)
if "symlink" in row: f.symlink_to(row["symlink"]); continue
with gzip.open(pathlib.Path(m["store"])/(row["sha256"]+".gz"),"rb") as z: data=z.read()
assert len(data)==row["bytes"] and hashlib.sha256(data).hexdigest()==row["sha256"]
f.write_bytes(data); f.chmod(row["mode"])
print("Verified source files restored:",len(m["files"]))
@@ -0,0 +1,36 @@
import pathlib,os,json,hashlib,gzip,shutil,subprocess,time
R=pathlib.Path("/Users/korizatou114/Projects/とりにく工房ゲーム制作部")
A=R/"artifacts/original-completion-2026-10-02"
OUT=R/"docs/plans/original-completion-2026-10-02/execution/storage-20261014"
OUT.mkdir(exist_ok=True)
STORE=R/"artifacts/source-content-store-20261014"; STORE.mkdir(exist_ok=True)
before=shutil.disk_usage(R).free
opened=subprocess.run(["lsof","-n","-F","n"],capture_output=True,text=True).stdout.splitlines()
openpaths=[s[1:] for s in opened if s.startswith("n/")]
rows=[]
for parent in sorted(A.glob("*")):
if not parent.is_dir() or parent.name.startswith("p23-02-") or parent.name.startswith("p08-03-"): continue
for stage in sorted(parent.iterdir()):
if not stage.is_dir() or not (stage.name=="stage" or stage.name.endswith("-stage")): continue
if not (stage/"project.godot").exists(): continue
if any(n==str(stage) or n.startswith(str(stage)+"/") for n in openpaths): continue
manifest=[]; allocated=0
for root,dirs,files in os.walk(stage):
dirs[:]=[d for d in dirs if d!=".godot"]
for name in files:
f=pathlib.Path(root)/name
if f.is_symlink(): manifest.append({"path":str(f.relative_to(stage)),"symlink":os.readlink(f)}); continue
data=f.read_bytes(); sha=hashlib.sha256(data).hexdigest(); dest=STORE/(sha+".gz")
if not dest.exists():
with gzip.open(dest,"wb",compresslevel=6) as z: z.write(data)
with gzip.open(dest,"rb") as z: assert hashlib.sha256(z.read()).hexdigest()==sha
manifest.append({"path":str(f.relative_to(stage)),"sha256":sha,"bytes":len(data),"mode":f.stat().st_mode&0o777})
m=parent/(stage.name+"-retired-source-manifest.json")
m.write_text(json.dumps({"original_path":str(stage),"store":str(STORE),"policy":"lossless deduplicated source archive; generated .godot cache retired; results and raw logs remain", "files":manifest},ensure_ascii=False))
assert len(json.loads(m.read_text())["files"])==len(manifest)
allocated=sum((pathlib.Path(root)/n).lstat().st_blocks*512 for root,dd,ff in os.walk(stage) for n in ff)
shutil.rmtree(stage)
row={"path":str(stage),"files_preserved":len(manifest),"allocated_bytes_before":allocated,"manifest":str(m)}; rows.append(row)
(OUT/"OTHER_STAGE_RETIREMENT.json").write_text(json.dumps({"free_before":before,"free_now":shutil.disk_usage(R).free,"rows":rows},ensure_ascii=False,indent=2))
if len(rows)%20==0: print(len(rows),round(shutil.disk_usage(R).free/2**30,2),flush=True)
print("DONE",len(rows),flush=True)
@@ -0,0 +1,36 @@
import pathlib,os,json,hashlib,gzip,shutil,subprocess,time
R=pathlib.Path("/Users/korizatou114/Projects/とりにく工房ゲーム制作部")
A=R/"artifacts/original-completion-2026-10-02"
OUT=R/"docs/plans/original-completion-2026-10-02/execution/storage-20261014"
OUT.mkdir(exist_ok=True)
STORE=R/"artifacts/source-content-store-20261014"; STORE.mkdir(exist_ok=True)
before=shutil.disk_usage(R).free
opened=subprocess.run(["lsof","-n","-F","n"],capture_output=True,text=True).stdout.splitlines()
openpaths=[s[1:] for s in opened if s.startswith("n/")]
rows=[]
for parent in sorted(A.glob("p23-02-*")):
if not parent.is_dir(): continue
for stage in sorted(parent.iterdir()):
if not stage.is_dir() or not (stage.name=="stage" or stage.name.endswith("-stage")): continue
if not (stage/"project.godot").exists(): continue
if any(n==str(stage) or n.startswith(str(stage)+"/") for n in openpaths): continue
manifest=[]; allocated=0
for root,dirs,files in os.walk(stage):
dirs[:]=[d for d in dirs if d!=".godot"]
for name in files:
f=pathlib.Path(root)/name
if f.is_symlink(): manifest.append({"path":str(f.relative_to(stage)),"symlink":os.readlink(f)}); continue
data=f.read_bytes(); sha=hashlib.sha256(data).hexdigest(); dest=STORE/(sha+".gz")
if not dest.exists():
with gzip.open(dest,"wb",compresslevel=6) as z: z.write(data)
with gzip.open(dest,"rb") as z: assert hashlib.sha256(z.read()).hexdigest()==sha
manifest.append({"path":str(f.relative_to(stage)),"sha256":sha,"bytes":len(data),"mode":f.stat().st_mode&0o777})
m=parent/(stage.name+"-retired-source-manifest.json")
m.write_text(json.dumps({"original_path":str(stage),"store":str(STORE),"policy":"lossless deduplicated source archive; generated .godot cache retired; results and raw logs remain", "files":manifest},ensure_ascii=False))
assert len(json.loads(m.read_text())["files"])==len(manifest)
allocated=sum((pathlib.Path(root)/n).lstat().st_blocks*512 for root,dd,ff in os.walk(stage) for n in ff)
shutil.rmtree(stage)
row={"path":str(stage),"files_preserved":len(manifest),"allocated_bytes_before":allocated,"manifest":str(m)}; rows.append(row)
(OUT/"STAGE_RETIREMENT.json").write_text(json.dumps({"free_before":before,"free_now":shutil.disk_usage(R).free,"rows":rows},ensure_ascii=False,indent=2))
print(json.dumps({"retired":str(stage),"count":len(rows),"free_gib":round(shutil.disk_usage(R).free/2**30,2)}),flush=True)
print("DONE",len(rows),flush=True)