diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_ADMISSION.json b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_ADMISSION.json new file mode 100644 index 0000000..89630cc --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_ADMISSION.json @@ -0,0 +1,16 @@ +{ + "scope": "Root QA only; existing catalog wage inputs, no production-value approval; no product/test source edits", + "base_probe_sha256": "34bd60a147602cc8f07bc36d8948579518da678e55579281c413c6a3fafc7f51", + "probe_sha256": "7a47b3e7e19f059c2b016d9e895259c186a82a212f8e0b1ad5344ac7b5a9d713", + "wrapper_sha256": "23bf2e241c7828b6533aa8107b3d33e962d5c53300a71b198e6fe371e0d4f4f0", + "catalog_sha256": "a2d0eecbe0369e9c725ecdfff5fa12749dd99c3aec458fc3412d1045affc7934", + "existing_candidates": [ + "staff_akane", + "staff_bardo" + ], + "source_refs": 1338, + "estimated_seconds": 90, + "free_before": 1681321984, + "required_free": 1567661072, + "formal_original_credit": 0 +} diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_ADMISSION.json b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_ADMISSION.json new file mode 100644 index 0000000..4ac8654 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_ADMISSION.json @@ -0,0 +1,20 @@ +{ + "scope": "Root formal save/restore acceptance fixture only; no worker or product edit", + "source_native": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01", + "probe_sha256": "4c56ff05b1bcf8775bb526a30ed021a4a2630ea4f360a5075f880806b052e6d1", + "wrapper_sha256": "e3b6eab32dd4fe3dfbff7ae9b67b34dd674236018bdb6bc7c64da25898ff5ed6", + "input_manifest_sha256": "9c69bb34893392ed8eacb1650ab194a44d56798e66338174d80e9e5d04829047", + "original_public_formal_pattern": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-01-formal-boundary-reload-r01.gd", + "original_pattern_sha256": "56e193a2c1d44c62c83374442b61c63935a69fdc1665ffa09bb549b0dfd8d14b", + "planned_phases": [ + "import", + "parse", + "writer", + "reader" + ], + "free_before": 1643499520, + "required_free": 1567661072, + "estimated_seconds": 90, + "formal_credit": 0, + "classification_finalized_before_first_engine_run": true +} diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_INPUT.json b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_INPUT.json new file mode 100644 index 0000000..d20c1e4 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_INPUT.json @@ -0,0 +1,34 @@ +{ + "source_native": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01", + "execution_sha256": "f10023182e59d198cb649f7f062ab25d13c074c9470e2d66177dfba6acc70011", + "source_refs": 1338, + "whole_typed_inputs": { + "before": { + "path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-before.var", + "bytes": 486164, + "sha256": "b96e271490a119a258d933ecd0dd13ac420e8d683d4133944f095b69294efe31" + }, + "midnight": { + "path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-midnight.var", + "bytes": 507492, + "sha256": "735c12abbc7569083a4774520e639f18a1824e7be007ac8a007ae8c906bc636b" + }, + "paused": { + "path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-paused.var", + "bytes": 506964, + "sha256": "f01b33c8f33cfe49ec9abf4d24b527f283b44eceb4f4137f8f78cad59c96c295" + }, + "after": { + "path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-after.var", + "bytes": 507264, + "sha256": "ea0ec680d4908a4bf6bfe46ac563d6138874b890b31d1b071c56607dfe233d1c" + }, + "next": { + "path": "/Users/korizatou114/Projects/\u3068\u308a\u306b\u304f\u5de5\u623f\u30b2\u30fc\u30e0\u5236\u4f5c\u90e8/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-next.var", + "bytes": 508104, + "sha256": "68c57eafd8d37afb780ae813bda778a393374db582febf53918c9a00e26859c9" + } + }, + "kitchen_id": "facility_00000003", + "original_price": 25 +} diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json new file mode 100644 index 0000000..621f691 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json @@ -0,0 +1,312 @@ +{ + "plan_id": "P04-01", + "production_commit": "54e81e576f5fe24b23c52f890e774a3b927b4fe2", + "scope": "Existing catalog public hires, physical DAY/NIGHT reception handover, actual nonzero payroll across approved dependency pause/resume midnight, formal SaveService/distinct PID. Catalog input use is not approval of final production balance. Not whole-unit acceptance.", + "catalog_pin": "a2d0eecbe0369e9c725ecdfff5fa12749dd99c3aec458fc3412d1045affc7934", + "existing_wages": { + "staff_akane": 120, + "staff_bardo": 135 + }, + "observed_daily_paid_total": 255, + "handover": [ + [ + "midnight-first-paid-before-handover-17-59-paid-actors", + [ + "staff_akane" + ] + ], + [ + "midnight-first-paid-at-completion-before-handover-18-00-paid-actors", + [ + "staff_akane" + ] + ], + [ + "midnight-first-paid-after-handover-18-00-paid-actors", + [ + "staff_bardo" + ] + ] + ], + "five_native_state_wage_counts": { + "before": { + "wage_rows": 0, + "total_wages": 0, + "sha256": "a58af4d0dfe843a10ac4aaa81bef56d73c13c5b2c4bbe89a52572442e3627225" + }, + "midnight": { + "wage_rows": 1, + "total_wages": 255, + "sha256": "edf4892d49862d714329532d3a564e3f5e017cfb06e66bbd659897463f0a7ec6" + }, + "paused": { + "wage_rows": 1, + "total_wages": 255, + "sha256": "7d28d990e95f100369851ae7c6f6ccef9641992a86bf9ecc2e7d43e419433ab1" + }, + "after": { + "wage_rows": 1, + "total_wages": 255, + "sha256": "b7f3215fd9ac9dcfd25859a712c5919952a6bd149dbe9294cd9dd6a758dfbff7" + }, + "next": { + "wage_rows": 1, + "total_wages": 255, + "sha256": "ea5f5d436bb6de45227b3436589b999775218f0d508397453132d5038296daff" + } + }, + "typed_outputs_14_sha_match_native": [ + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/writer-before-persisted.var", + "sha256": "b96e271490a119a258d933ecd0dd13ac420e8d683d4133944f095b69294efe31", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-before.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-before-loaded.var", + "sha256": "b96e271490a119a258d933ecd0dd13ac420e8d683d4133944f095b69294efe31", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-before.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/writer-midnight-persisted.var", + "sha256": "735c12abbc7569083a4774520e639f18a1824e7be007ac8a007ae8c906bc636b", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-midnight.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-midnight-loaded.var", + "sha256": "735c12abbc7569083a4774520e639f18a1824e7be007ac8a007ae8c906bc636b", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-midnight.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-replayed-midnight.var", + "sha256": "735c12abbc7569083a4774520e639f18a1824e7be007ac8a007ae8c906bc636b", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-midnight.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/writer-paused-persisted.var", + "sha256": "f01b33c8f33cfe49ec9abf4d24b527f283b44eceb4f4137f8f78cad59c96c295", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-paused.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-paused-loaded.var", + "sha256": "f01b33c8f33cfe49ec9abf4d24b527f283b44eceb4f4137f8f78cad59c96c295", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-paused.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-replayed-paused.var", + "sha256": "f01b33c8f33cfe49ec9abf4d24b527f283b44eceb4f4137f8f78cad59c96c295", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-paused.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/writer-after-persisted.var", + "sha256": "ea0ec680d4908a4bf6bfe46ac563d6138874b890b31d1b071c56607dfe233d1c", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-after.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-after-loaded.var", + "sha256": "ea0ec680d4908a4bf6bfe46ac563d6138874b890b31d1b071c56607dfe233d1c", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-after.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-replayed-after.var", + "sha256": "ea0ec680d4908a4bf6bfe46ac563d6138874b890b31d1b071c56607dfe233d1c", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-after.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/writer-next-persisted.var", + "sha256": "68c57eafd8d37afb780ae813bda778a393374db582febf53918c9a00e26859c9", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-next.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-next-loaded.var", + "sha256": "68c57eafd8d37afb780ae813bda778a393374db582febf53918c9a00e26859c9", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-next.var" + }, + { + "file": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-formal-native-r01/restart-evidence/reader-replayed-next.var", + "sha256": "68c57eafd8d37afb780ae813bda778a393374db582febf53918c9a00e26859c9", + "original": "/Users/korizatou114/Projects/とりにく工房ゲーム制作部/artifacts/original-completion-2026-10-02/p04-paid-shift-midnight-native-r01/order-evidence/midnight-next.var" + } + ], + "formal_original_and_reader_20_members_match": [ + { + "point": "before", + "member": "journal.log", + "sha256": "319a89ed6309ac30a4ab5b6d43b4743c75045a5b486a2ad40cc6abd9ee4c519f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/before/journal.log", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/before/journal.log" + }, + { + "point": "before", + "member": "manifest.json", + "sha256": "51ad08271d40c03f73d5758e76a76503019433ac7dfe689dbb2cdf757d9375a4", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/before/manifest.json", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/before/manifest.json" + }, + { + "point": "before", + "member": "thumbnail.png", + "sha256": "0ef55674eca98b6748ae5ccca85a14b042c1545a143810c9c47b487119895c32", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/before/thumbnail.png", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/before/thumbnail.png" + }, + { + "point": "before", + "member": "world.bin", + "sha256": "1db43cca40b660c402c800454cb11a389f71b199d8d44930390cfbcc50604f4c", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/before/world.bin", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/before/world.bin" + }, + { + "point": "midnight", + "member": "journal.log", + "sha256": "319a89ed6309ac30a4ab5b6d43b4743c75045a5b486a2ad40cc6abd9ee4c519f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/midnight/journal.log", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/midnight/journal.log" + }, + { + "point": "midnight", + "member": "manifest.json", + "sha256": "1b6d1f3e81200b8da193b47a421c88a1f69adf1279d48cd718ec3d10fc378ded", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/midnight/manifest.json", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/midnight/manifest.json" + }, + { + "point": "midnight", + "member": "thumbnail.png", + "sha256": "0ef55674eca98b6748ae5ccca85a14b042c1545a143810c9c47b487119895c32", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/midnight/thumbnail.png", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/midnight/thumbnail.png" + }, + { + "point": "midnight", + "member": "world.bin", + "sha256": "5f8412b441dce5d0f9777147b726e5dc48d0d6153ee61f00efa9f1a124fcbce0", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/midnight/world.bin", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/midnight/world.bin" + }, + { + "point": "paused", + "member": "journal.log", + "sha256": "319a89ed6309ac30a4ab5b6d43b4743c75045a5b486a2ad40cc6abd9ee4c519f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/paused/journal.log", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/paused/journal.log" + }, + { + "point": "paused", + "member": "manifest.json", + "sha256": "d3384f9ff64fda3d9ec2ab4b3e7e68038774ec26dd657fa043757370230b96af", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/paused/manifest.json", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/paused/manifest.json" + }, + { + "point": "paused", + "member": "thumbnail.png", + "sha256": "0ef55674eca98b6748ae5ccca85a14b042c1545a143810c9c47b487119895c32", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/paused/thumbnail.png", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/paused/thumbnail.png" + }, + { + "point": "paused", + "member": "world.bin", + "sha256": "2d8dbb4a6aece1861b1d45ab4c83511422b63c518b778cf74ad899f000b459d5", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/paused/world.bin", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/paused/world.bin" + }, + { + "point": "after", + "member": "journal.log", + "sha256": "319a89ed6309ac30a4ab5b6d43b4743c75045a5b486a2ad40cc6abd9ee4c519f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/after/journal.log", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/after/journal.log" + }, + { + "point": "after", + "member": "manifest.json", + "sha256": "fb5759cdf7d41c850054e2f14fcf20a42aa39f568725feb023f6eb7864bcf17f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/after/manifest.json", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/after/manifest.json" + }, + { + "point": "after", + "member": "thumbnail.png", + "sha256": "0ef55674eca98b6748ae5ccca85a14b042c1545a143810c9c47b487119895c32", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/after/thumbnail.png", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/after/thumbnail.png" + }, + { + "point": "after", + "member": "world.bin", + "sha256": "9608d4a0ded803be5cf63c80daafa802f2382e6ae4528a07742f8b7ef1210776", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/after/world.bin", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/after/world.bin" + }, + { + "point": "next", + "member": "journal.log", + "sha256": "319a89ed6309ac30a4ab5b6d43b4743c75045a5b486a2ad40cc6abd9ee4c519f", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/next/journal.log", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/next/journal.log" + }, + { + "point": "next", + "member": "manifest.json", + "sha256": "9d89852ab5fa1066928a099e87b13fcf17d44fe00fbad3ffbbde4e8baf866d95", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/next/manifest.json", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/next/manifest.json" + }, + { + "point": "next", + "member": "thumbnail.png", + "sha256": "0ef55674eca98b6748ae5ccca85a14b042c1545a143810c9c47b487119895c32", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/next/thumbnail.png", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/next/thumbnail.png" + }, + { + "point": "next", + "member": "world.bin", + "sha256": "19d9296c9c092d5a4bb7df7a716632402b7acf0eab768c593a7dc174ea598895", + "writer": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-68a8c5c7911f4fccb877ccd939bd3548-standard-runtime-writer/saves/p04_boundary/next/world.bin", + "reader": "/Users/korizatou114/Library/Application Support/TheTree-PCK-tests-7e437754341941f0a30890397a461e4b-standard-runtime-reader/saves/p04_boundary/next/world.bin" + } + ], + "original_packages_unchanged": true, + "writer_pid": 14262, + "reader_pid": 14476, + "reader_payroll_rows": [ + { + "absolute_minute": 1440, + "amount": 255, + "category": "WAGE", + "credit_account": "PLAYER_CASH", + "debit_account": "WAGE_EXPENSE", + "memo_key": "operations.payroll.settlement", + "related_transaction_id": "", + "source_entity_id": "payroll-day-00000001", + "transaction_id": "ledger_00000081" + } + ], + "actual_owned_pids": [ + 11317, + 11375, + 11412, + 14190, + 14226, + 14262, + 14476 + ], + "all_owned_ended": true, + "source_default_profile_doc4_unchanged": true, + "native_execution_pin": "f10023182e59d198cb649f7f062ab25d13c074c9470e2d66177dfba6acc70011", + "formal_execution_pin": "06759a46198ffb1292e43842b740d8298fc36116569f80577f2362cc518f6d1c", + "native_observations_pin": "6a0e5a9ed108e4284278c2624dc2798fb3dfb5430c51f3fd9bef8bfa333257fb", + "writer_receipt_pin": "65a7ede133e93af2d7248b56ef6adc97172482c8f95bff8fbd72531946162c38", + "reader_receipt_pin": "ce02261b6df6a6951c13c2cc782f43b57294825290824d89b196c5cdb2c70b8e", + "formal_credit": 0, + "independent_whole_review": "pending", + "remaining": [ + "native raw checker binding and whole seven-domain applicability", + "command resend, EV and other unproven boundaries", + "independent whole review and ordinary integration/final", + "applicable Windows final acceptance" + ] +} diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-native-r01.py b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-native-r01.py new file mode 100644 index 0000000..57218d0 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-native-r01.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +from pathlib import Path +import hashlib, importlib.util, json, os, shutil, subprocess, sys +sys.dont_write_bytecode = True +R = Path(__file__).resolve().parents[2] +A = R / 'artifacts/original-completion-2026-10-02' +OUT = A / 'p04-paid-shift-midnight-formal-native-r01' +QA = A / 'p04-paid-shift-midnight-formal-prep-r01/dependency-formal.gd' +INPUT = A / 'p04-paid-shift-midnight-formal-prep-r01/INPUT.json' +TEST = 'tests/s3/test_runtime_staff_assignment.gd' +def module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + m = importlib.util.module_from_spec(spec); spec.loader.exec_module(m); return m +def main(): + r = module('order_repro_runner', R / 'tools/run_all_tests.py') + root = r.source_refs(R); source = {n:v['sha256'] for n,v in root.items()} + source_path = A / 'p04-approved-shift-current-prep-r01/SOURCE_MAP.json' + assert source == r.read(source_path) and len(source) == 1338 + fixed = list(r.read(INPUT)['whole_typed_inputs'].values()) + [dict(path=str(INPUT),bytes=INPUT.stat().st_size,sha256=r.sha(INPUT)),dict(path=str(QA),bytes=QA.stat().st_size,sha256=r.sha(QA))] + def fixed_guard(): + for pin in fixed: + f=Path(pin['path']); assert not f.is_symlink() and f.stat().st_size==pin['bytes'] and r.sha(f)==pin['sha256'] + fixed_guard() + protected = r.default_player(R) + docs = {n:r.sha(R / 'docs/plans/original-completion-2026-10-02' / n) for n in ['IMPLEMENTATION_PLAN.md','PROGRESS_INTEGRATION.md','work_packages.json','progress_snapshot.json']} + old = Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p18-01-model/.runtime/P18-01-CODE/build/p18-relationship-evidence') + assert r.read(old / 'runner-ended.json')['passed'] + assert r.read(old / 'runner-input.json')['selected_source_map'] == source + assert shutil.disk_usage(A).free >= 1024**3 + Path('/Applications/Godot.app/Contents/MacOS/Godot').stat().st_size + 136*1024**2 + outer = module('order_literal_owned', r.SUPPORT / 'owned_outer.py') + assert not outer.native.helper['live_engines']() + refs = dict(root); refs[TEST] = dict(path=str(QA), bytes=QA.stat().st_size, sha256=r.sha(QA)) + expected = {n:dict(bytes=p['bytes'],sha256=p['sha256']) for n,p in refs.items()} + selected = dict(root_before=root,map={n:p['sha256'] for n,p in refs.items()},timeout=1200) + assert not OUT.exists(); OUT.mkdir(); stage=OUT/'stage'; stage.mkdir() + for leaf in ['starters','bootstrap']: (OUT/leaf).mkdir() + for n,p in r.read(r.SUPPORT/'bootstrap-scripts.json').items(): + data=p['text'].encode(); assert hashlib.sha256(data).hexdigest()==p['sha256']; (OUT/'bootstrap'/n).write_bytes(data) + for n,p in refs.items(): + dst=stage/n; dst.parent.mkdir(parents=True,exist_ok=True); r.copy_source(Path(p['path']),dst) + assert r.inventory(stage,stage=True)==expected + cache=old/'stage/.godot'; cache_before=r.inventory(cache) + for n in cache_before: + src=cache/n; dst=stage/'.godot'/n; dst.parent.mkdir(parents=True,exist_ok=True) + subprocess.run(['/bin/cp','-c',str(src),str(dst)],check=True); assert src.stat().st_ino != dst.stat().st_ino + assert r.inventory(stage/'.godot')==cache_before + r.write(OUT/'cache-reuse.json',dict(ended_run=str(old),ended_receipt_sha256=r.sha(old/'runner-ended.json'),whole_cache=cache_before,independent_inode=True,ordinary_import_required=True,ordinary_parse_required=True)) + paths=['res://'+n for n in sorted(refs) if n.endswith('.gd')]; r.write(OUT/'parse-paths.json',paths) + markers=module('order_literal_markers',R/'tools/strict_test_markers.py') + contracts=markers.load_contracts(R/'docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json') + contracts[TEST]=dict(test=TEST,template='Dependency formal restart: checks, failures',required=True) + policy=r.read(r.SUPPORT/'suite-policy.json'); assert TEST not in policy['suite_policies'] + r.write(OUT/'contracts.json',contracts) + r.write(OUT/'runner-input.json',dict(classification='P04-01 existing paid catalog payroll and DAY/NIGHT handover with dependency pause/resume across midnight using public formal SaveService and distinct-PID Reader; snapshots are exact typed evidence and JSON mirrors lose Variant key/value types; not Windows or whole-unit acceptance',owner_runner_pid=os.getpid(),wrapper_sha256=r.sha(__file__),QA=dict(path=str(QA),sha256=r.sha(QA),bytes=QA.stat().st_size),runner_sha256=r.sha(R/'tools/run_all_tests.py'),source_before=root,selected_source_map=selected['map'],source_map_authority=str(source_path),default_player_before=protected,doc4_before=docs,fixed_input_pins=fixed,source_adoption=False,QA_overrides=[TEST],ordinary_disk_floor_bytes=r.MIN_SPACE,functional_watchdog_seconds=1200)) + diagnostics=module('order_literal_diagnostics',r.SUPPORT/'diagnostic_gate.py'); owners=module('order_literal_owners',r.SUPPORT/'ordinary_proof_gate.py'); audio=module('order_literal_audio',r.SUPPORT/'audio_evidence_gate.py') + original=outer.run_phase + def run_phase(argv,folder,timeout,env,**kwargs): + env=dict(env) + if folder.name in ['writer','reader']: env.update(THE_TREE_BOUNDARY_RESTART_EVIDENCE=str(OUT/'restart-evidence'), THE_TREE_BOUNDARY_RESTART_MODE=folder.name, THE_TREE_BOUNDARY_RESTART_INPUT=str(INPUT)) + return original(argv,folder,timeout,env,**kwargs) + outer.run_phase=run_phase + phases=[]; previous={}; error=None; formal_before=None; public=(stage/'project.godot').read_bytes() + try: + for phase,test in [('import',None),('parse',None),('writer',TEST),('reader',TEST)]: + if phase == 'reader': formal_before = {n:r.inventory(Path(p)) for n,p in r.read(OUT/'restart-evidence/writer.json')['slots'].items()} + row=r.execute_phase('/Applications/Godot.app/Contents/MacOS/Godot',stage,OUT,phase,test,selected,expected,previous,policy,contracts,paths,public,protected,R,outer,markers,diagnostics,owners,audio) + phases.append(row); r.write(OUT/(phase+'-actual-phase.json'),row) + print(json.dumps(dict(phase=phase,passed=row['passed'],checks=row.get('reported_checks'),error=row.get('validation_error'))),flush=True) + if not row['passed']: + error=phase+' strict phase failure'; break + except BaseException as caught: error=type(caught).__name__+': '+str(caught) + finally: cleanup,cleanup_errors=outer.finish_captured(outer.OWNED) + fixed_guard() + assert r.source_refs(R)==root and r.default_player(R)==protected + assert {n:r.sha(R/'docs/plans/original-completion-2026-10-02'/n) for n in docs}==docs + assert r.inventory(stage,stage=True)==dict(expected,**previous) and r.inventory(cache)==cache_before + formal_after = {n:r.inventory(Path(p)) for n,p in r.read(OUT/'restart-evidence/writer.json')['slots'].items()} if (OUT/'restart-evidence/writer.json').exists() else None + formal_unchanged = formal_before is not None and formal_after == formal_before + passed=formal_unchanged and error is None and len(phases)==4 and all(p['passed'] for p in phases) and not cleanup_errors and all(p['engine_ended'] for p in cleanup) + r.write(OUT/'execution.json',dict(passed=passed,error=error,phases=phases,actual_captured_PIDs=[p.pid for p in outer.OWNED],cleanup=cleanup,cleanup_errors=cleanup_errors,all_source_unchanged=True,all_default_player_unchanged=True,doc4_unchanged=True,actual_native=len(outer.OWNED),formal_before=formal_before,formal_after=formal_after,formal_unchanged=formal_unchanged,whole_goal_accepted=False,unit_accepted=False)) + print(json.dumps(dict(passed=passed,error=error,actual_native=len(outer.OWNED))),flush=True) + return 0 if passed else 1 +if __name__=='__main__': raise SystemExit(main()) diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-prepare-r01.py b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-prepare-r01.py new file mode 100644 index 0000000..86ddc9d --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-formal-prepare-r01.py @@ -0,0 +1,70 @@ +from pathlib import Path +import hashlib,importlib.util,json,shutil +R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';P=A/'p04-paid-shift-midnight-formal-prep-r01';P.mkdir(exist_ok=True);N=A/'p04-paid-shift-midnight-native-r01';sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();assert json.loads((N/'execution.json').read_text())['passed'];base=A/'p04-01-formal-boundary-reload-r01.gd';s=base.read_text();s=s[:s.index('func _branch(')]+'''func _run() -> void: + _folder = OS.get_environment("THE_TREE_BOUNDARY_RESTART_EVIDENCE") + _mode = OS.get_environment("THE_TREE_BOUNDARY_RESTART_MODE") + if _folder.is_empty() or _mode not in ["writer", "reader"]: quit(2); return + _expect(DirAccess.make_dir_recursive_absolute(_folder) == OK, "fresh formal output") + var manifest: Dictionary = _json(OS.get_environment("THE_TREE_BOUNDARY_RESTART_INPUT")) + var inputs: Dictionary = manifest["whole_typed_inputs"] + _reset() + if _mode == "writer": + for point: String in inputs: _write_save(point, _input(inputs[point])) + else: + var writer: Dictionary = _json(_folder.path_join("writer.json")) + _expect(int(writer["pid"]) != OS.get_process_id() and String(writer["profile"]) != OS.get_user_data_dir(), "distinct actual Writer/Reader PID and private profiles") + for label: String in writer["slots"]: _copy_package(String(writer["slots"][label]), label) + for point: String in inputs: _load_save(point, _input(inputs[point])) + _load_save("before", _input(inputs["before"])) + var receipts: Array = [] + _runtime.economy_service.transaction_posted.connect(func(id: StringName, entries: Array): + var rows: Array = [] + for row: LedgerEntry in entries: rows.append(row.to_dictionary()) + receipts.append({&"id": id, &"minute": _clock.absolute_minute, &"rows": rows}) + ) + for point: String in ["midnight", "paused", "after", "next"]: + if point == "after": + var id := StringName(manifest["kitchen_id"]) + var command: CommandResult = _runtime.submit_command(&"set_facility_policy", {&"facility_id": id, &"patch": {&"business_open": true}}, &"player", &"", 10, -1, &"p04.dependency.reopen") + _expect(command.is_success(), "same public dependency reopen after formal restart") + _clock.advance_one_minute() + var expected := _input(inputs[point]) + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(expected), "all typed state after formal restart equals original native " + point) + _proof("replayed-" + point, _runtime.create_snapshot()) + var sale_count := 0 + for receipt: Dictionary in receipts: + for row: Dictionary in receipt[&"rows"]: + if row[&"category"] == &"SERVICE_SALE": + sale_count += 1 + _expect(receipt[&"minute"] == 1442 and row[&"amount"] == 25, "exact original service sale after formal restart") + _expect(sale_count == 1, "one sale notification across paused midnight and recovery") + _results.append({&"receipts": receipts, &"sale_count": sale_count}) + _proof("receipts", receipts) + _finish() +func _finish() -> void: + var file := FileAccess.open(_folder.path_join(_mode + ".json"), FileAccess.WRITE) + if file != null: + file.store_string(JSON.stringify({&"pid": OS.get_process_id(), &"profile": OS.get_user_data_dir(), &"slots": _slots, &"results": _results, &"checks": _checks, &"failures": _failures}, "\\t")); file.flush(); file.close() + _cleanup() + print("Dependency formal restart: %d checks, %d failures" % [_checks, _failures]) + quit(1 if _failures else 0) +''' +# Price assertion is bound to exact original definition/input, not a new product value. +s=s.replace('row[&"amount"] == 25','row[&"amount"] == int(manifest["original_price"])');Q=P/'dependency-formal.gd';assert not Q.exists() or Q.read_text()==s;Q.write_text(s) +obs=json.loads((N/'order-evidence/observations.json').read_text());kitchen=None +before=json.loads((N/'order-evidence/midnight-before.json').read_text());facilities=before['systems']['runtime']['facilities']['instances'];dining=next(f for f in facilities if f['definition_id']=='cafeteria');kitchen=dining['related_facility_id'];inputs={} +for point in ['before','midnight','paused','after','next']: + f=N/'order-evidence'/('midnight-'+point+'.var');inputs[point]={'path':str(f),'bytes':f.stat().st_size,'sha256':sha(f)} +M=P/'INPUT.json';M.write_text(json.dumps({'source_native':str(N),'execution_sha256':sha(N/'execution.json'),'source_refs':1338,'whole_typed_inputs':inputs,'kitchen_id':kitchen,'original_price':next(z['service']['price_snapshot'] for z in obs['observations'] if 'price_snapshot' in z.get('service',{}))},indent=2)+'\n') +w=(A/'p04-approved-shift-current-native-r01.py').read_text().replace('p04-approved-shift-current-native-r01','p04-paid-shift-midnight-formal-native-r01').replace("QA = A / 'p04-approved-shift-current-prep-r01/approved-shift.gd'","QA = A / 'p04-paid-shift-midnight-formal-prep-r01/dependency-formal.gd'\nINPUT = A / 'p04-paid-shift-midnight-formal-prep-r01/INPUT.json'") +w=w.replace("Order boundary diagnostic:","Dependency formal restart:").replace('P04-01 approved 18:00 completion-before-handover diagnostic on current source','P04-01 public formal SaveService Writer and distinct-PID Reader for approved dependency pause/resume across midnight on current source') +w=w.replace("if folder.name=='repro': env['THE_TREE_ORDER_EVIDENCE']=str(OUT/'order-evidence')","if folder.name in ['writer','reader']: env.update(THE_TREE_BOUNDARY_RESTART_EVIDENCE=str(OUT/'restart-evidence'), THE_TREE_BOUNDARY_RESTART_MODE=folder.name, THE_TREE_BOUNDARY_RESTART_INPUT=str(INPUT))") +w=w.replace("[('import',None),('parse',None),('repro',TEST)]","[('import',None),('parse',None),('writer',TEST),('reader',TEST)]") +w=w.replace('len(phases)==3','len(phases)==4').replace('phases=[]; previous={}; error=None;', 'phases=[]; previous={}; error=None; formal_before=None;') +w=w.replace(" row=r.execute_phase("," if phase == 'reader': formal_before = {n:r.inventory(Path(p)) for n,p in r.read(OUT/'restart-evidence/writer.json')['slots'].items()}\n row=r.execute_phase(") +w=w.replace(' passed=error is None'," formal_after = {n:r.inventory(Path(p)) for n,p in r.read(OUT/'restart-evidence/writer.json')['slots'].items()} if (OUT/'restart-evidence/writer.json').exists() else None\n formal_unchanged = formal_before is not None and formal_after == formal_before\n passed=formal_unchanged and error is None") +w=w.replace('whole_goal_accepted=False,unit_accepted=False','formal_before=formal_before,formal_after=formal_after,formal_unchanged=formal_unchanged,whole_goal_accepted=False,unit_accepted=False') +# Guard the raw inputs and QA before/after execution, besides existing source/profile/cache guards. +w=w.replace(' protected = r.default_player(R)'," fixed = list(r.read(INPUT)['whole_typed_inputs'].values()) + [dict(path=str(INPUT),bytes=INPUT.stat().st_size,sha256=r.sha(INPUT)),dict(path=str(QA),bytes=QA.stat().st_size,sha256=r.sha(QA))]\n def fixed_guard():\n for pin in fixed:\n f=Path(pin['path']); assert not f.is_symlink() and f.stat().st_size==pin['bytes'] and r.sha(f)==pin['sha256']\n fixed_guard()\n protected = r.default_player(R)") +w=w.replace(' assert r.source_refs(R)==root',' fixed_guard()\n assert r.source_refs(R)==root').replace('source_adoption=False,QA_overrides=[TEST]','fixed_input_pins=fixed,source_adoption=False,QA_overrides=[TEST]') +w=w.replace('P04-01 public formal SaveService Writer and distinct-PID Reader for approved dependency pause/resume across midnight on current source','P04-01 existing paid catalog payroll and DAY/NIGHT handover with dependency pause/resume across midnight using public formal SaveService and distinct-PID Reader').replace('no formal save, Windows or whole-unit acceptance','not Windows or whole-unit acceptance');W=A/'p04-paid-shift-midnight-formal-native-r01.py';compile(w,str(W),'exec');W.write_text(w);floor=1024**3+Path('/Applications/Godot.app/Contents/MacOS/Godot').stat().st_size+136*1024**2;free=shutil.disk_usage(A).free;assert free>=floor;rec={'scope':'Root formal save/restore acceptance fixture only; no worker or product edit','source_native':str(N),'probe_sha256':sha(Q),'wrapper_sha256':sha(W),'input_manifest_sha256':sha(M),'original_public_formal_pattern':str(base),'original_pattern_sha256':sha(base),'planned_phases':['import','parse','writer','reader'],'free_before':free,'required_free':floor,'estimated_seconds':90,'formal_credit':0};(P/'ADMISSION.json').write_text(json.dumps(rec,indent=2)+'\n');print(rec) diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-native-r01.py b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-native-r01.py new file mode 100644 index 0000000..a27d6d2 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-native-r01.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +from pathlib import Path +import hashlib, importlib.util, json, os, shutil, subprocess, sys +sys.dont_write_bytecode = True +R = Path(__file__).resolve().parents[2] +A = R / 'artifacts/original-completion-2026-10-02' +OUT = A / 'p04-paid-shift-midnight-native-r01' +QA = A / 'p04-paid-shift-midnight-prep-r01/paid-shift-midnight.gd' +TEST = 'tests/s3/test_runtime_staff_assignment.gd' +def module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + m = importlib.util.module_from_spec(spec); spec.loader.exec_module(m); return m +def main(): + r = module('order_repro_runner', R / 'tools/run_all_tests.py') + root = r.source_refs(R); source = {n:v['sha256'] for n,v in root.items()} + source_path = A / 'p04-paid-shift-midnight-prep-r01/SOURCE_MAP.json' + assert source == r.read(source_path) and len(source) == 1338 + protected = r.default_player(R) + docs = {n:r.sha(R / 'docs/plans/original-completion-2026-10-02' / n) for n in ['IMPLEMENTATION_PLAN.md','PROGRESS_INTEGRATION.md','work_packages.json','progress_snapshot.json']} + old = Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p18-01-model/.runtime/P18-01-CODE/build/p18-relationship-evidence') + assert r.read(old / 'runner-ended.json')['passed'] + assert r.read(old / 'runner-input.json')['selected_source_map'] == source + assert shutil.disk_usage(A).free >= 1024**3 + Path('/Applications/Godot.app/Contents/MacOS/Godot').stat().st_size + 136*1024**2 + outer = module('order_literal_owned', r.SUPPORT / 'owned_outer.py') + assert not outer.native.helper['live_engines']() + refs = dict(root); refs[TEST] = dict(path=str(QA), bytes=QA.stat().st_size, sha256=r.sha(QA)) + expected = {n:dict(bytes=p['bytes'],sha256=p['sha256']) for n,p in refs.items()} + selected = dict(root_before=root,map={n:p['sha256'] for n,p in refs.items()},timeout=1200) + assert not OUT.exists(); OUT.mkdir(); stage=OUT/'stage'; stage.mkdir() + for leaf in ['starters','bootstrap']: (OUT/leaf).mkdir() + for n,p in r.read(r.SUPPORT/'bootstrap-scripts.json').items(): + data=p['text'].encode(); assert hashlib.sha256(data).hexdigest()==p['sha256']; (OUT/'bootstrap'/n).write_bytes(data) + for n,p in refs.items(): + dst=stage/n; dst.parent.mkdir(parents=True,exist_ok=True); r.copy_source(Path(p['path']),dst) + assert r.inventory(stage,stage=True)==expected + cache=old/'stage/.godot'; cache_before=r.inventory(cache) + for n in cache_before: + src=cache/n; dst=stage/'.godot'/n; dst.parent.mkdir(parents=True,exist_ok=True) + subprocess.run(['/bin/cp','-c',str(src),str(dst)],check=True); assert src.stat().st_ino != dst.stat().st_ino + assert r.inventory(stage/'.godot')==cache_before + r.write(OUT/'cache-reuse.json',dict(ended_run=str(old),ended_receipt_sha256=r.sha(old/'runner-ended.json'),whole_cache=cache_before,independent_inode=True,ordinary_import_required=True,ordinary_parse_required=True)) + paths=['res://'+n for n in sorted(refs) if n.endswith('.gd')]; r.write(OUT/'parse-paths.json',paths) + markers=module('order_literal_markers',R/'tools/strict_test_markers.py') + contracts=markers.load_contracts(R/'docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json') + contracts[TEST]=dict(test=TEST,template='Midnight boundary diagnostic: checks, failures',required=True) + policy=r.read(r.SUPPORT/'suite-policy.json'); assert TEST not in policy['suite_policies'] + r.write(OUT/'contracts.json',contracts) + r.write(OUT/'runner-input.json',dict(classification='P04-01 existing catalog paid DAY/NIGHT actors with actual nonzero payroll and dependency pause/resume across midnight on current source; snapshots are exact typed evidence and JSON mirrors lose Variant key/value types; no formal save, Windows or whole-unit acceptance',owner_runner_pid=os.getpid(),wrapper_sha256=r.sha(__file__),QA=dict(path=str(QA),sha256=r.sha(QA),bytes=QA.stat().st_size),runner_sha256=r.sha(R/'tools/run_all_tests.py'),source_before=root,selected_source_map=selected['map'],source_map_authority=str(source_path),default_player_before=protected,doc4_before=docs,source_adoption=False,QA_overrides=[TEST],ordinary_disk_floor_bytes=r.MIN_SPACE,functional_watchdog_seconds=1200)) + diagnostics=module('order_literal_diagnostics',r.SUPPORT/'diagnostic_gate.py'); owners=module('order_literal_owners',r.SUPPORT/'ordinary_proof_gate.py'); audio=module('order_literal_audio',r.SUPPORT/'audio_evidence_gate.py') + original=outer.run_phase + def run_phase(argv,folder,timeout,env,**kwargs): + env=dict(env) + if folder.name=='repro': env['THE_TREE_ORDER_EVIDENCE']=str(OUT/'order-evidence') + return original(argv,folder,timeout,env,**kwargs) + outer.run_phase=run_phase + phases=[]; previous={}; error=None; public=(stage/'project.godot').read_bytes() + try: + for phase,test in [('import',None),('parse',None),('repro',TEST)]: + row=r.execute_phase('/Applications/Godot.app/Contents/MacOS/Godot',stage,OUT,phase,test,selected,expected,previous,policy,contracts,paths,public,protected,R,outer,markers,diagnostics,owners,audio) + phases.append(row); r.write(OUT/(phase+'-actual-phase.json'),row) + print(json.dumps(dict(phase=phase,passed=row['passed'],checks=row.get('reported_checks'),error=row.get('validation_error'))),flush=True) + if not row['passed']: + error=phase+' strict phase failure'; break + except BaseException as caught: error=type(caught).__name__+': '+str(caught) + finally: cleanup,cleanup_errors=outer.finish_captured(outer.OWNED) + assert r.source_refs(R)==root and r.default_player(R)==protected + assert {n:r.sha(R/'docs/plans/original-completion-2026-10-02'/n) for n in docs}==docs + assert r.inventory(stage,stage=True)==dict(expected,**previous) and r.inventory(cache)==cache_before + passed=error is None and len(phases)==3 and all(p['passed'] for p in phases) and not cleanup_errors and all(p['engine_ended'] for p in cleanup) + r.write(OUT/'execution.json',dict(passed=passed,error=error,phases=phases,actual_captured_PIDs=[p.pid for p in outer.OWNED],cleanup=cleanup,cleanup_errors=cleanup_errors,all_source_unchanged=True,all_default_player_unchanged=True,doc4_unchanged=True,actual_native=len(outer.OWNED),whole_goal_accepted=False,unit_accepted=False)) + print(json.dumps(dict(passed=passed,error=error,actual_native=len(outer.OWNED))),flush=True) + return 0 if passed else 1 +if __name__=='__main__': raise SystemExit(main()) diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-prepare-r01.py b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-prepare-r01.py new file mode 100644 index 0000000..644ddaf --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-midnight-prepare-r01.py @@ -0,0 +1,54 @@ +from pathlib import Path +import json,hashlib,shutil,importlib.util +R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';P=A/'p04-paid-shift-midnight-prep-r01';assert not P.exists();P.mkdir();old=A/'p04-approved-dependency-midnight-prep-r01/approved-dependency-midnight.gd';s=old.read_text();s=s.replace('var _first_summary: Dictionary = {}','var _first_summary: Dictionary = {}\nvar _paid_reception_id: StringName = &""\nvar _expected_daily_wages := 0') +needle='\t_original_price = definition.base_price';assert s.count(needle)==1;s=s.replace(needle,needle+'\n\t_setup_paid_reception()') +needle='\t_clock.advance_minutes(queue_at - _clock.absolute_minute)';assert s.count(needle)==1;s=s.replace(needle,'''\t_clock.advance_minutes(1079 - _clock.absolute_minute) + _observe("paid-before-handover-17-59") + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "normally hired daytime receptionist physically attends before original DAY boundary") + _clock.register_tick_handler(_clock.TickPhase.FACILITY_COMPLETION, &"zz.p04.paid.before-handover", func(minute: int): + if minute == 1080: + _observe("paid-at-completion-before-handover-18-00") + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "last DAY interval retains actual hired worker before handover") + ) + _clock.advance_one_minute(); _observe("paid-after-handover-18-00") + _expect(not _runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "daytime hired receptionist is removed after completion phase") + _clock.advance_minutes(queue_at - _clock.absolute_minute) + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_bardo"), "normally hired NIGHT replacement physically arrives")''') +needle='\t_first_summary = _runtime.operations_coordinator.get_day_summary(1).duplicate(true)';assert s.count(needle)==1;s=s.replace(needle,needle+''' + _expect(_expected_daily_wages > 0 and int(_first_summary[&"settlement"][&"new_wages_total"]) == _expected_daily_wages and int(_first_summary[&"settlement"][&"paid_total"]) == _expected_daily_wages, "real midnight settles full existing catalog wages once") + var wage_rows := 0 + for receipt: Dictionary in _receipts: + for row: Dictionary in receipt[&"rows"]: + if row[&"category"] == &"WAGE": + wage_rows += 1 + _expect(receipt[&"minute"] == 1440 and int(row[&"amount"]) == _expected_daily_wages and row[&"credit_account"] == &"PLAYER_CASH", "one real payroll transaction debits actual player cash at midnight") + _expect(wage_rows == 1, "exactly one nonzero payroll ledger row at midnight")''') +s=s.replace('if row[&"category"] == &"SERVICE_SALE":','if row[&"category"] == &"SERVICE_SALE" and row[&"source_entity_id"] == _facility_id and row[&"credit_account"] == StringName("GUEST_WALLET:" + String(_guest_id)):') +pos=s.index('func _reopen_dependency(');s=s[:pos]+'''func _setup_paid_reception() -> void: + var definition: FacilityDefinition = _runtime.definition_registry.get_facility(&"reception") + _expect(_cmd(&"build_facility", {&"definition_id": &"reception", &"origin": Vector3i(2, 0, WorldService.LAYER_FRONT)}).is_success(), "paid public reception construction") + _clock.advance_minutes(definition.build_minutes) + for instance: FacilityInstance in _runtime.facility_service.get_instances(): + if instance.definition_id == &"reception": _paid_reception_id = instance.instance_id + _expect(not _paid_reception_id.is_empty(), "reception completes using unchanged construction duration") + var catalog: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/characters/mvp_staff_candidates.json")) + for candidate_id: StringName in [&"staff_akane", &"staff_bardo"]: + var original_wage := -1 + for row: Dictionary in catalog["entries"]: + if StringName(row["id"]) == candidate_id: original_wage = int(row["daily_wage"]) + _expect(original_wage > 0 and _cmd(&"hire_staff_candidate", {&"candidate_id": candidate_id}).is_success(), "public hire of existing paid candidate " + String(candidate_id)) + var worker: StaffRuntime = _runtime.staff_service.get_staff(candidate_id) + _expect(worker != null and worker.get_effective_daily_wage() == original_wage, "existing catalog wage unchanged for " + String(candidate_id)) + _expected_daily_wages += original_wage + _expect(_cmd(&"set_staff_work_assignment", {&"staff_id": candidate_id, &"template_id": &"DAY" if candidate_id == &"staff_akane" else &"NIGHT", &"facility_id": _paid_reception_id}).is_success(), "ordinary recurring paid DAY or NIGHT assignment") + +''' + s[pos:] +needle='\tvar workers: Array = []';s=s.replace(needle,'''\tvar paid: Array = [] + for paid_id: StringName in [&"staff_akane", &"staff_bardo"]: + var hired: StaffRuntime = _runtime.staff_service.get_staff(paid_id) + if hired != null: paid.append(hired.create_snapshot()) + var reception: FacilityInstance = _runtime.facility_service.get_instance(_paid_reception_id) + _observations.append({&"label": label + "-paid-actors", &"minute": _clock.absolute_minute, &"paid_staff": paid, &"paid_reception": reception.create_snapshot() if reception != null else {}, &"expected_catalog_wages": _expected_daily_wages}) +''' + needle) +s=s.replace('P04-01 owner-approved dependency closure across real midnight; unchanged service and reservations resume with one original-price payment; public NIGHT actors with controlled inherited cook setup; typed same-process replay only; not formal SaveService/OS/Windows/whole acceptance','P04-01 existing paid catalog DAY/NIGHT reception handover and real nonzero payroll with approved dependency closure across midnight; catalog values are observed inputs, not approval of final product balancing; restaurant setup remains controlled; typed same-process replay only; no formal SaveService/OS/Windows/whole acceptance') +Q=P/'paid-shift-midnight.gd';Q.write_text(s);base=A/'p04-approved-dependency-midnight-native-r01.py';w=base.read_text().replace('p04-approved-dependency-midnight-native-r01','p04-paid-shift-midnight-native-r01').replace('p04-approved-dependency-midnight-prep-r01','p04-paid-shift-midnight-prep-r01').replace('/approved-dependency-midnight.gd','/paid-shift-midnight.gd').replace('P04-01 approved dependency pause/resume across midnight on current source','P04-01 existing catalog paid DAY/NIGHT actors with actual nonzero payroll and dependency pause/resume across midnight on current source');W=A/'p04-paid-shift-midnight-native-r01.py';compile(w,str(W),'exec');W.write_text(w);shutil.copyfile(A/'p04-approved-dependency-midnight-prep-r01/SOURCE_MAP.json',P/'SOURCE_MAP.json');floor=1024**3+Path('/Applications/Godot.app/Contents/MacOS/Godot').stat().st_size+136*1024**2;free=shutil.disk_usage(A).free;assert free>=floor;sha=lambda f:hashlib.sha256(f.read_bytes()).hexdigest();(P/'ADMISSION.json').write_text(json.dumps({'scope':'Root QA only; existing catalog wage inputs, no production-value approval; no product/test source edits','base_probe_sha256':sha(old),'probe_sha256':sha(Q),'wrapper_sha256':sha(W),'catalog_sha256':sha(R/'data/characters/mvp_staff_candidates.json'),'existing_candidates':['staff_akane','staff_bardo'],'source_refs':1338,'estimated_seconds':90,'free_before':free,'required_free':floor,'formal_original_credit':0},indent=2)+'\n');print('existing-catalog paid handover and midnight probe prepared; no engine yet') diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-root-audit-r01.py b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-root-audit-r01.py new file mode 100644 index 0000000..4620017 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-paid-shift-root-audit-r01.py @@ -0,0 +1,17 @@ +from pathlib import Path +import json,hashlib,shutil +R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';E=R/'docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015';N=A/'p04-paid-shift-midnight-native-r01';F=A/'p04-paid-shift-midnight-formal-native-r01';sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();load=lambda p:json.loads(p.read_bytes());n=load(N/'execution.json');f=load(F/'execution.json');assert n['passed']and f['passed']and f['formal_unchanged'];assert all(x[k]for x in [n,f]for k in ['all_source_unchanged','all_default_player_unchanged','doc4_unchanged']);assert all(z['engine_ended']for x in [n,f]for z in x['cleanup']);catalog=load(R/'data/characters/mvp_staff_candidates.json');amounts={x['id']:x['daily_wage']for x in catalog['entries']if x['id']in ['staff_akane','staff_bardo']};wages=sum(amounts.values());assert wages>0;obs=load(N/'order-evidence/observations.json');summary=obs['first_summary'];assert summary['closed_at']==1440 and summary['settlement']['paid_total']==summary['settlement']['new_wages_total']==wages;assert obs['first_receipts']==obs['replay_receipts'];handover=[x for x in obs['observations']if 'paid_reception'in x and 'handover'in x['label']];assert [x['paid_reception']['active_staff_ids']for x in handover]==[['staff_akane'],['staff_akane'],['staff_bardo']];states={};pin={} +for point in ['before','midnight','paused','after','next']: + p=N/'order-evidence'/('midnight-'+point+'.json');v=load(p);econ=v['systems']['runtime']['economy'];rows=[x for x in econ['entries']if x['category']=='WAGE'];assert len(rows)==(0 if point=='before'else 1) + if rows:assert rows[0]['amount']==wages and rows[0]['absolute_minute']==1440 and rows[0]['credit_account']=='PLAYER_CASH' + states[point]={'wage_rows':len(rows),'total_wages':sum(x['amount']for x in rows),'sha256':sha(p)};pin[str(p.relative_to(N))]=sha(p) +w=load(F/'restart-evidence/writer.json');d=load(F/'restart-evidence/reader.json');assert w['pid']!=d['pid']and w['profile']!=d['profile']and w['failures']==d['failures']==0;inputs=load(A/'p04-paid-shift-midnight-formal-prep-r01/INPUT.json');typed=[];members=[] +for point,row in inputs['whole_typed_inputs'].items(): + for name in ['writer-'+point+'-persisted','reader-'+point+'-loaded']+(['reader-replayed-'+point]if point!='before'else[]): + p=F/'restart-evidence'/(name+'.var');assert sha(p)==row['sha256'];typed.append({'file':str(p),'sha256':sha(p),'original':row['path']}) + wp=Path(w['slots'][point]);rp=Path(d['slots'][point]);names={'journal.log','manifest.json','thumbnail.png','world.bin'};assert {p.name for p in wp.iterdir()}==names=={p.name for p in rp.iterdir()} + for name in sorted(names):assert sha(wp/name)==sha(rp/name);members.append({'point':point,'member':name,'sha256':sha(wp/name),'writer':str(wp/name),'reader':str(rp/name)}) +assert len(typed)==14 and len(members)==20;reader_wage=[z for receipt in d['results'][0]['receipts']for z in receipt['rows']if z['category']=='WAGE'];assert len(reader_wage)==1 and reader_wage[0]['amount']==wages and reader_wage[0]['absolute_minute']==1440 +record={'plan_id':'P04-01','production_commit':'54e81e576f5fe24b23c52f890e774a3b927b4fe2','scope':'Existing catalog public hires, physical DAY/NIGHT reception handover, actual nonzero payroll across approved dependency pause/resume midnight, formal SaveService/distinct PID. Catalog input use is not approval of final production balance. Not whole-unit acceptance.','catalog_pin':sha(R/'data/characters/mvp_staff_candidates.json'),'existing_wages':amounts,'observed_daily_paid_total':wages,'handover':[(x['label'],x['paid_reception']['active_staff_ids'])for x in handover],'five_native_state_wage_counts':states,'typed_outputs_14_sha_match_native':typed,'formal_original_and_reader_20_members_match':members,'original_packages_unchanged':True,'writer_pid':w['pid'],'reader_pid':d['pid'],'reader_payroll_rows':reader_wage,'actual_owned_pids':n['actual_captured_PIDs']+f['actual_captured_PIDs'],'all_owned_ended':True,'source_default_profile_doc4_unchanged':True,'native_execution_pin':sha(N/'execution.json'),'formal_execution_pin':sha(F/'execution.json'),'native_observations_pin':sha(N/'order-evidence/observations.json'),'writer_receipt_pin':sha(F/'restart-evidence/writer.json'),'reader_receipt_pin':sha(F/'restart-evidence/reader.json'),'formal_credit':0,'independent_whole_review':'pending','remaining':['native raw checker binding and whole seven-domain applicability','command resend, EV and other unproven boundaries','independent whole review and ordinary integration/final','applicable Windows final acceptance']};(E/'ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json').write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n') +for source,name in [(A/'p04-paid-shift-midnight-native-r01.py','p04-paid-shift-midnight-native-r01.py'),(A/'p04-paid-shift-midnight-prep-r01/paid-shift-midnight.gd','paid-shift-midnight-r01.gd'),(A/'p04-paid-shift-midnight-prep-r01/ADMISSION.json','ROOT_PAID_SHIFT_MIDNIGHT_ADMISSION.json'),(A/'p04-paid-shift-midnight-formal-native-r01.py','p04-paid-shift-midnight-formal-native-r01.py'),(A/'p04-paid-shift-midnight-formal-prep-r01/ADMISSION.json','ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_ADMISSION.json'),(A/'p04-paid-shift-midnight-formal-prep-r01/INPUT.json','ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_INPUT.json'),(A/'p04-paid-shift-midnight-formal-prep-r01/dependency-formal.gd','paid-shift-midnight-formal-r01.gd'),(Path('/private/tmp/thetree-p04-paid-shift-midnight-prepare-r01.py'),'p04-paid-shift-midnight-prepare-r01.py'),(Path('/private/tmp/thetree-p04-paid-shift-midnight-formal-prepare-r01.py'),'p04-paid-shift-midnight-formal-prepare-r01.py')]:shutil.copyfile(source,E/name) +print({'paid_wages':wages,'handover_original_day_before_completion':True,'formal_writer_pid':w['pid'],'formal_reader_pid':d['pid'],'typed_hash_matches':14,'wage_rows_at_next':states['next']['wage_rows'],'whole_original_credit':0}) diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-formal-r01.gd b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-formal-r01.gd new file mode 100644 index 0000000..53fa277 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-formal-r01.gd @@ -0,0 +1,129 @@ +extends SceneTree +# Reuse reviewed entire boundary inputs. Formal public saves, separate owned Writer/Reader. +var _runtime: Variant +var _clock: Variant +var _state: Variant +var _checks := 0 +var _failures := 0 +var _folder := "" +var _mode := "" +var _cases: Array = [] +var _slots: Dictionary = {} +var _results: Array = [] +func _initialize() -> void: call_deferred("_run") +func _expect(ok: bool, label: String) -> void: + _checks += 1 + if not ok: _failures += 1; push_error(label) +func _json(path: String) -> Variant: + var file := FileAccess.open(path, FileAccess.READ) + _expect(file != null, "read sealed metadata " + path.get_file()) + if file == null: return null + var value: Variant = JSON.parse_string(file.get_as_text()); file.close(); return value +func _input(row: Dictionary) -> Dictionary: + var path := String(row["path"]) + _expect(FileAccess.get_sha256(path) == String(row["sha256"]), "exact original input SHA") + var file := FileAccess.open(path, FileAccess.READ) + _expect(file != null, "original typed input exists") + if file == null: return {} + var data := file.get_buffer(file.get_length()); file.close() + _expect(data.size() == int(row["bytes"]), "entire typed input length") + var value: Variant = bytes_to_var(data) + _expect(value is Dictionary and var_to_bytes(value) == data, "original entire typed input roundtrip") + return value if value is Dictionary else {} +func _proof(label: String, value: Variant) -> void: + var file := FileAccess.open(_folder.path_join(_mode + "-" + label + ".var"), FileAccess.WRITE) + _expect(file != null, "whole typed output " + label) + if file != null: file.store_buffer(var_to_bytes(value)); file.flush(); file.close() +func _reset() -> void: + _cleanup() + _runtime = load("res://autoload/simulation_runtime.gd").new() + _clock = load("res://autoload/game_clock.gd").new() + _state = load("res://autoload/game_state.gd").new() + _clock.reset(1, 6, 0); _state.reset() + _expect(bool(_runtime.initialize(_clock, _state, 424242).get(&"valid", false)), "ordinary Runtime initializes") + _clock.set_paused(true) +func _cleanup() -> void: + if _runtime != null: _runtime.free() + if _clock != null: _clock.free() + if _state != null: _state.free() + _runtime = null; _clock = null; _state = null +func _restore_expected(expected: Dictionary, label: String) -> void: + _expect(_runtime.restore_snapshot(expected), "public whole Runtime restore " + label) + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(expected), "whole restore equality " + label) +func _write_save(label: String, expected: Dictionary) -> void: + _restore_expected(expected, label) + var path := "user://saves/p04_boundary/" + label + var result := SaveService.save_snapshot(path, _runtime.create_snapshot()) + _expect(bool(result.get(&"ok", false)), "formal public package save " + label) + var inspected := SaveService.inspect_snapshot(path) + _expect(bool(inspected.get(&"ok", false)) and bool(inspected.get(&"read_only", false)) and var_to_bytes(inspected.get(&"snapshot", {})) == var_to_bytes(expected), "formal whole typed inspect " + label) + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(expected), "save leaves whole Runtime unchanged " + label) + _slots[label] = ProjectSettings.globalize_path(path) + _proof(label + "-persisted", expected) +func _copy_package(original: String, label: String) -> void: + var target := ProjectSettings.globalize_path("user://saves/p04_boundary/" + label) + _expect(DirAccess.make_dir_recursive_absolute(target) == OK, "fresh Reader package " + label) + var dir := DirAccess.open(original) + _expect(dir != null, "Writer entire package available") + if dir == null: return + var names := dir.get_files(); names.sort() + _expect(dir.get_directories().is_empty() and names == PackedStringArray(["journal.log", "manifest.json", "thumbnail.png", "world.bin"]), "exact complete four-member save package") + for member: String in names: + _expect(DirAccess.copy_absolute(original.path_join(member), target.path_join(member)) == OK, "copy complete member " + member) + _expect(FileAccess.get_sha256(original.path_join(member)) == FileAccess.get_sha256(target.path_join(member)), "literal copied member SHA " + member) + _slots[label] = target +func _load_save(label: String, expected: Dictionary) -> void: + var result := SaveService.load_snapshot(String(_slots[label])) + _expect(bool(result.get(&"ok", false)), "formal public package load " + label) + if not bool(result.get(&"ok", false)): return + _expect(var_to_bytes(result[&"snapshot"]) == var_to_bytes(expected), "loaded entire typed package matches original " + label) + _restore_expected(result[&"snapshot"], label) + _proof(label + "-loaded", _runtime.create_snapshot()) +func _run() -> void: + _folder = OS.get_environment("THE_TREE_BOUNDARY_RESTART_EVIDENCE") + _mode = OS.get_environment("THE_TREE_BOUNDARY_RESTART_MODE") + if _folder.is_empty() or _mode not in ["writer", "reader"]: quit(2); return + _expect(DirAccess.make_dir_recursive_absolute(_folder) == OK, "fresh formal output") + var manifest: Dictionary = _json(OS.get_environment("THE_TREE_BOUNDARY_RESTART_INPUT")) + var inputs: Dictionary = manifest["whole_typed_inputs"] + _reset() + if _mode == "writer": + for point: String in inputs: _write_save(point, _input(inputs[point])) + else: + var writer: Dictionary = _json(_folder.path_join("writer.json")) + _expect(int(writer["pid"]) != OS.get_process_id() and String(writer["profile"]) != OS.get_user_data_dir(), "distinct actual Writer/Reader PID and private profiles") + for label: String in writer["slots"]: _copy_package(String(writer["slots"][label]), label) + for point: String in inputs: _load_save(point, _input(inputs[point])) + _load_save("before", _input(inputs["before"])) + var receipts: Array = [] + _runtime.economy_service.transaction_posted.connect(func(id: StringName, entries: Array): + var rows: Array = [] + for row: LedgerEntry in entries: rows.append(row.to_dictionary()) + receipts.append({&"id": id, &"minute": _clock.absolute_minute, &"rows": rows}) + ) + for point: String in ["midnight", "paused", "after", "next"]: + if point == "after": + var id := StringName(manifest["kitchen_id"]) + var command: CommandResult = _runtime.submit_command(&"set_facility_policy", {&"facility_id": id, &"patch": {&"business_open": true}}, &"player", &"", 10, -1, &"p04.dependency.reopen") + _expect(command.is_success(), "same public dependency reopen after formal restart") + _clock.advance_one_minute() + var expected := _input(inputs[point]) + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(expected), "all typed state after formal restart equals original native " + point) + _proof("replayed-" + point, _runtime.create_snapshot()) + var sale_count := 0 + for receipt: Dictionary in receipts: + for row: Dictionary in receipt[&"rows"]: + if row[&"category"] == &"SERVICE_SALE": + sale_count += 1 + _expect(receipt[&"minute"] == 1442 and row[&"amount"] == int(manifest["original_price"]), "exact original service sale after formal restart") + _expect(sale_count == 1, "one sale notification across paused midnight and recovery") + _results.append({&"receipts": receipts, &"sale_count": sale_count}) + _proof("receipts", receipts) + _finish() +func _finish() -> void: + var file := FileAccess.open(_folder.path_join(_mode + ".json"), FileAccess.WRITE) + if file != null: + file.store_string(JSON.stringify({&"pid": OS.get_process_id(), &"profile": OS.get_user_data_dir(), &"slots": _slots, &"results": _results, &"checks": _checks, &"failures": _failures}, "\t")); file.flush(); file.close() + _cleanup() + print("Dependency formal restart: %d checks, %d failures" % [_checks, _failures]) + quit(1 if _failures else 0) diff --git a/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-r01.gd b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-r01.gd new file mode 100644 index 0000000..0508171 --- /dev/null +++ b/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/paid-shift-midnight-r01.gd @@ -0,0 +1,213 @@ +extends "res://tests/s3/test_runtime_actor_hardening.gd" +var _observations: Array[Dictionary] = [] +var _receipts: Array[Dictionary] = [] +var _first_receipts: Array[Dictionary] = [] +var _receipt_hook: Callable +var _evidence_dir := "" +var _facility_id: StringName = &"" +var _service_id: StringName = &"" +var _request_id: StringName = &"p04.order.midnight.request" +var _guest_id: StringName = &"p04.order.midnight.guest" +var _staff_ids: Array[StringName] = [&"p04.midnight.server.a", &"p04.midnight.server.b"] +var _serial := 0 +var _case := "midnight" +var _original_price := 0 +var _observation_pass := "first" +var _first_summary: Dictionary = {} +var _paid_reception_id: StringName = &"" +var _expected_daily_wages := 0 + +func _run() -> void: + _evidence_dir = OS.get_environment("THE_TREE_ORDER_EVIDENCE") + if _evidence_dir.is_empty(): quit(2); return + _expect(DirAccess.make_dir_recursive_absolute(_evidence_dir) == OK, "fresh external evidence directory") + _run_midnight() + _finish_order() + +func _run_midnight() -> void: + _reset_runtime(424242) + var enabled: Dictionary = _runtime.enable_production_operations() + _expect(bool(enabled.get(&"ok", false)), "public production operations enabled at original Day 1 06:00") + if not bool(enabled.get(&"ok", false)): return + var facility := _build_cafeteria(true) + if facility == null: return + _facility_id = facility.instance_id + var definition: FacilityDefinition = _runtime.definition_registry.get_facility(facility.definition_id) + _original_price = definition.base_price + _setup_paid_reception() + var cook_id := StringName("fixture.kitchen.worker.%s" % _facility_id) + _expect(_cmd(&"set_staff_work_assignment", {&"staff_id": cook_id, &"template_id": &"NIGHT", &"facility_id": facility.related_facility_id}).is_success(), "public original NIGHT assignment replaces inherited 23:59 cook fixture") + for id: StringName in _staff_ids: + _expect(_cmd(&"register_staff", {&"staff_id": id, &"role_id": &"server", &"options": {&"state": StaffRuntime.State.OFF_DUTY, &"current_cell": Vector3i.ZERO}}).is_success(), "register real workplace Staff " + String(id)) + _expect(_cmd(&"set_staff_work_assignment", {&"staff_id": id, &"template_id": &"NIGHT", &"facility_id": _facility_id}).is_success(), "original NIGHT 18:00-next06:00 assignment " + String(id)) + var queue_at := 1440 - definition.base_service_minutes - 1 + _expect(queue_at > _clock.absolute_minute, "setup finishes before original service start") + if queue_at <= _clock.absolute_minute: return + _clock.advance_minutes(1079 - _clock.absolute_minute) + _observe("paid-before-handover-17-59") + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "normally hired daytime receptionist physically attends before original DAY boundary") + _clock.register_tick_handler(_clock.TickPhase.FACILITY_COMPLETION, &"zz.p04.paid.before-handover", func(minute: int): + if minute == 1080: + _observe("paid-at-completion-before-handover-18-00") + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "last DAY interval retains actual hired worker before handover") + ) + _clock.advance_one_minute(); _observe("paid-after-handover-18-00") + _expect(not _runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_akane"), "daytime hired receptionist is removed after completion phase") + _clock.advance_minutes(queue_at - _clock.absolute_minute) + _expect(_runtime.facility_service.get_instance(_paid_reception_id).active_staff_ids.has(&"staff_bardo"), "normally hired NIGHT replacement physically arrives") + _expect(_clock.absolute_minute == queue_at and _runtime.operations_coordinator.current_minute == queue_at, "real production operations advance without blocked suffix") + if _clock.absolute_minute != queue_at: return + for id: StringName in _staff_ids: + var worker: StaffRuntime = _runtime.staff_service.get_staff(id) + _expect(_runtime.staff_service.requires_attendance(id) and StaffCommuteService.is_at_facility(worker, facility) and worker.current_cell != Vector3i.ZERO, "physical ordinary NIGHT workplace arrival " + String(id)) + var kitchen: FacilityInstance = _runtime.facility_service.get_instance(facility.related_facility_id) + var cook: StaffRuntime = _runtime.staff_service.get_staff(cook_id) + _expect(_runtime.staff_service.requires_attendance(cook_id) and StaffCommuteService.is_at_facility(cook, kitchen), "real kitchen NIGHT attendance, not legacy attendance bypass") + _expect(_stock(facility.local_inventory_id, &"ingredient/basic_meal", 1, &"p04.midnight.stock"), "one real meal to reserve") + _expect(_cmd(&"spawn_guest", {&"guest_id": _guest_id, &"guest_type_id": &"traveler", &"gold": _original_price * 2, &"options": {&"state": GuestRuntime.State.DECIDING, &"current_cell": Vector3i.ZERO}}).is_success(), "public actual Guest wallet") + _expect(_cmd(&"create_service_request", {&"facility_id": _facility_id, &"request_id": _request_id, &"guest_ids": [_guest_id]}).is_success(), "actual request original price/duration") + _clock.advance_one_minute() + var active: Array = _runtime.facility_service.get_active_services(_facility_id) + _expect(active.size() == 1, "one actual reserved service starts") + if active.size() != 1: return + var service: ServiceInstance = active[0]; _service_id = service.service_id + _expect(service.started_at + service.duration_minutes == 1440 and service.duration_minutes == definition.base_service_minutes and service.price_snapshot == _original_price, "original service completion coincides with 00:00") + _clock.advance_minutes(1439 - _clock.absolute_minute) + _expect(service.elapsed_minutes == service.duration_minutes - 1, "one original service minute remains at 23:59") + _expect(_runtime.operations_coordinator.get_day_summary(1).is_empty(), "real Day 1 not closed early") + _expect(_cmd(&"set_facility_policy", {&"facility_id": kitchen.instance_id, &"patch": {&"business_open": false}}).is_success(), "public dependency kitchen closure; dining itself remains open by policy") + _expect(not facility.related_facility_operating and kitchen.state == FacilityInstance.State.CLOSED, "dependency closure projects to dining") + var held_ids: Array[StringName] = service.inventory_reservations.duplicate() + var held_elapsed := service.elapsed_minutes + var held_service_id := service.service_id + _connect_receipts(); _observe("closed-before-23-59") + var before: Dictionary = _runtime.create_snapshot() + _clock.advance_one_minute(); _observe("paused-00-00") + _expect(_clock.absolute_minute == 1440 and int(_runtime.operations_coordinator.get_day_summary(1).get(&"closed_at", -1)) == 1440, "real daily close proceeds while dependent service is paused") + _assert_held(service, held_service_id, held_ids, held_elapsed) + var midnight: Dictionary = _runtime.create_snapshot() + _first_summary = _runtime.operations_coordinator.get_day_summary(1).duplicate(true) + _expect(_expected_daily_wages > 0 and int(_first_summary[&"settlement"][&"new_wages_total"]) == _expected_daily_wages and int(_first_summary[&"settlement"][&"paid_total"]) == _expected_daily_wages, "real midnight settles full existing catalog wages once") + var wage_rows := 0 + for receipt: Dictionary in _receipts: + for row: Dictionary in receipt[&"rows"]: + if row[&"category"] == &"WAGE": + wage_rows += 1 + _expect(receipt[&"minute"] == 1440 and int(row[&"amount"]) == _expected_daily_wages and row[&"credit_account"] == &"PLAYER_CASH", "one real payroll transaction debits actual player cash at midnight") + _expect(wage_rows == 1, "exactly one nonzero payroll ledger row at midnight") + _clock.advance_one_minute(); _observe("paused-00-01") + _assert_held(service, held_service_id, held_ids, held_elapsed) + var paused: Dictionary = _runtime.create_snapshot() + _expect(_reopen_dependency(kitchen.instance_id).is_success(), "public reopening of same dependency") + _clock.advance_one_minute(); _observe("resumed-complete-00-02") + _assert_completed(service, held_service_id, held_ids) + var after: Dictionary = _runtime.create_snapshot() + _clock.advance_one_minute(); _observe("stable-00-03") + _assert_completed(service, held_service_id, held_ids) + var next: Dictionary = _runtime.create_snapshot() + _first_receipts.assign(_receipts.duplicate(true)) + _expect(_runtime.restore_snapshot(before), "restore typed pre-midnight dependency-closed snapshot") + _observation_pass = "replay"; _receipts.clear(); _connect_receipts() + _clock.advance_one_minute() + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(midnight), "typed paused midnight state replay matches") + _clock.advance_one_minute() + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(paused), "typed second paused state replay matches") + _expect(_reopen_dependency(kitchen.instance_id).is_success(), "replay same public reopen command and idempotency key") + _clock.advance_one_minute() + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(after), "typed completed state replay matches") + _clock.advance_one_minute() + _expect(var_to_bytes(_runtime.create_snapshot()) == var_to_bytes(next), "typed subsequent state replay matches") + _expect(_first_receipts == _receipts, "all actual service and settlement receipts replay unchanged") + _write_var("before", before); _write_var("midnight", midnight); _write_var("paused", paused); _write_var("after", after); _write_var("next", next) + +func _setup_paid_reception() -> void: + var definition: FacilityDefinition = _runtime.definition_registry.get_facility(&"reception") + _expect(_cmd(&"build_facility", {&"definition_id": &"reception", &"origin": Vector3i(2, 0, WorldService.LAYER_FRONT)}).is_success(), "paid public reception construction") + _clock.advance_minutes(definition.build_minutes) + for instance: FacilityInstance in _runtime.facility_service.get_instances(): + if instance.definition_id == &"reception": _paid_reception_id = instance.instance_id + _expect(not _paid_reception_id.is_empty(), "reception completes using unchanged construction duration") + var catalog: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/characters/mvp_staff_candidates.json")) + for candidate_id: StringName in [&"staff_akane", &"staff_bardo"]: + var original_wage := -1 + for row: Dictionary in catalog["entries"]: + if StringName(row["id"]) == candidate_id: original_wage = int(row["daily_wage"]) + _expect(original_wage > 0 and _cmd(&"hire_staff_candidate", {&"candidate_id": candidate_id}).is_success(), "public hire of existing paid candidate " + String(candidate_id)) + var worker: StaffRuntime = _runtime.staff_service.get_staff(candidate_id) + _expect(worker != null and worker.get_effective_daily_wage() == original_wage, "existing catalog wage unchanged for " + String(candidate_id)) + _expected_daily_wages += original_wage + _expect(_cmd(&"set_staff_work_assignment", {&"staff_id": candidate_id, &"template_id": &"DAY" if candidate_id == &"staff_akane" else &"NIGHT", &"facility_id": _paid_reception_id}).is_success(), "ordinary recurring paid DAY or NIGHT assignment") + +func _reopen_dependency(kitchen_id: StringName) -> CommandResult: + return _runtime.submit_command(&"set_facility_policy", {&"facility_id": kitchen_id, &"patch": {&"business_open": true}}, &"player", &"", 10, -1, &"p04.dependency.reopen") + +func _assert_held(service: ServiceInstance, held_id: StringName, ids: Array[StringName], elapsed: int) -> void: + _expect(service.service_id == held_id and service.elapsed_minutes == elapsed and service.inventory_reservations == ids, "same service and own reservation IDs retain exact progress") + _expect(_service_receipts().is_empty() and _runtime.economy_service.get_balance(StringName("GUEST_WALLET:" + String(_guest_id))) == _original_price * 2, "no service sale or wallet charge during dependency closure") + for id: StringName in ids: + var reservation: InventoryReservation = _runtime.inventory_service.get_reservation(id) + _expect(reservation != null and reservation.state == InventoryReservation.State.ACTIVE, "own reservation remains reserved while dependency is closed") + +func _assert_completed(service: ServiceInstance, held_id: StringName, ids: Array[StringName]) -> void: + _expect(service.service_id == held_id and service.state == ServiceInstance.State.COMPLETED and service.completed_at == 1442, "same service completes once after dependency restoration") + _expect(service.inventory_reservations == ids and _service_receipts().size() == 1 and _runtime.economy_service.get_balance(StringName("GUEST_WALLET:" + String(_guest_id))) == _original_price, "same reserved service has one original-price payment") + for id: StringName in ids: + var reservation: InventoryReservation = _runtime.inventory_service.get_reservation(id) + _expect(reservation != null and reservation.state == InventoryReservation.State.CONSUMED, "own original reservation consumed once after restoration") + _expect(_runtime.operations_coordinator.get_day_summary(1) == _first_summary, "restored dependency does not mutate prior daily close") + +func _service_receipts() -> Array: + var selected: Array = [] + for receipt: Dictionary in _receipts: + for row: Dictionary in receipt[&"rows"]: + if row[&"category"] == &"SERVICE_SALE" and row[&"source_entity_id"] == _facility_id and row[&"credit_account"] == StringName("GUEST_WALLET:" + String(_guest_id)): + selected.append(receipt); break + return selected + +func _connect_receipts() -> void: + if _receipt_hook.is_valid() and _runtime.economy_service.transaction_posted.is_connected(_receipt_hook): + _runtime.economy_service.transaction_posted.disconnect(_receipt_hook) + _receipt_hook = func(id: StringName, entries: Array): + var rows: Array = [] + for row: LedgerEntry in entries: rows.append(row.to_dictionary()) + _receipts.append({&"id": id, &"minute": _clock.absolute_minute, &"rows": rows, &"staff_at_receipt": _runtime.facility_service.get_instance(_facility_id).active_staff_ids.duplicate()}) + _runtime.economy_service.transaction_posted.connect(_receipt_hook) + +func _cmd(kind: StringName, payload: Dictionary) -> CommandResult: + _serial += 1 + return _runtime.submit_command(kind, payload, &"player", &"", 10, -1, StringName("p04.order.shift.command.%d" % _serial)) + +func _observe(label: String) -> void: + label = _case + "-" + _observation_pass + "-" + label + var facility: FacilityInstance = _runtime.facility_service.get_instance(_facility_id) + var service: ServiceInstance = _runtime.facility_service.get_service(_service_id) + var guest: GuestRuntime = _runtime.guest_service.get_guest(_guest_id) + var paid: Array = [] + for paid_id: StringName in [&"staff_akane", &"staff_bardo"]: + var hired: StaffRuntime = _runtime.staff_service.get_staff(paid_id) + if hired != null: paid.append(hired.create_snapshot()) + var reception: FacilityInstance = _runtime.facility_service.get_instance(_paid_reception_id) + _observations.append({&"label": label + "-paid-actors", &"minute": _clock.absolute_minute, &"paid_staff": paid, &"paid_reception": reception.create_snapshot() if reception != null else {}, &"expected_catalog_wages": _expected_daily_wages}) + var workers: Array = [] + for id: StringName in _staff_ids: + var worker: StaffRuntime = _runtime.staff_service.get_staff(id) + var shift: ShiftInstance = _runtime.staff_service.get_shift(worker.shift_id) + workers.append({&"staff": worker.create_snapshot(), &"shift": shift.create_snapshot() if shift != null else {}, &"is_present": _runtime.staff_commute.is_present(worker, facility), &"requires_attendance": _runtime.staff_service.requires_attendance(id), &"at_facility": StaffCommuteService.is_at_facility(worker, facility), &"within_shift": shift.contains_minute(_clock.absolute_minute) if shift != null else false}) + _observations.append({&"label": label, &"minute": _clock.absolute_minute, &"workers": workers, &"facility_state": facility.state, &"power_available": facility.power_available, &"active_staff": facility.active_staff_ids.duplicate(), &"service": service.create_snapshot() if service != null else {}, &"request_present": _runtime.facility_service.get_request(_request_id) != null, &"wallet": _runtime.economy_service.get_balance(StringName("GUEST_WALLET:" + String(_guest_id))), &"available_meals": _runtime.inventory_service.available_quantity(facility.local_inventory_id, &"ingredient/basic_meal"), &"reservations": _runtime.inventory_service.create_snapshot(), &"guest": guest.create_snapshot() if guest != null else {}, &"receipts": _receipts.duplicate(true), &"day_summary": _runtime.operations_coordinator.get_day_summary(1), &"operations": _runtime.operations_coordinator.create_snapshot()}) + _write_var(_observation_pass + "-" + label.trim_prefix(_case + "-" + _observation_pass + "-"), _runtime.create_snapshot()) + +func _write_var(label: String, value: Variant) -> void: + var file := FileAccess.open(_evidence_dir.path_join(_case + "-" + label + ".var"), FileAccess.WRITE) + _expect(file != null, "write whole typed evidence " + label) + if file != null: file.store_buffer(var_to_bytes(value)); file.flush(); file.close() + var json_file := FileAccess.open(_evidence_dir.path_join(_case + "-" + label + ".json"), FileAccess.WRITE) + _expect(json_file != null, "write JSON mirror alongside authoritative typed snapshot") + if json_file != null: json_file.store_string(JSON.stringify(value, "\t")); json_file.flush(); json_file.close() + +func _finish_order() -> void: + var file := FileAccess.open(_evidence_dir.path_join("observations.json"), FileAccess.WRITE) + if file != null: + file.store_string(JSON.stringify({&"classification": "P04-01 existing paid catalog DAY/NIGHT reception handover and real nonzero payroll with approved dependency closure across midnight; catalog values are observed inputs, not approval of final product balancing; restaurant setup remains controlled; typed same-process replay only; no formal SaveService/OS/Windows/whole acceptance", &"observations": _observations, &"first_receipts": _first_receipts, &"replay_receipts": _receipts, &"first_summary": _first_summary, &"checks": _checks, &"failures": _failures}, "\t")); file.flush(); file.close() + _cleanup() + print("Midnight boundary diagnostic: %d checks, %d failures" % [_checks, _failures]) + quit(1 if _failures else 0) diff --git a/docs/plans/original-completion-2026-10-02/plan_validation.json b/docs/plans/original-completion-2026-10-02/plan_validation.json index e4e3cb2..c1a2597 100644 --- a/docs/plans/original-completion-2026-10-02/plan_validation.json +++ b/docs/plans/original-completion-2026-10-02/plan_validation.json @@ -254,6 +254,6 @@ "validate_facility_value_contracts.py": "91640e2a76cd6cc9186f7b85c0bf379b24b6cac0d48962815235ee628e7ae43e", "validate_plan.py": "23678227d9b3c556f1bd903f4b5b3147c4a82ce5085e10055481026803451b80", "validator_update_checks.json": "f997d0f3de2cea29550840b1d5cb23647d64f81329de46758551e2b6c8fecc27", - "work_packages.json": "a32096f6a761a8da9e3f3ddec1f58c5dc53dd861b6038f973629d4a39860f2b8" + "work_packages.json": "180d7dd46d0ea4c6e180cc1c373521a63ca1eaf743aedceccda1749e451c45d4" } } diff --git a/docs/plans/original-completion-2026-10-02/work_packages.json b/docs/plans/original-completion-2026-10-02/work_packages.json index 21e78de..18a84fa 100644 --- a/docs/plans/original-completion-2026-10-02/work_packages.json +++ b/docs/plans/original-completion-2026-10-02/work_packages.json @@ -3598,7 +3598,7 @@ }, "legacy_state": "in_progress", "state_scope": "package-level; completed means whole package accepted; partial implementation is not completion", - "current_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。", + "current_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。 追加でmain54e81e5の既存カタログ2名を公開hire/勤務割当で雇用し、実DAY/NIGHT交代と00:00給与255G一回を実測。正式SaveService Writer14262→別PID Reader14476でも全14typed出力が原native SHA一致、元20保存member不変、翌分まで給与行1件。既存給与データの入力利用であり本番balanceの新承認ではない。実行中C担当の入力/範囲は変更せず次の受入照合に保持。", "remaining_deliverables": [ { "id": "P04-01", @@ -3847,21 +3847,21 @@ "scope": "Root diagnosis and actual first repair; no original acceptance" } ], - "current_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。", + "current_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。 追加でmain54e81e5の既存カタログ2名を公開hire/勤務割当で雇用し、実DAY/NIGHT交代と00:00給与255G一回を実測。正式SaveService Writer14262→別PID Reader14476でも全14typed出力が原native SHA一致、元20保存member不変、翌分まで給与行1件。既存給与データの入力利用であり本番balanceの新承認ではない。実行中C担当の入力/範囲は変更せず次の受入照合に保持。", "remaining_conditions": [ "原7種更新順序・証拠対応の原本/承認済み仕様への全条件適合性と規約凍結を最終独立受入する", "承認D05の依存先休業pause/resume日跨ぎと正式SaveService/別PID復元はmain5f6bc11で実測済み。既存証拠と残の原7領域全条件への適合性・独立whole受入を残す。直接休業D-034と区別する。", "承認済みD05:17:59→18:00昼番の完了・課金後に交代。夜番不在・既存残業タスク・同分再送を現版証拠で確認", "既存39証拠等の適用版・入力・設定・環境を照合して不足境界だけ検証。全条件独立受入と通常統合/final/台帳反映。D05他領域は具体的根拠を確認し一括解決/一括停止にしない" ], - "progress_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。", + "progress_summary": "承認D05をmain5f6bc11/全1338sourceで実測。18:00は完了・25G一回課金時に昼番2人、その後交代0人。依存先休業は日跨ぎ1439→1441で同service/予約・進捗44/45・財布50保持、復帰後1442に完了・財布25・SALE25一回、1443追加0。さらに正式SaveServiceの5状態をWriter3854→別profile/PID Reader3879で保存読込し、公開厨房再開後の全型付き14出力SHAが原nativeと一致、元保存20member不変・Reader20member全SHA一致。全10owned PID通常終了。原7領域の残境界/非ゼロ給与/command再送/EV、raw結合checker完成、独立whole受入・正常統合finalが残り、原成果加点0。repair4編集6件を保持しprobe/Reader重複workerなし。実OpusがC結合層とraw改変負例に範囲を限定しAstraを選択、同タスクの正常dispatchでrepair5 implementing。LLM900秒は許可済みtask-only予算adapterで除去、検証watchdogと登録設定は維持。 追加でmain54e81e5の既存カタログ2名を公開hire/勤務割当で雇用し、実DAY/NIGHT交代と00:00給与255G一回を実測。正式SaveService Writer14262→別PID Reader14476でも全14typed出力が原native SHA一致、元20保存member不変、翌分まで給与行1件。既存給与データの入力利用であり本番balanceの新承認ではない。実行中C担当の入力/範囲は変更せず次の受入照合に保持。", "remaining_gaps": [ "依存先休業日跨ぎと正式保存/別PID復元の現版生証拠をcheckerへ結合する。原サービス/予約保持・課金一回・原保存全member不変・全型付きstate一致を監査し、未収集条件は未達のまま維持。", - "18:00実測は有限条件。未完了serviceの夜番不在/残業、非ゼロ給与決算、正式保存/別PID、command再送、EV予約等の不足と既存証拠適用性を個別確認する。", + "18:00と非ゼロ給与255Gの日跨ぎ/正式保存再開は有限実測済み。未完了serviceの夜番不在/残業、command同分再送、EV予約等の不足と既存証拠適用性を個別確認する。", "未提出repair4のA/B修正を保持し、C/D/Eの必要範囲を現実のguarded rawから完成する。LLM900秒打切りは実Opus判断と既存上限撤廃指示に沿う専用CLIのP04 implementer限定adapterで除去済み。登録config/digestと検証watchdogは不変。", "原7領域/安全性3結果/30-88の全条件を満たしてから独立wholeレビュー・登録validate・通常integration/final・台帳反映する。原成果の完了加点0。" ], - "updated_at_jst": "2026-10-16T01:31:45.380975+09:00", + "updated_at_jst": "2026-10-16T01:41:36.997105+09:00", "current_recheck": "execution/p04-01-current-recheck-20261015/recheck.json", "policy_candidate": "execution/p04-01-current-recheck-20261015/D05_POLICY_CANDIDATE.md", "owner_policy_update": { @@ -3885,7 +3885,8 @@ "formal_dependency_proof": "execution/p04-01-current-recheck-20261015/ROOT_APPROVED_DEPENDENCY_FORMAL_RESULT.json", "timeout_adapter": "execution/p04-01-current-recheck-20261015/OWNER_P04_LLM_TIMEOUT_ADAPTER.json", "actual_run": "cb864ee199f346408370f8944e574eb7", - "current_scope": "trusted raw binding C plus relevant adversarial Python fixtures only; no product/probe duplication or native/full regression" + "current_scope": "trusted raw binding C plus relevant adversarial Python fixtures only; no product/probe duplication or native/full regression", + "paid_shift_midnight_formal_proof": "execution/p04-01-current-recheck-20261015/ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json" } }, {