diff --git a/audit/xxf-ch5/cube-admission-20261023.json b/audit/xxf-ch5/cube-admission-20261023.json new file mode 100644 index 00000000..334367cd --- /dev/null +++ b/audit/xxf-ch5/cube-admission-20261023.json @@ -0,0 +1,122 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_CONSERVATIVE_ADMISSION_AND_MUTATION_INVALIDATION_NOT_FULL_ASSET_QUIESCENCE", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_mutation.h": "a16294fe21ddbbca585c7d89a1a8766c10b5d9763dda10ea9b3e6606c1bb6880", + "src/server/common/cube_handshake.h": "3490c4cd65c5ef8274536221d830983361dd7ae688cb9123564b0c115686f051", + "src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "src/server/db/src/Makefile": "1072d5d333e90c3b94717c6ce84da9a7948779f6cde32b202c37ba015741a839", + "src/server/game/src/port_cube_actor.h": "3de2d336d0222659a52d9b304a592b76d4ba501407fb40c10be2403382bcf0ed", + "src/server/game/src/port_cube_actor.cpp": "fa46aa608a9491bdff0db80423d4e79ae9542e947438f13446b12233b603067a", + "src/server/game/src/port_cube_item.inc": "1d443892fc1986f26814df66db54d4dee165f4f04058118fdd1a3cd6573d167a", + "src/server/game/src/port_cube_quest.h": "0cff21347f04bd3aa91022bf3e30dc47aca3f2d9e5a84cf60dfd1d60ef8b69e7", + "src/server/game/src/item.h": "8617f2418a1c68a12c36d5c432627ba7a96bf8d880cd1f73f5a759315e0073e9", + "src/server/game/src/item.cpp": "5e32a2f6ffc553803b51b08b3997174f27736405f22967102389df4a92088446", + "src/server/game/src/questpc.h": "030a6a1ddfdd7504f1ace8c19c5f64d4b8ecb857935e3b2a99ae83c914337ff0", + "src/server/game/src/questpc.cpp": "84f0d83561d1625b63ac4f41330688b9a3e73cc0d766dab3cfab67bc61e6b65e", + "src/server/game/src/questmanager.h": "64eb5ea60d137b0bd676174d1b2e80a45ebc654cf2e7d0f422da6c4e0e12c44d", + "src/server/game/src/questmanager.cpp": "64f28fac57ea0b11e5ef974e4252880343a0aed31a49c221d165ed9f71e55b39", + "src/server/game/src/char.cpp": "e5a7680767ed68e8fa7e6211828275145172d9084602ebe3ccfbb926d945cb21", + "src/server/game/src/cube.cpp": "410ceef7bff2c170cc10d9ddb673e4bed4153de6ba6c85737255b414eddefac3", + "src/server/game/src/port_switchbot.cpp": "fe849a2b9b0a060547addb39df8ca073600047458d08776e1345d888badba632", + "src/server/game/src/Makefile": "cf286e6d7aa2f01592e06180ed93ba6b6f384726f1dde8266c2b7cf333be3a13", + "tests/features/test_cube_mutation.py": "64872a5e15accb2cfce74b599f31666ae434f39acd4b635c235333520dd3484d", + "tests/features/test_cube_handshake.py": "63cfc33318545954ad88c3101afc147775df17e04d8cc565a6511b35d232da87", + "tests/features/test_cube_runtime.py": "f02e31a07c25112adbbbd36932a15bc3ca4fa12c3e72350291bf544de946aae9", + "tests/features/test_cube_gold_debit.py": "19d10a03263a4e0cf3cb75026ce4e03539cb3de36072f4513601743f50f87d5c", + "tools/cube/audit_mutations.py": "e6148a42fb1cce7b8c8fc7179bea788428fa06bda6c178e3fe91235af2085141", + "tools/cube/README.md": "03131c7992b275427fa743c98a0b823a4c5ac1e8ae28ea18a82f53776c88fb12" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "da1b857844f0cba6a51c539025a0cda5145448e9416bb6592e3ca128773ea1ba", + "scripts/build_xxf_features_json.py": "f3fef9fdeaee90b4ed91a744c91a5ddef52be576471f3839fc7bb6b9a0d2f56f", + "audit/xxf-ch5/features.json": "713043006ac9572ce1df7b9360b3878d00bd049cab09c57ae9bf020cdc6c2bd2", + "audit/xxf-ch5/cube-mutation-review-20261023.json": "961ff7d632a2f37af87dad283a952d493e88eaeec61ba298b110e617b727b73a", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "1b8ad4d08748791996c448ca5357e9068f2f5e709c73db4d830cddef7222785a", + "docs/XXF-CH5-CUBE-ADMISSION-20261023.md": "738f62cba2b38a8e74c094837ff3803ccbf4a54472c763d5adff282b5ec9b0ce", + "build/ch5-tests/20261023-cube-admission-final/report.json": "89d3874b8729e11a2a0c7712ef397ecc88a82509525ac20b92508fda3016d781" + }, + "native_source_and_artifact_sha256": { + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/common/cube_mutation.h": "a16294fe21ddbbca585c7d89a1a8766c10b5d9763dda10ea9b3e6606c1bb6880", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/common/cube_handshake.h": "3490c4cd65c5ef8274536221d830983361dd7ae688cb9123564b0c115686f051", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/db/src/Makefile": "1072d5d333e90c3b94717c6ce84da9a7948779f6cde32b202c37ba015741a839", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/port_cube_actor.h": "3de2d336d0222659a52d9b304a592b76d4ba501407fb40c10be2403382bcf0ed", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/port_cube_actor.cpp": "fa46aa608a9491bdff0db80423d4e79ae9542e947438f13446b12233b603067a", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/port_cube_item.inc": "1d443892fc1986f26814df66db54d4dee165f4f04058118fdd1a3cd6573d167a", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/port_cube_quest.h": "0cff21347f04bd3aa91022bf3e30dc47aca3f2d9e5a84cf60dfd1d60ef8b69e7", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/item.h": "8617f2418a1c68a12c36d5c432627ba7a96bf8d880cd1f73f5a759315e0073e9", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/item.cpp": "5e32a2f6ffc553803b51b08b3997174f27736405f22967102389df4a92088446", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/questpc.h": "030a6a1ddfdd7504f1ace8c19c5f64d4b8ecb857935e3b2a99ae83c914337ff0", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/questpc.cpp": "84f0d83561d1625b63ac4f41330688b9a3e73cc0d766dab3cfab67bc61e6b65e", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/questmanager.h": "64eb5ea60d137b0bd676174d1b2e80a45ebc654cf2e7d0f422da6c4e0e12c44d", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/questmanager.cpp": "64f28fac57ea0b11e5ef974e4252880343a0aed31a49c221d165ed9f71e55b39", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/char.cpp": "e5a7680767ed68e8fa7e6211828275145172d9084602ebe3ccfbb926d945cb21", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/cube.cpp": "410ceef7bff2c170cc10d9ddb673e4bed4153de6ba6c85737255b414eddefac3", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/port_switchbot.cpp": "fe849a2b9b0a060547addb39df8ca073600047458d08776e1345d888badba632", + "/root/deploy-features/cube-admission.DyUKei/build-root/src/server/game/src/Makefile": "cf286e6d7aa2f01592e06180ed93ba6b6f384726f1dde8266c2b7cf333be3a13", + "/root/deploy-features/cube-admission.DyUKei/build-root/bin/game": "8f88aa2a1ce21946d2cd1a0fbee7cc1c8050fb8a4c868b36aed955380ef122e3", + "/root/deploy-features/cube-admission.DyUKei/build-root/bin/db": "7a4cfcdc3ba0dd2e2b9bbfaf2f83059767331278fceeac3d9898c90e566759a9", + "/root/deploy-features/cube-admission.DyUKei/game-build-final.log": "607292b8eee96afeee0a558f273c8f699e26b5ad91959aeb3e0be4286a021c79", + "/root/deploy-features/cube-admission.DyUKei/db-build.log": "0ddf3f65e3bd5c1b12134ca81a735ae8b4b3fd35de3d5c8270dfc0a61a82df58" + }, + "tests": { + "report": "build/ch5-tests/20261023-cube-admission-final/report.json", + "pass": 129, + "fail": 0, + "blocked": 0, + "unittest_cases": 388, + "top_level_probes": 33, + "source_changed": false, + "release_ready": false, + "local": "ASan/UBSan actual item admission, aggregated actor admission, item Save and quest flag/timer bodies with explicit actor/item/quest substitutes; whole-switchbot-roll entry guard; sticky preparation invalidation; actual DB route abort/refusal behavior with explicit SQL/peer boundaries", + "expiry": "Four actual item expiry event function bodies unchanged versus repository HEAD; no expiry reset/cancel/defer introduced", + "native_game": "Fresh .cube-admission-final-obj: all game objects compiled and linked after final core-header/source freeze; inherited internal platform libraries, not a full clean-library rebuild", + "native_db": "Fresh .cube-admission-db-obj: all DB objects compiled and linked; inherited internal platform libraries", + "mysql": "Not rerun this batch; earlier InnoDB/worker evidence is historical, not current real-MySQL acceptance", + "live": "Not run; no production deployment/restart/player-asset writes", + "android": "Not run; no client craft action/capability change", + "post_regression": "Evidence JSON only; no runtime or metadata change" + }, + "review": { + "summary": "audit/xxf-ch5/cube-mutation-review-20261023.json", + "candidate_count": 735, + "source_files": 90, + "totals": { + "gold_points": 52, + "experience_points": 22, + "item_ownership": 203, + "item_image": 282, + "quest_work": 70, + "lifecycle": 106 + }, + "meaning": "Lexical review candidates, not call-graph coverage or certification; includes definitions/comments and misses indirect/alias/unlisted paths", + "activation_allowed": false + }, + "contracts": { + "admission": "Reject owned clock/event/unique/busy/skip-save items, personal quest timers/running scripts, active switchbot, party/victim/lifecycle hazards; non-creating PC lookup, all captured owned windows; recheck at preparation and Arm ACK/final-save boundary", + "expiry": "Original deadlines and handlers continue unchanged; conservative unique-type denial is a candidate restriction, not restored CH5 gameplay rules", + "switchbot": "Defer whole roll and new starts before flags/RNG/cost; existing scheduler remains, normal actors unchanged", + "notification": "Item Save/current or last owner; nonzero gold PointChange; script entry and actual quest flags/timers; WarpSet/Disconnect. Original work is not silently suppressed", + "sticky_mask": "Detected ABA mutations cannot restore Submit eligibility; pre-cookie Arm ACK retained only to cancel; post-Submit invalidation means Held, no cancellation/thaw", + "db_invalidation": "Exact internal identity binding; poison owner/drain proof; AbortUnprepared only, accepted PREPARED journal preserved. No implicit refund or release", + "classic_cube": "Held actors rejected before material/gold/RNG, normal fee behavior regression retained", + "gates": "HandshakeEnabled=false and ActorMutationAuditComplete=false; actual ingress rejects before Arm; no runtime crafting/Prepare/Execute hookup", + "encoding": "Quest PC/manager .h/.cpp verified equal HEAD bytes after removal of exact ASCII insertions. Cube.cpp equals previous catalogue source hash after removing exact new include/guard; prior dirty changes preserved." + }, + "not_complete": [ + "Durable retention/order/replay of legitimate post-Submit mutations/rewards; notification alone does not prevent lost work across logout/restart", + "Direct SetGold/SetExp/field writes, unlisted setters, server/global quest callbacks, party/ground-drop and full lifecycle quiescence", + "Safe authoritative image apply, exact ACK, thaw, terminal cleanup and new-owner recovery", + "Runtime reward factory/ID reservation and actual Prepare/Execute invocation", + "Copy attributes, success-rate items, matched live game/db and Android acceptance", + "Won, Wolfman, Conqueror and five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-apply-20261023.json b/audit/xxf-ch5/cube-apply-20261023.json new file mode 100644 index 00000000..f3fbdd95 --- /dev/null +++ b/audit/xxf-ch5/cube-apply-20261023.json @@ -0,0 +1,130 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_ORIGINAL_LIVE_IMAGE_INSTALLED_AND_READ_BACK_NO_ACK_RELEASE_OR_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-live-image-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_live_image.h": "bba68e1bcb96c21d9b9508a66b7db2f3aa7f0fd476a91ecf4ee40df89e832f6f", + "src/server/game/src/port_cube_apply.cpp": "901f1d882f92b8851448b73990deffab9b40a456b6d59bcc59ead3c23d093cfd", + "src/server/game/src/port_cube_apply.h": "938443a03cc971cb23b3151b1afbb76b1c5fdcc74d17a540a1efb32f50f1b0d0", + "src/server/game/src/port_cube_registry.inc": "2e63240254016bc1a1888711159c79f022c49c5548bc1674562b0d5283ef4539", + "src/server/game/src/port_cube_actor.cpp": "2a4420c50f3b4c0334b0b3870a051ef8d34784285a3e5947bd4c93e81de3c319", + "src/server/game/src/port_cube_factory.cpp": "0dc24cedf63cd07acd4129fee1c6aea1f149acf8d888eb985c0878cb202a648e", + "src/server/game/src/port_cube_factory.h": "0d18c4b459ad3e82db4952d46ff50bc5944e489f6cbf17b9d2443c88ccde079a", + "src/server/game/src/item.cpp": "9790276df09bb03eddd38e36b45340bbb189689030e74d5ac871559e1ffc12ec", + "src/server/game/src/item.h": "0cb6bd47944278bdd7642205dbf5efe415df48adf53f55e8f1934e212d002910", + "src/server/game/src/item_manager.cpp": "bf02c9e9d0f2d245df38e85f6320ff6043507eb77c99aa9f7b833f453d10620c", + "src/server/game/src/item_manager.h": "b298560c6cdd21ffd24a992ac9e80d77b4a2f7131dbf2bdaa025cc8fb6aebdfa", + "src/server/game/src/char.h": "bc6c46a9f31be30c8c130e71ac1a6272129fb272ce8ffe651e8f829a4a50b8ad", + "src/server/game/src/Makefile": "4d80ea09a9e15205d8a9d5be15af6504f7b23629df37eca2ef140d0609894978", + "tests/features/test_cube_craft.py": "4daca4df558541febe34d3a5dc24774094f0e4a911c468cc266a373685f9424c", + "tests/features/fixtures/cube_apply_cases.inc": "a6edad880ad38efcdc5e2af481d2af3646b9a33efafa7a553ae1137484e924d0", + "tests/features/fixtures/cube_factory_platform.h": "19289f3980cbc27ef8b6111c88f754bd4cf693ec899bd12d12dc9b673e99b33b", + "tests/features/fixtures/cube_factory_cases.inc": "037c0d285dfe31b5483cddbefe081e39b84e6fd70e902433ab31b4cc16ef6cd0", + "tests/features/fixtures/cube_factory_native.cpp": "dfda22dc74cefe6d9fb370789127bb80f906071c9f76ac2f6f35061fcfeee6f5", + "tools/cube/test_factory_native.sh": "1a61dec320bfc2e74b18afb9ddd1990fbe8900e3659e7908b0c3ba52d24664c6" + }, + "client_metadata_sha256": { + "docs/XXF-CH5-CUBE-APPLY-20261023.md": "f86611c53b8ee801734ded6284beeb0025da753ba0930b2563ed604f29be037e", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "23bd42e3a781a996360bd342e666ac8966e3995d2a0f801144ef66853368e592", + "scripts/build_xxf_features_json.py": "dd2eb7c8a132a820f91a7481c5198a7ebe8a1a3eb717cb1bd4e125addadc04d6", + "audit/xxf-ch5/features.json": "67892162ff63cb1a4933c086274e741fd9290275046edd862bc8cf69b688afcb" + }, + "implementation": [ + "Persisted explicit-ID restoring slot uses real CreateItem non-new-item path; copies count/sockets/attributes/full69 extra bytes without new-ID allocation, new-award RNG, DB saves, packets, logs or events", + "Original new sash AddToCharacter initialization extracted unchanged into shared PortCubeInitNewAttach; fresh reward templates initialize once, persisted restore never redraws", + "Preallocated ID/VID registry node publication validates exact replaced pointers; retirement cannot erase replacement or send DB delete; removes old delayed saves", + "Actual CHARACTER ordinary225 inventory/gold installation validates and stages before publication; preserves other windows; remaps replaced Cube/sash/quest-item references by permanent ID; consumed references null", + "Actual actor validates original full seal before install, exact authoritative normal image plus unchanged other windows after install; Applied duplicates do not reinstall; mismatches remain held", + "New registered items remain skip-save with events paused; no ACK, terminal release, thaw, public start or client craft capability" + ], + "tests": { + "cube_unittest": 38, + "full_report": "build/ch5-tests/20261023-cube-apply/report.json", + "report_sha256": "a695d198031d1024a669ebad303e59d7336ed1bebf940dd539519b174f4fb427", + "files_pass": 136, + "unittest": 406, + "top_level": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "ASan/UBSan actual factory/registry/CHARACTER installation with explicit platform and actor-held substitutes", + "Every allocation site in sample successful install injected bad_alloc; failures preserve original pointers, gold, maps and other window; no staged leaks", + "Same-ID replacement, complete metadata, 3-cell grid, all-consumed empty inventory, local selection remapping; locked/overlap/VID overflow/foreign ID refusal", + "Actual actor helper and LiveImageAnswer branch with explicit capture/install substitutes: full-seal checks, exact duplicate once, conflicting reply, before/after other-window mismatch remains held" + ], + "not_claimed": [ + "Real actor freeze/quiescence", + "Matched live socket gameplay", + "Android runtime acceptance" + ] + }, + "native": { + "root": "/root/deploy-features/cube-apply.0a597O", + "build": "Five actual actor/apply/factory/item/item_manager translation units compiled; final apply recompiled after reference remap; game linked with matching prior object cohort, not full game/DB rebuild", + "external_serialized_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "selected_source_hash_count": 15, + "game_sha256": "95438402c9d72f4aea41dd9446981df8f7fdec320795e6b9a686c7c300e8e07e", + "probe_log_sha256": "62cb82b1c51247dec536d5479ef898dc51e0eb66f356230b104edcb0290b9509", + "empty_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "probe_root": "/tmp/ch5-cube-factory.GD05fF", + "probe_sha256": "04ebaaf6093b099454b454da948ef905e095b97d81d470d5b03bc3165d2b7eba", + "probe_object_sha256": "ff90ac1f62831ef7587310822d3e6110b5395a05a49b298a54af06f68c10287a", + "renamed_main_object_sha256": "0529e3ecebd5e834dcd8ab0429577503639f36e8e325eff8a95220ca18968a77", + "result_log_sha256": "c680c046017c70308bf6ca58295ecfef97592fe75bd97f951693f16104b50301", + "result": "PASS actual game item/sash/restore/registry/retirement and template SaveSingleItem probe; synthetic proto, no DB descriptor/events or live actor freeze", + "game_or_db_daemon_started": false, + "db_sql_sources_changed": false, + "mysql_rerun": false + }, + "encoding": { + "files": [ + "src/server/game/src/item_manager.cpp", + "src/server/game/src/item_manager.h" + ], + "method": "Reversible ISO-8859-1 UTF-8 byte proxy for ASCII apply_patch edits, restored original encoding; non-ASCII streams compared equal and mode755 preserved", + "original_copies": "/tmp/ch5-cube-apply-encoding.RvU7Kh" + }, + "disk_management": { + "action": "gzip two superseded task-only offline probes, gzip -t passed; recoverable with gunzip", + "targets": [ + "/tmp/ch5-cube-factory.13mc4M/probe.gz", + "/root/deploy-features/cube-factory.LM5CPB/factory-probe.gz" + ], + "original_sha256": [ + "6f65914d777dbedd48a10c59b28edb4fa14edc489b9d45d54acca585650c9a53", + "45242d744af834a038f74e74117ef6d5f1045924d654193656bbdcbd57c7b89c" + ], + "approx_freed_mb": 124, + "remaining_mb": 359, + "final_game_probe_sources_logs_preserved": true + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "client_craft_enabled": false, + "release_ready": false, + "production_deployed": false + }, + "remaining": [ + "Exact image ACK and owner-authorized durable terminal release/replay before thaw", + "Restore normal saving, expiry events, quickslot correction and client full state safely", + "Audit external CItem references and reliable quiescence/deferred legitimate mutations", + "Old-core revocation, complete character/non-normal windows recovery, PREPARED/ABORTED/non-ok DONE reconciliation", + "Copy/rate item rules, public start and capability UI, matched live and Android acceptance", + "After Cube closes, implement Won then Wolfman then Conqueror then five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-batch-20261022.json b/audit/xxf-ch5/cube-batch-20261022.json new file mode 100644 index 00000000..1a2c1504 --- /dev/null +++ b/audit/xxf-ch5/cube-batch-20261022.json @@ -0,0 +1,105 @@ +{ + "schema_version": 1, + "date": "2026-10-22", + "status": "PARTIAL_CANDIDATE_SQL_BACKEND_NOT_WIRED_ONLINE", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "server_source_sha256": { + "src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "src/server/common/cube_store.h": "4ed9f1612b78513cc1b2588a80cfda2266d5cd6e21e1a0d7b7f6acf363ba2b25", + "src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "src/server/db/src/Makefile": "77c4433f2cbd9997981e7320c34bb027291816a6a12fe8280edb40811ba16a23", + "tests/features/fixtures/cube_batch_probe.cpp": "29495b9cbbe34ce91f61bac44705389e7b72f611bccd5a6885c8c5efeab7c62a", + "tests/features/test_cube_batch.py": "a8e3342aebc84f3e6fb2d350171d1f775a49b6c864cbc0b5e97b9ac96051fc57", + "tools/cube/schema.sql": "5437932fb1754dea7cffc9298f7edde70d80fb438e838fa56fdd8a9b8437ce7d", + "tools/cube/test_mysql.sh": "a3fd550bbf239087059cdd03b32cb99c61fffabae7ca37a128483ba291154968", + "tools/cube/README.md": "fd14f5394fb495f6ee2e1004fa3a8807b2256c094c78a47fc7a0ed1681ef57e5" + }, + "client_metadata_sha256": { + "scripts/test_xxf_all.py": "0d9b7930c5d5ae09458fa6bfb975bb433ce426b6068806c8da0eaea2b5d16252", + "scripts/build_xxf_features_json.py": "7d984314733fc81fb6a61469dcd6bf0b1858966f1f28ecff780fcb0ca53ec5e4", + "audit/xxf-ch5/features.json": "a12552462918aae1bc62f39c85d191597b4ec15c70088646d7c0cbfa1dc5c9f4" + }, + "artifact_sha256": { + "build/ch5-tests/20261022-222210-8kfwe9ij/report.json": "b6dce49a9d8c975bd3ce9c45334a41c59e39db261b5c23a3085db0affad718b9", + "build/ch5-cube-batch-all-tests-20261022.log": "270c013f5585c703b15d7437f41d70e3b2ae0cce5bedcb40bc0cbbe413307e4c" + }, + "remote_sha256": { + "/root/deploy-features/cube-batch.j5nQbT/src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "/root/deploy-features/cube-batch.j5nQbT/src/server/common/cube_store.h": "4ed9f1612b78513cc1b2588a80cfda2266d5cd6e21e1a0d7b7f6acf363ba2b25", + "/root/deploy-features/cube-batch.j5nQbT/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-batch.j5nQbT/tests/features/fixtures/cube_batch_probe.cpp": "29495b9cbbe34ce91f61bac44705389e7b72f611bccd5a6885c8c5efeab7c62a", + "/root/deploy-features/cube-batch.j5nQbT/tools/cube/schema.sql": "5437932fb1754dea7cffc9298f7edde70d80fb438e838fa56fdd8a9b8437ce7d", + "/root/deploy-features/cube-batch.j5nQbT/tools/cube/test_mysql.sh": "a3fd550bbf239087059cdd03b32cb99c61fffabae7ca37a128483ba291154968", + "/root/deploy-features/cube-batch.j5nQbT/mysql-test-verified.log": "3b411221be8470a0f8b7afcacba95aff6071cbd7d5c94d1bc2395c1f099f3944", + "/root/deploy-features/cube-batch.j5nQbT/db-build.log": "3546de1850972cd3d8c87f45dd7a8f75e67aeb3bb17c2a1fb480370dbf13087f", + "/root/deploy-features/cube-batch.j5nQbT/build-root/bin/db": "49e914d927ae5f0386ab66bb2335100943c377259facd6b8bc3f9e26392cc625", + "/root/deploy-features/cube-batch.j5nQbT/build-root/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-batch.j5nQbT/build-root/src/server/db/src/Makefile": "77c4433f2cbd9997981e7320c34bb027291816a6a12fe8280edb40811ba16a23", + "/tmp/ch5-cube-mysql.pmtMDQ/result.log": "ccf5a84c83f514df368995f4dc4e545faaa92957b5bb1c0b23557b1cb22b9cf3", + "/tmp/ch5-cube-mysql.pmtMDQ/cube-batch": "12b7af1fc18a84032aa3488dc26a7878e8dc5b7214734a6cf5dcfc2dfcefbd00" + }, + "tests": { + "report": "build/ch5-tests/20261022-222210-8kfwe9ij/report.json", + "pass": 123, + "fail": 0, + "blocked": 0, + "unverified": 0, + "unittest_cases": 371, + "top_level_probes": 33, + "source_changed_during_regression": false, + "release_ready": false, + "local": "ASan/UBSan actual cube_batch.h/cube_store.h compiled and executed with SQLite SQL dialect adapter", + "mysql": "PASS actual Mysql pinned connection wrapper, InnoDB, actual tools/cube/schema.sql in dedicated no-defaults socket-only instance", + "cases": [ + "Canonical explicit-width codec and truncated/trailing/corrupt input rejection", + "All-attempt costs and successful-only quantities; all-fail paid receipt without reward objects", + "Stackable splitting, multiple material stacks, locked inputs, physical grid/full/overlap, uint64 fees", + "Exact signed sockets/attributes and 69-byte state preservation", + "Conflicting identity, owner/epoch/account mismatch, offline-economy pending rejection", + "Every prepare/execute SQL statement failure position; pre-commit rejection and post-commit lost acknowledgement", + "Process exit after deduction, receipt write and durable commit; identity-only recovery", + "Two simultaneous duplicate executions across separate processes", + "MyISAM, schema version and unknown item-column readiness rejection", + "Actual non-strict MySQL numeric truncation warning rolls back tentative deduction", + "Corrupt saved request/draw/terminal receipt refused without new charges" + ], + "post_regression": "Documentation/evidence only; no runtime or metadata edits afterwards" + }, + "freebsd": { + "directory": "/root/deploy-features/cube-batch.j5nQbT", + "db_build": "PASS copied prior isolated build source/libs/objects, recompiled Economy.cpp and version.cpp, relinked db; not clean full-library rebuild; never deployed", + "mysql_directory": "/tmp/ch5-cube-mysql.pmtMDQ", + "isolated_socket_closed": true, + "production_socket_used": false, + "uploaded_sources_match": true + }, + "contracts": { + "activation": "No production game/db dispatch calls BatchStore; client remains capability4096 read-only; whole crafting macro remains 0", + "prepare": "Immutable complete batch image + pre-reserved factory IDs + durable 1..100 draws; exact replay never rerolls committed preparation", + "execute": "One pinned SQL transaction commits all attempted costs, only successful rewards and terminal receipt; rejected logical validation costs zero", + "fence": "Candidate trusts DB-owned matching FROZEN row (account/player/owner/epoch/token); test rows explicitly fixtures, not online cache proof", + "recovery": "Identity-only original payload and fixed draws; DONE receipt verifies successes/fee/item images; ambiguous commit requires lookup, no blind refund", + "item_ids": "Permanent existing economy reservation tombstones; existing boot high-water algorithm already includes them", + "warning_policy": "New Mysql warnings field does not change existing economy behavior; Cube candidate specifically treats warnings as errors" + }, + "limitations": [ + "No online character freeze, cache eviction/dual FIFO drain, owner-generation coordinator or post-commit resync implementation", + "No live action protocol/UI or trusted runtime recipe/factory wiring", + "Copy recipes and success-rate consumables refused; rewards do not merge existing stacks or use special bags", + "No matched live game/db actor, Android device or rendered visual acceptance", + "No production SQL/data mutation, deployment, restarts or forced logout", + "Shared schema readiness candidate requires unsuffixed deployment; future coordinator must enforce it", + "Test databases and logs retained; only dedicated MySQL instances shut down", + "No Won/Wolfman/Conqueror/five-slot completion claimed" + ], + "next": [ + "Runtime online owner/cache fencing and coordinated recovery", + "Trusted factory/request binding and receipt/resync pipeline", + "Copy/rate rules and matched live asset/device acceptance", + "Then Won, Wolfman, Conqueror, five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-catalog-20261022.json b/audit/xxf-ch5/cube-catalog-20261022.json new file mode 100644 index 00000000..400eafa3 --- /dev/null +++ b/audit/xxf-ch5/cube-catalog-20261022.json @@ -0,0 +1,111 @@ +{ + "schema_version": 1, + "date": "2026-10-22", + "status": "PARTIAL_READ_ONLY_NOT_RELEASED", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "source_sha256": { + "src/platform/ScriptLib/CubeRenewalScript.inc": "3d35252700f04848a2f2e2c8f18e4631d6b03213571876298aa9143ef6f34ecd", + "src/platform/ScriptLib/FeatureServiceScript.inc": "50d385786607bbae1d315a3dc6b0d8cd60a5e9ead0cde2b80c04a5ecc0628f22", + "src/port/CMakeLists.txt": "832d63f46ce86fd4507c18c4616438e4ea2aa40491a8b33d202b422cb0ad7dc5", + "tests/port/port_login_flow_test.cpp": "47cc188c3d94a99b9ab027131d66a23ef1acdf54340387fea0ce50c0e996c78b", + "tests/port/port_login_flow_server.cpp": "80a3bc3492e54a30263105cbfe5c955da776c6c7eaa7f39ff8f4c248955794ea", + "tests/wiki/test_cube_catalog.py": "506b25a5531a6cc55ed08f758ef078f9fd38248fd11a22731865c8092b455906", + "tests/wiki/test_service.py": "93c18fb0a94797373390c4e8c2a5e7679a9319f924f67912bfc5b2dcb255bef8", + "scripts/test_xxf_all.py": "5509b168992b8238fef5feb46d5b85d8bf8ee02ed7dddb8634bbf7532b31d8dd", + "scripts/build_xxf_features_json.py": "ad9b65a43c5b7a0921153877f00a8d64b42831b552327b933130953a09498da1", + "audit/xxf-ch5/features.json": "be4559eff30cf55d3e72725b5ceaf5d2df430ebde9040986a7d0f38ea29fd009" + }, + "server_source_sha256": { + "src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "src/server/game/src/char.h": "1c245ec37b7c2c972ac5cc1d11deedc1c6a88ac0990a409ea4b04ff8e012409a", + "src/server/game/src/cube.h": "5c3d5c24ed811a1b8971a15e26ef63cd38e842a73f75be0752df5d70ea84b6cf", + "src/server/game/src/cube.cpp": "bbb5160364f4a4068fdf27c1fdda1651bdfd5791cbfa73f1b5cac72fe5e3ec6a", + "src/server/game/src/port_cube_catalog.inc": "6826526e66f0d6ba2a56b319f33f90747f08cd66995e24722e88e9b87f3800d7", + "src/server/game/src/port_features.h": "7e72f29589a53a2d969a41062f0401ba252b7281d453f4d658c86b595c7a9536", + "src/server/game/src/Makefile": "257b99c05b24b2ada51842f79a444ca971d5f16db6e78155c300679a286b9cc8", + "tests/features/test_cube_catalog.py": "9102731bbf7f7aeaf08eac2ce3312dccdb06dd585314a879b2392bb1e0f5aae8", + "tests/features/test_queries.py": "161c6de01b516dccafd3755d51c7b40f05060fda3c30dd2b5e74ec6b81f81a6f", + "tests/features/test_bosses.py": "36dd2e4b1b4ce024b2de2af7c70c04379b4a8eab2d349c4d2b99ef50c663188e" + }, + "artifact_sha256": { + "build/ch5-tests/20261022-190031-6mw16lxl/report.json": "6119a4cf793dd21ea9a3cd1b438230b680f0e646a4c10203988a51fd87deb2bd", + "build/ch5-cube-native-build-20261022.log": "97732775ea6e2de9fa0a9d7f7ff2514c90d0c71666ff2ddbb3ab22b53f809a1d", + "build/ch5-cube-native-tests-verified-20261022.log": "ee214791fd773933dd549ae7e4535f72d4f50f76b592d0686ed2280f018d745a", + "build/ch5-cube-ch5-native-verified-20261022.log": "4a137757745e0c2b52e1605b2a781c7b4da9d8a405837768fff41e2081d5a1ca", + "build/ch5-cube-android-20261022.log": "c5abc743b03a70971ce7e1191d4e50b63c7c851bdcbd4237bfffb2b6c0a6f770", + "build/port-gate/macos/src/port/port_login_flow_test": "e9430dd781d6ba8bf47c352e7b84f4b00440abd1852d9e69e8ef7c2005fce90e", + "build/port-gate/macos/src/port/port_python_ui_modules_test": "fd94d16ca3475d8909005d8eec281039ffd7340e8fac993afa65e1273df25cad", + "android/app/build/outputs/apk/debug/app-debug.apk": "f5747448f1ad028bbab6c8608e4cb99421d9f59ffccdd0c9bc7af8c9f7d7e0bc", + "build/ch5-quiver-test-client-20261022/pack/Index": "83d6365507db81393613bb6ec55ffc6c2ebcc09257598ec047766aefd33211af", + "../喜相逢五区客户端_extracted_locale/root_scripts/uicuberenewal.py": "f097bee5cd115f1f1bd1b1eff458fccf9969d39e9cd57cfcb2fbb004907e1225" + }, + "tests": { + "local": { + "pass": 122, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 370, + "top_level_probes": 33, + "source_changed_during_regression": false, + "report": "build/ch5-tests/20261022-190031-6mw16lxl/report.json", + "native": "5/5: login_flow, quiver_sync, trade_level, cube_catalog, python_ui_modules", + "private_ch5": "PASS: real game window hooks and original CubeRenewal layout; FakeLoginServer recipe/preflight fixtures; 3-attempt check with unchanged gold/materials; not live server or rendered visual acceptance", + "server_probe": "Actual cube_recipe.h and port_cube_catalog.inc compiled under ASan/UBSan with explicit actor/item/proto substitutes; no SQL or live mutation", + "android": "Complete native Release / debug-signed APK; --no-deploy; adb list empty; no device acceptance", + "post_regression": "Documentation/evidence only; runtime and feature manifest unchanged" + }, + "freebsd": { + "directory": "/root/deploy-features/cube-catalog.7eDSki", + "build": "PASS: copied previous isolated source/internal libraries/objects, rebuilt affected game objects and linked game; not clean full-library rebuild; never deployed", + "source_hashes_match": true, + "sha256": { + "/root/deploy-features/cube-catalog.7eDSki/bin/game": "560a9a5f199c9212252c41d6f6b052843447d5153feb34d3f1d90bc89ca7933e", + "/root/deploy-features/cube-catalog.7eDSki/build.log": "537024552d93c3cec90a37cfbd7392eeab4b058797e3ab111cc463912d1c943e", + "/root/deploy-features/cube-catalog.7eDSki/src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/char.h": "1c245ec37b7c2c972ac5cc1d11deedc1c6a88ac0990a409ea4b04ff8e012409a", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/cube.h": "5c3d5c24ed811a1b8971a15e26ef63cd38e842a73f75be0752df5d70ea84b6cf", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/cube.cpp": "bbb5160364f4a4068fdf27c1fdda1651bdfd5791cbfa73f1b5cac72fe5e3ec6a", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/port_cube_catalog.inc": "6826526e66f0d6ba2a56b319f33f90747f08cd66995e24722e88e9b87f3800d7", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/port_features.h": "7e72f29589a53a2d969a41062f0401ba252b7281d453f4d658c86b595c7a9536", + "/root/deploy-features/cube-catalog.7eDSki/src/server/game/src/Makefile": "257b99c05b24b2ada51842f79a444ca971d5f16db6e78155c300679a286b9cc8" + } + }, + "contracts": { + "source": "Active archived AVA2 WORLDARD/COPY branches use locale/cube.txt; current loaded s_cube_proto is single runtime catalogue", + "catalogue": "capability4096; MTF1 cube NPC OFFSET; 8 recipes/page; catalogue and recipe FNV1a64 stale-content fingerprints (not cryptographic authority); complete-page atomic client publish", + "preflight": "MTF1 cubecheck RECIPE_ID ATTEMPTS1..100; uint64 requirements; normal inventory only; mutation_enabled=0 and capacity_reserved=0; no deduction, RNG or rewards", + "ui": "Original interleaved 16-field GetDates; labeled batch preflight; missing capability/UI preserves classic; stale/closed-window replies discarded", + "whole_feature_macro": "ENABLE_CUBE_RENEWAL_WORLDARD remains 0", + "verified_rule_basis": "All attempts pay materials/fee; reward quantity must equal successes*per-attempt output. Archived premature item creation/reward count and uninitialized copyAttr must not be replicated." + }, + "remaining": [ + "Online asset owner/cache epoch fencing across all mutation paths", + "Durable authoritative batch identity, receipts, fixed random outcomes and retry/reconnect/crash recovery", + "Actual all-attempt cost deduction, successful-only rewards, real capacity reservation and lossless copy attributes", + "Real MySQL/game/db asset roundtrip and Android device acceptance" + ], + "limitations": [ + "No production deployment, restarts, player/item/SQL mutation or forced logout", + "Not exact five-zone historical server reconstruction", + "FNV fingerprints provide staleness checking only", + "Source recipe loader is existing legacy parser; not claimed newly fully hardened", + "Existing unrelated missing images/audio/Wolfman motions and compiler warnings remain", + "Won, Wolfman, Conqueror and five-slot completion not claimed" + ], + "priority": [ + "Finish modern Cube durable craft/recovery", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-factory-20261023.json b/audit/xxf-ch5/cube-factory-20261023.json new file mode 100644 index 00000000..9c105d33 --- /dev/null +++ b/audit/xxf-ch5/cube-factory-20261023.json @@ -0,0 +1,122 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_REAL_REWARD_METADATA_FACTORY_NO_TRUSTED_BATCH_CALLER_OR_PUBLIC_CRAFT", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-item-ids-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "provenance": { + "archive": "AVA2/2. Backup SF+SRC and SQL/FILES+SRC.tgz", + "member": "home/Ava2_src/Srcs/Server/game/src/cuberenewal.cpp", + "member_sha256": "c428491df283ef480b754cc48a6471cc0f55d86868027f1872c4f65796d4d355", + "factory_call_line": 427, + "semantics": "Modern WORLDARD uses CreateItem defaults, not classic AutoGiveItem TryMagic=true; preserve actual new-item metadata, not archived over-award bugs" + }, + "server_source_sha256": { + "src/server/game/src/port_cube_factory.cpp": "3d6a048e5302ae4c2f0bed0ea6e5fd37439b0fbc293f41bf2e1b5cb896a2ac4a", + "src/server/game/src/port_cube_factory.h": "ca9bd03b527e639c1eca2802b84ca4e4fab155c20bb0ce1c41cb05b2e3adb516", + "src/server/game/src/item.h": "6e937f43c5d0ec348cf747791754a2a25989ec41011f17b824e6b68ae39fa875", + "src/server/game/src/item.cpp": "110ce2151569a3faa3a6d342252e76f0ba10e9cf9967d06ac984f72add64c75e", + "src/server/game/src/item_attribute.cpp": "08b22fdaa94f1d26fd2df2e103e879c1199e83c2b588db012f3167ce6bb41562", + "src/server/game/src/item_manager.cpp": "50a42bb33f170240dd2839853383a0bf7b07ec46382c9c7df0ad921ec301ce7e", + "src/server/game/src/Makefile": "f7301d2cfc6798ead8b6468b5671e2ef938ac672a4a07c40c0478a31f1dee3c1", + "tests/features/test_cube_craft.py": "5263ac92bf6d5fb0faf2286fafdda73ef97d6fbd58a7c7f6a2730f158d19efa4", + "tests/features/test_cube_mutation.py": "ca9045694ce62bb16cb08984b2b65fdae9a58048dc665d9526bbe05a9391acdd", + "tests/features/fixtures/cube_factory_platform.h": "bf0d56945da7c65e4fbc58dbff180f44a518e52c01969eb1889a25722996c84b", + "tests/features/fixtures/cube_factory_cases.inc": "ab06ff4af2c7c35acf9e85856416731626477692b2b872aa4d1a7c9e60c6872f", + "tests/features/fixtures/cube_factory_native.cpp": "ebe6183b93bafc9acd34177bd8eeda3be8229d6aefc4d0fd44b817db226a486d", + "tools/cube/test_factory_native.sh": "1a61dec320bfc2e74b18afb9ddd1990fbe8900e3659e7908b0c3ba52d24664c6" + }, + "client_metadata_sha256": { + "scripts/build_xxf_features_json.py": "aa470e4f2a1352349d563bb5e0c50682f58470e7e9bdac548def5065a65d51f1", + "audit/xxf-ch5/features.json": "c80db255c9dab30bfb150cee201c3344c58158219cf28a69ff54184ef8a7f583", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "cd6bcbcac4e6ce28f7458c5bf88f56b2ad9b1afbf062853ac45758d06ef0d0e8", + "docs/XXF-CH5-CUBE-FACTORY-20261023.md": "a5be8974c465d301be8f28d6d6103f6c45a802bd89a3543aa086025a55852a98" + }, + "changes": [ + "Real CreateItem new-item branch binds reserved IDs without changing id=0 semantics; single-use internal slot, default TryMagic=false", + "Per-item transient flag suppresses Save notifications/delayed-save, update packets, socket/attribute logs and expiry events; original metadata initialization retained", + "No VID increment/ID or VID registration; template destruction sends no DB delete and erases no ID/VID mappings", + "RAII releases each transient even on early return or exception; whole output unchanged on failure; IDs are consumed, never refunded", + "Empty skill catalogue refused before ID reservation, preventing legacy book initializer infinite retry on absent candidates" + ], + "encoding": { + "original_item_manager_sha256": "8cf1cea9a2169d8cf7fd9375c46cb61fa092bd554c3f1971f8a17cdf71ab0b0d", + "snapshot": "/tmp/ch5-cube-encoding.XJLfnM/item_manager.original.cpp", + "method": "Reversible Latin1 byte proxy for apply_patch ASCII edits, then reverse conversion", + "non_ascii_bytes_equal": true, + "file_mode_preserved": "755" + }, + "tests": { + "cube_unittest": 34, + "full_report": "build/ch5-tests/20261023-cube-factory-final/report.json", + "report_sha256": "1578c185e42451ebfa28bfc2ea2efaada89ebb481b2bb0500f0ae6428dea9ac8", + "files_pass": 136, + "unittest": 402, + "top_level": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "Actual CreateItem/DestroyItem/Save/socket/attribute bodies plus factory facade under ASan/UBSan, with explicit primitive/platform/data substitutes", + "Metadata/extra bytes for addon/socket/unique/timed/wear/blend/skill/DS; no save/log/registry/VID/event side effects", + "Partial construction, count failure, exceptions, unchanged output, empty skills, reentry/duplicate ID, ordinary factory save/registration/timer/destroy preserved", + "Old mutation Save probe retains original notifications/save assertions and adds template-only no-notification assertion" + ] + }, + "native": { + "root": "/root/deploy-features/cube-factory.LM5CPB", + "kind": "fresh_game_object_directory_all_game_units_compiled_across_repair_attempts_no_old_object_reuse", + "dependency_libraries": "existing matching isolated cube-source.iDdvhO libraries", + "max_compiler_jobs": 2, + "terminal_exit": 0, + "initial_error": "New factory TU lacked char.h type declarations; fixed and rebuilt", + "full_compile_log": "game-final.log", + "full_compile_log_sha256": "44fe638d7702c57bcd30cf2dae790b132bc2df6b3b8b26ab7d3dd1b8fbcffd88", + "final_recheck_log": "game-verified.log", + "final_recheck_log_sha256": "4b8f5381fc6d7dd431d72fa446bde2aa5d0f483c704b1d4a63c42781adf264e3", + "game_sha256": "7563b0844bb3bfbd34edf6fb6f96197cbb2acf185c3d5b7d88e7a841b88b6aa6", + "selected_source_hashes_match_local": true, + "exported_factory_symbol_verified": true, + "game_main_started": false, + "db_rebuilt": false, + "mysql_rerun": false + }, + "native_offline_probe": { + "script": "tools/cube/test_factory_native.sh", + "fixture": "tests/features/fixtures/cube_factory_native.cpp", + "evidence": "/tmp/ch5-cube-factory.CJlZiw", + "terminal_exit": 0, + "probe_sha256": "45242d744af834a038f74e74117ef6d5f1045924d654193656bbdcbd57c7b89c", + "object_sha256": "a333f6494c1c88db4a6722f56091edcc09f9e7bbc9faa9d56a00dadee0a7a4b9", + "renamed_main_object_sha256": "0529e3ecebd5e834dcd8ab0429577503639f36e8e325eff8a95220ca18968a77", + "result_log_sha256": "148899ac086cc7f200665b9ccaab22dc04d657aad1fb66d0e13b3100917f1059", + "empty_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "scope": "Real fully compiled game objects and allocator/item/addon/socket/expiry/event code with only synthetic in-memory proto. Original main symbol renamed in a copy, never executed; no DB descriptor. No registered items/VIDs/events; Update/GracefulShutdown safe. Not real data or live acceptance." + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "public_craft": false, + "production_deploy": false, + "production_restart": false, + "production_migration": false, + "player_assets_changed": false, + "client_or_android_build": false + }, + "remaining": [ + "Factory is compiled but not yet called by trusted batch builder or public player action", + "Batch identity, current loaded NPC recipe and full actor snapshot must be assembled and tied to factory once per accepted request; never regenerate accepted metadata", + "In-process reserved IDs/templates require durable original fence acceptance before Execute/external exposure", + "Actor apply/exact ACK/thaw, complete quiescence/deferred mutation, old-core revocation, full data recovery, copy/rate items and live/Android acceptance remain incomplete", + "Won/Wolfman/Conqueror/five slots not advanced this batch" + ], + "next": "Trusted batch construction and actual internal begin caller using current canonical NPC recipe, actual snapshot, server-owned identity and real metadata factory; preserve disabled gates until closure is proven" +} diff --git a/audit/xxf-ch5/cube-fence-20261022.json b/audit/xxf-ch5/cube-fence-20261022.json new file mode 100644 index 00000000..0bf462c3 --- /dev/null +++ b/audit/xxf-ch5/cube-fence-20261022.json @@ -0,0 +1,126 @@ +{ + "schema_version": 1, + "date": "2026-10-22", + "status": "PARTIAL_DB_GUARDS_AND_DURABLE_LIFECYCLE_CORE_NOT_GAME_WIRED", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "server_source_sha256": { + "src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "src/server/common/cube_store.h": "f44c9ddfeea56ecf0cdcc8a0f5b9d62918793f55c99ac30ceb88d7a795d87bd4", + "src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "src/server/common/cube_fence.h": "bc1008464050764d94a446eca31cbb9e6eee5b3c359f59b453390382144513a3", + "src/server/common/economy.h": "43d4b67c7c21366abc2582f83d051005813538875fca62859be03619532fda88", + "src/server/common/economy_store.h": "249402f37cb806c2dbf624d378ff82104d7d07325190c3f9f83e7005ae29744c", + "src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "src/server/db/src/Cube.cpp": "a0b744dcd90dd4384639f1cd42bfcb549df657ccc4a16500305c88b69ccb2396", + "src/server/db/src/ClientManager.h": "b1163ad24eed8c3a37403d055ba45eb771c25339776124053a3bf8da958a82f5", + "src/server/db/src/ClientManager.cpp": "37ab398d05cfa5224da1ecfb08214940ef79c8de1fa5b7132181c0ebdc166bcd", + "src/server/db/src/Economy.cpp": "77b9dbc34c14532fb8476da7bf3bf4ca598821dd0390e27b7291806abd13fff8", + "src/server/db/src/ItemIDRangeManager.cpp": "895a9719fd26f7379d26ec40d6fe7412922ad98c0f7c96fd6ed81ff6b6ff2e4e", + "src/server/db/src/Makefile": "fbd6a0116ce8b0419e4c1ba197441d68bb7ad3dc89ce3997f9b7af10540af6f3", + "tests/features/fixtures/cube_batch_probe.cpp": "6ea42fec89a6b28f7d0e65b15ea7833998b10c9a54aaffabc393dde5b2047de9", + "tests/features/test_cube_fence.py": "ef44cb968244088c639027073d71eccff438a475aa19548e1dac0a2b50f1fd14", + "tests/features/test_cube_db_guards.py": "8bf37e714d0ffc86f2c9f778956725bec0424a3d44e2cf785588478c4f3817b2", + "tests/features/test_economy_coordinator.py": "857b20e70510ab7ae93a5a4720940c7670165113f469a09e8617af78fa07fa4e", + "tests/features/test_legacy_item_ids.py": "91e9bf72165ca01e269322ec599291c8d9da3d93bb61e7f7835df0d4dd8cbbb6", + "tools/cube/schema.sql": "7d1a730087321e5d027454400195a3724d24c0c82977f246eda2a5d9065fdc67", + "tools/cube/upgrade-v2.sql": "f0d985116087ef485dddf802ac1e9666c2e65c93b18c1e3870d3e6f371d14551", + "tools/cube/test_mysql.sh": "9e925dc88e1c347a05cef82323c3b662af20923a99c90bbc17920ad747b6ac7b", + "tools/cube/README.md": "f3d268f29104d56f4bc88e42533939309e88c490b2c819421dbfb6779ba268f2" + }, + "client_metadata_sha256": { + "scripts/test_xxf_all.py": "39bd0649af20e1865b9f777965164cce1c0c107a434ce0347d8476779bb311ae", + "scripts/build_xxf_features_json.py": "7d7f33fb1a40b467c4bc3cfedf82da8cf4457b4464cad38d4301fa35b6280123", + "audit/xxf-ch5/features.json": "bb0c45676bd5a4f332907f1f582b3703bef2312f50bb46717a0678643b2b83e0" + }, + "artifact_sha256": { + "build/ch5-tests/20261022-230645-miudzocm/report.json": "72be4ce0a55600b3cf4f3033616783710880a1c501f725f64bf948707fcac1c7", + "build/ch5-cube-fence-tests-final-20261022.log": "eed051d5fe0269ef7d46d82049eeda77e4a788fc8297e6ce1f935a9cb0eb9c8f" + }, + "remote_sha256": { + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/cube_store.h": "f44c9ddfeea56ecf0cdcc8a0f5b9d62918793f55c99ac30ceb88d7a795d87bd4", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/cube_fence.h": "bc1008464050764d94a446eca31cbb9e6eee5b3c359f59b453390382144513a3", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/economy.h": "43d4b67c7c21366abc2582f83d051005813538875fca62859be03619532fda88", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/economy_store.h": "249402f37cb806c2dbf624d378ff82104d7d07325190c3f9f83e7005ae29744c", + "/root/deploy-features/cube-fence.wGvs6m/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-fence.wGvs6m/tests/features/fixtures/cube_batch_probe.cpp": "6ea42fec89a6b28f7d0e65b15ea7833998b10c9a54aaffabc393dde5b2047de9", + "/root/deploy-features/cube-fence.wGvs6m/tools/cube/schema.sql": "7d1a730087321e5d027454400195a3724d24c0c82977f246eda2a5d9065fdc67", + "/root/deploy-features/cube-fence.wGvs6m/tools/cube/upgrade-v2.sql": "f0d985116087ef485dddf802ac1e9666c2e65c93b18c1e3870d3e6f371d14551", + "/root/deploy-features/cube-fence.wGvs6m/tools/cube/test_mysql.sh": "9e925dc88e1c347a05cef82323c3b662af20923a99c90bbc17920ad747b6ac7b", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/Cube.cpp": "a0b744dcd90dd4384639f1cd42bfcb549df657ccc4a16500305c88b69ccb2396", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/ClientManager.h": "b1163ad24eed8c3a37403d055ba45eb771c25339776124053a3bf8da958a82f5", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/ClientManager.cpp": "37ab398d05cfa5224da1ecfb08214940ef79c8de1fa5b7132181c0ebdc166bcd", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/Economy.cpp": "77b9dbc34c14532fb8476da7bf3bf4ca598821dd0390e27b7291806abd13fff8", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/ItemIDRangeManager.cpp": "895a9719fd26f7379d26ec40d6fe7412922ad98c0f7c96fd6ed81ff6b6ff2e4e", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/db/src/Makefile": "fbd6a0116ce8b0419e4c1ba197441d68bb7ad3dc89ce3997f9b7af10540af6f3", + "/root/deploy-features/cube-fence.wGvs6m/build-root/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-fence.wGvs6m/build-root/bin/db": "960cd0c0dfd6d2586f855ec5faa068d4861dac5249b90e493691c2ab38251046", + "/root/deploy-features/cube-fence.wGvs6m/db-build.log": "cec6efd8889f224265851b3bf15656c7668f7b8b2324dd33caaaf9b40a7dc975", + "/root/deploy-features/cube-fence.wGvs6m/db-build-id-final.log": "e6b6a12c8b07e37b11933de00b0cf8e8d5771996570ecfa0ab6c409528fcc679", + "/root/deploy-features/cube-fence.wGvs6m/mysql-test-process-final.log": "0c5957d77b1f96036550420767fa37467a2da59f3d59f6e81309ef4a31203beb", + "/tmp/ch5-cube-mysql.cPcG99/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.cPcG99/cube-batch": "245b03d18e0e380a101b325fd16c39a3a65e53a3006df82ff5880deac9d4f1bf", + "/tmp/ch5-cube-mysql.cPcG99/upgrade-refused.log": "e2fa15a609a73b5cc6e0129306cf4cb8497d728a8cf9510c717c1d29f550d7f1", + "/tmp/ch5-cube-mysql.cPcG99/upgrade-pending-refused.log": "87bbbd9e85ee501bd6dfc89715d06ca448b82db894b78bb85c2432934671a5f2" + }, + "tests": { + "report": "build/ch5-tests/20261022-230645-miudzocm/report.json", + "pass": 125, + "fail": 0, + "blocked": 0, + "unverified": 0, + "unittest_cases": 374, + "top_level_probes": 33, + "source_changed_during_regression": false, + "release_ready": false, + "native_cpp": "ASan/UBSan actual cube_batch/store/drain/fence code; actual db/src/Cube.cpp methods with explicit SQLMsg/discovery adapters", + "stress": "8 batch + 8 fence runs using newly spawned processes, all pass", + "mysql": "Actual InnoDB, pinned Mysql wrapper, new schema v2, v1 upgrade refusal/partial-DDL retry/history retention/idempotency, independent process recovery", + "db": "Fresh .cube-v2-obj: all DB objects compiled and linked; final ItemIDRangeManager update recompiled/relinked; inherited internal libraries, not full clean-library build", + "post_regression": "Documentation/evidence only; no runtime or metadata changes" + }, + "contracts": { + "runtime_db_gates": "Cube.cpp linked, called by player/quest/item save/destroy, peer item flush, player load/deletion, economy enqueue/settlement. Absent schema preserves baseline; partial/unknown schema or query failure denies", + "durable_drain": "Immutable body + per-item locks + reward tombstones precede cache eviction; clean two-main/async correlation core -> FROZEN, failed/lost owner -> ABORTED", + "fifo_boundary": "Drain is a transport/session correlation core; real FIFO enqueue/callback adapter NOT implemented", + "prepare": "Requires exact frozen body, clean drain_state and all snapshot/reward item locks; only same-request pre-reserved reward IDs accepted", + "resync": "Canonical SQL gold/normal-inventory image, exact ACK and SQL re-read; atomic lock removal + RELEASED; stale ACK cannot release newer batch; no wall-clock expiry", + "ids": "Boot range SQL includes active Cube item fences, including cached IDs absent from item; permanent reward tombstones created at DRAINING", + "migration": "Cube schema v2 + economy schema v1. upgrade-v2 refuses all unresolved old fences/prepared requests; no synthetic owner/body reconstruction" + }, + "freebsd": { + "directory": "/root/deploy-features/cube-fence.wGvs6m", + "binary": "/root/deploy-features/cube-fence.wGvs6m/build-root/bin/db", + "mysql_directory": "/tmp/ch5-cube-mysql.cPcG99", + "uploaded_sources_match": true, + "mysql_socket_closed": true, + "production_socket_used": false + }, + "known_failures_resolved": [ + "Initial migration label conflicted with MySQL grammar; corrected and refusal messages now explicitly asserted instead of accepting arbitrary SQL error", + "macOS system SQLite/libsystem_trace occasionally crashed after fork; workers now use posix_spawn + fresh process/runtime/connection, with 8 repeated sanitizer runs" + ], + "limitations": [ + "No production deployment, restarts, schema installation or player asset writes", + "No game actor freeze, all-mutator/event isolation, trusted final-save handshake or real FIFO callback adapter", + "No runtime dispatch to Prepare/Execute/FenceStore, actual reward-factory/action protocol, image application or owner rebind", + "Failure baselines must precede final-save handoff; normal saves after DRAINING intentionally blocked, so Begin then ch->Save is invalid", + "Canonical resync image excludes runtime-only lock/event state; usable bit is not unlock permission", + "No matched live actor/network packets or Android-device/visual acceptance; no new client native/APK build claimed", + "Copy attributes and rate-improvement items still unsupported; Won/Wolfman/Conqueror/five-slot completion not claimed", + "Test databases retained; no release of persistent holds by timeout" + ], + "next": [ + "Game-side quiescence plus owner/session-bound final snapshot ingress", + "Real DB cache eviction/dual FIFO adapter, with callbacks unable to recreate dirty state", + "Receipt and authoritative-image apply/ACK/recovery handshakes, then matched live/device acceptance", + "Only then enable crafting and continue Won/Wolfman/Conqueror/five slots" + ] +} diff --git a/audit/xxf-ch5/cube-fifo-20261022.json b/audit/xxf-ch5/cube-fifo-20261022.json new file mode 100644 index 00000000..9b4fd6a7 --- /dev/null +++ b/audit/xxf-ch5/cube-fifo-20261022.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "date": "2026-10-22", + "status": "PARTIAL_COMPILED_DB_FIFO_ADAPTER_NO_GAME_INGRESS_OR_CRAFT_ACTIVATION", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "server_source_sha256": { + "src/server/common/sql_fence_router.h": "6d281d912df9473b4caec8ea84d56660a0916fff839a06e8da343de5b73c35e7", + "src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "src/server/common/cube_fence.h": "bc1008464050764d94a446eca31cbb9e6eee5b3c359f59b453390382144513a3", + "src/server/common/cube_store.h": "f44c9ddfeea56ecf0cdcc8a0f5b9d62918793f55c99ac30ceb88d7a795d87bd4", + "src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "src/server/db/src/SQLFences.h": "ccb0911bee777dd12b8f5d1775e93286acaf7306c941f73c4ccb7bb59820c9a7", + "src/server/db/src/CubeRuntime.h": "3395915eb8b0005a67b96a6b04767a55211b1454291308f0a7323d4d47308c18", + "src/server/db/src/CubeRuntime.cpp": "c973d93d306ffd192d2f864c07470e766cc1c6872c255ca3f96a64fc258e0ef6", + "src/server/db/src/ClientManager.h": "cc84c37a70b60afae5ea43d868d7a29ad4598efcfb6ee8292db7a8ffa09c4975", + "src/server/db/src/ClientManager.cpp": "245d52062cb931001a8df8cea8df6cc89dc86d16447b9202f1087d8e3bd36a34", + "src/server/db/src/DBManager.h": "6de26da4e08ac91f178e2617710a9623b6e82654adda24433824f498a0b4cbb7", + "src/server/db/src/DBManager.cpp": "60f0883eff3e5b0d8d77d5c97c0f60b7e2dd2956c17c7f334090784dcfb984a2", + "src/server/db/src/Economy.cpp": "b08f1cadd00fb78b51d6f5fd1895a7241e2f8a147793dd637987c7380ee0753a", + "src/server/db/src/Makefile": "090a3f09947dbc71b5d6061cfa3e60e65646c123bb19857611ac9aa14d8de50c", + "tests/features/test_cube_runtime.py": "6a7313626ec033ffcf32970e19b47fe8c7ffcad31a6e2ba68eaf5643d91d0b62", + "tests/features/test_sql_fence_router.py": "1f82d88343b04a6bc63c128d10a8f98f9d85b13c305b69768c8ce9013e65c282", + "tests/features/test_economy_coordinator.py": "8dcc3b4f6851015b96d138d8d35cf98457ac11cf5097901a63d304196d1004a0", + "tests/features/fixtures/sql_fence_mysql_probe.cpp": "f1ecc8c7cea9556469454eb9bda616d889fc95ace696edaed2ed82512d824509", + "tools/cube/test_mysql.sh": "8dde274f74f340373e44ea4e253bcb6fab8c5995f3b615c41330b9ef46904524", + "tools/cube/README.md": "1b394e1a3fd27fe7396ec9ee3e6a64c3f5a5973543fbc67dd8e01e4e61dc3d6d" + }, + "client_metadata_sha256": { + "scripts/test_xxf_all.py": "e791c935f3eb2effe77be7ba3e34644d7fc16c80fa542b84bc9462addd3efb4a", + "scripts/build_xxf_features_json.py": "84c17e3bd1e18648bea83e4abc4f0a9b60aa42180a83ce9da7a881b7886bd6a2", + "audit/xxf-ch5/features.json": "f8e022a4649a105dfdc563c1a2b8b0c3d5f1a41043745e03fc66c70dafb85328", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "10efc98241286ec0bc45c6b98f69b8cb14f3794a078afa948a4828dc37a09953", + "docs/XXF-CH5-CUBE-FIFO-20261022.md": "0722ae44a001672779e70da0dc15fa9dd371d01cd2eb6b9adc79b51d3218c43b" + }, + "native_artifact_sha256": { + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/sql_fence_router.h": "6d281d912df9473b4caec8ea84d56660a0916fff839a06e8da343de5b73c35e7", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/cube_fence.h": "bc1008464050764d94a446eca31cbb9e6eee5b3c359f59b453390382144513a3", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/cube_store.h": "f44c9ddfeea56ecf0cdcc8a0f5b9d62918793f55c99ac30ceb88d7a795d87bd4", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/cube_recipe.h": "754ada4d1c8f035001d1df8bbe87b0781a6128ae53603fa8c203d0693dc8254f", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/SQLFences.h": "ccb0911bee777dd12b8f5d1775e93286acaf7306c941f73c4ccb7bb59820c9a7", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/CubeRuntime.h": "3395915eb8b0005a67b96a6b04767a55211b1454291308f0a7323d4d47308c18", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/CubeRuntime.cpp": "c973d93d306ffd192d2f864c07470e766cc1c6872c255ca3f96a64fc258e0ef6", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/ClientManager.h": "cc84c37a70b60afae5ea43d868d7a29ad4598efcfb6ee8292db7a8ffa09c4975", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/ClientManager.cpp": "245d52062cb931001a8df8cea8df6cc89dc86d16447b9202f1087d8e3bd36a34", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/DBManager.h": "6de26da4e08ac91f178e2617710a9623b6e82654adda24433824f498a0b4cbb7", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/DBManager.cpp": "60f0883eff3e5b0d8d77d5c97c0f60b7e2dd2956c17c7f334090784dcfb984a2", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/Economy.cpp": "b08f1cadd00fb78b51d6f5fd1895a7241e2f8a147793dd637987c7380ee0753a", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/src/server/db/src/Makefile": "090a3f09947dbc71b5d6061cfa3e60e65646c123bb19857611ac9aa14d8de50c", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/tests/features/fixtures/sql_fence_mysql_probe.cpp": "f1ecc8c7cea9556469454eb9bda616d889fc95ace696edaed2ed82512d824509", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/tools/cube/test_mysql.sh": "8dde274f74f340373e44ea4e253bcb6fab8c5995f3b615c41330b9ef46904524", + "/root/deploy-features/cube-fifo.MFbPU1/build-root/bin/db": "5aa910de308c795c5ead2ab7c14f9b5385d71d32f414b2cf77dafbcab6f49361", + "/root/deploy-features/cube-fifo.MFbPU1/db-build-final.log": "a451c20ecb2fe4d4b0cfb82bb4203ee7ff9fc3044898d389ec5fdfe80a7b8689", + "/root/deploy-features/cube-fifo.MFbPU1/db-build-recovery-final.log": "11ec8ed46f78b14afe2ecba052503190ccdfec0e1ca8e1b2900f1b4cf5ab2b9b", + "/root/deploy-features/cube-fifo.MFbPU1/mysql-test.log": "a58faec37e9c2c84c8ff7216929682cce1e9daec86d563a7930dc0c2bf84da4b", + "/tmp/ch5-cube-mysql.DGgvHs/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/tmp/ch5-cube-mysql.DGgvHs/sql-fence-worker": "644bbb616bbb51879d34c5f3b75c8af1c7a1fc5a447234edf9f30bd2f032f5f5" + }, + "tests": { + "report": "build/ch5-tests/20261022-cube-fifo-final/report.json", + "pass": 127, + "unittest_cases": 377, + "top_level_probes": 33, + "fail": 0, + "blocked": 0, + "source_changed_during_regression": false, + "release_ready": false, + "native_db": "Fresh .cube-fifo-obj: all DB objects rebuilt; final recovery change recompiled/relinked, inherited internal platform libraries; no deployment", + "sqlite": "Actual CubeRuntime.cpp methods with explicit peer/cache/SQL adapter boundaries; ASan/UBSan; 11 scenarios plus ownership/cache mismatch and stale/out-of-order callbacks", + "worker_mysql": "Actual libsql threaded CAsyncSQL2 worker and actual SQLFences.h, exact dedicated socket validated before session-variable probes; mixed Economy/Cube reply routing and physical FailureEpoch", + "mysql": "Existing InnoDB batch/lifecycle/crash recovery and explicit v1 upgrade tests rerun on isolated socket-only server; closed /tmp/ch5-cube-mysql.DGgvHs/mysql.sock", + "post_regression": "Evidence JSON only; no runtime/metadata change" + }, + "contracts": { + "arm": "Capture main/async/router failure baselines before trusted final-save handoff; account/peer/player ownership and cookie/session binding; no game ingress caller", + "submit": "Exact cached wallet and canonical normal inventory metadata match; collect all owned cached IDs including gear/tombstones, persistent Begin then direct eviction and numbered main barriers", + "async": "Same PLAYER async FIFO as Economy; opaque monotonic tokens, kind-specific ownership queues, bounded capacity, no pointer dereference/token reuse", + "finish": "Actual callback dispatch and periodic tick; clean owner+failure proof persists FROZEN, failed/lost owner persists ABORTED; ambiguous FinishDrain commit reads original persisted result", + "hold": "Arm may expire only before Begin attempted; Begin attempt/terminal phases retain hold, limit128 contexts; no mutation, automatic release, resync or terminal-context cleanup", + "encoding": "DBManager.h legacy non-UTF8 edited by narrowly scoped byte-preserving substitutions, verified minimal diff; no whole-file recoding" + }, + "not_complete": [ + "Game actor quiescence across all mutation/event paths and trusted Arm/final-save/Submit protocol", + "Character generation validation in game; cache usable flag is not ownership proof", + "Runtime factory reservation and recipe/NPC verification, Prepare/Execute invocation", + "Runtime authoritative image application/exact ACK, thaw, terminal context cleanup", + "Disconnect/restart owner transfer and online recovery", + "Copy attributes and success-rate items", + "Matched live game/db plus Android acceptance", + "Won, Wolfman, Conqueror and five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-gold-20261023.json b/audit/xxf-ch5/cube-gold-20261023.json new file mode 100644 index 00000000..2986b3ad --- /dev/null +++ b/audit/xxf-ch5/cube-gold-20261023.json @@ -0,0 +1,113 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_DEFERRED_POSITIVE_GOLD_BACKEND_NO_LIVE_PRODUCER", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_store.h": "33ec59838141c7cb6661c3406980d3b7ea86afd472358cc6ca7af31e15d18e03", + "src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "src/server/db/src/Cube.cpp": "ac8e1245b33380eb3af72ac9325e12952168e6147027f56b81bfc9218285a177", + "src/server/db/src/CubeGold.cpp": "a89e07ca3f1138398ee14eefb7e290f92d240c5594d31ca227a590ba45dd2830", + "src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "src/server/db/src/Makefile": "3d6d367b140f025e46e76e24b819e4d9819b0a8f3cf996cae7f79d175c428cfb", + "tests/features/fixtures/cube_batch_probe.cpp": "e181f796d97ffb99274dc652cc4bfad49a82631f1207f02bb7d0db2ca07bc316", + "tests/features/fixtures/cube_gold_probe.cpp": "aa1ba220eec52b6a43c9fc1369bb9bbb16afdc68cb9489500ee0be1ea9dbdde5", + "tests/features/test_cube_gold.py": "6c34eb137decea4e63424d49fc39dee24695bb7bea7a640e42d3326df0d6b0b1", + "tests/features/test_cube_db_guards.py": "4f3ec999e38c4c063648c239f3ae34642074070ecfca373fcfb5741c18bd89a2", + "tools/cube/test_mysql.sh": "68a3bdfca2ead03f6f3539d831892022a597ebd3f7fb95d17ed57497c0c7734c", + "tools/cube/gold-schema.sql": "377a6c6d1c5d294877cda5924d5c694ad6bb4215b6cf25a1576521912d5598af", + "tools/cube/README.md": "0961ecd98154d142f05c1ec98a4f6b61c5ff726ac997986297c17a80569d7892" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "26e5a752b1a74756f354dc38b785ee2c887fdf8a34f925204abef510e4c3c824", + "scripts/build_xxf_features_json.py": "421d821d3933ff5ce28bbcb7235d0a4c395cec1f5a10d38cfd2357fc8765a978", + "audit/xxf-ch5/features.json": "b5b99d0d87b820c125ff7d4b7b21c2d25343aee5ee0bee1370d38a2ddfb2289d", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "d9076f3438f784c24693e99ed53da4553081d630c91ec46462f82a2742898776", + "docs/XXF-CH5-CUBE-DEFERRED-GOLD-20261023.md": "4f74e9c5d69c9abe6565035933b27be18b85e966e4ac7cca255beafdc6dbde61", + "build/ch5-tests/20261023-cube-gold-final/report.json": "95447e663a8c4d42ddd521c1cb5df6bce62ec5fce239ce0f2b7978b5f86baf9d" + }, + "native_source_and_artifact_sha256": { + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/cube_store.h": "33ec59838141c7cb6661c3406980d3b7ea86afd472358cc6ca7af31e15d18e03", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/common/economy_mysql.h": "acab8d9c6bd69ac0979472fc908d22d9e66783f0b316e53d27d0bd8adb721b9a", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/db/src/Cube.cpp": "ac8e1245b33380eb3af72ac9325e12952168e6147027f56b81bfc9218285a177", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/db/src/CubeGold.cpp": "a89e07ca3f1138398ee14eefb7e290f92d240c5594d31ca227a590ba45dd2830", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/db/src/Makefile": "3d6d367b140f025e46e76e24b819e4d9819b0a8f3cf996cae7f79d175c428cfb", + "/root/deploy-features/cube-gold.KpZPZN/build-root/tests/features/fixtures/cube_batch_probe.cpp": "e181f796d97ffb99274dc652cc4bfad49a82631f1207f02bb7d0db2ca07bc316", + "/root/deploy-features/cube-gold.KpZPZN/build-root/tests/features/fixtures/cube_gold_probe.cpp": "aa1ba220eec52b6a43c9fc1369bb9bbb16afdc68cb9489500ee0be1ea9dbdde5", + "/root/deploy-features/cube-gold.KpZPZN/build-root/tools/cube/test_mysql.sh": "68a3bdfca2ead03f6f3539d831892022a597ebd3f7fb95d17ed57497c0c7734c", + "/root/deploy-features/cube-gold.KpZPZN/build-root/tools/cube/gold-schema.sql": "377a6c6d1c5d294877cda5924d5c694ad6bb4215b6cf25a1576521912d5598af", + "/root/deploy-features/cube-gold.KpZPZN/bin/db": "de270b99388cb437f9470c9f89a434b807830ec131592486b6c99c9fd461e5cb", + "/root/deploy-features/cube-gold.KpZPZN/db-build.log": "e0516a998ecd3409b5a7a7631c740fbbabbed74dd393a6277345f4bd9b4f95fd", + "/root/deploy-features/cube-gold.KpZPZN/mysql.log": "750793c914eba7d312c288ccb395a6170fb755d971fb0a4551123d2cf7b2c952", + "/tmp/ch5-cube-mysql.Etxbiv/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.Etxbiv/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.Etxbiv/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/libsql/libsql.a": "95a4e9e82afca7d0bd2eee64aba163db719b838c8f16c491369d7133d385b7fe", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/libthecore/lib/libthecore.a": "a991d2f5cd2a5aac5490ff58d643d31561adb66cdb0bd5c1728ce2124592dfea", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/libpoly/libpoly.a": "6626db248c11eea03c3e7d9296d3cdd9b8020f03b3527bfe2f361a61283fc520", + "/root/deploy-features/cube-gold.KpZPZN/build-root/src/server/libgame/lib/libgame.a": "60a146fb474f7576aefda405dd1989c2ee1f0d6f9c6e5811779255f0949ed2c4" + }, + "tests": { + "report": "build/ch5-tests/20261023-cube-gold-final/report.json", + "unittest_cases": 389, + "top_level_probes": 33, + "summary": { + "pass": 130, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "source_changed": false, + "release_ready": false, + "local": "ASan/UBSan SQLite intent codec/order/history, all enqueue/apply SQL-failure positions, apply warning rollback, commit rejection/lost ACK, restart and simultaneous duplicate processes; actual DB guard methods extracted with explicit SQL boundary substitutes", + "mysql": "Actual base v2 and optional addon v1 DDL on dedicated socket-only MySQL; base/lifecycle and gold store probes plus real libsql worker FIFO and explicit v1 upgrade probes all passed", + "mysql_root": "/tmp/ch5-cube-mysql.Etxbiv", + "mysql_shutdown": "Dedicated instance shut down by script, pid absent; data/logs retained", + "native_db": "Fresh .cube-gold-db-obj: complete DB objects compiled and linked, including explicit GoldIntentStore instantiation; inherited platform libraries, not clean dependency-library rebuild", + "native_source_matches": 14, + "native_platform": "FreeBSD 13.2-RELEASE i386; FreeBSD clang 14.0.5; gmake -j2 CC=c++; isolated bin only", + "native_warning_limit": "Legacy Makefile retains -w. This is not a strict-warning/type-safety audit.", + "native_game": "Not rebuilt this batch; game source unchanged by this batch", + "client_native": "Not rebuilt; no client action/protocol or capability activation change", + "live": "Not run. No production deployment, restart or player-asset writes", + "android": "Not run", + "post_regression": "Only this evidence JSON was added after the final regression; no runtime, tests, docs or manifest changes" + }, + "contracts": { + "scope": "Positive reward intents only. Stable global event identity, immutable 129-byte canonical body, account/player/epoch/owner/request, sequence 1..1024; source labels are not authentication", + "schema": "Optional addon v1 with two InnoDB tables, base Cube remains v2. No runtime install. Absent preserves baseline; partial/unknown/nontransactional/query-error refuses. Cached discovery requires coordinated maintenance/restart.", + "enqueue": "Account lock, exact current DRAINING/FROZEN/ABORTED batch identity; no wallet mutation. New admission closes at RESYNC; duplicate immutable event can replay read-only even after release.", + "apply": "Identity-only persisted amount, clean FROZEN/drain1, validated original DONE receipt, contiguous applied prefix and expected post-craft SQL wallet; account lock and atomic wallet/APPLIED transaction. Never auto-execute PREPARED.", + "recovery": "Pending lookup survives process restart. Accepted ambiguous commit replays once; historical APPLIED receipt does not re-add or require later wallet equality.", + "barriers": "Pending/corrupt records prevent Resync/Release. Actual DB player-save/account-load checks pending rows even without base fence; exact image ACK/fresh reread remain necessary.", + "abort": "ABORTED intents retained, automatic Apply blocked; no automatic refund, discard, takeover or timeout release.", + "overflow": "Held and queued; no silent truncation, auto-refund or dropped intent", + "gates": "HandshakeEnabled=false; ActorMutationAuditComplete=false; no game producer/packet/runtime store calls" + }, + "not_complete": [ + "Trusted source event generation/outbox/authentication/retry and durable ACK: SQL exactly-once application alone does not close the pre-Enqueue crash gap", + "Do not divert an already-performed PointChange or replay stale wallet/inventory snapshots", + "ABORTED reconciliation, cross-core/new-owner handover and complete actor quiescence", + "Item/EXP/negative costs, expiry and global/server callback retention", + "Actual reward factory/ID allocation, Prepare/Execute invocation, authority-image apply/exact ACK/thaw", + "Copy attributes, success-rate items and matched live/Android acceptance", + "Won, Wolfman, Conqueror and five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-handshake-20261023.json b/audit/xxf-ch5/cube-handshake-20261023.json new file mode 100644 index 00000000..050cbf89 --- /dev/null +++ b/audit/xxf-ch5/cube-handshake-20261023.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_PREPARATION_HANDSHAKE_COMPILED_AND_TESTED_FULL_ACTOR_QUIESCENCE_NOT_IMPLEMENTED", + "features": [ + "F21" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_handshake.h": "0e2750426999b14b899e415a300b3ed17699cb14eb2d8a7ba325e9ed99f07cf4", + "src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "src/server/db/src/CubeRuntime.h": "17cd525f02b9d5048a8fbe16cc12ee6df975a69e2af97d85be74422529bd5c21", + "src/server/db/src/CubeRuntime.cpp": "adf1ad90df81170a73c8d0244933585a74e7c332798cd4d6f39e43667ed8ce08", + "src/server/db/src/ClientManager.h": "bc84c24fbf774554181018bde5aaa3af43345bae15bd035c2f6fad148438d324", + "src/server/db/src/ClientManager.cpp": "15181bbc5db0adcabcb58fc886db2d75b9474c0593e3e29f42bbf90952fb903d", + "src/server/db/src/Makefile": "066f8b8c1badef9eed08aff44c25e5fdfd4ee81e3990b8c714121dd086ef82d9", + "src/server/game/src/port_cube_actor.h": "ce9411527868cd056be475384204f926c755f4f77bf8963915fe21a57cec3dff", + "src/server/game/src/port_cube_actor.cpp": "dd45d1ad014b0edf98a1c45f53708c8dcf236c4907e09716864043f35d4ec0f3", + "src/server/game/src/port_cube_flush.inc": "ec594a776b2db3953998b6f475ffa1cd1d554f0379364ac882bfcd6749a8f2e0", + "src/server/game/src/port_cube_catalog.inc": "bbad2415f570d6e44b814f44e9f5ee102f9f53e3aec346729a8f684e71dd3423", + "src/server/game/src/item_manager.h": "1654164482c359c700b49f33495d1d75db7a196af13e035f2f20e36148977b3f", + "src/server/game/src/item_manager.cpp": "8cf1cea9a2169d8cf7fd9375c46cb61fa092bd554c3f1971f8a17cdf71ab0b0d", + "src/server/game/src/char.cpp": "8750bd6f2d05f9d3831cb5e6733af38ae51566c353ecf5232624a7a3f39ff089", + "src/server/game/src/char_item.cpp": "582101a95d7160c7dbf975779b11d80f8359b4cbd4c135224d59754af76c2d2d", + "src/server/game/src/input_db.cpp": "653e51df15c4abe9cf1e02235b23e7a2cdd1230e739002247c185286822fd9b3", + "src/server/game/src/main.cpp": "27ea273ac6dfea86f6afba762d66b7cf4129083d0d0a396acf5db44428bc8ea9", + "src/server/game/src/Makefile": "934efdb10e20b99005227eb2bc6eddc99babed8e10dcb4c165ca275189ba8aaf", + "tests/features/test_cube_handshake.py": "f9eebde2f26014d8f3efc5c9c923629ed7a341b57dbcf60e0b8126084e76b538", + "tests/features/test_cube_runtime.py": "4a3f475f487baa16bd837a0aa41b7ba1f554b829445183ef944bdcdb3812683b", + "tests/features/test_cube_catalog.py": "3a6d31d293d35a573f3d338cbeea496f49523e46f2c6e4a2990eac5c95f47319", + "tools/cube/README.md": "bf4871ce48382a156167ef64e092cb2e53ef13fa92da71e83d50799c82c4fca1" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "c4d89fcc94b3989ad23370a7e7417e59b1912e9b47d45fa4f73f7ec534cdca2d", + "scripts/build_xxf_features_json.py": "0d34bf47b2ffdd687c63955e380c01b7d24b47c47c899b9498eab57f4cd00263", + "audit/xxf-ch5/features.json": "05f4126bd87a0fe444079c36e5d939beae1da991e9833b7bd523ad2b5830a1d4", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "4c061cdb0c9dbc33a379d43d01418112bf7f27bf7740cfa358df7149d9b90394", + "docs/XXF-CH5-CUBE-HANDSHAKE-20261023.md": "b8ce3f1abac7ee471916d8be61695b725fbdd521dda81c3ae1ba73911ec3dcc5", + "build/ch5-tests/20261023-cube-handshake-final/report.json": "da22b9d0110059721d154503dcdb37b38fd8dce997bd88ed4234ecd05d9ac793" + }, + "native_source_and_artifact_sha256": { + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/common/cube_handshake.h": "0e2750426999b14b899e415a300b3ed17699cb14eb2d8a7ba325e9ed99f07cf4", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/common/cube_batch.h": "5846847fe7cd02f3c3bffec88588ec390c7e095ed1d22dc7400b16d64d27d9a7", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/common/cube_drain.h": "bc76c939a187871f39d752e49778c05e2ad8d5df14901c470fc41bddbbedc006", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/db/src/CubeRuntime.h": "17cd525f02b9d5048a8fbe16cc12ee6df975a69e2af97d85be74422529bd5c21", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/db/src/CubeRuntime.cpp": "adf1ad90df81170a73c8d0244933585a74e7c332798cd4d6f39e43667ed8ce08", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/db/src/ClientManager.h": "bc84c24fbf774554181018bde5aaa3af43345bae15bd035c2f6fad148438d324", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/db/src/ClientManager.cpp": "15181bbc5db0adcabcb58fc886db2d75b9474c0593e3e29f42bbf90952fb903d", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/db/src/Makefile": "066f8b8c1badef9eed08aff44c25e5fdfd4ee81e3990b8c714121dd086ef82d9", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/port_cube_actor.h": "ce9411527868cd056be475384204f926c755f4f77bf8963915fe21a57cec3dff", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/port_cube_actor.cpp": "dd45d1ad014b0edf98a1c45f53708c8dcf236c4907e09716864043f35d4ec0f3", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/port_cube_flush.inc": "ec594a776b2db3953998b6f475ffa1cd1d554f0379364ac882bfcd6749a8f2e0", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/port_cube_catalog.inc": "bbad2415f570d6e44b814f44e9f5ee102f9f53e3aec346729a8f684e71dd3423", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/item_manager.h": "1654164482c359c700b49f33495d1d75db7a196af13e035f2f20e36148977b3f", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/item_manager.cpp": "8cf1cea9a2169d8cf7fd9375c46cb61fa092bd554c3f1971f8a17cdf71ab0b0d", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/char.cpp": "8750bd6f2d05f9d3831cb5e6733af38ae51566c353ecf5232624a7a3f39ff089", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/char_item.cpp": "582101a95d7160c7dbf975779b11d80f8359b4cbd4c135224d59754af76c2d2d", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/input_db.cpp": "653e51df15c4abe9cf1e02235b23e7a2cdd1230e739002247c185286822fd9b3", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/main.cpp": "27ea273ac6dfea86f6afba762d66b7cf4129083d0d0a396acf5db44428bc8ea9", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/src/server/game/src/Makefile": "934efdb10e20b99005227eb2bc6eddc99babed8e10dcb4c165ca275189ba8aaf", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/bin/game": "4405ddf2cd23513061c48e95b05bd8df6e01cf137de101f26cae70fa629c28f2", + "/root/deploy-features/cube-handshake.O7iqNe/build-root/bin/db": "0bf18f4780711f77df980dffb655dd3ea210082727d45a0530bdc8d918f5f8c9", + "/root/deploy-features/cube-handshake.O7iqNe/game-build-final.log": "f9d980ac143e4733841cab51c2f1b19508b445478a49f12a3800d4a86b336d6c", + "/root/deploy-features/cube-handshake.O7iqNe/game-recheck.log": "7b6c4da3d46836dd7ba7569ec1136c9c71a038f3bdbc567227fa42de7c8bb56b", + "/root/deploy-features/cube-handshake.O7iqNe/game-save-order-final.log": "c5ecb466b27f139080cf4c7697fb4596e8a00d588c060f0c200705fdeb873b95", + "/root/deploy-features/cube-handshake.O7iqNe/db-build.log": "08fc9f39abf0d04b65974fd32cea332a191475ae1b768d459cf0ee4421ccd767" + }, + "tests": { + "report": "build/ch5-tests/20261023-cube-handshake-final/report.json", + "pass": 128, + "unittest_cases": 381, + "top_level_probes": 33, + "fail": 0, + "blocked": 0, + "source_changed": false, + "release_ready": false, + "local": "ASan/UBSan actual handshake codec, actor preparation state core with explicit audited-freeze substitute, actual game snapshot routine and pending-item flush with actor/item substitutes, actual DB route with peer/cache/SQL substitutes", + "native_game": "Inherited object/library tree; affected game objects rebuilt and linked. Initial clock-skew warning addressed by later make recheck, final player-save-order source compiled and linked separately; no live launch", + "native_db": "Fresh .cube-handshake-obj: all DB objects compiled and linked with inherited internal platform libraries", + "mysql": "Not rerun this batch. Previous isolated InnoDB and libsql FIFO evidence belongs to cube-fifo-20261022.json, not newly bound acceptance", + "live": "Not run; no production deployment, restart or player-asset writes", + "android": "Not run; internal server preparation only, no new client craft capability", + "post_regression": "Evidence JSON only; no runtime or metadata changes" + }, + "contracts": { + "ingress": "Internal header78 explicit 102-byte LE prefix, body<=40000; exact length/version/reserved/identity/operation checks. Actual DB ingress rejects before Arm/SQL because HandshakeEnabled=false", + "activation": "HandshakeEnabled=false AND ActorMutationAuditComplete=false. No command/config override, no client command/capability, no Prepare/Execute invocation", + "state": "WaitArm -> WaitDrain or WaitCancel; timeout/DB loss/frozen/aborted outcomes retain Held. Only exact pre-Begin Cancelled ACK clears preparation; this is not an actor event scheduler/freeze implementation", + "identity": "Reply matches VID, descriptor handle, account/player, session/epoch and owner/token/cookie. Exact Arm replay returns original cookie; changed body never replaces context", + "recipe": "Game rechecks live cube NPC/context and exact current loaded recipe bytes; FNV UI revision not an authorization token; copy refused", + "snapshot": "Canonical ordinary inventory and all-owned-window seal across inventory/equipment, DS, switchbot and five special bags; sockets/attrs/extra69/usability; duplicate ID aliases and native long narrowing rejected", + "final_save": "Arm ACK precedes draining pending player save (or force SaveReal), own pending item snapshots including detached destroys, force all currently owned items; compare seal again, mark submitted before enqueue. Last-owner cannot flush items now owned by others", + "cancel": "Only before any Begin attempt; short cancellation tombstone replays ACK and rejects late Submit. Any attempted/ambiguous Begin means held, never timeout cancellation", + "encoding": "item_manager.h/.cpp preserved byte-for-byte apart from exact ASCII declaration/include; implementation in UTF-8 port_cube_flush.inc; verified against HEAD bytes" + }, + "not_complete": [ + "Full game asset mutation/event quiescence: expiry, combat/party rewards, quest/direct callbacks, background systems and lifecycle", + "Safe runtime freeze/thaw, authoritative post-transaction image apply and exact ACK", + "Trusted factory ID/reward template creation and actual Prepare/Execute calls", + "Disconnect/cross-core/restart owner recovery and terminal context cleanup", + "Copy attributes and success-rate items", + "Matched live game/db and Android acceptance", + "Won, Wolfman, Conqueror and five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-image-ack-20261023.json b/audit/xxf-ch5/cube-image-ack-20261023.json new file mode 100644 index 00000000..d252d552 --- /dev/null +++ b/audit/xxf-ch5/cube-image-ack-20261023.json @@ -0,0 +1,136 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_ORIGINAL_LIVE_IMAGE_DURABLY_ACKNOWLEDGED_NO_TERMINAL_RELEASE_OR_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-apply-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_image_ack.h": "f41db2842bd85bc58d9063919690f89c7af2d3e5b57660f0130d59e072a83464", + "src/server/common/cube_live_image.h": "15f3965874d25c1adb1503532630438faa6ac13a9067ca142c4464b9f0860f84", + "src/server/common/cube_handshake.h": "792e9d3dcb3314f009e803f98a41837753d80992b8cfda024c1969ac53f00c95", + "src/server/db/src/CubeRuntime.cpp": "210dbc63ececee1b0831388168284abf2c81fbe331d9fefeb5b36383ff446935", + "src/server/db/src/ClientManager.h": "653fc5084e3faeb09bea7f792810123c525ab1c87b2c9482cdf0aa406b750db4", + "src/server/db/src/Makefile": "4edba8eaf62c637e9e585f5deb9dd148e385b9286f676e19741638bafd32ef71", + "src/server/game/src/port_cube_actor.cpp": "de004adfeffef037cf09d948ec9f3e8514289f8f47bb6f84f1e4861773a79665", + "tests/features/fixtures/cube_batch_probe.cpp": "7b15e96680b78fe9d6d859428b21318bd8ab44b88db9af248d7be47d9227d355", + "tests/features/fixtures/cube_image_ack_probe.cpp": "6081eaf4ed4e47fe7d82de42de6f5cee6df1f1447a88c5b2aee32865df0fc632", + "tests/features/test_cube_craft.py": "9eaf06cc9ccb63854d76924fea862492ae59b1c8fa872dc19e38c0582f02b0a9", + "tests/features/test_cube_image.py": "fff95816223ac632c3119884405df86c2bfe4ff537f3395e10de7366192cf91c", + "tests/features/test_cube_outbox.py": "ff99aff9692a9d727eb51012bbc4610f752883ae4ca0ee76f6e2c7805dbf2f3d", + "tests/features/test_cube_runtime.py": "c15fbd4c5b4731b60d1889c86ef38894d1e94334b142dd0336a75d315f8f589b", + "tools/cube/image-ack-schema.sql": "174f84ff970a21731a0be8d06415a99df00701b7a9976df6926e1f4ae23466b7", + "tools/cube/test_mysql.sh": "5006c7928934835c4d9e9c4603f47186d175e2e8554ed17a4cbc90ba4e5a7eeb", + "tools/cube/README.md": "95c166aebd780d40a23324454ffeb4a5c7c06c85bd22c225150a4b2072daad3f" + }, + "client_metadata_sha256": { + "docs/XXF-CH5-CUBE-IMAGE-ACK-20261023.md": "81d17e0cecd026c89201168394904b57739321c44986265d35d61a8cfdcf0ff3", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "4b0bd899258dac0607877445584e415dc541a6b288f5bcfa863141169952dd37", + "scripts/build_xxf_features_json.py": "8809918eef16bf8b244edfbf2365a4a4c6506e0f4e527b4b83d4d10616138e4c", + "audit/xxf-ch5/features.json": "333721726a6ebc2620e461b155e0949a849a80a5b42fa1258945e3e46b01062e" + }, + "implementation": [ + "Internal LiveImageAck=20/Answer=21, LiveImageAcknowledged=17; existing values/version preserved; complete canonical image request and exact success echo, Held empty body", + "Optional additive image-ACK addon v1: two InnoDB tables, explicit maintenance only, no runtime installer or production migration", + "Actual Fence.Resync account transaction/pinned connection rereads current inventory/gold and original LIVE owner proof; already issued identical RESYNC image required; immutable batch/grant/image insert or exact replay commits with Resync", + "Lost COMMIT reply replay revalidates current authority; stale/revoked/adopted owners or corrupt history cannot obtain acknowledgment", + "Actual game helper recaptures complete applied seal and exact normal inventory/gold before every ACK send and first ACK answer; joint bounded retry queue; duplicates never reinstall or downgrade ack state", + "Acknowledged retains ActorHandshake hold, skip-save and paused events; no lease/item-fence/reservation removal, terminal release, saving/UI restoration or thaw" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-image-ack-complete-check/report.json", + "report_sha256": "ea8f5b14bd93423569f641273d8d0b00b817d6cf725a539a9a63850f2c86e924", + "files_pass": 136, + "unittest": 407, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "ASan/UBSan real store against explicit SQLite advisory-lock substitute; actual game apply/ACK preparation helpers, ACK-answer branch and Tick with documented actor/install/transport boundaries", + "Every successful ACK SQL query failure/warning, rejected/ambiguous commit, separate-process exit at INSERT and COMMIT", + "Stale peer/session/revision/broker, changed current or saved image, missing issued phase, corrupt historical grant, revoked/adopted owner, missing/unknown/nontransactional addon refusal", + "Canonical ACK wire and every truncation, duplicate image/ACK no downgrade, mismatched image held, applied other-window mutation blocks ACK, Tick retry then stop after acknowledgment", + "Actual DB route, hard-disabled ingress does no SQL, original live context, identity mismatch and peer-gone refusal" + ], + "repairs": [ + "Updated existing outbox harness extraction marker to include new reply type without weakening direction filtering", + "Final full suite supplies existing AVA2 reference path; first run omitted it and was blocked; all historical runs retained", + "MySQL fixture initially used SQLite-only engine flag; corrected to actual ALTER TABLE ENGINE=MyISAM then restore InnoDB in isolated DB" + ] + }, + "native": { + "root": "/root/deploy-features/cube-image-ack.AZBRrM", + "build_script": "native-build.sh", + "build_script_sha256": "c097477fc72fa415abad68ea866a4f876d71ae6ed9d5976a6b4ce0f5721dbd06", + "build_scope": "Actual port_cube_actor.cpp and CubeRuntime.cpp compiled; linked matched previous game apply and DB live-image object cohorts; not full object rebuild", + "instance_or_serialized_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "game_sha256": "4660553889b0a44737265894b3e834665be733f869d46f839896e68c955d36b8", + "db_sha256": "a122ecaa3799bff0dbc06d1e5e230e95e4526142cade13b89959d8a57f14ad4a", + "empty_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "binaries_stripped_to_limit_disk_usage": true, + "repairs": [ + "Native legacy false macro deduced int in callback: explicit bool lambda return added", + "Staging closure includes locale.hpp; DB manual link includes pthread" + ], + "game_or_db_daemon_started": false + }, + "mysql": { + "evidence": "/tmp/ch5-cube-mysql.UxPD9a", + "isolated_socket_only": true, + "production_socket_used": false, + "socket_and_pid_absent_after_shutdown": true, + "initial_full_script_exit": 134, + "initial_full_script_log": "/root/deploy-features/cube-image-ack.AZBRrM/mysql-tests.log", + "initial_full_script_log_sha256": "9c9d67e71cc4bd38b02577718320b7deaee014d72b84a6f5247ec0806044e4d6", + "initial_result": "Base/batch/fence/gold/outbox/source/owner/image probes passed; ACK probe stopped at SQLite-only engine-flag assertion; no full-script success claim or later migration/worker test claim", + "final_retry_script": "/root/deploy-features/cube-image-ack.AZBRrM/mysql-retry.sh", + "final_retry_script_sha256": "f8adf591770215d38aabc15afc79af9e69beb59cb3569192836c3cc8196669d8", + "final_retry_exit": 0, + "final_retry_scope": "Restart only same stopped isolated data directory with no-defaults/socket-only/skip-networking and shutdown trap; apply additive ACK schema; corrected actual MySQL ACK probe and actual craft probe pass", + "ack_result_sha256": "886976fc538031d5655276f01d8a9bcb0c061b55fdf8b3dd44d2edb545bfb235", + "ack_probe_sha256": "fd494fc8622aae465aa2945e90ac283c7d8b7c02519d862674a56a9f5d21096b", + "craft_result_sha256": "fb6869c63afc7c6d062ea0732ae0ba6ad41fea57786b284ae885bb40b9f5185a", + "craft_probe_sha256": "77efc1d6947593c7bfe49683e05662f782de4f11df70bf63a3909085544e55de", + "not_claimed": [ + "Matched game/DB socket gameplay", + "Complete actor quiescence", + "Android acceptance", + "Final entire test_mysql.sh rerun or this batch SQL worker/upgrade tests" + ] + }, + "operations": { + "production_deployed": false, + "production_restarted": false, + "production_migrated": false, + "player_assets_modified": false, + "git_commit_or_push": false, + "material_deletions": false, + "remaining_server_disk_mb": 167, + "next_native_run_must_check_space": true + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "client_craft_enabled": false, + "release_ready": false + }, + "remaining": [ + "Owner-authorized durable terminal release and replay; history ACK alone must never authorize release", + "Restore saving/expiry events and quickslot/client complete publication before thaw", + "Complete actor quiescence, durable deferred legitimate mutations and external CItem references audit", + "Old-core revocation, complete character/non-normal-window recovery, PREPARED/ABORTED/non-ok DONE reconciliation", + "Copy/success-rate item rules, public start/capability UI, matched live and Android acceptance", + "After Cube closes: Won, Wolfman, Conqueror, five character slots in that order" + ] +} diff --git a/audit/xxf-ch5/cube-item-ids-20261023.json b/audit/xxf-ch5/cube-item-ids-20261023.json new file mode 100644 index 00000000..cf81a73d --- /dev/null +++ b/audit/xxf-ch5/cube-item-ids-20261023.json @@ -0,0 +1,80 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_BATCH_ITEM_ID_RESERVATION_NO_FACTORY_CALLER_OR_CRAFT_ACTION", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-live-craft-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_item_ids.h": "4b36a38dd93c0764e6bfc2fe4db81a7dc3e2564d2d02bc8883fabb0d4020e8e4", + "src/server/game/src/port_cube_ids.h": "d1c379550fd954ee756e092fe2a4bd30920add003bbf1e13303563f84019b2fd", + "src/server/game/src/item_manager_idrange.cpp": "ea491db6c2a8e66f88bd2ca09065c0f49dc4e0e2bd99ff544635f45861cdfd68", + "src/server/game/src/Makefile": "cc971dacaadb3668111a5e40fc8a5086462746a849c40d931753cbb10d7691fa", + "tests/features/test_cube_craft.py": "15c46e154f70f8c008c1a3fa935b9f52a902fb31488e61fa63bfef457a9517cc" + }, + "client_metadata_sha256": { + "scripts/build_xxf_features_json.py": "cebdb2a43d60dc2e22a3f3a768d93e65eb4c9ecbe46a22b6c711bf9a12a5b049", + "audit/xxf-ch5/features.json": "4d460084d2cf8c5ae0657935b896657049beb1bb86218d55d8f9fbdd11852f85", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "9f326c9539cf208b931276e67784f5407ca62e49edb3f3dc1ecc5a4023990b88", + "docs/XXF-CH5-CUBE-ITEM-IDS-20261023.md": "e49b594258e1a810c78b37175e9d5a43f23172da6995325360febf8632f3a8c3" + }, + "tests": { + "cube_unittest": 33, + "full_report": "build/ch5-tests/20261023-cube-item-ids/report.json", + "report_sha256": "086b7610b11be085acd659a6050739eeb67dd7983fa49fac5fa5ef0b8122ad6d", + "files_pass": 136, + "unittest": 401, + "top_level": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "Actual allocator TU compiled with explicit platform/descriptor substitutes under ASan/UBSan", + "Bounded whole-batch reservation, current/spare counts and order, UINT32 sentinels and overlapping ranges", + "Current-map collision, missing spare or descriptor: unchanged output/cursor/ranges, no shutdown", + "Ordinary allocator interleaving, single spare request, nested admission refusal and RAII exceptional cleanup" + ] + }, + "native": { + "root": "/root/deploy-features/cube-item-ids.hSwxYp", + "baseline_objects": "/root/deploy-features/cube-live-craft.x0vRrX/build-root/src/server/game/src/.cube-live-craft-game-obj", + "kind": "incremental_actual_TU_compile_and_full_game_relink_using_prior_verified_objects_and_libraries", + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "game_sha256": "abec898bb1d3240b7c6a91f2295d8f1276de66317b65baf380632ce29d411f2a", + "object_sha256": "0948870e6f61b7f648d8d815e5caa7fc58d79a3d71abda21beb2287c6a3982a6", + "compile_log": "compile.log", + "link_log": "link.log", + "empty_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "exported_symbol_verified": true, + "max_compiler_jobs": 1, + "game_started": false, + "db_rebuilt": false, + "mysql_rerun": false + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "public_craft": false, + "production_deploy": false, + "production_restart": false, + "production_migration": false, + "player_assets_changed": false, + "client_or_android_build": false + }, + "limitations": [ + "No actual crafting caller of the reservation API yet", + "In-process cursor consumption is not durable SQL ID reservation: original fence must accept IDs before Execute/external exposure", + "Real reward factory metadata/socket/expiry initialization without world/save/event/destruction side effects remains incomplete", + "Trusted batch assembly, public action, actor apply/ACK/thaw, full mutation audit and live/Android acceptance remain incomplete", + "Won/Wolfman/Conqueror/five-slot implementation not advanced in this batch" + ], + "next": "Actual reward factory and trusted batch construction using these IDs; keep the two gates false until the complete crafting/application/recovery chain is proven" +} diff --git a/audit/xxf-ch5/cube-lifecycle-20261023.json b/audit/xxf-ch5/cube-lifecycle-20261023.json new file mode 100644 index 00000000..2abba8b3 --- /dev/null +++ b/audit/xxf-ch5/cube-lifecycle-20261023.json @@ -0,0 +1,81 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_RESTORED_ITEM_EVENT_PREPARATION_NO_DB_RESUME_SAVE_ENABLE_CALLER_OR_THAW", + "priority": ["Cube", "Won", "Wolfman", "Conqueror", "Five character slots"], + "previous_checkpoint": "audit/xxf-ch5/cube-presentation-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/game/src/port_cube_restore.h": "80aaf897e8d855d012a3e6b9805a44d0b69280b7bf5258c566a6e2003dbdf01a", + "src/server/game/src/port_cube_restore.cpp": "5bf270de80719302bf90ad6e9b22c14b59c226509305247861f4999e73ee1594", + "src/server/game/src/port_cube_lifecycle.inc": "7dbea7ed225613f6139cf3c892940b7f7e7738d1e617cce678bbc95c173fb2c0", + "src/server/game/src/event.cpp": "bd57efc47feb842784cc782dadbf92fef3074c6c6fd7f8f2a02af7cfaf7f59f5", + "src/server/game/src/event_queue.cpp": "e01ae8c03037c736e67958f0cbd00165b345f958eda3e2f0241c2cf9772de6df", + "src/server/game/src/item.cpp": "eb858ad8c651166c6cc5f8f786a4c9358b2e5517bb7ccde6354afb1c589de80b", + "src/server/game/src/item.h": "5684227e597ae048544f6dcf35dbf06a144ac86938673b2133e48a3c1d0957b3", + "src/server/game/src/port_cube_actor.cpp": "dae34e649cffd4ec5314b9052f0084a3999470ff2d62ab8b86f8fe4787d9861d", + "src/server/game/src/Makefile": "464566f4deb71cf6a44c74a887c9d86f71efc330c3f5d900e025f1f113da4495", + "tests/features/test_cube_restore.py": "1a916d8f9cb876edb7c3e078d09b0cfa89ba521352e935be148bae46b04c53ba", + "tests/features/test_cube_mutation.py": "5dadf828e300f8a9b16e4058184c00ebc0a2522b1b534e9744f571df17f0858b", + "tests/features/test_cube_craft.py": "816309af7e0fa766e2aa907ccf379f7eca4725bbe3d181abcefca8ddbecb70ed", + "tests/features/test_cube_handshake.py": "19b69a64cc8b4cf45d89bf409d70b0ac6aae47945a9b37565382e122ea6b7ad9", + "tests/features/fixtures/cube_restore_platform.h": "ebb97f02f0adddd105f640029a73f81a7f1dd4aee08798d3534ab4161798d34c", + "tests/features/fixtures/cube_restore_cases.inc": "b3857b1b849d7b3d264456da1c742a19301f26b7cbf7e5eb677780786fb94467" + }, + "client_source_metadata_sha256": { + "scripts/test_xxf_all.py": "053f505a7cd17446bb494dbb2cbdf84f799569f82a3b4af9c11e9b9ac6ed21a2", + "scripts/build_xxf_features_json.py": "b241f015ea88168b5637d5a8800a6441386a8826e246dd24ff9d985b0948f645", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "714e0b26c7fd5cc07e20e98e4357305fa5c2bcd68a9ae42e1b14d8099c249b73", + "docs/XXF-CH5-CUBE-LIFECYCLE-20261023.md": "87312263a946131ab35f0e14a523c2a3bf15c3e382940fd65b778c80488d7fba", + "audit/xxf-ch5/features.json": "571178ea2ad17a383d6f5bd8d2f8429463fbd02edb16deeb8983b0f9ddbd5888" + }, + "implementation": [ + "Actual acknowledged LIVE actor prepares restored inventory events after authoritative publication using existing bounded two-job Tick queue and exact all-window pre/post seal", + "Move-only restoration plan binds owner PID/VID, current registry ID/VID maps, item pointers/cells and complete persisted metadata; all-item validation before save-flag commit", + "Prepared real-time/started-first-use/absolute-unique wrappers preserve persisted deadlines and pause while skip-save OR current owner held; unstarted first-use, unequipped wear and played-time unique durations remain unstarted", + "Original expiry callbacks remain identical except checked dynamic_cast for derived prepared real-time info; postactivation dropped ownerless items still expire", + "Prepare allocation failure cancels prepared wrappers without saving or metadata mutation; cancelled queue nodes drain by original scheduling rather than immediate deletion", + "PortCubeEnableRestoredInventory is a trusted allocation-free skip-save clearing primitive with NO runtime caller; it requires future authenticated DB resume and does not itself save or thaw", + "Actual event creation owns info on entry, failed queue insertion cleans pending nodes, dispatch detaches dequeued q_el before self-cancellation; no EVENT/CItem/CHARACTER/queue instance layout changes", + "Legacy non-ASCII streams in event.cpp/event_queue.cpp preserved byte-for-byte" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-lifecycle-verified/report.json", + "report_sha256": "455568123f14832a3bf216bbcc8b4f4778e73b989453f6a80684b0ac21111d5c", + "files_pass": 138, + "unittest": 412, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "targeted": "ASan/UBSan actual scheduler/expiry/lifecycle/plan bodies; event allocation failures1..3 and every dynamically measured group-prepare allocation; explicit CHARACTER/CItem/DB substitutes", + "initial_full_run": "build/ch5-tests/20261023-cube-lifecycle/report.json: one legacy exact-body test failed on intentional checked cast; updated test permits only that exact cast and still compares every remaining original callback byte" + }, + "native_build": { + "host": "192.168.21.203", + "platform": "FreeBSD i386", + "root": "/root/deploy-features/cube-lifecycle.rqxKH1", + "rebuilt": ["port_cube_actor.o", "port_cube_restore.o", "item.o", "event.o", "event_queue.o"], + "other_objects": "/root/deploy-features/cube-view.u4iBuI/src/server/game/src/.view-obj", + "script": "native-build.sh", + "script_sha256": "932f662e18b5fb722be31bd2269247e9b7274975c572b99d1b167b719def4d47", + "game_sha256": "b88de5fff66c1836b8d7c4bf3168cdbede5f7f45868f47548ef51d185d3b1b38", + "compile_and_link_log_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "remote_source_hashes_match": true, + "max_parallel_compilers": 2, + "db_rebuilt": false, + "game_launched_or_deployed": false, + "production_restarted_or_migrated": false, + "remaining_disk_mb": 101 + }, + "gates": {"HandshakeEnabled": false, "ActorMutationAuditComplete": false, "ENABLE_CUBE_RENEWAL_WORLDARD": false}, + "remaining": [ + "Complete actor quiescence and durable legitimate post-Submit mutations/rewards; direct setters/global callbacks, other windows and old-core revocation", + "Game Release22 request/answer, current-authority DB resume and lost-reply/disconnect reconciliation before save-enable/thaw", + "Classic BYTE count-bearing action extension, public craft capability/action, special recipes/copy/rate items and exceptional DONE reconciliation", + "Matched live game/DB and Android device acceptance; no client runtime changes or new client native builds this batch", + "Won, Wolfman, Conqueror and five-character-slot subsequent batches" + ], + "complete": false +} diff --git a/audit/xxf-ch5/cube-live-craft-20261023.json b/audit/xxf-ch5/cube-live-craft-20261023.json new file mode 100644 index 00000000..bda5e288 --- /dev/null +++ b/audit/xxf-ch5/cube-live-craft-20261023.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_INTERNAL_LIVE_PREPARE_EXECUTE_NO_FACTORY_PUBLIC_ACTION_APPLY_ACK_OR_THAW", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "previous_checkpoint": "audit/xxf-ch5/cube-recovery-image-20261023.json", + "server_source_sha256": { + "src/server/common/cube_craft.h": "a1ca38354c3b373040c46888ba193e6033354215f7fe3ad491f83a7d4e3c2ac0", + "src/server/common/cube_receipt.h": "eebc33813715f665ff10b30dd1c2b2367c858d9ce2ce91bb91604a2630e95ba3", + "src/server/common/cube_random.h": "d74c556efb3e6db08f51e96bee7f69c639af73748648001d92bba7fdc66b180b", + "src/server/common/cube_handshake.h": "5a4a98b7931b4d38ff95036ed9b2e1858f4b53261c4ae8e548c0548360098320", + "src/server/common/cube_owner.h": "7755a3a051b958f598853d43effd015773caaf00a5dcfff9b84f3e0fb10a9e2f", + "src/server/common/cube_store.h": "8add68cda002eef7e5fefa4654c75240990f0af7181d78feeed7bb7bea41de4a", + "src/server/db/src/ClientManager.h": "29e94c3641b02a435a7f0d1336e6b14f64a5114c2603dc2ee229d296621e616d", + "src/server/db/src/CubeRuntime.cpp": "87bdd103a1202cce133ced1db60836cd41b3c7b3543dce2224eb16d1d1690a44", + "src/server/db/src/Makefile": "0a82ef25f877b94cff811b3333366e556c4ae28940808456bf2fdad691350c03", + "src/server/game/src/port_cube_actor.cpp": "59e53750fe9b106d19df96394f114eb4bd11e78a11e8d7455352b3d1576c7bed", + "src/server/game/src/Makefile": "4ed317f42b9a54a3272f23b2907617b09419e8d477f3c5c8c170fe6cad13214a", + "tests/features/fixtures/cube_craft_probe.cpp": "741159dd68ab55b5dde7a59546a86daa75a8ddbfaa3871ca1e629876462d3873", + "tests/features/test_cube_craft.py": "94761aedcbf7ed873cb37f2746c72bdb283ed692ac614b647f0ceba51787bed7", + "tests/features/test_cube_runtime.py": "82d311952eec2ea804f61901aec287a3a77671d964dbfe1c8ee218a0e9415111", + "tests/features/test_cube_outbox.py": "0b6db7142fbb4429a0445d55576c472b5cddcb084da72b42907e4af95b506888", + "tests/features/test_cube_handshake.py": "55020da76df966b93885134fec74cf69bc182c6d674800cf2499de26ab90e796", + "tools/cube/test_mysql.sh": "67532651674ada188f376a51042af76329777bc6ce43a888202bc8beeeef73b4" + }, + "client_metadata_report_sha256": { + "scripts/test_xxf_all.py": "8324f8ccd75e0e25a8806e1d183cef90cad02850319072f1c72e4f5e0d40809d", + "scripts/build_xxf_features_json.py": "6dd2e5185421f763822fd5570e6f93bb984d84452b41ad147cc160a63680c1ac", + "audit/xxf-ch5/features.json": "4aede1b4abdd299729b45df8da7a445ff3f6692f6bb9552886b4e7af1a71c260", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "69ec1f98e6b6505a3e5c001781d9cb2ca3cd9a62e071b15274822de7a0f1d18e", + "docs/XXF-CH5-CUBE-LIVE-CRAFT-20261023.md": "c4b18fb4e586ec5485876c501658f7ae9d445d40c7aa4d3cb196787da97c9c5e", + "build/ch5-tests/20261023-cube-live-craft/report.json": "da7d74ba192ce858c009f8b758dcd968b2ccb2cef57806302a156499b6b513ce" + }, + "freebsd_selected_source_sha256": { + "src/server/common/cube_craft.h": "a1ca38354c3b373040c46888ba193e6033354215f7fe3ad491f83a7d4e3c2ac0", + "src/server/common/cube_receipt.h": "eebc33813715f665ff10b30dd1c2b2367c858d9ce2ce91bb91604a2630e95ba3", + "src/server/common/cube_random.h": "d74c556efb3e6db08f51e96bee7f69c639af73748648001d92bba7fdc66b180b", + "src/server/common/cube_handshake.h": "5a4a98b7931b4d38ff95036ed9b2e1858f4b53261c4ae8e548c0548360098320", + "src/server/common/cube_owner.h": "7755a3a051b958f598853d43effd015773caaf00a5dcfff9b84f3e0fb10a9e2f", + "src/server/common/cube_store.h": "8add68cda002eef7e5fefa4654c75240990f0af7181d78feeed7bb7bea41de4a", + "src/server/db/src/ClientManager.h": "29e94c3641b02a435a7f0d1336e6b14f64a5114c2603dc2ee229d296621e616d", + "src/server/db/src/CubeRuntime.cpp": "87bdd103a1202cce133ced1db60836cd41b3c7b3543dce2224eb16d1d1690a44", + "src/server/db/src/Makefile": "0a82ef25f877b94cff811b3333366e556c4ae28940808456bf2fdad691350c03", + "src/server/game/src/port_cube_actor.cpp": "59e53750fe9b106d19df96394f114eb4bd11e78a11e8d7455352b3d1576c7bed", + "src/server/game/src/Makefile": "4ed317f42b9a54a3272f23b2907617b09419e8d477f3c5c8c170fe6cad13214a", + "tests/features/fixtures/cube_craft_probe.cpp": "741159dd68ab55b5dde7a59546a86daa75a8ddbfaa3871ca1e629876462d3873", + "tools/cube/test_mysql.sh": "67532651674ada188f376a51042af76329777bc6ce43a888202bc8beeeef73b4" + }, + "freebsd_artifact_sha256": { + "/root/deploy-features/cube-live-craft.x0vRrX/bin/game": "bd90abc44136f09f22c2f06857dede0e1ed914142354401f646e8859fa686092", + "/root/deploy-features/cube-live-craft.x0vRrX/bin/db": "7b37aa70ad425e528f7c61348845d1691481a3145a8ddf74313e91b6627a94b0", + "/root/deploy-features/cube-live-craft.x0vRrX/game.log": "08de2b250f3eca2a2127cf286e0175c1a3918fa3cd530ff679cd9ae6b9144e06", + "/root/deploy-features/cube-live-craft.x0vRrX/db.log": "cd5c5b0293ee41547101cd7091ae08bb74a88953e190b2bb8621706175b9d460", + "/root/deploy-features/cube-live-craft.x0vRrX/mysql.log": "3601b56564c5c2b1099f039f0f8e4fc4df6fc607edd604de861a8b65a393535c", + "/tmp/ch5-cube-mysql.ovjwNt/craft-result.log": "fb6869c63afc7c6d062ea0732ae0ba6ad41fea57786b284ae885bb40b9f5185a", + "/tmp/ch5-cube-mysql.ovjwNt/image-result.log": "a5a36a8b40b78ec8ee46b2747c9a06c04974e71d925fc3e85731c8681b405913", + "/tmp/ch5-cube-mysql.ovjwNt/owner-result.log": "037e0241d73fe4a53b10d46f5531bc09a1db005cf6d2dc97322c8b83db9212fc", + "/tmp/ch5-cube-mysql.ovjwNt/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.ovjwNt/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.ovjwNt/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.ovjwNt/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.ovjwNt/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/tmp/ch5-cube-mysql.ovjwNt/cube-craft": "6543887080dda5405a244477177d20737fd95d6bd3a1321ef0929bb6fb337899" + }, + "tests": { + "summary": { + "pass": 136, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 400, + "top_level_probes": 33, + "source_changed": false, + "release_ready": false, + "report": "build/ch5-tests/20261023-cube-live-craft/report.json", + "local": "ASan/UBSan actual live-owner backend transaction, actual actor Tick and actual DB route bodies; explicit audit/source/actor/peer/cache/SQLite session/FIFO test boundaries. Canonical CCR1/factory metadata/fee/state tests and POSIX entropy rejection/EINTR/failure boundaries. No real socket or player acceptance.", + "native_root": "/root/deploy-features/cube-live-craft.x0vRrX", + "native_source_matches": 13, + "native": "Fresh game/DB object directories compiled and linked with inherited platform-matched dependencies, max two native compiler jobs. Legacy -w/-DNDEBUG; not active-gate, strict-warning, full dependency rebuild or client/device acceptance.", + "mysql_root": "/tmp/ch5-cube-mysql.ovjwNt", + "mysql": "Dedicated no-defaults socket-only skip-networking instance: actual live-owner Prepare/Execute callback transaction probe, each authorization/mutation SQL failure and warning, ambiguous commits, one charge/award, revoked owner and non-ok replay, before/after Prepare/Execute COMMIT process exits/new-broker refusal. Base/lifecycle/gold/outbox/source/owner/image/FIFO and upgrade suites also pass. Socket absent after normal isolated shutdown. Runtime transport is not exercised by this script.", + "fixture_repair": "Existing outbox actual-handler extractor no longer found its old Answer-only delimiter after CraftAnswer routing was added. Updated to assert and split the new explicit boundary, preserving every original gold/source ACK assertion; no skipped tests or runtime workaround.", + "cleanup": { + "kind": "task-generated rebuildable .o directories only", + "approximate_size": "1.2GB", + "paths": [ + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/game/src/.cube-admission-final-obj", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/game/src/.cube-admission-obj", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/game/src/.cube-outbox-game-obj", + "/root/deploy-features/cube-recovery-image.5bISSS/build-root/src/server/game/src/.cube-image-game-obj", + "/root/deploy-features/cube-recovery-image.5bISSS/build-root/src/server/db/src/.cube-image-db-obj" + ], + "retained": "Source, binaries, logs, SQL evidence and dependency libraries retained; objects recoverable by rebuild, not trash restore." + }, + "deployment": "No production deployment/restart/migration/player writes, no new client/Android native/device acceptance.", + "post_regression": "Only this evidence JSON added after final local regression; runtime/tests/metadata/docs hashes unchanged." + }, + "contracts": { + "wire": "Internal header78 messages15 Prepare/16 Execute/17 CraftAnswer; statuses14 Prepared/15 Complete. Identity-only empty requests with original session/cookie. CCR1 receipt: magic4/code1/success1/fee8/count2+max100*117 =11716 body,11818 total frame. Known outcomes only; non-ok zero success/fee/awards.", + "authorization": "Actual route requires current original LIVE owner (not adopted recovery), peer/login/handle/session/cookie, clean FROZEN and exact original source seal. Prepare/Execute callbacks revalidate inside the account transaction on the same pinned SQL connection. No caller replacement batch/recipe/rewards/rolls.", + "rng": "New Prepare draws unbiased1..100 from /dev/urandom with rejection of200..255; persistent fixed draws before assets. Entropy failure returns invalid0, no weak fallback. Exact prepared/done retry does not invoke draw. Existing body with invalid persistent state no longer acknowledged.", + "execution": "Identity-only Execute reads original body/rolls and uses existing atomic material/cash/award/DONE transaction. Duplicate or lost commit acknowledgement returns original receipt; no repeat charge or award.", + "game": "Actual actor Tick begins only after clean Frozen and durable source-close ACK, then phased Prepare/Execute retries. At most two ready craft requests/tick, round-robin and2s intervals. Receipt validated against immutable batch/proto/full factory image. Completion stops execute polling but retains actor action/save hold; disconnect/mutation retains held state.", + "generic_backend": "Optional callback remains for trusted legacy isolated backend users; new runtime always supplies real authorization. No public unguarded mutation command or new client capability.", + "gates": "HandshakeEnabled=false; ActorMutationAuditComplete=false; ENABLE_CUBE_RENEWAL_WORLDARD=0. Caller still must construct a trusted complete batch; this batch does not provide a user-facing craft action.", + "schema": "Base Cube v2/gold-addon v2/owner-addon v1 unchanged." + }, + "next_factory_evidence": { + "sources": [ + "src/server/game/src/item_manager.cpp:149", + "src/server/game/src/item_manager_idrange.cpp:20" + ], + "observations": [ + "CreateItem(bSkipSave=true) avoids map insertion but still resets SkipSave false and initializes expiration events; it is not a no-side-effect template constructor.", + "GetNewID shuts down the game if current and spare ranges are exhausted; factory/ID admission must not blindly call it on exhaustion.", + "Use actual factory initialization and safe permanent-ID handling, not zeroed reward placeholders or copied metadata assumptions." + ] + }, + "not_complete": [ + "Trusted batch builder/actual reward factory/permanent IDs and public client/game craft action/capability negotiation", + "Original actor image apply/exact ACK/terminal release/thaw and online deferred Gold Apply coordination", + "Complete mutation/reward quiescence/durable retention", + "Cross-core old actor/cache revocation, full character recovery and PREPARED/ABORTED/non-ok reconciliation", + "Copy/success-rate items, status UI, real socket/matched live/Android acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-live-image-20261023.json b/audit/xxf-ch5/cube-live-image-20261023.json new file mode 100644 index 00000000..17154b4a --- /dev/null +++ b/audit/xxf-ch5/cube-live-image-20261023.json @@ -0,0 +1,122 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_ORIGINAL_LIVE_IMAGE_AND_AUTHORIZED_GOLD_CREDIT_NO_LOCAL_APPLY_ACK_OR_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-start-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_live_image.h": "839a2220c0ae43f2a0d4b21c0bc31fc87c4e3077238ec06ea7d60f190cd8bcb1", + "src/server/common/cube_owner.h": "86a30099e9072c8e6f8cc1656dca0a351b6e91c706877a0c0a216a16f80104a0", + "src/server/common/cube_gold_store.h": "77d68ed672606aa4a4b7d36eee92edb2c26071336c5d59b54a8ae7ae2369b327", + "src/server/common/cube_handshake.h": "aa52cdd7f79332addf60777e99a7bd563e91340aad56b693ed78101ed94d1f25", + "src/server/db/src/CubeRuntime.cpp": "b73b7f08cf0338f1a8945783b46775489c560f5ecc159dfc157cc88fd06fbc65", + "src/server/db/src/ClientManager.h": "3ed226e9016afc19416d2d95b7e017f34f2b96ee34c142957ce8bd6d0af8df89", + "src/server/db/src/Makefile": "0a82ef25f877b94cff811b3333366e556c4ae28940808456bf2fdad691350c03", + "src/server/game/src/port_cube_actor.cpp": "6971add40ce7f6f56d84cc3b8c4eaf6e70b2917e1d59250b5211e91a988ac9b0", + "src/server/game/src/port_cube_actor.h": "2ce80244d0d6e544e37efa0fa64a22c91c5e2c9d01c2bf38b7bafc76fe7e677c", + "src/server/game/src/input_db.cpp": "eec30217ebcafd2792513c6c7b0e067b87f110e70430016f69e17f46579fe5e5", + "src/server/game/src/port_cube_recovery.cpp": "6aa02d1d44a3c47da1274f4f69793bf183bd177114bb02677a76bec3d2843459", + "src/server/game/src/port_cube_recovery.h": "0bad689c50dcd03fce9f1f4a5e38cfdf550cc4e2afd265ca2f696fdf16968b63", + "src/server/game/src/Makefile": "c961674c00b2fad0477820d4ab3151a4a7c59e76478f4290fde83462607356e8", + "tests/features/fixtures/cube_image_probe.cpp": "a4cff6700fe92cb2f38259aff6a100fdcaf7f6f30fb10d8e48d49ec5e9099fc0", + "tests/features/test_cube_image.py": "14b1c9d48b03e0d5cb043b6df4b4d8b193a268b38949bf466cb42e2f2b3bdaf9", + "tests/features/test_cube_runtime.py": "d74a89f30a6b4e9094e119a369ac9e6c79dd68e9a8d2b1b7cc9f195a010d9f40", + "tests/features/test_cube_craft.py": "33c9ecf8da9e4d0338236d546210080a0995b6421d0eba81463ca34fdbd88b7e", + "tests/features/test_cube_outbox.py": "dd2183d94495142b57a558e9c68648961799d13536c373730b027e0135fc6eee", + "tests/features/test_cube_handshake.py": "508cb9c4e3289e3cd2814b7dfa773bca47966f77c16b5d7a0925af5d8548a1ae", + "tools/cube/test_mysql.sh": "67532651674ada188f376a51042af76329777bc6ce43a888202bc8beeeef73b4" + }, + "client_metadata_sha256": { + "docs/XXF-CH5-CUBE-LIVE-IMAGE-20261023.md": "96c959280a5ecb55df3ffc2ba9726dfc25586725623d1a3c5ee6ef76b2526254", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "d893b25d64a10fed9d8a47cc3b9cc794594f4908b6f30f62290ecab2ca61626c", + "scripts/build_xxf_features_json.py": "efeed40b2d7c5dcc79e9b5349b9b5ee12a609c36f09ff492b76cdd2b7ccb5cda", + "audit/xxf-ch5/features.json": "b107196247ee4e0dad21bf32d2da08129a7d84803b6507f8799bd089825d497c" + }, + "implementation": [ + "LiveImageRequest=18/Answer=19 and status LiveImageReady=16; old values retained; empty identity-only request; canonical raw inventory image max26335/frame26437", + "Actual ingress disabled -> Held without SQL; actual original peer/handle/session/cookie/playing-account/batch context checked", + "At most two persisted pending gold events per request; Gold.Apply now accepts authorization inside same account transaction/pinned connection, before even historical replay; new route always passes exact original LIVE CraftWithin proof", + "Fence.Resync uses explicit LIVE image callback sharing existing ADOPTED proof code; exact original peer/binding, leader/lease, sealed source, ok DONE/fixed draws, applied credits/wallet/full inventory/locks/reservations and immutable image all required", + "Actual actor Tick requests only after ok receipt and durable original source ACK; rebuilds exact expected image from original batch/receipt/outbox credits; wrong identity/conflicting bytes/lost context stay held; common max2 jobs/tick", + "Image is retained only; no local asset writes, item creation, image ACK or thaw" + ], + "tests": { + "cube_unittest": 36, + "full_report": "build/ch5-tests/20261023-cube-live-image/report.json", + "report_sha256": "58a685ee317bb04773455bc35362cc8c4acce4ce491d7fe32bf58abce9937546", + "files_pass": 136, + "unittest": 404, + "top_level": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "Actual DB route with explicit peer/cache/SQL-queue boundary: disabled no SQL, stale session, three credit events in bounded2+1 requests, lost gold/image COMMIT confirmation and exact replay, no repeated charge/rewards/credits, disconnect refusal", + "LIVE/ADOPTED mutual refusal, revoke/adopt separation and immutable image; every LIVE image SQL failure/warning; Gold.Apply callback including APPLIED history", + "Local exact image reconstruction, metadata/credits/overflow, cookie/conflict refusal, paid zero-success; actual actor Tick request/stop/hold progression", + "Existing gold ACK and snapshot probes retain old assertions with new dispatch/type declarations; runtime test local names scoped to avoid fixture redefinition" + ] + }, + "native": { + "root": "/root/deploy-features/cube-live-image.tYdTWx", + "db_build": "all DB objects compiled in fresh .cube-live-image-db-obj", + "game_build": "actual actor/input_db/recovery TUs rebuilt against one coherent new header/common root; linked matching factory cohort plus updated cube-start cube.o", + "external_serialized_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "game_sha256": "5e69a3d1163c0cc9a94709e91821c5dd1abc49341684bef29f39f9ea4c58d700", + "db_sha256": "4f766aa5eea41fa1fc9f14647278828a354f094db0df69bc07dbec49fe302574", + "db_log_sha256": "c41c02bdd014f86da4ce12aea5a8bbd5a99bbcc9e7379e2fc4e4f8201b20999c", + "empty_game_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "environment_repairs": [ + "First overlay mixed two physical economy.h copies despite pragma once; copied coherent game headers into new source root", + "Included locale.hpp in copied header cohort; no source algorithm changed to accommodate environment" + ], + "game_or_db_daemon_started": false + }, + "mysql": { + "script": "tools/cube/test_mysql.sh", + "terminal_exit": 0, + "evidence": "/tmp/ch5-cube-mysql.NfFByi", + "isolated_socket_only": true, + "socket_absent_after_shutdown": true, + "production_socket_used": false, + "log": "/root/deploy-features/cube-live-image.tYdTWx/mysql.log", + "log_sha256": "216f74867ab72ea69b2c996345b69f4c872bcb9aba45f4e071eebb5ffef072e8", + "image_log_sha256": "903e5ccd87ae8117b302d4bbc3689720f93fc45f161c73053aebb80e68d6c3c7", + "result": "LIVE authority/image/transactional gold checks and existing batch/fence/gold/outbox/source/owner/recovery-image/craft/libsql FIFO and migrations passed; not matched live-game acceptance" + }, + "cleanup": { + "target": "/root/deploy-features/cube-live-craft.x0vRrX/build-root/src/server/game/src/.cube-live-craft-game-obj", + "validated_only_regular_o_files": true, + "removed": "~292MB rebuildable task-generated .o files only", + "preserved": "source, binaries, logs, database evidence, current factory object cohort and dependency libraries", + "recovery": "recompile original retained sources" + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "public_craft": false, + "production_deploy": false, + "production_restart": false, + "production_migration": false, + "player_assets_changed": false, + "client_or_android_build": false + }, + "remaining": [ + "Original actor image application/exact ACK/owner terminal release/thaw still incomplete", + "Complete quiescence and durable legitimate mutation defer, old-core revocation, full character/other-window recovery and exceptional/PREPARED reconciliation pending", + "Public Start action/capability/status UI, copy/rate items, clock-generation handling, matched live and Android acceptance pending", + "Won/Wolfman/Conqueror/five slots not advanced this batch" + ], + "next": "Apply exact retained image to original held actor without ordinary saves/expiry/registration side effects, then exact-image ACK and owner-aware terminal release/thaw; keep gates closed until full acceptance" +} diff --git a/audit/xxf-ch5/cube-live-release-20261023.json b/audit/xxf-ch5/cube-live-release-20261023.json new file mode 100644 index 00000000..0392ad16 --- /dev/null +++ b/audit/xxf-ch5/cube-live-release-20261023.json @@ -0,0 +1,70 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_GAME_LIVE_TERMINAL_RELEASE_TRANSPORT_NO_DB_RESUME_SAVE_ENABLE_OR_THAW", + "priority": ["Cube", "Won", "Wolfman", "Conqueror", "Five character slots"], + "previous_checkpoint": "audit/xxf-ch5/cube-lifecycle-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/game/src/port_cube_actor.cpp": "06027569762e24ee0dee5a6a498c31a7e8c462532bec36c2a02821fe0f91da5c", + "src/server/common/cube_live_image.h": "72a45497eda53e157dea556dac4327fb68183481be5cf06d27afde17a08a3d05", + "tests/features/test_cube_craft.py": "9bd6fc35a602ebfbe2f2d7844f1dd19f17512d01f1b9e4f5f439977efe320ebc", + "tests/features/fixtures/cube_release_actor.inc": "ae02d7cfa519b57cb3fd339c50f307484159ec4db7c069f1e221c8f34ec0f1eb", + "tests/features/test_cube_outbox.py": "c1f260393307b4be4b23c931d4a37cc9d67696fb87b00ffc9ed2517f8d273c4a" + }, + "client_source_metadata_sha256": { + "scripts/build_xxf_features_json.py": "8e53a0d35de7dff0713c06adeb20acc95da77a216236833f17eb6a661fae52f1", + "tests/wiki/test_feature_manifest.py": "8e0beff085c49ffe55fe1c8a4d2b127d49c169db6ba90a9a1fc1cbfa61ccf09f", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "366fe7d8ed2529fe2465a8bd597523aa7950256879b17dac94aaacc82dc1698c", + "docs/XXF-CH5-CUBE-LIVE-RELEASE-20261023.md": "1536a6e974f045e971ff8c62b8e632f8937daf76e5adc27309e41cf7b48b700e", + "audit/xxf-ch5/features.json": "849625c93ab78f7fbcc7e2241d019efb1ca0e66340fe547d3eea582ee0c25e38" + }, + "implementation": [ + "Actual original-LIVE actor Tick sends Release22 only after acknowledged exact image, publication and paused-event preparation; retains existing bounded two-job shared queue and original two-second retry interval", + "LiveReleaseFlow freezes original session/cookie/batch identity and canonical complete image; Held retries, foreign identities ignored, same-identity conflicting image held, exact success duplicate idempotent and late Held cannot downgrade success", + "Actual releaseReady and acceptRelease check current actor/connection/gates, submitted clean flow, complete craft, ACK, all-window applied seal, exact normal inventory/gold image, registered prepared-not-enabled restoration plan and all36 ID-rebound quickslots before send/retry/acceptance", + "Release success stops SQL retries but does not enable saving, call PortCubeEnableRestoredInventory, remove actor hold, clear DB memory save/load gates or thaw", + "Existing DB transactional release implementation unchanged; all optional schema/owner/ACK/current image/fence and exact replay checks retained", + "Fixed metadata generator ordering that previously discarded appended lifecycle notes; added real generator regression using captured output without rewriting shared artifact", + "Gold-outbox actual-body test now extracts up to generic actor-response guard instead of hardcoding its complete expanding reply allowlist" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-live-release-verified/report.json", + "report_sha256": "916c2492c624a8e7aea61ac4d317e5275aec4a9a6fa80435633af00a0fa4fd49", + "files_pass": 138, + "unittest": 414, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "targeted": "ASan/UBSan actual readiness/acceptance helpers, actual Tick body, actual LiveReleaseFlow and existing DB route/transaction probes; explicit actor/snapshot/restoration/DB boundary substitutes, not complete freeze or live gameplay proof", + "initial_full_run": "build/ch5-tests/20261023-cube-live-release/report.json: one outbox extraction marker failed because reply allowlist expanded; fixed marker and reran all suites" + }, + "native_build": { + "platform": "FreeBSD i386", + "host": "192.168.21.203", + "root": "/root/deploy-features/cube-live-release.DB7CaE", + "rebuilt": ["port_cube_actor.o"], + "other_objects": "/root/deploy-features/cube-lifecycle.rqxKH1/src/server/game/src/.lifecycle-obj", + "script": "native-build.sh", + "script_sha256": "9e314948d6b07b18348e6dad407951422dc37548e9b8b7e53de293d16f9eb141", + "game_sha256": "f25dfe18028fde44e6c8ffabde2c09d1f3050111b80e13ea49b31f5d139579d5", + "compile_and_link_log_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "remote_source_hashes_match": true, + "parallel_compilers": 1, + "remaining_disk_mb": 86, + "game_launched_or_deployed": false, + "production_restarted_or_migrated": false, + "db_or_client_rebuilt": false + }, + "gates": {"HandshakeEnabled": false, "ActorMutationAuditComplete": false, "ENABLE_CUBE_RENEWAL_WORLDARD": false}, + "remaining": [ + "Authenticated current-owner DB resume handoff, save-enable and safe actor thaw with lost-reply/peer-loss/restart reconciliation", + "Complete actor quiescence and durable retention of legitimate post-Submit changes/rewards, direct setters/global callbacks, non-normal windows and old-core revocation", + "Classic BYTE count-bearing action extension, public crafting capability/action, special recipes/copy/rate items, exceptional DONE reconciliation", + "Matched live game/DB and Android device acceptance", + "Won, Wolfman, Conqueror and five-character-slot subsequent batches" + ], + "complete": false +} diff --git a/audit/xxf-ch5/cube-mutation-review-20261023.json b/audit/xxf-ch5/cube-mutation-review-20261023.json new file mode 100644 index 00000000..42b132c1 --- /dev/null +++ b/audit/xxf-ch5/cube-mutation-review-20261023.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "scope": "lexical_review_candidates_not_semantic_coverage", + "warning": "Includes definitions/comments/conditional branches; misses aliases, macros, indirect calls and unlisted setters. No hit is automatically accepted or safe.", + "totals": { + "gold_points": 52, + "experience_points": 22, + "item_ownership": 203, + "item_image": 282, + "quest_work": 70, + "lifecycle": 106 + }, + "source_sha256": { + "BattleArena.cpp": "dcb0cfd3757c2cbe34b051bab7cedd6bb93d69436b4d5251f0936c3c09e3839b", + "DragonLair.cpp": "027e2a3dc68f91ea41d74aa10ba25aa0b824bc8bed13cb0211b4f2152d5b7693", + "DragonSoul.cpp": "eeab115680f33f7573cd1869e5a86c7167b1448ecf68f93dc86071f7d9601b6e", + "OXEvent.cpp": "5e512f457c4c34c81540f638f59694539bca9e59a4de96ad382e0d263aa8e4dd", + "PetSystem.cpp": "5f0875c5edcc9abe40c40c98f506400d7a0f82ecc25db34a5ebda6f84ff0a660", + "XTrapManager.cpp": "9a390ac51a193883402fe1f3038495d4f748cd4b59510c2327fe5e8aec945cf7", + "arena.cpp": "aff87046d4f5b88b5d398ecc9e2723f9f70d9ce9b58a70f1fe40e1aaabdf8a8f", + "auction_manager.cpp": "7aa21fcc6f801edfb0f93e94c2fb0111539ccd3a8e984fb4a530a974217fb725", + "ava2_chest.inc": "80a55806328d69d620e97ab11490905dccc771fbf6d877cdc41f81c9ad082f88", + "ava2_track_commands.h": "6184f83df7e11d59a39780e597b9bab012ccb965b41baae80c44f513cf8d9305", + "biolog_remote.h": "2a8d87ce1f5cb99979c390b41dc4eb92a2141d025b9f96a905bd32280913427d", + "blend_item.cpp": "ed9e475a7d42590e1277f61d7a6d1a54661a7a20ce3997ea33cbf1e3d47a6383", + "building.cpp": "c29fc5e10222693de781f67bad83a9aae6972aab0c307a0fa90c9fd097d0e1e1", + "castle.cpp": "68d4e71f597a8cd33237bdcc1d90c2eb687353086743b24ccc223c1130df6e2b", + "char.cpp": "e5a7680767ed68e8fa7e6211828275145172d9084602ebe3ccfbb926d945cb21", + "char.h": "1c245ec37b7c2c972ac5cc1d11deedc1c6a88ac0990a409ea4b04ff8e012409a", + "char_battle.cpp": "f053a6bcc2c2d0425e9ff1ced341ac877b008aea3dd532ec9d79421bf5532df7", + "char_dragonsoul.cpp": "86d3448869896f26a7f32a948af0b380852833f3ee2e1509176250ef2b7cf915", + "char_item.cpp": "582101a95d7160c7dbf975779b11d80f8359b4cbd4c135224d59754af76c2d2d", + "char_manager.cpp": "32c49dee07a79b15b928b2827336666abef4eb17680d0cd2c5c303e0a6d95054", + "char_skill.cpp": "007ea3e155f3d2032a329bd5c40274111ae146551d92a1a9e4f961217827ff17", + "cmd_general.cpp": "f0367377fa77f768433f34b11bec80db923a4543a9ba379f3873a6e1ad29deb5", + "cmd_gm.cpp": "34d979e24e523769d6a63a832293b41edfd8710ad73285cc0bc97a37792eb7e9", + "cube.cpp": "410ceef7bff2c170cc10d9ddb673e4bed4153de6ba6c85737255b414eddefac3", + "db.cpp": "ba4be6c50ee6dcc6ee1da277b01d3bf220a4668b912b343175a512c9a3d8cce4", + "desc.cpp": "7e16ee517495d80af2318d7468d93e08c02e082d6bc67ed5dea8e6ed17ee1bda", + "dungeon.cpp": "3f964833b712092d2a4080de00e6bbda2ce3b8be53b750e84dddbec1c4dfda58", + "dungeon.h": "a6a3db35022ac6ef3544cbfd000d5c645e98c91b2905de961f9913a80f642c8a", + "exchange.cpp": "1e8b1fb1c0400a817c2aff3442da3d86c3f5eb9772248993b8b4aff1e38eabaa", + "exchange.h": "af6431ba044438d36de8e12cb59554756849ae625bc1cda2525812b590d59b37", + "fishing.cpp": "1af341aebc1ff1b459ecab2079aead15da384385e41e4fe5d7f8746df01b14f7", + "guild.cpp": "af3da74ec4a1f7c7ff32d6499899e6f968de9d9df44b9b1bfb28b69a188d29ed", + "guild_war.cpp": "002c0c850e52ba7524b859c0085335f3be8d5da019034cbaeba0620cc569cd31", + "input.h": "a7cfe582d33ded938612d527e539bc6722157b86be2021a3ae3c533049680ec4", + "input_db.cpp": "653e51df15c4abe9cf1e02235b23e7a2cdd1230e739002247c185286822fd9b3", + "input_login.cpp": "25c295d1a95f3f733089ceef1a43f258d48b9cb101c44a7c5c44e43ddec8cf7e", + "input_main.cpp": "343ed6e9a5a654a500dbfe7ab41b54dc8a2f332eef97200971a4bb4ba861eef8", + "input_p2p.cpp": "7590b50db3f533f06e54a84760706fd6c7c8a39108182e10ec0b30ad1cb29d73", + "item.cpp": "5e32a2f6ffc553803b51b08b3997174f27736405f22967102389df4a92088446", + "item.h": "8617f2418a1c68a12c36d5c432627ba7a96bf8d880cd1f73f5a759315e0073e9", + "item_attribute.cpp": "72cc7aa63299e25be89e22a7f21122da0452bd6448ee7799530d0aabe1af6f64", + "item_manager.cpp": "8cf1cea9a2169d8cf7fd9375c46cb61fa092bd554c3f1971f8a17cdf71ab0b0d", + "item_manager.h": "1654164482c359c700b49f33495d1d75db7a196af13e035f2f20e36148977b3f", + "marriage.cpp": "214a2bcd971460e7b2410e1d5e1dd4b2429f829be9e3e5b7e0f7cfc13cec7089", + "mining.cpp": "be3a5cf54622cce6a500a9d12a9fc906c726fa1be339cf0bef99d64c2577fc0a", + "offlineshop_manager.cpp": "9a880a00af3a7c94d76b042a0778e9e595a23c5ac7f4c937f69f7771c613a26a", + "offlineshop_manager.h": "f425ffbe395c299cb1642f85fd060d7c8d840f3ae13e9958433913d1ca9bb730", + "over9refine.cpp": "b1da94d0944e5f8ad1e591cd4956352efb7a552e5d93193610b5b63ef1052c5a", + "party.cpp": "e07c532b9b751b4a87694a2c9c2d445b676b579be673206715ad9774557d346c", + "party.h": "540665563648e1853c347922075d754d545e4c7a61b18593f398d50ab1eed5e5", + "passpod.cpp": "9f756e021891fb9aeadcbfa99829e193d26e19cd417b26c0798828f720369dd2", + "passpod.h": "3544cc17a4c27ffca81b397312545a0216c4f37e1ccc7f6c9c45a83496d81dee", + "polymorph.cpp": "e73a1f91f060071439ae04484d80b3d327545d8b342272179f66f97c661e0b59", + "port_attr_lock.cpp": "80fa0316f79c9717d3248d42d76131d0bf5da0da172d92797f8a003b78ae2ffd", + "port_ava2_dungeon.cpp": "6870ecee85f57a1240ede95d031fb2a17295677090ee968ba127f95d0ad06017", + "port_ava2_travel.h": "f7216ce7156ee5297946195d5c827a63d0dee3fb2d6bba182bbf1fc15c4ce58d", + "port_battlepass_runtime.h": "bb99fea6b8f97ec4b5c2c08fc3b4f84d2155d1e2f8531cce087d595149b48f61", + "port_costume_attr.cpp": "02b03bfe09080708c9f78403aaad47ea573c1651a91707a7d04079e91d06a005", + "port_cube_actor.cpp": "fa46aa608a9491bdff0db80423d4e79ae9542e947438f13446b12233b603067a", + "port_cube_flush.inc": "ec594a776b2db3953998b6f475ffa1cd1d554f0379364ac882bfcd6749a8f2e0", + "port_pendant.cpp": "bf215149710df0f95f6f0673e0500f454192dbef1d52c17cff9ea368ceaef141", + "port_premium.h": "096d316ff61ce47e9eed5e5c961988dd2a627bd9ee0f32b7cc3347de1432cc63", + "port_sash.cpp": "94f9eff7e7639e3d0fe3ade66fa3b690b943e7b52a58794bd1a0356d69b6066b", + "port_switchbot.cpp": "fe849a2b9b0a060547addb39df8ca073600047458d08776e1345d888badba632", + "pvp.cpp": "e00d759660b81b7b70141dfb135bc8be388df82b8a4879d49c995db161d4215b", + "pvp.h": "5b97879bc3dd33e91043a915b0dc07c7c79d931b2858d5c682a9cb5ea0638e5e", + "questevent.cpp": "23e1a558b9063c73a1e396f368fdeda0d8fcb94cec8b7c1313b07ad08a7bb80d", + "questlua.cpp": "0910e3d4abbe68e33a6a5160b53b7b2c5fb02534bc9cc0a59a75dc6e3de00abd", + "questlua_dungeon.cpp": "95fe9bd63ff2983e8784421af17f217016203e5f2b4c757336f67da93bf9b7f9", + "questlua_forked.cpp": "6861fbfb6a396cf0f88a2d76319da893c0954e30b7eaa4cb22a5b210cff2ba61", + "questlua_global.cpp": "49a4120444031448e64e13b439c68005526d8992b286fa93dd9620a62d38d2f4", + "questlua_item.cpp": "5b853d6be410c75db4a0078dd2288ab5232a2cdb5e7120636fe9b4fe6def128b", + "questlua_monarch.cpp": "1f915d474834a14ebf9af01f60a1bcd430ec28c49b460d9ed242420c582feb4d", + "questlua_party.cpp": "947afc0422c7143c7fc2d73ff7db99d41536153212dcb020f0ebc2ef58f3cf58", + "questlua_pc.cpp": "72dac477bd309b4ab02bd58f3a1184121c92baab084fdc5432457ced58e968df", + "questmanager.cpp": "64f28fac57ea0b11e5ef974e4252880343a0aed31a49c221d165ed9f71e55b39", + "questmanager.h": "64eb5ea60d137b0bd676174d1b2e80a45ebc654cf2e7d0f422da6c4e0e12c44d", + "questnpc.cpp": "7aa84201261d335d0feee2cc1d02c50a5fa302ee8cec8b8d73b91a580aa576fa", + "questpc.cpp": "84f0d83561d1625b63ac4f41330688b9a3e73cc0d766dab3cfab67bc61e6b65e", + "questpc.h": "030a6a1ddfdd7504f1ace8c19c5f64d4b8ecb857935e3b2a99ae83c914337ff0", + "safebox.cpp": "2e72187371a6b98f020db15a29c64285ed75c61db40b00c8e2c77156b8072c4a", + "sectree.cpp": "3169d6a0b0dcbfa2b493e481030a7c2ad3108067faec944ee38e396d13b9db7d", + "sectree.h": "19f1866546e428188a880a2551d3561f8c0e986614b32c6db1d14e8fdbd22d8f", + "sectree_manager.cpp": "b90b9ca7ed6e39b63a85b9432c1c360b8d0408a777a00b95ac5d311dcb9ada55", + "shop.cpp": "205d857fae14066b40b2136c19800fe914359805350dfcaa20d9604aeb510784", + "shopEx.cpp": "d24965016a01468d1c5f6541a299aba249d428fa5f991668fafec37732743cde", + "shop_manager.cpp": "a4de904006e62a43dfb4ff0ed193c4db4da45e508e376b539b9e23e79d5b956c", + "test.cpp": "e333e80a190b1875c4017540f4107f64e7ab1c13d4112b93d94afba48ec863d1", + "test_window.cpp": "b65d3ea9a6f336f0f72dec63ed1b074766662815c4bdce2e0aa365bdee169fb3", + "wedding.cpp": "026b86de42ca49d8d8e863384fadc3fcf956e4f22bad0177a550b4ca1e561bb8" + }, + "activation_allowed": false, + "candidate_count": 735, + "reproduce": "python3 tools/cube/audit_mutations.py" +} diff --git a/audit/xxf-ch5/cube-outbox-20261023.json b/audit/xxf-ch5/cube-outbox-20261023.json new file mode 100644 index 00000000..d62e85f0 --- /dev/null +++ b/audit/xxf-ch5/cube-outbox-20261023.json @@ -0,0 +1,122 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_GROUND_GOLD_OUTBOX_AND_ENQUEUE_ACK_CANDIDATE_INGRESS_DISABLED", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_gold_outbox.h": "4a476f076dce84fa5ee89911cf67c02aa07c61fc58b389fa859b4413d474f586", + "src/server/common/cube_handshake.h": "e37560d55eb5c2f2141321f2bc88ce7984ae507fe8835b43f752f2db2af7cb79", + "src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "src/server/game/src/port_cube_actor.cpp": "9bcb8c6651c06506b0bf1896cfa5bf3346da9f085618a06b930149db09dac6fc", + "src/server/game/src/port_cube_actor.h": "63ec80a16f4b0a8d2bbcc6db769dad794343ae969bedec3106ec1fdc0d21644e", + "src/server/game/src/char_item.cpp": "766b09f6bd344a1ca69a1c12d99b547627a4db4b81cf86374eb97a1379962ba7", + "src/server/game/src/Makefile": "2120e4351742d6be69f8db9425356cdb76d2d9da0e8f1c9876f02575fc7c94e1", + "src/server/db/src/CubeRuntime.cpp": "d431f12bcb0216729e0faf0db6fd3fa1cc102015ff67868da6314fbb0eaf51b2", + "src/server/db/src/Makefile": "4092f08089b2d2f15b4dd20008fd661c8f2abda9603ce97e3b22f30327ce2d27", + "tests/features/fixtures/cube_outbox_probe.cpp": "a2c3c969b68633f3b8e842ebbc473aee18e3cef6299e9c27095b04f317be8326", + "tests/features/test_cube_outbox.py": "fc04bad9593e6f9b919ac254b6268d312b74d18b014b1cfb7c1bc63ee487d7fa", + "tests/features/test_cube_runtime.py": "4c898f6e7618fc9c7d3c88052d8a4b03b3e1460cb32c34a5fadf1ca5276c4331", + "tests/features/test_cube_handshake.py": "c909f837666465e7970b60bebdea84f26bd90c3c317ee897052a5b6ea2e61b44", + "tools/cube/test_mysql.sh": "8ffa0bb92f434a5e20c18582402bf2f1646f3e588eb829d94671b340bcbbe7b1", + "tools/cube/README.md": "2e790a961bcfe1f4d5ab17bed25635ab656ec4ca4239b58cb20dff7d6da84925" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "de1fd0bc5c4f22cfc9e24e36cc323db36ed3b08bf78fa847fc3c23addc925771", + "scripts/build_xxf_features_json.py": "8e5c8e34f6d1e0c684e416ebd2cfa7b41e52cbd0a52ea7888f481d6f56d09976", + "audit/xxf-ch5/features.json": "15ecbac735a25e1df14c64af379b19809dc0a1fc3259a4c65655ff5c5b2f656d", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "66e447367fb4f6916ad94115ca56f40efeb21d6c03f43ae6bf4e98d4d9ada2dd", + "docs/XXF-CH5-CUBE-OUTBOX-20261023.md": "b51b9915b30be62cfd0edf92eb9e3ea5f1b010c233ab048dfa6f02624d0e9b3f", + "build/ch5-tests/20261023-cube-outbox-final/report.json": "a6a6fe2243be400fd3f26761c4475fe8aa8b331af052e6ab67f882b3563f368e" + }, + "freebsd_source_artifact_sha256": { + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/common/cube_gold_outbox.h": "4a476f076dce84fa5ee89911cf67c02aa07c61fc58b389fa859b4413d474f586", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/common/cube_handshake.h": "e37560d55eb5c2f2141321f2bc88ce7984ae507fe8835b43f752f2db2af7cb79", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/game/src/port_cube_actor.cpp": "9bcb8c6651c06506b0bf1896cfa5bf3346da9f085618a06b930149db09dac6fc", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/game/src/port_cube_actor.h": "63ec80a16f4b0a8d2bbcc6db769dad794343ae969bedec3106ec1fdc0d21644e", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/game/src/char_item.cpp": "766b09f6bd344a1ca69a1c12d99b547627a4db4b81cf86374eb97a1379962ba7", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/game/src/Makefile": "2120e4351742d6be69f8db9425356cdb76d2d9da0e8f1c9876f02575fc7c94e1", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/db/src/CubeRuntime.cpp": "d431f12bcb0216729e0faf0db6fd3fa1cc102015ff67868da6314fbb0eaf51b2", + "/root/deploy-features/cube-outbox.405sXZ/build-root/src/server/db/src/Makefile": "4092f08089b2d2f15b4dd20008fd661c8f2abda9603ce97e3b22f30327ce2d27", + "/root/deploy-features/cube-outbox.405sXZ/build-root/tests/features/fixtures/cube_outbox_probe.cpp": "a2c3c969b68633f3b8e842ebbc473aee18e3cef6299e9c27095b04f317be8326", + "/root/deploy-features/cube-outbox.405sXZ/build-root/tools/cube/test_mysql.sh": "8ffa0bb92f434a5e20c18582402bf2f1646f3e588eb829d94671b340bcbbe7b1", + "/root/deploy-features/cube-outbox.405sXZ/bin/game": "eee96d1f8a4e1f24ed696572b6a8993b14ed4e9f349fcd19ec192d966677fac3", + "/root/deploy-features/cube-outbox.405sXZ/bin/db": "83587a1264ac2734e81ed3448925f4c3d8968f594aa95d5d4e9714e44f370d11", + "/root/deploy-features/cube-outbox.405sXZ/game-build.log": "d568b1ef1be4a73d984e85d07b6c1e82a71d7dedd8ed811c40f67d168d6a83f9", + "/root/deploy-features/cube-outbox.405sXZ/game-final.log": "e379fb61e4643aad55de1c5e151589d8a2e9b70efe6477d72e38ad842dd299b0", + "/root/deploy-features/cube-outbox.405sXZ/db-build.log": "ff10bc6a56f99e162e0cd3a6ba8c9954ae21b34a7a4f305628cdffca755e9451", + "/root/deploy-features/cube-outbox.405sXZ/mysql.log": "deb4c9b976c3843235574325763d0d8e80207debb5a6b021e3a7639ce6fe31e3", + "/tmp/ch5-cube-mysql.XYY57Q/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.XYY57Q/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.XYY57Q/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.XYY57Q/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca" + }, + "tests": { + "summary": { + "pass": 131, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "source_changed": false, + "release_ready": false, + "unittest_cases": 391, + "top_level_probes": 33, + "report": "build/ch5-tests/20261023-cube-outbox-final/report.json", + "local": "ASan/UBSan actual ground-gold helper, extracted original PickupItem gold branch and actual GoldAck handler; explicit actor/item/entropy/audited-gate substitutes; source write-before-remove, no local GiveGold/Save, ordinary behavior, party/distance/ownership denial, uncertain cross-player quarantine, handle/session/cookie ACK identity, no thaw", + "journal": "Real file locks/codec, short/EINTR/partial writes, claim/ACK/initial fsync failures, corrupt/torn records, oversized file, hard/symbolic links; separate-process exits after real claim/ACK fsync; restart restores pending and sequence history", + "sql_handoff": "Outbox CLAIM -> ambiguous Enqueue COMMIT -> restart/replay same body -> durable ACK -> verified DONE craft -> Apply once -> exact-image release. Tested with SQLite and actual MySQL; this uses explicit actor/SQL ownership fixtures, not a real game freeze.", + "actual_db_route": "Original authenticated peer/login/handle/session/cookie and batch binding; disabled actual ingress, stale identity, ambiguous commit, repeated/conflicting event, incoming forged GoldAck and missing restart binding refuse or retain pending without extra currency", + "native_source_matches": 13, + "native": "Fresh .cube-outbox-game-obj and .cube-outbox-db-obj, -j2 sequential full game/DB compile+link; actor explicitly rebuilt/relinked afterward against final outbox header. Internal platform libraries inherited, not full clean-library rebuild.", + "native_root": "/root/deploy-features/cube-outbox.405sXZ", + "mysql_root": "/tmp/ch5-cube-mysql.XYY57Q", + "mysql": "Dedicated no-defaults socket-only MySQL ran actual base/addon DDL, base/lifecycle/gold/outbox fault+crash+duplicate scenarios, actual libsql FIFO and explicit v1 upgrade probes; script shuts down only this dedicated instance and retains evidence", + "warnings": "Legacy Makefiles retain -w; not strict-warning/type-safety certification", + "client_native": "Not rebuilt this batch; no client runtime/action/capability change", + "android": "Not run", + "live": "Not run. No production deployment/restart/config/asset/SQL mutation or forced logout", + "encoding": "char_item.cpp byte-for-byte equals pre-pull preserved stash after reversing exact new gold-pickup/save replacements; original encoding and previous dirty edits retained", + "post_regression": "Only this evidence JSON added after final unified regression; runtime/tests/docs/manifest unchanged" + }, + "contracts": { + "source": "Only submitted held non-party PC after original distance/ownership check and current binding/lifecycle/actual ground-gold validation. Ordinary GiveGold/group distribution path unchanged. No generic PointChange diversion.", + "durability": "Core-private cube-gold-outbox/journal, CGO1 fixed 166-byte LE frames, exclusive lock, O_NOFOLLOW, regular single-link current-owner non-group/world-write file, initial file/lock/directory fsync; CLAIM/ACK fsync before success. Checksum is corruption detection, not authorization.", + "identity": "Random 128-bit event ID canonical positive intent account/player/epoch/owner/request/sequence, persisted with session/cookie/handle and ground VID/vnum/map.", + "source_order": "Fsync CLAIM -> synchronous source removal/destroy, no local GiveGold or stale player Save. Failed/uncertain append does not remove pile and quarantines VID even against other actors. Pure pre-write refusal does not quarantine.", + "limits": "1024 intents per batch, 8192 historical claims and 16MiB log; ACK history retained, no automatic compaction/cleanup. Conservative gold headroom includes pre-craft wallet and all recorded batch credits.", + "wire": "Internal unreleased header78 GoldEnqueue7/GoldAck8, GoldStored8/GoldApplied9; 102-byte prefix +129-byte intent =231 bytes. Game/DB must match. No client crafting capability.", + "ack": "Only DB immutable Stored/Applied is acknowledged. Game validates body/handle/session/cookie and fsyncs ACK; it does not apply currency or authorize thaw.", + "retry": "At most two pending deliveries per three seconds, round-robin; stable body/event on all retries. Outbox only opened/replayed when both ingress/audit gates permit and DB is connected.", + "restart": "Local pending/history recover, but DB/game restart, owner/peer/session change is NOT auto-adopted; original runtime binding required. Retain pending evidence for trusted reconciliation.", + "gates": "HandshakeEnabled=false, ActorMutationAuditComplete=false, modern craft macro remains off; no real source path activated and no live Prepare/Execute/Apply/resync/release hookups" + }, + "not_complete": [ + "Trusted durable owner adoption/reconciliation after game/DB restart, peer loss or cross-core handover", + "Source-close/drain barrier before Resync: SQL queue empty cannot exclude local not-yet-enqueued intents", + "ABORTED wallet reconciliation and complete actor quiescence across setters, item/EXP/expiry/global/server callbacks", + "Other gold sources and party distribution retention", + "Online reward factory/ID allocation, actual Prepare/Execute, authority image apply/exact ACK/thaw", + "Copy attributes, success-rate items and matched real-server/Android acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-owner-20261023.json b/audit/xxf-ch5/cube-owner-20261023.json new file mode 100644 index 00000000..4cbbd3ec --- /dev/null +++ b/audit/xxf-ch5/cube-owner-20261023.json @@ -0,0 +1,121 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_DURABLE_AUTHORITY_AND_HELD_ADOPTION_NO_RECOVERY_THAW", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_owner.h": "929b4837a8f33c6a54fcdacecbdffaa9244d57786f94f84d9885a0a06fc9e359", + "src/server/common/cube_owner_types.h": "78b4f829fc78771423f1ea2c87117328cbd0b05f2ef3a20263b951556514ab75", + "src/server/common/cube_fence.h": "48098e4f363e1e577cd3d41d8d88ac16dcca585c635823650479810b2b06d680", + "src/server/db/src/Cube.cpp": "52558b6413fa7f072528637ccede622a06d5a47499362fd1a4315d7deba49329", + "src/server/db/src/CubeRuntime.cpp": "3cce871a74c72380c3a6368ad16bbd33791e34cd929fc309699be1db3b34a293", + "src/server/db/src/CubeRuntime.h": "03398f5cac8eb9c8d5e85d8e53715435be43cb8117f378fd703ac8fd59f69aa3", + "src/server/db/src/ClientManager.h": "4bffd70b1e1f10e0e8e2b76f3a0a995d7436138b9d8e8d7ae8665a1c7616d5e3", + "src/server/db/src/Makefile": "4b682d16a9e93f21332498c4efae7021ddc4199ffa124e172fc215748b8f09d0", + "tests/features/fixtures/cube_batch_probe.cpp": "68a53c09055d3ddf972a4cce376b141d9dd02b08c1292d8cb5dfbfe85f41c43d", + "tests/features/fixtures/cube_owner_probe.cpp": "fc4dc4b1d09967b452a3bdbf9f523c00691361b0198765dbd4f95c5a17704bdb", + "tests/features/test_cube_owner.py": "0df3b27554b4368cdef583ab55332df86e6626473323722a02d33361834f191f", + "tests/features/test_cube_runtime.py": "3da53fcd5f020eccdecdba81b58b28ea2d9cb00a323d29528f8d63493f2cd8c5", + "tests/features/test_cube_db_guards.py": "8c83645ea5ff85c96afcb0727ae33c78c779761006f741d23d43007ebfb1ed3b", + "tools/cube/owner-schema.sql": "938b897df7c2d2bb7d2364d49b32542f24438166b59716bc478dc477fcf146a3", + "tools/cube/test_mysql.sh": "ab3b4b80839acc4dc45caab5269d1965a3578e30168d8a6d6b306d557e0df3ab", + "tools/cube/README.md": "6a8097bf275ae4407625eeb302570edd8e8fd7c9ccc97d4a6411952c49d5408d" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "79df0d9bc5e1415835610a1e1c9745b5bdac7c3b1a5ab5f30dcd7db19a190757", + "scripts/build_xxf_features_json.py": "d93921c1fa9726505fefae94a36f48280a94da03e3306fbac10ef7abedeec2ae", + "audit/xxf-ch5/features.json": "f5e59bfe3c11f2164cebb6e01a661b3e2aaa09ec88dbefc1dc45403423ce0289", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "440bad9336c798c5ec8a06ddd767326026b9de3337905ae157893cee7e5e5100", + "docs/XXF-CH5-CUBE-OWNER-20261023.md": "a60204f70895bb323efdb6d7b04d2484c40ccc7796864a3f1c3c66dc3ab50c4f", + "build/ch5-tests/20261023-cube-owner/report.json": "ac28d0fe97cd92339083a51dedc05c18399b143ee1c9c4e233a3e36ad99bfccf" + }, + "freebsd_selected_source_sha256": { + "src/server/common/cube_owner.h": "929b4837a8f33c6a54fcdacecbdffaa9244d57786f94f84d9885a0a06fc9e359", + "src/server/common/cube_owner_types.h": "78b4f829fc78771423f1ea2c87117328cbd0b05f2ef3a20263b951556514ab75", + "src/server/common/cube_fence.h": "48098e4f363e1e577cd3d41d8d88ac16dcca585c635823650479810b2b06d680", + "src/server/db/src/Cube.cpp": "52558b6413fa7f072528637ccede622a06d5a47499362fd1a4315d7deba49329", + "src/server/db/src/CubeRuntime.cpp": "3cce871a74c72380c3a6368ad16bbd33791e34cd929fc309699be1db3b34a293", + "src/server/db/src/CubeRuntime.h": "03398f5cac8eb9c8d5e85d8e53715435be43cb8117f378fd703ac8fd59f69aa3", + "src/server/db/src/ClientManager.h": "4bffd70b1e1f10e0e8e2b76f3a0a995d7436138b9d8e8d7ae8665a1c7616d5e3", + "src/server/db/src/Makefile": "4b682d16a9e93f21332498c4efae7021ddc4199ffa124e172fc215748b8f09d0", + "tests/features/fixtures/cube_batch_probe.cpp": "68a53c09055d3ddf972a4cce376b141d9dd02b08c1292d8cb5dfbfe85f41c43d", + "tests/features/fixtures/cube_owner_probe.cpp": "fc4dc4b1d09967b452a3bdbf9f523c00691361b0198765dbd4f95c5a17704bdb", + "tools/cube/owner-schema.sql": "938b897df7c2d2bb7d2364d49b32542f24438166b59716bc478dc477fcf146a3", + "tools/cube/test_mysql.sh": "ab3b4b80839acc4dc45caab5269d1965a3578e30168d8a6d6b306d557e0df3ab", + "tools/cube/README.md": "6a8097bf275ae4407625eeb302570edd8e8fd7c9ccc97d4a6411952c49d5408d" + }, + "freebsd_artifact_sha256": { + "/root/deploy-features/cube-owner.qlOExe/bin/db": "14fc3323732a1f0e680b7a036c6b9ace98ffe74e2f0d6ebc4ddb9c59d1742b20", + "/root/deploy-features/cube-owner.qlOExe/db.log": "c519801fe3f032538c2bc3666be28534c7d79be161751fb4cbc101df10337dca", + "/root/deploy-features/cube-owner.qlOExe/db-final.log": "517c4ca291c23fe44442c3e6a9401276791d3a6cc9bd5f01fb82af8d38e425c2", + "/root/deploy-features/cube-owner.qlOExe/mysql.log": "bbe080f3ec401a6bff83968a843c5b2f61a22e3d7a258afa53a1f710eabbdc80", + "/root/deploy-features/cube-owner.qlOExe/mysql-final.log": "a60c42e3a8f00d6d5884a2e75c80adf572c377b4b3eda3af56bc62536eb29361", + "/tmp/ch5-cube-mysql.8q8CPV/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.8q8CPV/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.8q8CPV/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.8q8CPV/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.8q8CPV/owner-result.log": "3a8709fb25d7e0882d411c37657b60dee74df77bd1ed6224167dbb42640600a7", + "/tmp/ch5-cube-mysql.8q8CPV/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/tmp/ch5-cube-mysql.8q8CPV/cube-owner": "ce018aa9ebae379a973646eeca7fe7ade179bef2bf3b10fa581a7d37fd6ecae3", + "/tmp/ch5-cube-mysql.8q8CPV/upgrade-refused.log": "e2fa15a609a73b5cc6e0129306cf4cb8497d728a8cf9510c717c1d29f550d7f1", + "/tmp/ch5-cube-mysql.8q8CPV/gold-upgrade-version-refused.log": "af2da00062a1f9caf711614d3715a3b57b634df9cc70aeea9ce3ef8a0ef04d68" + }, + "tests": { + "summary": { + "pass": 133, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "source_changed": false, + "release_ready": false, + "unittest_cases": 393, + "top_level_probes": 33, + "report": "build/ch5-tests/20261023-cube-owner/report.json", + "local": "ASan/UBSan actual authority backend and actual DB methods with explicit SQLite session/advisory, peer/cache/FIFO substitutes; per-SQL bind/revoke/adopt failure and warning, ambiguous commits, transaction process exits, fresh-session authenticated held recovery, original sealed source and applied/pending wallet prefix; isolated lease ordinary-save/load guards.", + "mysql": "Dedicated socket-only no-defaults instance with actual DDL; real two-connection advisory lock competition/disconnect/generation, base/lifecycle/gold/outbox/source/owner probes, libsql FIFO, base and gold-addon upgrades; final source rerun successful and socket gone after shutdown.", + "mysql_root": "/tmp/ch5-cube-mysql.8q8CPV", + "earlier_mysql_root": "/tmp/ch5-cube-mysql.UcAraI", + "native_root": "/root/deploy-features/cube-owner.qlOExe", + "native_source_matches": 13, + "native": "Fresh .cube-owner-db-obj DB build/link using inherited platform libraries (read-only referenced extern/lib directories). Final DB layout/runtime rebuilt after last source changes. No new game/client/Android native acceptance.", + "repair": "First native build exposed legacy false macro / lambda inferred return-type mismatch in Cube.cpp; explicit ->bool fixed it. First build log retained, final build passed.", + "warnings": "Legacy -w remains. Earlier rebuild emitted host/source clock-skew warning; final fresh-layout rebuild passed. No strict-warning or full dependency-library rebuild claim.", + "deployment": "No production deployment/restart/migration/player writes. Only disposable partial copy in this newly created isolation root removed to recover disk; previous artifacts/source untouched.", + "post_regression": "Only this evidence JSON added after final local regression; runtime and prior documentation/manifest hashes unchanged." + }, + "contracts": { + "schema": "Base Cube v2 + gold-addon v2 + separate optional owner-addon v1, three InnoDB tables; actual Arm requires all. Explicit maintenance install only; no manufactured leases for legacy holds.", + "authority": "One per-database connection-scoped advisory lock and canonical boot nonce; generation advances on new boot or actual SQL connection. Acquire never recursively re-locks same held connection. Current operations revalidate in the pinned connection scope; queued old generation cannot finish drain.", + "atomic_binding": "Fence.Begin, item locks/reservations and immutable owner lease commit under the same account transaction. Exact replay validates original row; no missing-row repair.", + "revocation": "Only trusted peer/account-lifecycle callbacks, or strictly newer broker generation, may persist revoke. Packet Invalidate, elapsed time and transient SQL error are not trusted lifecycle proof.", + "adoption": "Authenticated current peer, non-playing account and player membership; persisted revoke, fresh session, original clean fence, exact original sealed-source manifest, verified DONE and applied/pending credit prefix/current wallet. No reroll, implicit Execute/Apply, money write, normal player load or thaw. Lost ACK returns original persisted grant.", + "holds": "All LIVE/REVOKED/ADOPTED leases deny ordinary saves/account loads including orphan ledger. Legacy Fence.Release refuses registered leases even on duplicate release. No owner terminal cleanup/release API yet.", + "gates": "HandshakeEnabled=false; ActorMutationAuditComplete=false; ENABLE_CUBE_RENEWAL_WORLDARD=0. Capability4096 remains read-only." + }, + "not_complete": [ + "Public recovery transport and core boot/old actor/cache revocation; second disconnect of adopted owner", + "Owner-aware authoritative image application/exact ACK/thaw and terminal owner release; all registered owners deliberately stay held", + "Bounded main-loop revocation retries/performance before enabling live traffic", + "Other task/item/EXP/expiry/direct setter/global/party mutations and durable deferral/quiescence", + "Unsealed crashed source recovery and ABORTED reconciliation", + "Online factory/permanent IDs, Prepare/Execute/Apply wiring, copy/success-rate items", + "Matched live game/db and Android device acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-presentation-20261023.json b/audit/xxf-ch5/cube-presentation-20261023.json new file mode 100644 index 00000000..f3cdb4c1 --- /dev/null +++ b/audit/xxf-ch5/cube-presentation-20261023.json @@ -0,0 +1,166 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_ACKNOWLEDGED_ACTOR_PRESENTATION_AND_FULL_COUNT_NO_EVENT_SAVE_RESUME_OR_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-release-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_presentation.h": "77dc70d969d38bcc5f1caf127acca5958c86491a64ad38cb85613d15a21c506f", + "src/server/game/src/port_cube_publish.cpp": "a7fe37e205986ae98667d26485afd060d926416d64b69bf2f7da608de1a9cdc9", + "src/server/game/src/port_cube_publish.h": "6a0ada546f607b6b42feca82e0c27db116f64bc8f6c2acf49be5a829925cbe13", + "src/server/game/src/port_cube_actor.cpp": "e90db3d20c0949dd7fc14145106c6e935b8a1ae9fe0b5edf64aeb0442f4f5df5", + "src/server/game/src/item.cpp": "0f35f66a18ebee62587b8f01a89ce2c710cb82b110a3fbc691b0038101f93e2d", + "src/server/game/src/char.h": "9d7873407d0c6fc191c9135ff6e2725f8e8eec5ced4ed0e669838278653668dc", + "src/server/game/src/Makefile": "f5646e7fb7a8b5bc94bff1152c8d3e8c509cb0ea25fc43435414f11a9659f1ac", + "tests/features/test_cube_craft.py": "513cab79b1db9fb5039f5bd27e2b53e3f8602f4a17ef45c5afd7964a79255e44", + "tests/features/test_cube_handshake.py": "6a89a08374fc2bf8cabd23389c9d6eadd0aa2e4142cb9760ba28d546f9e53637" + }, + "client_source_metadata_sha256": { + "src/port/common/CubePresentation.h": "77dc70d969d38bcc5f1caf127acca5958c86491a64ad38cb85613d15a21c506f", + "src/port/UserInterface/GameType.h": "caf9b0dc4a154e2e3c896246fdbeff33235006e0b6bbafcb199a9546690b1e03", + "src/port/UserInterface/PythonPlayer.cpp": "23fdcefa38b5ea476d01a4b09ab036e0bdcb261aa2508b2928fcfa1ca862e164", + "src/port/UserInterface/PythonPlayer.h": "041a541acd3a58499ccdae5acbcbe9021f4df95ce43409e733e13728d3a2ded2", + "src/port/UserInterface/PythonPlayerCubeView.inc": "9ef1b1ef9a4f7f7b83297edd0ddbf3e565d29ebee0b5bc9a3b5942bea38b011f", + "src/port/UserInterface/PythonSafeBox.cpp": "c938655b1f80f8059f10b823d834e1f1132be0a2703dcb2a7590fe21467ccd36", + "src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp": "e55b65ec8ec2f48c01dfaff9c1778400f074e194f835caf4381b40e225b3d72b", + "src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp": "9f214ad37f6596b62fac0f00fb5e4cfade9a9fd621b699ac737b69f0862d2d92", + "tests/wiki/test_cube_presentation.py": "3b37eaa2db2472d73ce8ee4824631c86272cd28deb6f50c3421463f782a8ee06", + "scripts/build_xxf_features_json.py": "398d224f5c901bbf4eb08db9703cc7a7fed9a7a67b9b5c6e57b50639f5fdc53f", + "scripts/test_xxf_all.py": "2aae64e3b54fe2ca212ecfec4f8ce6e8b39c8f804339b83f8c1d4547b8fa16d5", + "docs/XXF-CH5-CUBE-PRESENTATION-20261023.md": "ae652f6899842d4cadf0064ebed99a71777e86a85cd5fea71f915becf82d2263", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "e80ad180afd954c2296124326c2cc621e3158dd728155eef36bdc0dc96dba807", + "audit/xxf-ch5/features.json": "e9a3eaeb0dbec43f168cc3e086c016d82c8adc161d8ed0707d855032dcad46f9" + }, + "implementation": [ + "Identical two-repo GC93 op11 bounded LE presentation codec: epoch64/gold64/normal225/full counts/all69 metadata/quickslots36; body132..27582, total<=27587", + "Actual Start/Begin reject unsupported presentation revision before entropy/ID/SQL work; >=mt20261025 only; old native version remains on existing op10 item-extra fallback", + "Actor captures original36 quickslots before install; durable ACK then existing joint round-robin max2 craft/image/ACK/presentation jobs per tick, full applied seal checked before/after", + "Actual server publisher validates current owner/cell/ID/display-vnum/count/flags/sockets/attributes/raw69 and original-or-planned shortcut state, serializes before mutation then enqueues one packet, checks GAME phase after enqueue; no Save/RNG/events or thaw", + "Shortcuts rebind by permanent ID; consumed/empty original targets clear even when reward occupies same cell; skill/emotion/other-window shortcuts preserved; retries use original captured bindings", + "Actual client stages all225 rows and validates complete proto/grid/stackability/shortcut plan before POD inventory/shortcut/gold64 commit; other windows/gear/status/page untouched; UI refresh flags set only afterward", + "Client stores epoch+canonical bytes, exact duplicate does not reapply over subsequent updates, stale epoch ignored and conflicting same epoch refused; player Clear resets guard", + "Internal client TItemData.count widens to DWORD only in memory; classic BYTE wire records unchanged; op12 full count+raw69 companion on existing PortItemExtraSend paths for rev25, count1..2000 and current nonzero-ID conflict checks", + "Name display is bounded without overwriting raw metadata; legacy op10 sanitizer unchanged", + "Published means validated server enqueue, NOT client receipt/rendering; game still no22 sender, save/events paused, actor and DB resume holds remain" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-presentation-verified/report.json", + "report_sha256": "773d8c7a388052b95a60fdecc1d2eb021e82c2614104e192bdd96ccaa3d5026b", + "files_pass": 137, + "unittest": 411, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "new_presentation_tests": 3, + "coverage": [ + "ASan/UBSan real mirrored codec/Rebind: empty/full225, count2000, signed32/16 metadata, raw69, full range/truncations, duplicate/invalid counts/IDs/gold/shortcuts", + "Actual client player commit+GC93 receiver with explicit proto/player/transport boundary: missing proto, physical overlap, invalid shortcut, gold64, untouched gear/page, exact/stale replay without rollback, conflict refusal and full-count identity guard", + "Actual server publisher and actual PortItemExtraSend body with explicit descriptor/item/actor boundary: version refusal/fallback, enqueue exception and deterministic retry, current data/shortcut refusal, count2000/raw69", + "Actual actor apply/Tick probes extended for original shortcut capture, ACK->single publication with hold retained and unsupported Start before entropy/IDs", + "Initial old snapshot harness missed new codec include; include added without removing original assertions; synthetic server attrs initialized for deterministic fixture" + ], + "not_claimed": [ + "Complete actor quiescence and external references audit", + "Actual rendered UI or matched live game/DB socket acceptance", + "Expiry event/saving restoration or resume/thaw", + "All full-count action packet semantics", + "Android install/device acceptance" + ] + }, + "native_server": { + "root": "/root/deploy-features/cube-view.u4iBuI", + "script": "native-build.sh", + "script_sha256": "4b31f3fc3479e9c3eff466c5d2832ea034e1c102900d4b6e0235bffb46aae252", + "scope": "Actual port_cube_actor/port_cube_publish/item translation units compiled, linked matched previous release/apply objects; no whole-object rebuild, no DB rebuild", + "instance_or_internal_db_wire_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "selected_source_files": 7, + "game_sha256": "4c50891828e2ed02bc67f3894d5740b7ab1b5cdaf19681ed4ab80adba3e19248", + "empty_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game_or_db_daemon_started": false + }, + "native_client": { + "internal_player_data_layout_changed": true, + "classic_wire_struct_layout_changed": false, + "revision": "mt20261025", + "macos": { + "architecture": "arm64", + "commands": [ + "cmake --build build/native --target port_platform -j2", + "cmake --build build/release --target mt_native_render -j2" + ], + "terminal_exit": 0, + "executable": "build/release/src/host/mt_native_render", + "executable_sha256": "a9498be948420d77d06bb64100d4d05a7509c2e119eade314ea58e2aa439090d", + "logic_library_sha256": "b799fd7cdc4f9d64cae17474ce665c0ec1d87bbf66e6e1a925338577325d9d73", + "platform_library_sha256": "f70c46cbd7a0c3e6012e0278b4d0558f462e0db9323c77b5c9479680a738cc06", + "platform_log": "/tmp/ch5-cube-view-client-build-verified.log", + "platform_log_sha256": "312f79c6d74743f1d2009cea99c8498bbf50b5d037ca8f904fec9a925903d3df", + "link_log": "/tmp/ch5-cube-view-macos-link.log", + "link_log_sha256": "aa99d5472950003787bf36ffa1c5c7ed5c49ef8450deabd902915406da5bc66c", + "launched": false + }, + "android": { + "abi": "arm64-v8a", + "api": 24, + "ndk": "27.2.12479018", + "commands": [ + "cmake --build build/android/app-build --target port_platform -j2", + "cmake --build build/android/app-build --target main -j2" + ], + "terminal_exit": 0, + "shared_library": "build/android/app-build/src/host/libmain.so", + "shared_library_sha256": "127b38274f877ff2e98b5232c1a78df036d3abf05f48631362f6bbb40a0cd955", + "logic_library_sha256": "e2a1904177d1e9096cf8fcae552e2b7730e5490fd6574dfaa108c89a8e6a7499", + "platform_library_sha256": "4cdb1cd5c6c93dfeff99aa0ea648e00e52a010d71d500ae2d57ef906222560b7", + "platform_log": "/tmp/ch5-cube-view-android-build.log", + "platform_log_sha256": "6805de4ece4327bfbe2e92402e4588f5df9ce2a2ef9bc170461467859e8ca797", + "link_log": "/tmp/ch5-cube-view-android-link.log", + "link_log_sha256": "95e9f5ba1d6fa54b65c7d4866abea3aea4cbe2b92c6658fe0d71471434d6c3ca", + "apk_built_or_installed": false, + "device_acceptance": false + }, + "build_notes": [ + "Existing non-void-return/endif warnings remain; no new warning-free claim", + "Initial native-build target mt_native_render unavailable because that cache disables host rendering; used already configured release host cache instead of reconfiguring it", + "Initial client snapshot adapter used unavailable server shortcut names/helpers; corrected to actual client SLOT_TYPE/range constants; final macOS and Android builds pass" + ] + }, + "operations": { + "db_or_sql_sources_changed": false, + "mysql_rerun": false, + "production_deployed": false, + "production_restarted": false, + "production_migrated": false, + "player_assets_modified": false, + "git_commit_or_push": false, + "material_deletions": false, + "remaining_server_disk_mb": 118, + "next_native_run_must_check_space": true + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "client_craft_enabled": false, + "release_ready": false + }, + "remaining": [ + "Restore normal saving and correct absolute/remaining expiry semantics without redrawing/resetting accepted metadata, then actual release-readiness/send/DB resume/thaw", + "Extend/audit BYTE count-bearing action packets and regular update timing before claiming all2000-stack gameplay support", + "Complete actor quiescence/durable deferred legitimate mutations/external references audit", + "Old-core revocation, complete character/other-window recovery, PREPARED/ABORTED/non-ok DONE reconciliation", + "Copy/rate item rules, public craft/capability UI, matched presentation/live game and Android device acceptance", + "After Cube closes: Won, Wolfman, Conqueror, five character slots in that order" + ] +} diff --git a/audit/xxf-ch5/cube-recovery-image-20261023.json b/audit/xxf-ch5/cube-recovery-image-20261023.json new file mode 100644 index 00000000..4bfe7474 --- /dev/null +++ b/audit/xxf-ch5/cube-recovery-image-20261023.json @@ -0,0 +1,128 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_OWNED_GOLD_NORMAL_INVENTORY_IMAGE_NO_CHARACTER_APPLY_ACK_OR_THAW", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "previous_checkpoint": "audit/xxf-ch5/cube-recovery-wire-20261023.json", + "server_source_sha256": { + "src/server/common/cube_image.h": "14d6900f617b78d46b107e320838dc2cd3bd69afa213be453c0c2e1be8a7fca1", + "src/server/common/cube_owner.h": "2c3329b72049984cb1eaeb58eea16ff8270181fa042a153740110c1ee86cf3bf", + "src/server/common/cube_fence.h": "c9223e45e43d1c7d99ca401947c82f966c8ac6a7c9b7be124ccf1f92918a023b", + "src/server/common/cube_handshake.h": "1ceeb5bc8dc478f73df3ff68cf1b23fe328db72fc8f39530e8f8f75f3000e26e", + "src/server/common/cube_recovery.h": "8e6f633af5a80aab84f6ef5f5d159af4ce43b6a355dc95c4121798a71d0b09b7", + "src/server/db/src/ClientManager.h": "a4f44f165b490dd5f59eb120c6fb3ebb7abb72d4c0a2f655106c99f6a27fb9db", + "src/server/db/src/CubeRuntime.cpp": "7081a926f3ac85cd13cc36f2e1ef1809965b8aea2ad5da77d84057cef05e5c9e", + "src/server/db/src/Makefile": "21469974b2f5662269c4a2c33ad27bedd9ad1545c2ac1c6e8c182e43a0172703", + "src/server/game/src/port_cube_recovery.cpp": "6aa02d1d44a3c47da1274f4f69793bf183bd177114bb02677a76bec3d2843459", + "src/server/game/src/port_cube_recovery.h": "0bad689c50dcd03fce9f1f4a5e38cfdf550cc4e2afd265ca2f696fdf16968b63", + "src/server/game/src/input_db.cpp": "eec30217ebcafd2792513c6c7b0e067b87f110e70430016f69e17f46579fe5e5", + "src/server/game/src/Makefile": "676cd58f166ea149d5da6b1e244b0f304a8b7f946962fa9c718f342605792d2e", + "tests/features/fixtures/cube_owner_probe.cpp": "b417c2f200e694385b11cbb758ef345ac3d26cc1562124ebc8d5ce6d612b1421", + "tests/features/fixtures/cube_image_probe.cpp": "08a5a3b776748408d688e96eb6c19cda1f49c63b9db5dd31ea3071adaa115b4c", + "tests/features/test_cube_image.py": "0db9e63a237de864af36238945ec15a7ef69d570d54860c896512f4b3cf05220", + "tests/features/test_cube_recovery.py": "3434e7da6d722d25123f4a1b2f98b3567cb609852cac3d7d53192349d0889553", + "tests/features/test_cube_runtime.py": "3b55bfa2e871a12e6e103e07707d689590a9d58c0869c08901dbe0c372064b82", + "tools/cube/test_mysql.sh": "13efdf092b063b5aecac56169cfcd50219eea0f1cdfe9fa6367e22dc55524c69" + }, + "client_metadata_report_sha256": { + "scripts/test_xxf_all.py": "19cfbaab6f94a1203979e97138370594616dc2949205eb0b2a563eacd503658a", + "scripts/build_xxf_features_json.py": "3956ec24091dd0e975fb4a4671522c949b33183628c0c1a12cff7a61cf424b7e", + "audit/xxf-ch5/features.json": "0e130e47e05e43e260b651c4f7160e52822c28ac6c9847ef2008808ef19347dc", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "33fbf5c2325d6e8bfed3a89848c0ab3ab92f62513eaa6bf6b98214e593ed2387", + "docs/XXF-CH5-CUBE-RECOVERY-IMAGE-20261023.md": "cc4835c354608544f475394ae3593247555155d1f029c93ea205f983c2df5abc", + "build/ch5-tests/20261023-cube-recovery-image-final/report.json": "365fad0b4d5988d326813963af61ef4ba46b505b2abbb50a76fbd209830172ee", + "build/ch5-tests/20261023-cube-recovery-image/report.json": "5c7dbdaf0d6f0539df646373806d6712a896e9a232563f6536321098637a8b3d" + }, + "freebsd_selected_source_sha256": { + "src/server/common/cube_image.h": "14d6900f617b78d46b107e320838dc2cd3bd69afa213be453c0c2e1be8a7fca1", + "src/server/common/cube_owner.h": "2c3329b72049984cb1eaeb58eea16ff8270181fa042a153740110c1ee86cf3bf", + "src/server/common/cube_fence.h": "c9223e45e43d1c7d99ca401947c82f966c8ac6a7c9b7be124ccf1f92918a023b", + "src/server/common/cube_handshake.h": "1ceeb5bc8dc478f73df3ff68cf1b23fe328db72fc8f39530e8f8f75f3000e26e", + "src/server/common/cube_recovery.h": "8e6f633af5a80aab84f6ef5f5d159af4ce43b6a355dc95c4121798a71d0b09b7", + "src/server/db/src/ClientManager.h": "a4f44f165b490dd5f59eb120c6fb3ebb7abb72d4c0a2f655106c99f6a27fb9db", + "src/server/db/src/CubeRuntime.cpp": "7081a926f3ac85cd13cc36f2e1ef1809965b8aea2ad5da77d84057cef05e5c9e", + "src/server/db/src/Makefile": "21469974b2f5662269c4a2c33ad27bedd9ad1545c2ac1c6e8c182e43a0172703", + "src/server/game/src/port_cube_recovery.cpp": "6aa02d1d44a3c47da1274f4f69793bf183bd177114bb02677a76bec3d2843459", + "src/server/game/src/port_cube_recovery.h": "0bad689c50dcd03fce9f1f4a5e38cfdf550cc4e2afd265ca2f696fdf16968b63", + "src/server/game/src/input_db.cpp": "eec30217ebcafd2792513c6c7b0e067b87f110e70430016f69e17f46579fe5e5", + "src/server/game/src/Makefile": "676cd58f166ea149d5da6b1e244b0f304a8b7f946962fa9c718f342605792d2e", + "tests/features/fixtures/cube_owner_probe.cpp": "b417c2f200e694385b11cbb758ef345ac3d26cc1562124ebc8d5ce6d612b1421", + "tests/features/fixtures/cube_image_probe.cpp": "08a5a3b776748408d688e96eb6c19cda1f49c63b9db5dd31ea3071adaa115b4c", + "tools/cube/test_mysql.sh": "13efdf092b063b5aecac56169cfcd50219eea0f1cdfe9fa6367e22dc55524c69" + }, + "freebsd_artifact_sha256": { + "/root/deploy-features/cube-recovery-image.5bISSS/bin/game": "74fdf5e4ff2025ce6a00d0a8e3a58252636755081a95e0234de2e606a2ac2f59", + "/root/deploy-features/cube-recovery-image.5bISSS/bin/db": "20af1df930e27edf7b4c5b8ea428c1a232c2c563eb7ec6286275c935bb55e3a9", + "/root/deploy-features/cube-recovery-image.5bISSS/game.log": "b2ccd86e095dcbf4ee3f173e797b19ef16f035ca3b8bce6e6cdd6c4be640069f", + "/root/deploy-features/cube-recovery-image.5bISSS/db.log": "222e377cad5663fcdb2908e66890c3d3ab4bf9593e7074edb2a8c306d41f45d5", + "/root/deploy-features/cube-recovery-image.5bISSS/mysql.log": "293a979e3315e9071b7ede4df837b4c024b61bb3f71e01507c011f99ac9d8773", + "/tmp/ch5-cube-mysql.Eb126j/image-result.log": "a5a36a8b40b78ec8ee46b2747c9a06c04974e71d925fc3e85731c8681b405913", + "/tmp/ch5-cube-mysql.Eb126j/owner-result.log": "037e0241d73fe4a53b10d46f5531bc09a1db005cf6d2dc97322c8b83db9212fc", + "/tmp/ch5-cube-mysql.Eb126j/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.Eb126j/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.Eb126j/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.Eb126j/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.Eb126j/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/tmp/ch5-cube-mysql.Eb126j/cube-image": "d55a4fffc9add5af5bb82805e7b22138af02585d0d08b30e0dff5ec90ac084d9" + }, + "tests": { + "summary": { + "pass": 135, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 396, + "top_level_probes": 33, + "source_changed": false, + "release_ready": false, + "report": "build/ch5-tests/20261023-cube-recovery-image-final/report.json", + "earlier_report": "build/ch5-tests/20261023-cube-recovery-image/report.json", + "earlier_scope": "First pass retained. Added refusal of unowned legacy Resync on registered leases, then reran all tests with final source in a new directory.", + "local": "ASan/UBSan owned image transaction with explicit SQLite dialect/session/advisory-lock substitutes. Actual game controller body with explicit audit/descriptor/proto/DB-send boundary; actual DB route body with explicit peer/cache/SQL FIFO boundary. No live socket or player acceptance.", + "cases": "Full canonical item/gold result from saved fixed draws and verified ok DONE; original sealed source and all-applied credits; zero-credit stale wallet; material/reward/socket/extra corruption; missing input/output/current-item locks and reservations; revoked/wrong grant; immutable saved image and legacy Resync refusal; each SQL failure/warning, rejected/lost COMMIT, process exits after image write and COMMIT/new broker adoption; zero-success paid result, pending/applied credit and non-ok DONE refusal; bounded image envelope, proto/grid, duplicate/conflicting responses, no load/ACK/thaw.", + "native_root": "/root/deploy-features/cube-recovery-image.5bISSS", + "native_source_matches": 15, + "native": "Fresh game/DB object directories, successful compile/link using inherited platform-matched dependencies, max two native compiler jobs. Game does not include cube_fence.h/cube_owner.h; the later legacy-Resync guard and fixture update were staged before fresh DB and MySQL builds. Not a whole dependency-library rebuild, strict-warning, active-gate or runtime/socket acceptance.", + "mysql_root": "/tmp/ch5-cube-mysql.Eb126j", + "mysql": "Dedicated no-defaults socket-only skip-networking instance: actual base/lifecycle/gold/outbox/source/owner/image probes and threaded libsql FIFO plus base/gold upgrades pass. Image probe covers transaction SQL faults, warnings, commit ambiguity and process crashes with actual MySQL. Socket absent after normal isolated shutdown.", + "cleanup": "Only previous task-generated .cube-wire-game-obj (291M) and .cube-wire-db-obj (44M) under /root/deploy-features/cube-recovery-wire.1PaNsl removed to recover disk; their source, binaries, logs and SQL evidence retained. Objects reproducible by rebuild, not recovered from trash.", + "deployment": "No production deployment/restart/migration/player writes. No new client/Android native or device acceptance.", + "post_regression": "Only this evidence JSON added after final local regression; runtime/tests/docs/metadata hashes unchanged." + }, + "contracts": { + "scope": "Gold and normal inventory only, not equipment/other windows/full character data. Bytes are retained on game, never applied to actor/assets in this batch.", + "transaction": "Fence.Resync owns account transaction, image SQL read and persistent RESYNC image commit. Same pinned connection callback checks current broker/ADOPTED grant, original source manifest, applied credits, verified ok DONE and recomputed settlement, expected full item bytes, wallet even with zero credits, all old/worst-output/current-owned ID fences and output reservations.", + "image": "Existing gold8+count2+max225*(reward114+cell2+usable1) canonical bytes, max26335. Usable1 is canonical format, not action permission. Proto/grid checked in DB and game.", + "wire": "Internal messages13 RecoveryImageRequest/14 RecoveryImageAnswer, ready status13. Request/Held body160 grant bytes; ready body grant160+length2+image, max26497, total frame26599. Existing prefix102/body maximum40000 unchanged.", + "replay": "Lost image COMMIT ACK yields Held and exact retry. Current owner's already-persisted RESYNC image cannot be overwritten by a different image; registered lease also blocks unowned legacy Resync. Old release still refused. No timeout unlock.", + "game": "Grant automatically schedules bounded image requests. Held preserves three-second retry delay. Exact duplicate image idempotent, same-grant conflict or bad proto/grid poisons recovery qualification. Getter returns retained bytes only; no character/item creation, money change, normal load, automatic ACK or thaw.", + "failed_batches": "Zero successes with ok paid settlement restores charged costs and no invented awards. Non-ok DONE/ABORTED/unsealed sources/unapplied credits remain held for reconciliation.", + "gates": "HandshakeEnabled=false; ActorMutationAuditComplete=false; ENABLE_CUBE_RENEWAL_WORLDARD=0; no new client craft capability.", + "schema": "Base Cube v2/gold-addon v2/owner-addon v1 unchanged." + }, + "not_complete": [ + "Full character and equipment/other-window controlled recovery data loading", + "Old core/actor/cache revocation, actual image application, exact ACK, persistent owner terminal release and thaw", + "Capability/version negotiation, select recovery UI and real socket fault/live tests", + "All mutation/reward quiescence or durable deferral, unsealed source and ABORTED/non-ok DONE reconciliation", + "Actual factory/permanent IDs/Prepare/Execute/Apply online wiring, copy/success-rate items", + "Matched live client/game/db and Android device acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-recovery-lifecycle-20261023.json b/audit/xxf-ch5/cube-recovery-lifecycle-20261023.json new file mode 100644 index 00000000..d4bdebfe --- /dev/null +++ b/audit/xxf-ch5/cube-recovery-lifecycle-20261023.json @@ -0,0 +1,101 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_PRELOAD_ADOPTION_LIFECYCLE_NO_GAMEPLAY_RECOVERY_OR_THAW", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "previous_checkpoint": "audit/xxf-ch5/cube-owner-20261023.json", + "server_source_sha256": { + "src/server/common/cube_owner_types.h": "0fd8159c05280505a64ebaf4a97e5989181d30fc1f3e8aab9667e2f128265414", + "src/server/common/cube_owner.h": "3c10a8344b8d10bbb1e79baef97d038783ec71a61e1ddd68164d22b27b6b81bb", + "src/server/db/src/CubeRuntime.h": "504c76772bae04b394307a1d86a924db509bb5674bc2ef76cc02b1450a3c10c7", + "src/server/db/src/CubeRuntime.cpp": "c920e8507392997c9a67994a78fb5cc8b05a31d5fba963a14330710747395ff7", + "src/server/db/src/ClientManager.h": "f05c8a6af0e94bed2caa63a8dee9015f6acbbdbb9dc3b33c5e90a624ca059cf0", + "src/server/db/src/ClientManager.cpp": "88205ebe4640273986f5f7150851cf5f133931260cba6c2e94a5af103741c419", + "tests/features/test_cube_runtime.py": "80215db88ef75c841bd3e1dc1bf81e59e56b7a052648fdaed020f8521ed2718b", + "tests/features/fixtures/cube_owner_probe.cpp": "28a7e710b2d4fd09bf2594830703e3aa34faf0ce8453ce6b00ab73552899ef33", + "tools/cube/README.md": "ed6db429ba6ce44c242e108583148d1ebc24200133ebcbf8ef659853454a2188" + }, + "client_metadata_report_sha256": { + "scripts/build_xxf_features_json.py": "1ec4fb1b9a524834cefbd3163ecf63cf7e6d61623ef4b193ddc3a7b67c620038", + "audit/xxf-ch5/features.json": "492311ee417d63fbb06e1f8b143391e74052e400c5c48c78953ef2166b1b6fdf", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "27efa2863a8a366c7c95861b0b47037b93ca567240337500a231451414a862a9", + "docs/XXF-CH5-CUBE-RECOVERY-LIFECYCLE-20261023.md": "aeb5b709c117c4922d8812f389482f06b3ea5a008bb689cc6e9bda56633dbaa7", + "build/ch5-tests/20261023-cube-recovery-life/report.json": "1f6c431b189a48a7aba8fd970ba749eb636b1e18587276885a0cb5295c81f426" + }, + "freebsd_selected_source_sha256": { + "src/server/common/cube_owner_types.h": "0fd8159c05280505a64ebaf4a97e5989181d30fc1f3e8aab9667e2f128265414", + "src/server/common/cube_owner.h": "3c10a8344b8d10bbb1e79baef97d038783ec71a61e1ddd68164d22b27b6b81bb", + "src/server/db/src/CubeRuntime.h": "504c76772bae04b394307a1d86a924db509bb5674bc2ef76cc02b1450a3c10c7", + "src/server/db/src/CubeRuntime.cpp": "c920e8507392997c9a67994a78fb5cc8b05a31d5fba963a14330710747395ff7", + "src/server/db/src/ClientManager.h": "f05c8a6af0e94bed2caa63a8dee9015f6acbbdbb9dc3b33c5e90a624ca059cf0", + "src/server/db/src/ClientManager.cpp": "88205ebe4640273986f5f7150851cf5f133931260cba6c2e94a5af103741c419", + "tests/features/fixtures/cube_owner_probe.cpp": "28a7e710b2d4fd09bf2594830703e3aa34faf0ce8453ce6b00ab73552899ef33", + "tools/cube/README.md": "ed6db429ba6ce44c242e108583148d1ebc24200133ebcbf8ef659853454a2188" + }, + "freebsd_artifact_sha256": { + "/root/deploy-features/cube-recovery-life.GSOyx6/bin/db": "7c25b1e134d97a982089160e7fab337b704a92a3e18b1fe2c8b743859954b40a", + "/root/deploy-features/cube-recovery-life.GSOyx6/db.log": "bc67f07f9f0f9ccfe686bd975ffbd61bda94e946a011f7d12ad6f12492c64abd", + "/root/deploy-features/cube-recovery-life.GSOyx6/db-final.log": "bc67f07f9f0f9ccfe686bd975ffbd61bda94e946a011f7d12ad6f12492c64abd", + "/root/deploy-features/cube-recovery-life.GSOyx6/mysql.log": "2a0e57131898040694ec4c83f32e4013ad047df49002e6450f462e76657a4243", + "/tmp/ch5-cube-mysql.XTQctx/cube-owner": "9cdfe7dd20b5b678aae887acceb3b490feee43bff4f8fc87cc4ee3f4fbb51f7f", + "/tmp/ch5-cube-mysql.XTQctx/owner-result.log": "037e0241d73fe4a53b10d46f5531bc09a1db005cf6d2dc97322c8b83db9212fc", + "/tmp/ch5-cube-mysql.XTQctx/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.XTQctx/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.XTQctx/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.XTQctx/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.XTQctx/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca" + }, + "tests": { + "summary": { + "pass": 133, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 393, + "top_level_probes": 33, + "source_changed": false, + "release_ready": false, + "report": "build/ch5-tests/20261023-cube-recovery-life/report.json", + "local": "Actual DB methods compiled with ASan/UBSan and explicit peer/cache/SQL FIFO/SQLite connection-lock boundaries: repeated held adoption, commit rejection/lost ACK, close before retry, proposal cookie reuse, durable non-ownership retirement, invalid logout, auth replacement, SQL warning/backoff, saturation, joint task budget/fairness and UINT32_MAX key.", + "native_root": "/root/deploy-features/cube-recovery-life.GSOyx6", + "native": "Fresh DB object directory and successful final layout/runtime rebuild/link with inherited platform-matched libraries. Eight selected source hashes match local. Initial -j2, final -j1 with local single-job regression. No new game/client/Android native acceptance; legacy -w not strict-warning verification.", + "mysql_root": "/tmp/ch5-cube-mysql.XTQctx", + "mysql": "Dedicated socket-only no-defaults skip-networking instance, actual DDL; owner probe repeats adopted-owner revoke/adopt with rejected/lost commit and warnings, preserves original source/single settlement and still rejects release; base/lifecycle/gold/outbox/source/owner and actual libsql FIFO plus base/gold upgrades pass. Socket gone after normal isolated shutdown. Actual DB runtime scheduler not executed against MySQL in this fixture.", + "post_regression": "Only this evidence JSON added after final local regression. No runtime, tests or prior docs changed afterward.", + "deployment": "No production deploy/restart/migration/player writes." + }, + "contracts": { + "tracking": "Successful adoption and Retry proposals retained as held pre-load runtime sessions; pre-load expects !IsPlay. No normal player load or action permission. Exact grant replay is refused once trusted invalidation is pending.", + "ambiguous": "A close before first retry can revoke a committed proposal. A pre-commit Retry reuses original cookie. Only durable revoke or reread non-ownership proof retires obsolete recovery memory; SQL lease/source/receipt/item fences survive.", + "callbacks": "Peer close marks sticky loss without SQL. Valid current-peer NUL-terminated exact-size logout and auth record removal/replacement mark account loss before identity reuse. Packet Invalidate is not lifecycle revoke proof.", + "scheduler": "One sorted 64-bit cookie+job-type circular work queue; at most two revoke/finalize jobs per tick. Five-second failure retry backoff. Counts jobs, not SQL statements or absolute latency. No timeout unlock.", + "adoption": "Repeated held revision chains retain original immutable source and verified DONE/wallet checks; no new draw, material deduction, payment or thaw.", + "capacity": "128 contexts; new adoption refused before SQL mutation when no registration capacity. Exact existing proposal retries do not allocate another slot.", + "ingress": "Old Arm replay checks current authority. Recovery API remains internal; no public recovery network protocol. HandshakeEnabled=false and ActorMutationAuditComplete=false; client craft macro remains 0." + }, + "not_complete": [ + "Recovery message protocol/game coordinator and old core/actor/cache revocation", + "Authoritative recovery data/image application, exact ACK, owner terminal release and thaw", + "Lifecycle of an actually loaded restored player (this batch is pre-load only)", + "All legitimate mutation/reward quiescence or durable deferral, unsealed source and ABORTED reconciliation", + "Actual factory/permanent IDs/Prepare/Execute/Apply online wiring and copy/success-rate items", + "Matched live game/db and Android device acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-recovery-wire-20261023.json b/audit/xxf-ch5/cube-recovery-wire-20261023.json new file mode 100644 index 00000000..5e2b87eb --- /dev/null +++ b/audit/xxf-ch5/cube-recovery-wire-20261023.json @@ -0,0 +1,110 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_GATED_PRELOAD_RECOVERY_WIRE_NO_IMAGE_OR_THAW", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "previous_checkpoint": "audit/xxf-ch5/cube-recovery-lifecycle-20261023.json", + "server_source_sha256": { + "src/server/common/cube_owner_types.h": "9b7aacc9123b465c0559188bf2c4f8da273a3c70c3407fa40b71785aa72500dd", + "src/server/common/cube_handshake.h": "eb1b8c828af4b128f91cf3b63fe501d77dd71be64687e704787b3fd7aa5e6785", + "src/server/common/cube_recovery.h": "bdca34d66720990002af672b9d9e74d459702f17dc087e460ae24293ed694e0c", + "src/server/db/src/ClientManager.h": "54ca3eb9a18127079b7d57d26c98bb87052d196edcead288f239e9e6bac0b709", + "src/server/db/src/CubeRuntime.cpp": "58477e35cc9bd9fe95380b5181304054723df8a5fc884f8ff537f0362be2c5fb", + "src/server/game/src/port_cube_recovery.h": "eaa937dbdd0620f4c1853a45b963e0b0dc48262999b01c09920e3d6e6020bc20", + "src/server/game/src/port_cube_recovery.cpp": "6f411bd9e8c034bba66e989a1efc291a81adcd43a27c27c65d42f37377a2c8e6", + "src/server/game/src/input_login.cpp": "879efc23f83fd97745687bb34c0d80da961164735f3a376cf29aa2bab5fffceb", + "src/server/game/src/input_db.cpp": "97ece474b38299f148c80bb0ddbf9a81cc963cf12c05958d28b65b0f23110dcb", + "src/server/game/src/main.cpp": "756ea63f993fe770cc296cda6be0468265649ae82855cea741c71497e3ebf0e2", + "src/server/game/src/Makefile": "ef75539f8b96d8e202a291e36abc90e0a0b8c5db0e8f2092d129b70f9cd26c7e", + "tests/features/test_cube_recovery.py": "ad221a07f94f4a41c57c71bf8500877d2b44e4c47ae84b4b7b160153200ca80e", + "tests/features/test_cube_runtime.py": "088b309d9af6ed3e10c4fdfccfa5058bf69b1b1f5d2e0c3dbf29a96eb33dc3d1" + }, + "client_metadata_report_sha256": { + "scripts/test_xxf_all.py": "924275896f0601583e32bf96a49d75da88d3ca7e727aaa388f4a0d2922790e1b", + "scripts/build_xxf_features_json.py": "976bed64b68767ab0504a801ef8acbdd03db5ccc00598a8d09a3b36339045dce", + "audit/xxf-ch5/features.json": "c0f71c042b5176f4a9fe3cfc80cad8899528a87518d3a9105b665a90d7f4140a", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "e0ec91d203c94ac85f76116ec6560daa360cfd2c4c3bbad0c06d4290999e2ed1", + "docs/XXF-CH5-CUBE-RECOVERY-WIRE-20261023.md": "d7f90e63eeb5e14c00773b0ce41a8927e48a5af4816dbe748c7d398889fb45aa", + "build/ch5-tests/20261023-cube-recovery-wire/report.json": "ff515e9b4e66226bdb9ddadd04ac5d0477123b7f91f20c22414e623cd142ba8e" + }, + "freebsd_selected_source_sha256": { + "src/server/common/cube_owner_types.h": "9b7aacc9123b465c0559188bf2c4f8da273a3c70c3407fa40b71785aa72500dd", + "src/server/common/cube_handshake.h": "eb1b8c828af4b128f91cf3b63fe501d77dd71be64687e704787b3fd7aa5e6785", + "src/server/common/cube_recovery.h": "bdca34d66720990002af672b9d9e74d459702f17dc087e460ae24293ed694e0c", + "src/server/db/src/ClientManager.h": "54ca3eb9a18127079b7d57d26c98bb87052d196edcead288f239e9e6bac0b709", + "src/server/db/src/CubeRuntime.cpp": "58477e35cc9bd9fe95380b5181304054723df8a5fc884f8ff537f0362be2c5fb", + "src/server/game/src/port_cube_recovery.h": "eaa937dbdd0620f4c1853a45b963e0b0dc48262999b01c09920e3d6e6020bc20", + "src/server/game/src/port_cube_recovery.cpp": "6f411bd9e8c034bba66e989a1efc291a81adcd43a27c27c65d42f37377a2c8e6", + "src/server/game/src/input_login.cpp": "879efc23f83fd97745687bb34c0d80da961164735f3a376cf29aa2bab5fffceb", + "src/server/game/src/input_db.cpp": "97ece474b38299f148c80bb0ddbf9a81cc963cf12c05958d28b65b0f23110dcb", + "src/server/game/src/main.cpp": "756ea63f993fe770cc296cda6be0468265649ae82855cea741c71497e3ebf0e2", + "src/server/game/src/Makefile": "ef75539f8b96d8e202a291e36abc90e0a0b8c5db0e8f2092d129b70f9cd26c7e" + }, + "freebsd_artifact_sha256": { + "/root/deploy-features/cube-recovery-wire.1PaNsl/bin/db": "d88b25d89d6851d8b24dd1f32c90356977b34173cea7019205afade8402d52ed", + "/root/deploy-features/cube-recovery-wire.1PaNsl/db.log": "c5df49bec8f7eec3defc9bc7c1ba2d0f59b29b72d1f67d771af636d110bcb0c1", + "/root/deploy-features/cube-recovery-wire.1PaNsl/mysql.log": "ff7eff36b488f11c829dc1afcc4283d94bdb2b53a3364651451c26ee48904b20", + "/tmp/ch5-cube-mysql.SRMGGN/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.SRMGGN/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.SRMGGN/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.SRMGGN/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.SRMGGN/owner-result.log": "037e0241d73fe4a53b10d46f5531bc09a1db005cf6d2dc97322c8b83db9212fc", + "/tmp/ch5-cube-mysql.SRMGGN/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/root/deploy-features/cube-recovery-wire.1PaNsl/bin/game": "3ef630a48ef90591afa6403570937a30e467a35998c42d3388346af8517a6fa5", + "/root/deploy-features/cube-recovery-wire.1PaNsl/game.log": "528680a6472eee727dc150eb03453e032d2810ff392cc1f1e609a90601e31055" + }, + "tests": { + "summary": { + "pass": 134, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 395, + "top_level_probes": 33, + "source_changed": false, + "release_ready": false, + "report": "build/ch5-tests/20261023-cube-recovery-wire/report.json", + "local": "ASan/UBSan actual game recovery controller body plus canonical codec; explicit audit-gate/descriptor/DB send substitutes. Actual DB route body uses explicit peer/cache/SQLite connection/FIFO and Clear-loadability substitutes. Existing guard tests separately exercise actual SQL guard bodies. Not a game<->DB socket or live-player test.", + "cases": "CRG1 160-byte grant and UINT64 extremes, truncation, canonical zero-identity claim, stale/wrong handle/session replies, one classic load after Clear, no load from Granted or late Clear, descriptor-handshake reuse, observed lost transport, bounded fair retries; actual DB disabled ingress performs no SQL, valid grant reply, wrong/playing account Held, forged reply not a request.", + "native_root": "/root/deploy-features/cube-recovery-wire.1PaNsl", + "native": "Fresh .cube-wire-game-obj and .cube-wire-db-obj compiled/linked successfully with inherited platform-matched external/internal libraries, max two native compiler jobs in total. Eleven selected source hashes match local. Legacy -w/-DNDEBUG and inherited dependency libraries mean this is not strict-warning, runtime or whole-library-rebuild acceptance.", + "mysql_root": "/tmp/ch5-cube-mysql.SRMGGN", + "mysql": "Dedicated no-defaults socket-only skip-networking instance. Actual base/lifecycle/gold/outbox/source/owner probes, threaded libsql FIFO and base/gold upgrades passed; socket absent after isolated shutdown. No actual recovery network session exercised by this script.", + "deployment": "No production deployment/restart/migration/player writes; no client or Android native/device acceptance.", + "post_regression": "Only this evidence JSON added after final local regression; runtime, tests and prior metadata/docs unchanged." + }, + "contracts": { + "wire": "Internal header78 messages11 RecoveryClaim/12 RecoveryAnswer; statuses11 RecoveryGranted/12 RecoveryClear. Existing 102-byte prefix/version1 and existing messages unchanged. Canonical Claim: account/player/session nonzero; epoch/cookie0, owner/token32 ASCII zeros, empty body.", + "grant": "CRG1 +32-byte boot +LE generation8/connection8/peer4/revision8 +96-byte binding =160 bytes; full Granted frame262, Held/Clear102. Exact canonical decode/reencode and envelope-binding match required.", + "db": "Real ingress requires both false gates before recovery SQL, otherwise replies Held without SQL. Route authenticates current peer, non-playing account and membership. Only explicit memory+SQL loadability produces Clear; no failed adoption/SQL error fallback. Granted invokes existing persisted owner/source/DONE/wallet checks.", + "game": "Actual CharacterSelect invokes preflight before classic load only when gates enabled. Coordinator pins descriptor pointer/handshake/account/player/index/random session; 128 contexts and max2 fair retries/tick every3s. Clear allows one still-guarded classic load. Granted only retained for future image coordinator; no load/assets/ACK/thaw.", + "parser_repair": "Actual CInputDB::Process previously accepted only Answer on header78, incorrectly rejecting GoldAck/GoldCloseAck. Explicit DB reply whitelist now permits Answer, GoldAck, GoldCloseAck, RecoveryAnswer; requests and malformed frames still rejected. Analyze dispatches RecoveryAnswer separately.", + "gates": "HandshakeEnabled=false; ActorMutationAuditComplete=false; ENABLE_CUBE_RENEWAL_WORLDARD=0. No new client craft capability or normal-load bypass.", + "schema": "Base Cube v2, gold-addon v2, owner-addon v1 unchanged; grant wire record is not a schema migration." + }, + "not_complete": [ + "Recovery image/full character data loading and owner-aware exact ACK/terminal release/thaw", + "Old core/actor/cache revocation and unobserved disconnect/core-boot identity protocol", + "Capability/version negotiation, select-phase recovery UI, actual socket fault tests", + "Complete mutation/reward quiescence or durable deferral, unsealed source and ABORTED reconciliation", + "Actual factory/permanent ID/Prepare/Execute/Apply online wiring, copy/success-rate items", + "Matched live client/game/db and Android device acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-release-20261023.json b/audit/xxf-ch5/cube-release-20261023.json new file mode 100644 index 00000000..15a02433 --- /dev/null +++ b/audit/xxf-ch5/cube-release-20261023.json @@ -0,0 +1,138 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_ORIGINAL_LIVE_TERMINAL_SQL_RELEASE_NO_GAME_RELEASE_SEND_RESUME_OR_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-image-ack-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_release.h": "a0fcb5cf823a1b4899e0734ce0acf23dcd4040159725a63369c650650349ecdc", + "src/server/common/cube_fence.h": "bbb68cc1193d05c29e01e0347fd6ffe84738f2785ecce269b1ceb3b9e7fe27ed", + "src/server/common/cube_owner.h": "52a0ffce3c3a4a5264815897f78edbe5bc0e4e60c051bf119f5fd6aa6a6cf21b", + "src/server/common/cube_handshake.h": "997252e68461410763e3c90734ba1dd47fc89aa2e3fe16d813442215e8968992", + "src/server/db/src/CubeRuntime.cpp": "df81befad6231f6106227aabc6ac293001f1942424ecf25a184992517de98178", + "src/server/db/src/Cube.cpp": "4c363a164380e4f2d8eecab3533dedc042adfae6cccb8fc786c1444e1a601827", + "src/server/db/src/ClientManager.h": "2ccfb7f23110387938a0579057efab4b17b140bc48cbd71112ebc047191530a3", + "src/server/db/src/Makefile": "3a11daff54414bd2ee2046328bda6912ba53908817ba96daa1224051ce9874c8", + "tests/features/fixtures/cube_release_probe.cpp": "040d78d79673473393adf571974d92f7cf32f5edbac685d94c62bc3a5f083001", + "tests/features/fixtures/cube_image_ack_probe.cpp": "e2ae5708ee3fed8cff1c5b5a127c83434e22541a0d24e81069c918ae30f8aac8", + "tests/features/fixtures/cube_batch_probe.cpp": "a6dba07155c5fd936e9e08539d83af643687586bcc0f7bc6061d1810abbe6784", + "tests/features/test_cube_image.py": "53060315c453b381ec16e73585e4f6305084430fdb99add774faa419bf4ec9ac", + "tests/features/test_cube_runtime.py": "b424d35fa41ab152c41abd483c313e780c406c5ed419ec51286a4d57c36b7cd5", + "tests/features/test_cube_db_guards.py": "717294a13e53fe38744ca0a02aa4287621c8a9209c13416f375ba172874e13a4", + "tools/cube/release-schema.sql": "85d5af61d3c2a56500e75448ce9761d68e0237a133c3237c46178c20139f348f", + "tools/cube/test_mysql.sh": "a51541ff4690c174afc5800061c7668d2f957103190bf95bc0ad15e9615caf4a", + "tools/cube/README.md": "abe9f24564ec8ea29c597003fae6d229c334e1710a365433d8e2fb7c34ed3438", + "src/server/game/src/input_db.cpp": "eec30217ebcafd2792513c6c7b0e067b87f110e70430016f69e17f46579fe5e5", + "src/server/game/src/port_cube_actor.cpp": "de004adfeffef037cf09d948ec9f3e8514289f8f47bb6f84f1e4861773a79665", + "src/server/game/src/port_cube_recovery.cpp": "6aa02d1d44a3c47da1274f4f69793bf183bd177114bb02677a76bec3d2843459" + }, + "client_metadata_sha256": { + "docs/XXF-CH5-CUBE-RELEASE-20261023.md": "adb68a31a78e51c3e739d3d74916920b6aeb973e2dada4ea57f366a88937ead2", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "c6042ca38323e900bf771c1e44a83baddef3004b23c1d7e72b4b9381abd38020", + "scripts/build_xxf_features_json.py": "867717e73ac337895a6b21a89eda4e1395255e7a27445b00ea5c0ed67024de88", + "audit/xxf-ch5/features.json": "afe3c470979530254202c48193b0173a1b819b92de0fde1f5473f99a17802585" + }, + "implementation": [ + "Optional release-addon v1: two InnoDB tables after Cube v2/gold v2/owner v1/image-ACK v1, immutable full batch/grant/image terminal receipt, no runtime DDL", + "Actual Fence.Release ownership callback shares account transaction; original LIVE proof, current SQL wallet/inventory, exact issued RESYNC and exact durable ACK checked before terminal insert/lease retirement/item-fence retirement/RELEASED commit", + "Permanent ID reservations, craft/gold/ACK histories retained; no charge/award/RNG or asset data writes", + "Exact terminal replay revalidates original broker and ACK/history/fence image, rejects newer batch/conflicting lease/item fence, never clears a new hold", + "Internal messages22/23, LiveReleased18 appended; actual disabled ingress returns Held before SQL; runtime route matches actual peer/handle/session/account-playing/cookie/batch and retains began memory hold on success", + "Trusted peer-gone revocation queue can reconcile a lost release COMMIT reply by exact durable terminal proof, marking revocation work complete without retiring save/load memory hold", + "ID-only flush/destroy guard retains batch input/reward ID protection after SQL release; other current non-MALL/non-SAFEBOX item owner checked against held contexts; query failure refuses, Arm final saves/other owners/account-based storage unaffected", + "Actual game remains at Acknowledged with no LiveReleaseRequest sender and no thaw; saving/events/UI are not restored" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-release-final/report.json", + "report_sha256": "e749a1bfcb5d00050b815b343af0d56c6d288b27e7bb38d79ab9d8b315262cff", + "files_pass": 136, + "unittest": 408, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "dedicated_batch_tests": 18, + "coverage": [ + "ASan/UBSan actual release/ACK/fence/owner stores against explicit SQLite connection/advisory substitute", + "Every first-release and replay SQL query failure/warning, rejected/ambiguous COMMIT, process death after terminal insert/lease deletion/item-fence deletion/COMMIT: one atomic outcome", + "Missing/corrupt ACK, stale peer/session/revision/broker, revoked/adopted owner, changed current/saved image/phase, cross-player request fence, corrupt terminal history, newer batch refusal; permanent ID tombstones retained", + "Actual CubeRuntime route with explicit peer/cache/FIFO boundaries: disabled no SQL, stale identity, failed/lost COMMIT, exact duplicate reply, peer-gone terminal reconciliation and memory hold preserved", + "Actual CubeItemWritable method with SQLMsg boundary: known consumed/reward IDs and current other owned windows held after SQL fences retire; owner query failure refuses; Arm/other owner/MALL/SAFEBOX/cancelled context preserved", + "Canonical22/23 full-image wire, truncation and direction classification; not matched gameplay acceptance" + ], + "not_claimed": [ + "Complete actor quiescence or external CItem reference audit", + "Actual game release sending or resume handoff", + "Normal saving/events/UI publication/thaw", + "Matched live game/DB or Android device acceptance" + ] + }, + "native": { + "root": "/root/deploy-features/cube-release.cmuZNy", + "script": "native-build.sh", + "script_sha256": "0386b859edde19e74eeb90d1c36409e1b60dc00f757ae8322678fe4c62f806a3", + "scope": "Actual CubeRuntime/Cube/input_db/port_cube_actor/port_cube_recovery translation units recompiled; game and DB linked matching previous ACK/apply cohorts, not all objects rebuilt", + "instance_or_serialized_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "game_sha256": "613f72c324bcf3a2d938a5b9910c1f80afd030016f600369eb0e12eeebe28173", + "db_sha256": "ca573298906d2ab7a68bf7811cdf75f7cfc4742ff468b434a7aa6bf9ffcc1b8a", + "empty_compile_link_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "binaries_stripped": true, + "game_or_db_daemon_started": false, + "baseline_objects_preserved": "Removed only the isolated build Cube.o symlink before compiling replacement, not its previous-cohort target" + }, + "mysql": { + "script": "/root/deploy-features/cube-release.cmuZNy/mysql-test.sh", + "script_sha256": "b1b3db1c398b94efff48dd0308d354cee7d512feaacda8ea797a71898688f6bd", + "reused_stopped_isolated_datadir": "/tmp/ch5-cube-mysql.UxPD9a/data", + "isolated_socket": "/tmp/ch5-cube-mysql.UxPD9a/mysql.sock", + "no_defaults_socket_only_skip_networking": true, + "production_socket_used": false, + "terminal_exit": 0, + "socket_and_pid_absent_after_shutdown": true, + "ack_probe_sha256": "0da7f3a2abd8d194d60c4186cf5b6e28e745671db27672ff71cd62d4a51eed91", + "release_probe_sha256": "eca1678f62ef65456f4a92f8b63d07dcd2f36eece05e4d22fb2e7bb0ed0ff8e8", + "ack_result_sha256": "886976fc538031d5655276f01d8a9bcb0c061b55fdf8b3dd44d2edb545bfb235", + "release_result_sha256": "e63fb162196b13963bc9849ca4ac4f8d48d2b844170fbab094d0c4cf8b1a9c4e", + "result": "Actual MySQL ACK and terminal-release probes pass, including genuine MyISAM refusal/restored InnoDB, every query failure/warning, lost/rejected COMMIT and separate-process atomicity boundaries", + "not_rerun": [ + "Full test_mysql.sh migration/SQL-worker suite", + "Matched live game/DB socket acceptance", + "Native runtime ID-only guard execution (actual method covered by SQLite SQLMsg harness plus native compilation)" + ] + }, + "operations": { + "production_deployed": false, + "production_restarted": false, + "production_migrated": false, + "player_assets_modified": false, + "git_commit_or_push": false, + "material_deletions": false, + "remaining_server_disk_mb": 136, + "next_native_run_must_check_space": true + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "client_craft_enabled": false, + "release_ready": false + }, + "remaining": [ + "Game actual release-readiness/send and authenticated DB resume handoff; SQL terminal result is not sufficient thaw permission", + "Restore normal saving and expiry events, correct quickslots and publish full client state with exact readback", + "Complete actor quiescence/durable deferred legitimate mutations and external references audit", + "Old-core revocation, complete character/non-normal-window recovery, PREPARED/ABORTED/non-ok DONE reconciliation", + "Copy/success-rate item rules, public craft/capability UI, matched live and Android acceptance", + "After Cube closes: Won, Wolfman, Conqueror, five character slots in that order" + ] +} diff --git a/audit/xxf-ch5/cube-resume-check-20261023.json b/audit/xxf-ch5/cube-resume-check-20261023.json new file mode 100644 index 00000000..c4622493 --- /dev/null +++ b/audit/xxf-ch5/cube-resume-check-20261023.json @@ -0,0 +1,81 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_CURRENT_SQL_RESUME_PREFLIGHT_AND_RESTART_QUARANTINE_NO_ACTIVATION_OR_THAW", + "priority": ["Cube", "Won", "Wolfman", "Conqueror", "Five character slots"], + "previous_checkpoint": "audit/xxf-ch5/cube-live-release-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_fence.h": "fa0147b6f9e9facec5012a96a748acc22a717f269a5330a4df33285d9a2fa21d", + "src/server/common/cube_owner.h": "707b2ed1801176a1b0bb9ca5a7f5186756b385082ae06804582fdd1d2a511262", + "src/server/common/cube_release.h": "5f35cccde158deb444da9f28a3fa6d424b78fa06aa9dd409508f4d8d54a1ffbc", + "src/server/common/cube_handshake.h": "9691f88dabe15b5297b88971689bbd5278da6d1e672d66652133e8126d3ad98c", + "src/server/db/src/CubeRuntime.cpp": "a0c9ccdcc4e1857f6052b2dcfa1deb5b309ed7273c498eaf3fc91b383cb4be80", + "src/server/db/src/Cube.cpp": "2fe723ebe5b2734e51799d43d6febde6770c20169306dd22525138296f488edd", + "src/server/db/src/ClientManager.h": "51b654929837d2e9c8edffed133d52603ac2069e6824c6eefa2abe6c80864a92", + "src/server/game/src/Makefile": "1b1bd641c11e0ccea263c96ebd5fd3686509b02b9f0a4dc508f1592ca1f237c3", + "tests/features/fixtures/cube_release_probe.cpp": "7075401f77d5fa590bf87bb697ca464c3b6932a90c4c9f65e634f938109d1c65", + "tests/features/fixtures/cube_resume_probe.cpp": "56faa2a1f65f555e6daec921174423ff53d17274cbd3103652f915edeb7bb419", + "tests/features/test_cube_resume.py": "6754d0455a6c6cb4da03ce37b8ba6b4bc87d0d625dc19533a647cf0132e07e5f", + "tests/features/test_cube_runtime.py": "9257d471836e53c464a767300f7f0efdbf2d3cda01cc5c14479a9145e85ccbed", + "tests/features/test_cube_db_guards.py": "b47d4a2099b84724bb4f42d6ed0dd49c82fae819bf33772c3e1ce574632c88d4" + }, + "client_source_metadata_sha256": { + "scripts/test_xxf_all.py": "525c5a97ae5307608a3117bd5c4f04bc003160dc34f1d01826c93d8872782410", + "scripts/build_xxf_features_json.py": "a241fa7fb93da21d96e6893e9a8f6a39be3fbe491cd8caaf250ca01283c5d709", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "24fccf4b91dc5c65f0d1ab31c22e3dba360b93b7c523a5c43bafcc3e8e850106", + "docs/XXF-CH5-CUBE-RESUME-CHECK-20261023.md": "32034f24d9963adef322fa3c7e0bfcbb3b39b0de284f9db40b032c474ede2b10", + "audit/xxf-ch5/features.json": "429efa22c0feb5bf8d0c91de7f5c6018da73a036a99270b43850e51e7dad39bf" + }, + "implementation": [ + "Fence.CheckReleasedImage locks original account/fence, verifies RELEASED/drain1/full original batch/image, rereads current normal225/gold and invokes authority on the same pinned transaction; a historical Release replay is insufficient", + "Release.CheckResumeLive verifies full ACK/terminal history, current original broker and no lease/fence, sealed gold source/applied credit chain, fixed-roll ok DONE reconstruction and permanent reward-ID tombstones", + "Owner released-image mode shares original settlement verification without resurrecting retired leases/item fences; does not prove full non-normal-window metadata or complete character recovery", + "Internal24/25 LiveResumeChecked route requires original still-playing peer/handle/session/cookie/account/RELEASED context; hard-disabled ingress responds Held without SQL; successful read-only preflight retains all memory holds", + "Modern terminal receipt plus current RELEASED fence now persistently quarantines player/account loads/saves and current/reserved item IDs after DB restart empties memory; absent addon keeps baseline and partial/unknown/nontransactional/failing discovery refuses", + "No activation receipt, actual game24 sender, save-enable caller or thaw; preflight result is not a cacheable resume grant. Future activation must revalidate current state inside its authorization transaction" + ], + "tests": { + "full_report": "build/ch5-tests/20261023-cube-resume-check-verified/report.json", + "report_sha256": "cc30258ff5973579ad3ddd1466fa92b9d1eb4e6a33e84bf0aeb32dd49c7fd0dd", + "files_pass": 139, + "unittest": 415, + "top_level_script_exit_only": 33, + "source_changed": false, + "release_ready": false, + "targeted": "ASan/UBSan actual stores, DB runtime route and SQL guard bodies; SQLite/peer/cache boundaries explicitly substituted. Every preflight query failure/warning, commit refusal/ambiguity, corrupt/stale/newer data, wire truncation, hard-disabled no-SQL route and empty-memory terminal quarantine tested; not live DB restart or gameplay acceptance", + "initial_full_run": "build/ch5-tests/20261023-cube-resume-check/report.json: all139 files passed, but source changed during native compiler compatibility repair; superseded by stable verified run" + }, + "native_build": { + "host": "192.168.21.203", + "platform": "FreeBSD i386", + "root": "/root/deploy-features/cube-resume-check.dqj94p", + "rebuilt_game": ["input_db.o", "port_cube_actor.o", "port_cube_recovery.o"], + "rebuilt_db": ["CubeRuntime.o", "Cube.o"], + "other_game_objects": "/root/deploy-features/cube-live-release.DB7CaE/src/server/game/src/.live-release-obj", + "other_db_objects": "/root/deploy-features/cube-release.cmuZNy/src/server/db/src/.release-obj", + "script": "native-build.sh", + "script_sha256": "c9f5eaabf1f9e991e5ced088769080fec17b64629bf2a830a5256efbf318690c", + "game_sha256": "b2301f2ca7a0aa91a149dd37f65917c4d54347eb8a4718ede6e7e05ff483ea1c", + "db_sha256": "203767ecd9e1dd2fe8e0fe733eac2e5db20043b3422c98c0693977e78789322e", + "compile_and_link_log_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "remote_source_hashes_match": true, + "max_parallel_compilers": 2, + "remaining_disk_mb": 62, + "initial_failure_repaired": "Missing staged locale.hpp and legacy false macro deducing int in new lambdas; staged header and explicit bool returns, then recompiled and linked", + "candidate_launched_or_deployed": false, + "production_restarted_or_migrated": false, + "client_rebuilt": false + }, + "gates": {"HandshakeEnabled": false, "ActorMutationAuditComplete": false, "ENABLE_CUBE_RENEWAL_WORLDARD": false}, + "remaining": [ + "Durable resume completion protocol and peer-scoped normal/ID-only save/delete/flush handoff; safe actor save-enable/thaw and restart/lost-reply reconciliation", + "Complete actor quiescence, legitimate delayed changes/rewards, direct setters/global callbacks, old-core revocation and full character/non-normal-window restoration", + "Classic BYTE count-bearing action extension, public crafting capability/action, special recipes/copy/rate items and exceptional DONE reconciliation", + "Matched live game/DB and Android device acceptance", + "Won, Wolfman, Conqueror and five-character-slot subsequent batches" + ], + "complete": false +} diff --git a/audit/xxf-ch5/cube-source-close-20261023.json b/audit/xxf-ch5/cube-source-close-20261023.json new file mode 100644 index 00000000..6b35a7f1 --- /dev/null +++ b/audit/xxf-ch5/cube-source-close-20261023.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_DURABLE_GROUND_SOURCE_CLOSURE_NO_FULL_QUIESCENCE_OR_OWNER_RECOVERY", + "features": [ + "F21" + ], + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_existing_dirty_work": true, + "server_source_sha256": { + "src/server/common/cube_gold_source.h": "9e4cd7afbf49771397d2d6f8fd1432f11f1970f2190a5c1e17db079d728c356b", + "src/server/common/cube_gold_intent.h": "31be773ec4cefaa0e8d611be70d430ec2ca4eda9101e9036c4a87eb5a4d7e74b", + "src/server/common/cube_gold_store.h": "c2676cff6414e44fb99bc769400dd17bcd8a5b0cc4bd24d575a3f15812f3ebde", + "src/server/common/cube_gold_outbox.h": "1df2260cea61f5454d3c736fd2ab8edc8d63eb452f210f7f077bed0921324cf0", + "src/server/common/cube_handshake.h": "3b2b9a8132d354cc2156d006da0d04d4f6ccfd32ebb01ce8bc98c883fbbcce0c", + "src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "src/server/db/src/Cube.cpp": "aeb4962a3f7e64287cc1f277eb0b7973126deb2a22beb5d22baa2d5dd1628fd7", + "src/server/db/src/CubeRuntime.cpp": "64fdd3188729dc2ea5bfc2ee36c9d547a2c76b9888ac954327c9f6fff380e242", + "src/server/db/src/Makefile": "74e14f0d616888e0c5e3b4e8bec27097828fe69d58623c75a585a3e77e6de09d", + "src/server/game/src/port_cube_actor.cpp": "bf8876133b3ed0ce1324ba1453c759c2953e44e2e9d3258b74302183fdffb581", + "src/server/game/src/Makefile": "5bbf4b04cd12a9e0d90f09e44e690bd682b50c8262d65d361c0b1fa9a5d3226b", + "tests/features/fixtures/cube_batch_probe.cpp": "e5f0da491900b732344e848d86e46bc78a060e88be89e09f437840425b56cc10", + "tests/features/fixtures/cube_gold_probe.cpp": "90eb7313555de867f73acf308fdee28a20da36b108094c5d407f888a6cffb032", + "tests/features/fixtures/cube_outbox_probe.cpp": "688fc5c7f165a75a60e7f7e982f2460ebb181aa88a393ae36dbc551e75815efc", + "tests/features/fixtures/cube_source_probe.cpp": "a91c3b4ae299608f9523887ef4dc53762e674c28db6ae5cdd1d3e914ac7b6858", + "tests/features/fixtures/economy_probe.cpp": "3289d5406767045817140d98e2ea7b97014bd1abdd23c40ee7b2c5024779690c", + "tests/features/fixtures/economy_view_probe.cpp": "e0277ba2e897ff482a0f042784159ba193d9e7251825e7bcab8ca7dda87e8c8c", + "tests/features/test_cube_source.py": "96948718a5aa4964e32f50ba6583e72e32c609aaac6fe95e1e5ea9f60babaf0a", + "tests/features/test_cube_outbox.py": "5b81be2db11b4bf89ac428feff78f622372ceee58836ed09870106051a966762", + "tests/features/test_cube_runtime.py": "ad06b4b795a5e530a101be553e0417f2a3571a1aa92ee13c83bb56de4eeb5a8d", + "tests/features/test_cube_db_guards.py": "d02633ca275d791c30d36eafc402e7835189c3a35e8993cf49868e9520db2f17", + "tools/cube/gold-schema.sql": "5944ba6cb601023af95305f35bffe4d4c93221489725ea023e237ec60b4fd4ed", + "tools/cube/gold-upgrade-v2.sql": "4bc43ad9f66455b865105c0809774fafaf4227f602db0bd234990e815609e343", + "tools/cube/test_mysql.sh": "cb2b81e35661691c449d2f8978ddc085e23324ec9742bd24c70eb90c67edad72", + "tools/cube/README.md": "820a6243e3c00f0a8014cbb40e050653c7efda4ea64af2d0e711beb5f0d6d3a4" + }, + "client_metadata_and_report_sha256": { + "scripts/test_xxf_all.py": "e28c11c87bbf3adf63285099da96f5c7855484e5c6382ce4a2ecb0e28de7fbf0", + "scripts/build_xxf_features_json.py": "8d31d7f259f6ee6fa04c8c8502c6d9f9c1ddda4bd340615b0c6221e1a708167d", + "audit/xxf-ch5/features.json": "70cea5d65c2565b545491bfdd7261acb1a9adc27910f035c50330fbc6cccf7e8", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "56e47b0e2625f8c1c7d5fa1e9a7afd4be4a290d70d3d9fb5eb977aa2a27957af", + "docs/XXF-CH5-CUBE-SOURCE-CLOSE-20261023.md": "0c4a5e4b6f58455d9d0bc3cfd5197feaeded22bc9342a26942ee4470e372408a", + "build/ch5-tests/20261023-cube-source-verified/report.json": "f750849798c8286bc097a27da31013ba28b937d79ec9ded0ca1cca6c1a49115e", + "build/ch5-tests/20261023-cube-source-final/report.json": "fcc9c29ef0c0e42fe1fe3bf819203a6614fe2e52c64403a7afb98a79294bea32" + }, + "freebsd_source_artifact_sha256": { + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_gold_source.h": "9e4cd7afbf49771397d2d6f8fd1432f11f1970f2190a5c1e17db079d728c356b", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_gold_intent.h": "31be773ec4cefaa0e8d611be70d430ec2ca4eda9101e9036c4a87eb5a4d7e74b", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_gold_store.h": "c2676cff6414e44fb99bc769400dd17bcd8a5b0cc4bd24d575a3f15812f3ebde", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_gold_outbox.h": "1df2260cea61f5454d3c736fd2ab8edc8d63eb452f210f7f077bed0921324cf0", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_handshake.h": "3b2b9a8132d354cc2156d006da0d04d4f6ccfd32ebb01ce8bc98c883fbbcce0c", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/db/src/Cube.cpp": "aeb4962a3f7e64287cc1f277eb0b7973126deb2a22beb5d22baa2d5dd1628fd7", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/db/src/CubeRuntime.cpp": "64fdd3188729dc2ea5bfc2ee36c9d547a2c76b9888ac954327c9f6fff380e242", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/db/src/Makefile": "74e14f0d616888e0c5e3b4e8bec27097828fe69d58623c75a585a3e77e6de09d", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/game/src/port_cube_actor.cpp": "bf8876133b3ed0ce1324ba1453c759c2953e44e2e9d3258b74302183fdffb581", + "/root/deploy-features/cube-source.iDdvhO/build-root/src/server/game/src/Makefile": "5bbf4b04cd12a9e0d90f09e44e690bd682b50c8262d65d361c0b1fa9a5d3226b", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/cube_batch_probe.cpp": "e5f0da491900b732344e848d86e46bc78a060e88be89e09f437840425b56cc10", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/cube_gold_probe.cpp": "90eb7313555de867f73acf308fdee28a20da36b108094c5d407f888a6cffb032", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/cube_outbox_probe.cpp": "688fc5c7f165a75a60e7f7e982f2460ebb181aa88a393ae36dbc551e75815efc", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/cube_source_probe.cpp": "a91c3b4ae299608f9523887ef4dc53762e674c28db6ae5cdd1d3e914ac7b6858", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/economy_probe.cpp": "3289d5406767045817140d98e2ea7b97014bd1abdd23c40ee7b2c5024779690c", + "/root/deploy-features/cube-source.iDdvhO/build-root/tests/features/fixtures/economy_view_probe.cpp": "e0277ba2e897ff482a0f042784159ba193d9e7251825e7bcab8ca7dda87e8c8c", + "/root/deploy-features/cube-source.iDdvhO/build-root/tools/cube/gold-schema.sql": "5944ba6cb601023af95305f35bffe4d4c93221489725ea023e237ec60b4fd4ed", + "/root/deploy-features/cube-source.iDdvhO/build-root/tools/cube/gold-upgrade-v2.sql": "4bc43ad9f66455b865105c0809774fafaf4227f602db0bd234990e815609e343", + "/root/deploy-features/cube-source.iDdvhO/build-root/tools/cube/test_mysql.sh": "cb2b81e35661691c449d2f8978ddc085e23324ec9742bd24c70eb90c67edad72", + "/root/deploy-features/cube-source.iDdvhO/bin/game": "15b1bcd751289321e9570874e012970a58a1fe12336749b79a0cf2c51b66909d", + "/root/deploy-features/cube-source.iDdvhO/bin/db": "ae2381f7e323f010115183baa38cdf705c844f44672b015f16e869954203eb23", + "/root/deploy-features/cube-source.iDdvhO/game-build.log": "5dc857b2f0fef3d8c57d6b8bd4da276ad385649e6bba69aacc66d1c21e046d2a", + "/root/deploy-features/cube-source.iDdvhO/db-build.log": "4f4ff623f9c751d844d6c19cf4dfb5086e0a54874c52724ee0cb03e3a3ef5cad", + "/root/deploy-features/cube-source.iDdvhO/db-final.log": "15cfb03ba0cab42e3369aa664032004e76c30f10ba0073ec9b1505b0254ca7d3", + "/root/deploy-features/cube-source.iDdvhO/mysql.log": "f3f494bd59d268c25a88a8532e4158661b9bd7fd79606876b158978983e72422", + "/root/deploy-features/cube-source.iDdvhO/economy-fixture-compile.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "/tmp/ch5-cube-mysql.OaXUw8/source-result.log": "350beca25f7e16dedd3dae4f0ad5d61213326485e2b6c0241151c259c3a3c7c9", + "/tmp/ch5-cube-mysql.OaXUw8/result.log": "12192293b3990416951c89948fb04abf8359da34771a513f39aee3757ea284f5", + "/tmp/ch5-cube-mysql.OaXUw8/gold-result.log": "9148968795d6255464ef2ce88e6e22b2ba56788cac18c25285279dfdcdaf91f7", + "/tmp/ch5-cube-mysql.OaXUw8/outbox-result.log": "14a6b59e571c0c7474cd07322307f8a50284240f826d8164e6a8b8bd19d9f6f9", + "/tmp/ch5-cube-mysql.OaXUw8/sql-worker.log": "9ed28959c3e362731439c3dc31d5fb08ad8e746021eca382d17bf46c2ee66fca", + "/tmp/ch5-cube-mysql.OaXUw8/gold-upgrade-version-refused.log": "af2da00062a1f9caf711614d3715a3b57b634df9cc70aeea9ce3ef8a0ef04d68", + "/tmp/ch5-cube-mysql.OaXUw8/gold-upgrade-partial-refused.log": "4b61ee986ff4857bc6990b03a3dff4a795ce1be0f235e4367e3b5c95fc932664", + "/tmp/ch5-cube-mysql.OaXUw8/gold-upgrade-engine-refused.log": "e75a6ec8e569cf6e3d45ce2545cf8ee90e5ae1615ea52445d2369ddc996e7892" + }, + "tests": { + "summary": { + "pass": 132, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "source_changed": false, + "release_ready": false, + "unittest_cases": 392, + "top_level_probes": 33, + "report": "build/ch5-tests/20261023-cube-source-verified/report.json", + "source": "ASan/UBSan zero/late-source closure; persistent journal closing and exact ACK; per-SQL failure/warning and rejected/ambiguous commit; process exits before/after SQL COMMIT or file fsync; two-process duplicate sealing; malformed/bounded exact manifests and old-addon refusal", + "actual_paths": "Actual source helper and source-ACK body with explicit actor/item/audited-gate boundaries; actual DB close route validates peer/login/handle/session/cookie and batch; missing or old addon cannot Arm", + "mysql": "Dedicated socket-only --no-defaults MySQL, actual base/addon DDL, base/lifecycle/gold/outbox/source probes and real libsql FIFO, base upgrade and gold v1->v2 migration; no production socket", + "mysql_root": "/tmp/ch5-cube-mysql.OaXUw8", + "native_root": "/root/deploy-features/cube-source.iDdvhO", + "native": "Fresh game/DB object directories and sequential -j2 compile/link, DB runtime forced rebuilt/relinked after final Arm addon-readiness check; inherited internal platform libraries, not clean dependency-library rebuild", + "native_source_matches": 20, + "warnings": "Legacy -w remains; not strict-warning acceptance", + "regression_failure_retained": { + "report": "build/ch5-tests/20261023-cube-source-final/report.json", + "failure": "economy_view fork child crashed under macOS ASan inside system logging/libsqlite openDatabase", + "repair": "Shared economy fixture and view wrapper use posix_spawn fresh workers with exact original 1976-byte requests; all ten operations/190 SQL exit/replay boundaries and concurrent buyer/same-order settlement assertions retained. No economic runtime changes or skipped failing test.", + "verification": "Economy/view/coordinator targeted SQLite ASan tests passed, then all 132 files passed. FreeBSD real-MySQL fixture paths compiled with -fsyntax-only; old economy real-MySQL runtime suite not rerun." + }, + "client_native": "Not rebuilt; no client runtime/capability changes", + "live": "Not run; no production deployment/restart/migration/player writes", + "android": "Not run", + "post_regression": "Only this evidence JSON added after final regression. Later development must use a new source/test evidence boundary." + }, + "contracts": { + "scope": "Current ground-gold source only. Both actual ingress/audit gates false.", + "local_close": "Fsync CLOSING on matching Frozen, prohibit new source claims, retain old delivery retries; only after every prior intent has durable ACK can PendingSources emit closure proof. Empty sources also close explicitly.", + "journal": "CGO1 166-byte frames, op3 CLOSING/op4 source ACK; 96-byte binding +4-byte count+canonical zero padding; replay restores closing/ack and refuses new claims after closure. Old claim/ACK remains readable; unknown/torn/conflicting records are not discarded.", + "manifest": "4-byte count plus exact ordered 32-byte event IDs, max1024, body32772/frame32874. No digest/count-only surrogate.", + "sql": "Gold addon v2 (base Cube v2 unchanged), InnoDB sources table stores original binding/full manifest. Account lock serializes seal with new enqueue; exact historical retries allowed, new events after seal refused.", + "resync": "Addon v2 Resync/Release require exact source proof matching all persisted intents, all credits applied, validated craft receipt/current wallet and exact image ACK. Missing/corrupt proof retains hold, including zero-reward batches.", + "readiness": "Actual DB Arm requires gold-addon v2, not merely the base store. Ordinary absent-addon compatibility does not authorize a modern actor.", + "ack": "Exact source manifest/handle/session/cookie checked and fsynced. Source ACK never authorizes actor thaw.", + "migration": "Explicit gold-upgrade-v2.sql preserves v1 intents/receipts and manufactures no closures, rejects unknown/non-InnoDB/partial metadata, supports repair/retry/idempotence; no runtime install or production migration.", + "owner": "Old cookie/token does not authorize new owner after game/DB restart; trusted durable adoption/reconciliation still required." + }, + "not_complete": [ + "Trusted owner revocation/adoption after game/DB restart or cross-core handover", + "Other source/mutation quiescence: task/item/EXP/expiry/direct setter/global/party paths", + "ABORTED reconciliation", + "Online factory/ID allocation, Prepare/Execute/Apply, image application/exact ACK/thaw", + "Copy/success-rate items, matched live/Android acceptance", + "Won/Wolfman/Conqueror/five character slots" + ] +} diff --git a/audit/xxf-ch5/cube-start-20261023.json b/audit/xxf-ch5/cube-start-20261023.json new file mode 100644 index 00000000..165e84d4 --- /dev/null +++ b/audit/xxf-ch5/cube-start-20261023.json @@ -0,0 +1,95 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_TRUSTED_START_FACTORY_BEGIN_NO_PUBLIC_ACTION_OR_APPLY_ACK_THAW", + "priority": [ + "Cube", + "Won", + "Wolfman", + "Conqueror", + "Five character slots" + ], + "previous_checkpoint": "audit/xxf-ch5/cube-factory-20261023.json", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_dirty_work": true, + "server_source_sha256": { + "src/server/game/src/port_cube_actor.cpp": "42ac0daa028996b9d093ddba915ea0b13b544c1f81a01d8ef07a24398810c881", + "src/server/game/src/port_cube_actor.h": "2ce80244d0d6e544e37efa0fa64a22c91c5e2c9d01c2bf38b7bafc76fe7e677c", + "src/server/game/src/port_cube_catalog.inc": "a9df683dd8cb89664b605636207213d261ff9582d8f4bb8519354178757b2b1a", + "src/server/game/src/cube.cpp": "410ceef7bff2c170cc10d9ddb673e4bed4153de6ba6c85737255b414eddefac3", + "src/server/game/src/Makefile": "c26fdbcee25af2d5b64864c6da0435b7cc13155a123a8d06e03f8d5b820905dc", + "tests/features/test_cube_craft.py": "50b1329ce6dd5e02f44c0b29f3aef60eb81eb7184948873076084ab3e14992d4", + "tests/features/test_cube_catalog.py": "056259ced55e896345f1c38125a0d2b23120782bed80f3a179ee7487ffca05a4" + }, + "client_metadata_sha256": { + "docs/XXF-CH5-CUBE-START-20261023.md": "2cc5a77133465dd5024dab752528dd8fd99c6f5db359cbb457ddfa05e5afe637", + "docs/AVA2-IMPLEMENTATION-SPEC.md": "1076885d5313f546da6a78dafa837e4ca14c0f0c4404f8e6acdead9cbe4be5d5", + "scripts/build_xxf_features_json.py": "f7ec7dd8a7d5114eca1b9545dd206f6a19c539df929af940a1f67fc2cb3fef7e", + "audit/xxf-ch5/features.json": "c28291a8069bfb7c28a602fc258ace21cb6c53f067721535fc292a498b576d24" + }, + "implementation": [ + "Internal Start only accepts actor/recipe ID/staleness revision/attempts; both gates checked before entropy or IDs", + "Actual loaded canonical NPC recipe resolver, full snapshot/admission/material/gold preflight, server-generated owner/token/nonzero session", + "Real reward factory for bounded worst-case output, current-proto physical settlement preflight, then actual Begin canonical/snapshot recheck", + "Original immutable owner handles exact repeated action; no factory/identity regeneration or repeated Arm; no unfreezing on failure", + "CLOCK_REALTIME nanoseconds bounded to INT64_MAX and process-monotonic epoch; original DB non-RELEASED hold and prior RELEASED epoch rules retained" + ], + "epoch_limitation": "Not durable cross-core/restart epoch allocation. Clock skew/rollback can refuse a new request; it cannot overwrite an old hold. Needs synchronized clocks or future DB-authoritative generation negotiation; no automatic retry under a replacement identity after accepted work.", + "tests": { + "cube_unittest": 35, + "full_report": "build/ch5-tests/20261023-cube-start/report.json", + "report_sha256": "d9d5222bbe3c7f9313d5d72d4cddfb23fc0c936589400c5fa80238ac483ec2fa", + "files_pass": 136, + "unittest": 403, + "top_level": 33, + "source_changed": false, + "release_ready": false, + "coverage": [ + "Actual resolver version/id/copy denial and unchanged output", + "Actual Start function with explicit gate/actor/snapshot/factory/Begin substitutes: no work disabled, preflights, full metadata, entropy/zero session/clock failures, monotonic epoch after rollback, factory failure, identity/invalidation/duplicate checks", + "Actual Start plus actual Begin function bodies: immutable owner insertion, exact full Arm batch bytes, unchanged gold, no second factory or Arm, final recipe recheck refusal", + "Substitute gate=true tests do not prove real actor freeze or authorize enabling gates" + ] + }, + "native": { + "root": "/root/deploy-features/cube-start.mURCqf", + "kind": "recompiled_actual_actor_and_cube_TUs_then_full_game_link_against_prior_fresh_cube_factory_object_cohort", + "baseline_objects": "/root/deploy-features/cube-factory.LM5CPB/build-root/src/server/game/src/.cube-factory-game-obj", + "class_or_protocol_layout_changed": false, + "max_compiler_jobs": 2, + "terminal_exit": 0, + "selected_source_hashes_match_local": true, + "exported_start_and_resolver_symbols_verified": true, + "game_sha256": "dca231c2f28ffbfc691ea2dc5467d8f4a369a36885eb2d4ba53e469a33645401", + "compile_logs": [ + "actor-final.log", + "cube.log" + ], + "link_log": "link-final.log", + "empty_logs_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "full_game_recompile": false, + "game_started": false, + "db_rebuilt": false, + "mysql_rerun": false + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "public_start_caller": false, + "public_craft": false, + "production_deploy": false, + "production_restart": false, + "production_migration": false, + "player_assets_changed": false, + "client_or_android_build": false + }, + "remaining": [ + "Start is the actual internal factory/Begin caller, but no client action/public command invokes Start yet", + "Original live-owner authoritative image/application/exact ACK/thaw and online gold-application coordination incomplete", + "Complete mutation quiescence/defer, old-core revocation/full recovery, exceptional settlement reconciliation and cross-core epoch handling incomplete", + "Copy/rate items, capabilities/status UI, matched live and Android acceptance pending", + "Won/Wolfman/Conqueror/five slots not advanced this batch" + ], + "next": "Original live-owner authoritative result image and apply/exact ACK/thaw closure before exposing a user craft action" +} diff --git a/audit/xxf-ch5/features.json b/audit/xxf-ch5/features.json index 18745e06..c64ef2e3 100644 --- a/audit/xxf-ch5/features.json +++ b/audit/xxf-ch5/features.json @@ -2,8 +2,8 @@ "schema_version": "1.1", "description": "XXF-CH5 to Cross-Platform Client Feature Migration Tracking Manifest", "baseline": { - "client_head": "60ed66692e2daccd66c4485b3632ae3fdb100933", - "server_head": "5b7442ea37cf162c4aadf18ea6b26c817e30b768", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", "preserves_dirty_worktree": true, "gate_script": "scripts/port_gate.sh", "snapshot_kind": "dirty_working_tree_heads_only", @@ -34,7 +34,7 @@ "path": "metin2-client/Client/pack/Index", "symbol": "pack_index", "reachable_import": null, - "sha256": "02c49fda69adf9325fb5b3231f47c3544711185526fbf47985010d1c3e59cf7a" + "sha256": "6a7612af15e051ee6c5eddd444c965721a3d0f5601b5f8223ad667e2d541ea22" } ], "rules": { @@ -203,7 +203,7 @@ { "path": "喜相逢五区客户端_extracted_locale/root_scripts/uitarget.py", "symbol": "SUB_RACE_FLAG_TO_FILENAME", - "reachable_import": "uitarget", + "reachable_import": "uiTarget", "sha256": "c105f6f82fba32cb97e417c3f264611ddda3b941cb98060439897b0fe15d216a" } ], @@ -212,7 +212,7 @@ "provenance": "XXF-CH5", "unresolved": [], "accepted_differences": [ - "Maps 6 elements (elec, fire, ice, wind, earth, dark)" + "Electric/fire/ice/wind/earth/dark attack-affinity flags, not inferred weakness or drop rates; lowest known flag wins for multi-element templates" ] }, "dependencies": [ @@ -222,20 +222,22 @@ "client": "src/platform/ScriptLib/TargetElementScript.inc", "server": null, "data": "mob_proto", - "resources": "ui/target_element", + "resources": "d:/ymir work/ui/game/12zi/element/*.sub", "entrypoints": [ - "TargetBoard.SetEnemyVID" + "uiTarget.TargetBoard.SetEnemyVID", + "uiTarget.TargetBoard.SetRaceElement", + "uiTarget.TargetBoard.ResetTargetBoard" ] }, - "protocol_contract_ref": null, + "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#ch5-target-trade", "activation_and_shutdown": { "client_gate": "app.ENABLE_ELEMENTAL_TARGET", "server_gate": null, "safe_default": "Hide icon when race has no elemental flag" }, "status": { - "source": "pending_review", - "implementation": "pending_review", + "source": "partially_verified", + "implementation": "partial", "build": "pending", "unit": "pending", "live": "pending", @@ -267,7 +269,7 @@ "locale_cases_ref": null, "observation_and_shutdown_ref": null, "blockers": [ - "Current candidate source/resource hashes and feature-specific acceptance evidence required" + "Actual server template consistency, rendered visual and Android device acceptance pending" ], "rollback_contract_ref": null }, @@ -283,8 +285,8 @@ "source": [ { "path": "喜相逢五区客户端_extracted_locale/root_scripts/uiexchange.py", - "symbol": "ExchangeDialog.SetLevel", - "reachable_import": "uiexchange", + "symbol": "ExchangeDialog.OpenDialog", + "reachable_import": "uiExchange", "sha256": "4b7ecc82a2107439eb61b350716c4d91921a73859e88b4c1a662a96017fdc62f" }, { @@ -296,31 +298,34 @@ ], "rules": { "version": "1.0", - "provenance": "XXF-CH5", + "provenance": "XXF-CH5 display with PORT server snapshot adaptation; not recovered original CH5 wire", "unresolved": [], "accepted_differences": [ - "Partner level synced via exchange packet or character status" + "51-byte GC_EXCHANGE START.arg3 carries partner opening-level snapshot, 0 legacy/unknown; never actor-cache fallback; levels 1..255; not a live level-up feed" ] }, "dependencies": [], "implementation": { "client": "src/port/UserInterface/PythonExchange.cpp", - "server": "game/src/exchange.cpp", + "server": "src/server/game/src/exchange.cpp", "data": null, "resources": null, "entrypoints": [ - "CPythonExchange::SetLevelFromTarget" + "CHARACTER::ExchangeStart", + "CPythonNetworkStream::RecvExchangePacket", + "CPythonExchange::SetTargetLevel", + "uiExchange.ExchangeDialog.OpenDialog" ] }, - "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#exchange", + "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#ch5-target-trade", "activation_and_shutdown": { "client_gate": "exchange.GetLevelFromTarget", "server_gate": null, "safe_default": "Hide level text if 0" }, "status": { - "source": "pending_review", - "implementation": "pending_review", + "source": "partially_verified", + "implementation": "partial", "build": "pending", "unit": "pending", "live": "pending", @@ -352,7 +357,7 @@ "locale_cases_ref": null, "observation_and_shutdown_ref": null, "blockers": [ - "Current candidate source/resource hashes and feature-specific acceptance evidence required" + "Matched two-player real-server trade/cancel/reconnect and Android device acceptance pending; title shows partner level, self snapshot exposed through API" ], "rollback_contract_ref": null }, @@ -721,13 +726,13 @@ "path": "metin2-client/src/platform/ScriptLib/InventoryPagesScript.inc", "symbol": "InventoryWindow patch", "reachable_import": "mt_inventory", - "sha256": "6dc8988f72ede963752372370b06ed81e89f14c58bb19445723f0a4f063e82ca" + "sha256": "c328445b7180142e0e084ca3593a1c37e182ef56607b96ca02585a19fa41c0da" }, { "path": "metin2-client/src/port/UserInterface/GameType.h", "symbol": "c_Inventory_Page_Count = 5", "reachable_import": null, - "sha256": "d6af0dbf008962fe1f18837b73cf5e44a632d3eae1ce96ab11861290902b5ef8" + "sha256": "caf9b0dc4a154e2e3c896246fdbeff33235006e0b6bbafcb199a9546690b1e03" } ], "rules": { @@ -1003,7 +1008,7 @@ "path": "metin2-client/src/platform/ScriptLib/SwitchbotScript.inc", "symbol": "Switchbot", "reachable_import": "mt_switchbot", - "sha256": "02a01c511fd147838e98aa6c0fb6be18e98de8410ee36717e38ac4375ba15de4" + "sha256": "9fa555e78c733c8f53da8524fa62334460d7383f1fff0725781e6567395c1ebd" } ], "rules": { @@ -1170,7 +1175,7 @@ "path": "metin2-client/src/port/UserInterface/GameType.h", "symbol": "c_Costume_Slot_Pendant = 23", "reachable_import": null, - "sha256": "d6af0dbf008962fe1f18837b73cf5e44a632d3eae1ce96ab11861290902b5ef8" + "sha256": "caf9b0dc4a154e2e3c896246fdbeff33235006e0b6bbafcb199a9546690b1e03" }, { "path": "metin2-client/src/platform/ScriptLib/PendantScript.inc", @@ -1257,7 +1262,7 @@ "path": "metin2-client/src/port/UserInterface/GameType.h", "symbol": "c_Costume_Slot_Weapon, c_Costume_Slot_Mount, c_Costume_Slot_Sash", "reachable_import": null, - "sha256": "d6af0dbf008962fe1f18837b73cf5e44a632d3eae1ce96ab11861290902b5ef8" + "sha256": "caf9b0dc4a154e2e3c896246fdbeff33235006e0b6bbafcb199a9546690b1e03" } ], "rules": { @@ -1601,10 +1606,10 @@ "provenance": "XXF-CH5", "unresolved": [ "79501 excluded due conflicting price/duration metadata; timed 79502-79504 candidate generated but not installed", - "Native arrow-type visual sync and matched live/device/item-lifecycle acceptance" + "Matched real-server item lifecycle, mounted/costume weapon combinations, actual attack timing and Android device acceptance" ], "accepted_differences": [ - "AVA2 active quiver9 semantics; claw8 reserved only; explicit pre-shot expiry checks; classic arrow visual fallback; whole-feature macro stays off" + "AVA2 active quiver9 semantics; claw8 reserved only; pre-shot expiry checks; capability2048 negotiated GC219 instead of expanding legacy parts; AVA2 special MSA missing in CH5; classic fallback when assets absent; whole-feature macro stays off" ] }, "dependencies": [], @@ -1616,7 +1621,10 @@ "entrypoints": [ "CHARACTER::GetArrowAndBow", "CHARACTER::UseArrow", - "CPythonPlayer::__HasEnoughArrow" + "CHARACTER::PortEnableQuiverSync", + "CPythonPlayer::__HasEnoughArrow", + "CPythonNetworkStream::RecvQuiverState", + "mt_quiver_motion.LoadGameData" ] }, "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#quiver", @@ -1660,7 +1668,7 @@ "observation_and_shutdown_ref": null, "blockers": [ "79501 excluded due conflicting price/duration metadata; timed 79502-79504 candidate generated but not installed", - "Native arrow-type visual sync and matched live/device/item-lifecycle acceptance" + "Matched real-server item lifecycle, mounted/costume weapon combinations, actual attack timing and Android device acceptance" ], "rollback_contract_ref": null }, @@ -1767,33 +1775,119 @@ } ], "rules": { - "version": "1.0", - "provenance": "XXF-CH5", + "version": "2.0-read-only", + "provenance": "AVA2 active WORLDARD/COPY branches; actual locale/cube.txt; current classic s_cube_proto", "unresolved": [ - "Server durable receipt/batch progress support" + "Complete game actor quiescence, especially durable retention of legitimate post-Submit mutations/rewards and direct setters/global callbacks; conservative admission and invalidation are not a freeze proof; both gates remain false", + "Game release-readiness and DB resume handoff, saving/expiry-event restoration and thaw; classic count-bearing action packets still BYTE; full character/non-normal-window recovery; copy attributes and success-rate items", + "Matched live game/db plus Android device asset consistency and presentation acceptance" ], "accepted_differences": [ - "Server validates every unit atomically" + "Game/client runtime remains read-only catalogue and 1..100-attempt preview; no craft action", + "Candidate SQL backend has fixed draws and atomic costs/rewards; v2 lifecycle adds durable per-item locks, correlated drain core and exact-image resync ACK", + "DB runtime guard methods are wired into saves/loads/deletes/economy and item flush; absent schema preserves baseline, partial schema fails closed", + "DB Arm/Submit adapter drives actual SQL FIFOs; internal header78 bounded LE handshake and game preparation/seal/final-save order are compiled but ingress is disabled, not a complete actor-freeze implementation", + "Only explicit pre-Begin cancellation ACK may clear preparation; timeout/lost transport/late cancel retain hold; detached dirty items included before Submit", + "Candidate reserves normal-inventory cells without merging reward stacks; copy recipes explicitly refused", + "Refuse unsupported multi-reward recipes rather than guessing semantics", + "Do not copy archived reward-count/item-allocation/copy-initialization bugs", + "ResumeCheck24/25 is an internal read-only preflight, NOT a resume grant: one pinned account transaction rechecks current normal inventory/gold, exact terminal ACK/history, current broker/no lease/fence, sealed source/applied credits, fixed-roll DONE reconstruction and permanent ID reservations. Runtime requires original still-playing peer/handle/session/ownership and RELEASED context, retaining all memory holds. Modern terminal RELEASED receipts also quarantine player/account saves/loads and current/reserved item IDs after DB restart, when memory holds disappear; no activation receipt or unlock path exists yet. No actual game sender or save-enable/thaw; both ingress gates remain false.", + "Candidate original-LIVE game now sends immutable terminal Release22 only after durable image ACK, authoritative publication and paused-event preparation. Every send/retry and accepted reply validates complete applied seal/image, registered restoration plan and all36 identity-rebound shortcuts; bounded shared Tick retries retain original session/cookie/batch/image. LiveReleased stops SQL retries but leaves actor held, item skip-save and DB memory gates intact. No DB resume grant, save-enable runtime caller or thaw; both ingress gates remain false.", + "Candidate held actor prepares registered restored-item expiry events only after publication and exact full-seal checks. Real-time, started-first-use and absolute unique clocks preserve persisted deadlines and remain paused while either held or skip-save. Unequipped wear, unstarted-first-use and played-time unique durations do not start. Exact owner/item/VID/full-metadata plan validation precedes an allocation-free skip-save clearing primitive, which has NO runtime caller pending authenticated DB resume. Actual event creation owns info on allocation failure and queue insertion cleans pending nodes; dispatch detaches a dequeued node before callbacks may cancel it. This is preparation, not save/event activation or thaw.", + "Revision25 GC93 op11 candidate publishes one bounded LE gold64/225-normal-inventory/36-shortcut view after durable ACK and full actor-seal recheck. Shortcut bindings captured before replacement are remapped by permanent item ID; consumed inputs never bind to a reward reusing the cell. Client stages full proto/grid/shortcut validation and commits without callbacks, preserves other windows and ignores exact/stale replay without overwriting later state. Internal client item counts widen only in memory; classic wire structs remain BYTE, with revision25 op12 full-count/extra companions on existing item set/update paths and old op10 fallback. Enqueue is not client receipt/rendering or thaw; ordinary save/expiry clocks and resume remain paused.", + "Candidate original-LIVE terminal SQL release uses optional release-addon v1: inside one account transaction it revalidates full ACK/current SQL/current LIVE grant, writes immutable batch/grant/image receipt, retires the lease and item fences, and sets RELEASED. Permanent item-ID tombstones remain. Exact replay checks current broker and refuses any conflicting newer lease/fence/history. Internal messages22/23 stay hard-gated; the candidate game sender waits for exact publication and paused-event preparation, without activating saving/events. DB memory save/load hold survives SQL release; trusted disconnect can reconcile lost release-COMMIT replies without inventing revocation or thaw. Resume, full actor readiness and gameplay acceptance remain incomplete.", + "Candidate original LIVE normal-inventory/gold image now installs persisted metadata without reward RNG or save/event side effects and verifies all-window readback. Internal LiveImageAck=20/Answer=21 carries the complete canonical image; optional image-ACK addon v1 stores immutable full batch/grant/image inside the same account Resync transaction after current SQL and original LIVE authority proof. Lost commit reply retries revalidate ownership. Actor rechecks full applied seal before every bounded ACK retry and initial ACK answer. Acknowledged is still held: no item-fence removal, owner release, save/event resume, UI publication or thaw.", + "Conservative admission denies item clocks/locks, PC timers, running quests, switchbot, party/combat/lifecycle hazards; whole switchbot rolls defer before cost/RNG. Gold/item/quest/lifecycle notifications latch invalidation; internal Invalidate aborts only unprepared fences, never accepted receipts. Both ingress gates remain false.", + "Gold-addon v2 / base Cube v2: positive intents persist and SQL credit follows verified DONE on clean FROZEN. Candidate non-party ground-gold pickup fsyncs outbox before removal, skips local credit/save, and retries exact bound enqueue/ACK. Frozen reply durably closes this source; only after every delivery ACK may its exact ordered event-ID manifest be sealed in SQL. Empty batches also need closure; new events after sealing are rejected and Resync/Release require matching seal plus completed credits. Real ingress remains disabled; trusted owner recovery, other mutations, ABORTED and actual crafting/image pipeline remain incomplete.", + "Owner-addon v1 candidate adds database-scoped connection lock and boot/connection generation, atomic fence+lease binding, trusted disconnect revocation and authenticated non-playing-account held adoption after exact original source/DONE/wallet checks. Adopted owners remain held; all registered owner rows block legacy release and ordinary loads/saves. No public recovery transport, owner-aware image/thaw or core-boot old-cache revocation is enabled.", + "Held adoption and ambiguous Retry proposals are now registered before returning, so repeated disconnect/logout/auth-record replacement can revoke them without a client ACK. Rejected commits reuse the same proposal cookie; durable non-ownership proof permits retiring only obsolete in-memory recovery slots. Peer/logout callbacks perform no SQL; a joint round-robin queue permits at most two revoke/finalize jobs per tick, with five-second failure backoff. This is pre-load lifecycle recovery, not restored gameplay or an absolute SQL latency guarantee.", + "Disabled internal header78 recovery preflight is wired before classic character load. Canonical RecoveryClaim=11/RecoveryAnswer=12 uses a 160-byte LE owner grant; only explicit unheld RecoveryClear allows one still-guarded classic load. Granted never loads/thaws. Game pins descriptor pointer/handshake/account/player/session and bounds retries; actual DB reply parser now permits GoldAck, GoldCloseAck and RecoveryAnswer as well as Answer, rejecting request-direction messages. Old core revocation and authoritative image restore remain incomplete; both gates stay false.", + "RecoveryImageRequest=13/Answer=14 now transports only gold+normal-inventory image, not full character restoration. Resync validates the current adopted grant inside the same account transaction, original sealed source, verified ok DONE and fixed-draw settlement, exact expected item bytes, all applied credits/current wallet even for zero credits, item locks/reservations. Previously issued owner image cannot be overwritten. Game validates item proto/grid and retains bytes without loading, applying, acknowledging or thawing; old core/full data/ACK release remain incomplete.", + "Disabled original-live-owner Prepare=15/Execute=16/CraftAnswer=17 now calls the actual durable backend with authorization inside the same account transaction/pinned SQL connection. Requires clean FROZEN, current LIVE grant and original exact sealed source; fixed DB entropy draws persist once, identity-only Execute/replay returns canonical CCR1 receipt. Actual actor Tick advances only after durable source-close ACK, validates receipt against batch/proto, bounds request retries and retains actor hold after completion. Batch/factory/permanent-ID construction, public craft action, local apply/ACK/thaw and full mutation audit remain incomplete." ] }, "dependencies": [], "implementation": { "client": "src/platform/ScriptLib/CubeRenewalScript.inc", - "server": "game/src/cube.cpp", + "server": "src/server/game/src/port_cube_catalog.inc", "data": "cube.txt", "resources": "ui/cube", "entrypoints": [ - "CubeRenewalWindow.Open" + "game.GameWindow.BINARY_Cube_Open", + "cube_renewal.OpenPreview", + "cube_renewal.CheckBatch", + "PortCubeQuery", + "PortCubeStart" + ], + "server_ownership": [ + "src/server/db/src/Cube.cpp", + "src/server/common/cube_drain.h", + "src/server/common/cube_fence.h", + "src/server/db/src/CubeRuntime.cpp", + "src/server/db/src/SQLFences.h", + "src/server/common/sql_fence_router.h", + "src/server/common/cube_handshake.h", + "src/server/game/src/port_cube_actor.cpp", + "src/server/game/src/port_cube_flush.inc", + "src/server/common/cube_mutation.h", + "src/server/game/src/port_cube_item.inc", + "src/server/game/src/port_cube_quest.h", + "src/server/common/cube_gold_intent.h", + "src/server/common/cube_gold_store.h", + "src/server/db/src/CubeGold.cpp", + "src/server/common/cube_gold_outbox.h", + "src/server/common/cube_gold_source.h", + "src/server/common/cube_owner.h", + "src/server/common/cube_owner_types.h", + "src/server/common/cube_recovery.h", + "src/server/game/src/port_cube_recovery.cpp", + "src/server/game/src/port_cube_recovery.h", + "src/server/common/cube_image.h", + "src/server/common/cube_live_image.h", + "src/server/common/cube_image_ack.h", + "tools/cube/image-ack-schema.sql", + "src/server/common/cube_release.h", + "tools/cube/release-schema.sql", + "src/server/common/cube_presentation.h", + "src/server/game/src/port_cube_publish.cpp", + "src/server/game/src/port_cube_publish.h", + "src/server/game/src/port_cube_restore.h", + "src/server/game/src/port_cube_restore.cpp", + "src/server/game/src/port_cube_lifecycle.inc", + "src/server/game/src/event.cpp", + "src/server/game/src/event_queue.cpp", + "src/server/game/src/port_cube_apply.cpp", + "src/server/game/src/port_cube_apply.h", + "src/server/game/src/port_cube_registry.inc", + "src/server/game/src/char.h", + "src/server/common/cube_craft.h", + "src/server/common/cube_receipt.h", + "src/server/common/cube_random.h", + "src/server/common/cube_item_ids.h", + "src/server/game/src/port_cube_ids.h", + "src/server/game/src/item_manager_idrange.cpp", + "src/server/game/src/port_cube_factory.cpp", + "src/server/game/src/port_cube_factory.h", + "src/server/game/src/item_manager.cpp", + "src/server/game/src/item.cpp", + "src/server/game/src/item.h", + "src/server/game/src/item_attribute.cpp" + ], + "client_presentation": [ + "src/port/common/CubePresentation.h", + "src/port/UserInterface/PythonPlayerCubeView.inc", + "src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp", + "src/port/UserInterface/GameType.h" ] }, - "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#cube_renewal", + "protocol_contract_ref": "AVA2-IMPLEMENTATION-SPEC.md#ch5-cube-catalogue", "activation_and_shutdown": { - "client_gate": "app.ENABLE_CUBE_RENEWAL", - "server_gate": "cube.cpp version check", - "safe_default": "Classic cube fallback" + "client_gate": "Capability4096 only enables labeled read-only preview; ENABLE_CUBE_RENEWAL_WORLDARD remains 0", + "server_gate": "No public crafting action; internal Start/settlement/live-image handlers remain behind both false hard gates", + "safe_default": "Classic Cube unchanged; unsupported server does not open modern preview" }, "status": { - "source": "pending_review", + "source": "partially_verified", "implementation": "partial", "build": "pending", "unit": "pending", @@ -1826,8 +1920,9 @@ "locale_cases_ref": null, "observation_and_shutdown_ref": null, "blockers": [ - "Server durable receipt/batch progress support", - "Current candidate source/resource hashes and feature-specific acceptance evidence required" + "Complete game actor quiescence, especially durable retention of legitimate post-Submit mutations/rewards and direct setters/global callbacks; conservative admission and invalidation are not a freeze proof; both gates remain false", + "Game release-readiness and DB resume handoff, saving/expiry-event restoration and thaw; classic count-bearing action packets still BYTE; full character/non-normal-window recovery; copy attributes and success-rate items", + "Matched live game/db plus Android device asset consistency and presentation acceptance" ], "rollback_contract_ref": null }, @@ -2441,13 +2536,13 @@ "path": "metin2-client/src/port/UserInterface/Packet.h", "symbol": "TPacketGCExtendedPointGold", "reachable_import": null, - "sha256": "7d4546b516d5530ff31557974239a1d5a5a45619739af41c582706f0463a6eb1" + "sha256": "9beec28ee5915210e908b43e32536f8f1f7a8a039905763b6ca96d3693efd6f4" }, { "path": "metin2-client/src/port/UserInterface/PythonPlayer.h", "symbol": "CPythonPlayer::GetElk", "reachable_import": "player", - "sha256": "47b6a5b48ac5f7af6939de2f92b944570353eb231ccb23021e3288230a262b3a" + "sha256": "041a541acd3a58499ccdae5acbcbe9021f4df95ce43409e733e13728d3a2ded2" } ], "rules": { @@ -2873,7 +2968,7 @@ "path": "metin2-client/src/port/UserInterface/Packet.h", "symbol": "ENABLE_ATTR_6TH_7TH", "reachable_import": null, - "sha256": "7d4546b516d5530ff31557974239a1d5a5a45619739af41c582706f0463a6eb1" + "sha256": "9beec28ee5915210e908b43e32536f8f1f7a8a039905763b6ca96d3693efd6f4" }, { "path": "metin2-client/src/platform/ScriptLib/CostumeAttrScript.inc", @@ -2975,7 +3070,7 @@ "path": "metin2-client/src/platform/ScriptLib/FeatureServiceScript.inc", "symbol": "Calendar/Dungeons/Boss query", "reachable_import": "mt_feature_service", - "sha256": "71e0a3cf925bfb698279a482f6f912c246d457d7d66d6538502e0eea219d09f4" + "sha256": "50d385786607bbae1d315a3dc6b0d8cd60a5e9ead0cde2b80c04a5ecc0628f22" } ], "rules": { diff --git a/audit/xxf-ch5/post-pull-20261023.json b/audit/xxf-ch5/post-pull-20261023.json new file mode 100644 index 00000000..6c4d8341 --- /dev/null +++ b/audit/xxf-ch5/post-pull-20261023.json @@ -0,0 +1,194 @@ +{ + "schema_version": 1, + "date": "2026-10-23", + "status": "PARTIAL_POST_MERGE_BUILD_AND_OFFLINE_ASSET_VERIFICATION_NOT_LIVE_ACCEPTANCE", + "client_head": "c1de05dc98b5efa84eb0d08f9cfe193a2612c7e1", + "server_head": "6924dc9b4936f25ff008952049f475a8f0d29683", + "preserves_existing_dirty_work": true, + "stash_backups_retained": { + "client": "41c65cd046bd4d4bbf028d725454cba1a9774d19", + "server": "96a3b05a4303c8ef66e4d46fe7f5d5e77aef93b0" + }, + "client_source_asset_binary_log_sha256": { + "tests/port/port_login_flow_test.cpp": "03225d2bc66654dbe7c086f629ad9536ba11d24f5a0c461d91d1f34d4a7cddc4", + "tests/port/port_solution_b_verify_test.cpp": "6221e0fd48676248741d12c37a15c048928863bff69fa31563530997e92b7d61", + "src/platform/ScriptLib/Resource.cpp": "4061a059d78bb49bd399c378b0f4ee6b7f203b95a1ceea4af2ef58e85b9f850a", + "src/platform/ScriptLib/SwitchbotScript.inc": "9fa555e78c733c8f53da8524fa62334460d7383f1fff0725781e6567395c1ebd", + "src/port/UserInterface/PythonApplicationModule.cpp": "c51ba23fb1a558b68c96dd499d2f9f4f2a602ddd44be041db2b0c4f26c30dac1", + "scripts/build_xxf_item_overlay.py": "d8f53a993dd0204c556fe6f7bfe1e5cdd448ba8c9bf9139e3e05a0f3487fd0fe", + "scripts/migrate_to_xxf_models.py": "b6ba95d52cd3f3a12449dd4db5c20f91a8abeb4e91d9295423f68a77808a4589", + "scripts/build_xxf_features_json.py": "421d821d3933ff5ce28bbcb7235d0a4c395cec1f5a10d38cfd2357fc8765a978", + "audit/xxf-ch5/features.json": "18222476a93925bba2ffd0b396b7fc0f65bfc8c0a59d37db4047b70196bbf2fd", + "docs/XXF-CH5-POST-PULL-20261023.md": "6740737bf83a752d67c921acae1f945a16e01affab90887e6f00f1d0ee42f057", + "Client/channel.inf": "40af4223da57ac5321e5deff8ba83c70ae980cda5c7825cde91a862e9709a112", + "Client/locale.cfg": "8f0a83e09f6c500fc6b6e194540e5826aaedec10cfb2164bcdbb925223b81a19", + "Client/pack/Index": "6a7612af15e051ee6c5eddd444c965721a3d0f5601b5f8223ad667e2d541ea22", + "Client/pack/root.eix": "2afcc4cf5ce569747d810d2954c5f28f2ddf48b583bdc6cf06e0a2d226dcb060", + "Client/pack/root.epk": "0ea0c8a2353657716d024b74dcbdf9b29a7afc93c2ede38c6403ccb0fb5a6ca6", + "Client/pack/ava2items.eix": "bbc4edd58cc37df3be797405e3fef5d801f20fc17635b7b26653f8ff2bdeb92d", + "Client/pack/ava2items.epk": "6807610f65a5534ace494ed56629ea930c4f8e06220b3802b6e7b1e3931e1700", + "Client/pack/locale_zh_ava2.eix": "61b3663025affef193562a88c9256706177e5a3b8e2fb05d9e13b9980b1393cf", + "Client/pack/locale_zh_ava2.epk": "203cc5160027829d6f2082c9b54404890abe3fdc252bcd9d7e5c1e1252e50791", + "Client/pack/locale_zh.eix": "6c54f2adb0599dd67130ef3404627a707a3e22a6956a268df3528821084f0276", + "Client/pack/locale_zh.epk": "ad7d62aeeeb2819600abb96fe8a5569c5fb1149184c20b988b415e13e77409fd", + "Client/pack/new-ui.eix": "01a78ade0e5f216a3cb25093774bf679f252dc7e5a0ac5e381a725f252cdef3c", + "Client/pack/new-ui.epk": "dd9f61451cfcc596ebcfa5bfeb21fb6f7c3babd1d4c68d20e3d12a5a2f17493a", + "build/release/src/host/mt_native_render": "0d8da54a2454b11bceeab86f6a022e7af4d03a313f47f6709c8a54ac3c937e4e", + "build/native/src/port/port_login_flow_test": "217ff38124a9102f96b0e988d86077d19c37ab57e2356b518c92d23bc95eabe3", + "build/native/src/port/port_solution_b_verify_test": "ce84161f8ef2449e8a55f65d8f81b9979c63b9f1221be7dd21c98fef9a27641b", + "build/ch5-tests/20261023-post-pull-final/report.json": "b149b1536c87fb94d5ffd629a08bdda50f57e64c27105b526bad54aea4a2aeec", + "build/ch5-post-pull.g6GcPk/ch5-merge-client-build.log": "7a1c0d106795fec0b6d775ada6b9d43756c0a7d05dfb8f7da423f28b7bb64e77", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-native-tests-build.log": "4ea8c5f8f248357d641dd613c0a3778e3748ef7738a364ab334ee11cd86382ab", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-pack-tests-build.log": "98810c15dab6a8be65d303ee7f7574a309678e87192403c7b0ed0bace4f524c4", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-pack-native.log": "b96768d3a16dbd1cbc91acb54dde4fb86fe42e126279490e027d6daf11c60ccf", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-unit-native.log": "c16b37ad19daa05d76a13126210bc2207b9680ad8ac6d8cf4d4e9251922f60b7", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-solutionb.log": "1f187789cd71d66f8d172a31dbd401c282ed38af0d928f871f5a628d7b88b051", + "build/ch5-post-pull.g6GcPk/ch5-post-pull-final-regression.log": "342cdf30e09198af85a26eb2cb30f9bb7eb7d1831736d3e44124353743d602c3" + }, + "server_source_sha256": { + "src/server/game/src/main.cpp": "808d850d4f20599c2bb26620a8bec4f1c49552367a62f5d267bad708144d9341", + "src/server/game/src/Makefile": "cf286e6d7aa2f01592e06180ed93ba6b6f384726f1dde8266c2b7cf333be3a13", + "src/server/game/src/port_cube_actor.cpp": "fa46aa608a9491bdff0db80423d4e79ae9542e947438f13446b12233b603067a", + "src/server/game/src/char_item.cpp": "582101a95d7160c7dbf975779b11d80f8359b4cbd4c135224d59754af76c2d2d", + "src/server/game/src/offlineshop_manager.cpp": "9a880a00af3a7c94d76b042a0778e9e595a23c5ac7f4c937f69f7771c613a26a", + "src/server/common/cube_handshake.h": "3490c4cd65c5ef8274536221d830983361dd7ae688cb9123564b0c115686f051", + "src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "src/server/common/cube_store.h": "33ec59838141c7cb6661c3406980d3b7ea86afd472358cc6ca7af31e15d18e03", + "src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "src/server/db/src/Cube.cpp": "ac8e1245b33380eb3af72ac9325e12952168e6147027f56b81bfc9218285a177", + "src/server/db/src/CubeGold.cpp": "a89e07ca3f1138398ee14eefb7e290f92d240c5594d31ca227a590ba45dd2830", + "src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "src/server/db/src/Makefile": "3d6d367b140f025e46e76e24b819e4d9819b0a8f3cf996cae7f79d175c428cfb" + }, + "freebsd_source_binary_log_sha256": { + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/game/src/main.cpp": "808d850d4f20599c2bb26620a8bec4f1c49552367a62f5d267bad708144d9341", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/game/src/Makefile": "cf286e6d7aa2f01592e06180ed93ba6b6f384726f1dde8266c2b7cf333be3a13", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/game/src/port_cube_actor.cpp": "fa46aa608a9491bdff0db80423d4e79ae9542e947438f13446b12233b603067a", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/game/src/char_item.cpp": "582101a95d7160c7dbf975779b11d80f8359b4cbd4c135224d59754af76c2d2d", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/game/src/offlineshop_manager.cpp": "9a880a00af3a7c94d76b042a0778e9e595a23c5ac7f4c937f69f7771c613a26a", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/common/cube_handshake.h": "3490c4cd65c5ef8274536221d830983361dd7ae688cb9123564b0c115686f051", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/common/cube_gold_store.h": "aef59d5ca9f8f5668df992c0c2e283d79bd71f8f4bec14bdfd8b18191aec6f8e", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/common/cube_gold_intent.h": "fe03b5c91def0ba9a17615b24421937341ec17842f541c12558f46c6ea6b2dd8", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/common/cube_store.h": "33ec59838141c7cb6661c3406980d3b7ea86afd472358cc6ca7af31e15d18e03", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/common/cube_fence.h": "a4d26a1e7eaa8dfc04eb3ccdad3ded0a962a2f1f49161dce1c1dad5028362f42", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/db/src/Cube.cpp": "ac8e1245b33380eb3af72ac9325e12952168e6147027f56b81bfc9218285a177", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/db/src/CubeGold.cpp": "a89e07ca3f1138398ee14eefb7e290f92d240c5594d31ca227a590ba45dd2830", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/db/src/CubeRuntime.cpp": "a4733833c7c0073206c7cff056dc0abaab154a826ab3ed4f1e595dd96b0f5de2", + "/root/deploy-features/ch5-post-pull.ptruOK/build-root/src/server/db/src/Makefile": "3d6d367b140f025e46e76e24b819e4d9819b0a8f3cf996cae7f79d175c428cfb", + "/root/deploy-features/ch5-post-pull.ptruOK/bin/game": "6380a9d34bc265476d58e65b42063dd14cc38520e79037bfa026aec552242849", + "/root/deploy-features/ch5-post-pull.ptruOK/bin/db": "ed73045feaf16879efb7aa158c6f3d1aa3699b12e5c9a326870d6ac91d068502", + "/root/deploy-features/ch5-post-pull.ptruOK/game-build.log": "45eb3535e299ed32f90f7b77312e091ad67652872d753fda36dd67d9e06a6f49", + "/root/deploy-features/ch5-post-pull.ptruOK/db-build.log": "716ce461cd7fce9c293ae41d19689bba08145c4d316755c1b07671bda6ecada8" + }, + "tests": { + "summary": { + "pass": 130, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "source_changed": false, + "release_ready": false, + "unittest_cases": 389, + "top_level_probes": 33, + "report": "build/ch5-tests/20261023-post-pull-final/report.json", + "client_build": "CMake Release mt_native_render succeeded; existing SDL3/Vulkan/CMake pipeline retained, no Swift/Xcode project or Run setup added", + "native_units": "2/2: port.grp_resource, port.python_ui_modules", + "native_ch5": "FakeLoginServer current Client packs, real CubeRenewal layout/preflight, new PNG resource-factory and item-type assertions; passed. Does not craft or connect to production.", + "solution_b": "8/8 GR2 models plus locale/proto/cube/icon load checks passed; explicit expected item count 12059. Invalid 0/12x/4294967296 expectations rejected.", + "freebsd": "Fresh game and DB object directories, -j2 sequential builds, inherited platform-matched internal libraries; no production replacement or process launch", + "warnings": "Existing warning output retained. Server Makefiles retain -w: not a strict-warning audit.", + "mysql": "Not rerun; previous isolated MySQL results remain historical", + "live": "Not run; only read selected CHANNEL/PORT/P2P_PORT/MAP_ALLOW fields from CH4 CONFIG, no credentials/database mutation", + "android": "Not built or device-tested this batch", + "rendered_visual": "Not performed; native loading assertions are not visual acceptance", + "post_regression": "Only this evidence JSON added after final regression; no source/manifest/doc edits" + }, + "assets": { + "registered_pack_pairs_present": 44, + "overlay_before_base_locale": true, + "base_item_count": 11545, + "ava2_item_count": 7626, + "overlay_item_count": 12059, + "added_vnums": 514, + "retyped_vnums": 303, + "comparison": "All added/retyped canonical proto records equal AVA2 source, overlay ID set equals union of base and AVA2. Read via existing pack decoder and native item_proto_patch; no rebuilding formal packs.", + "png_actual_loads": [ + { + "path": "cream/pages/page_1_down.png", + "width": 26, + "height": 26 + }, + { + "path": "d:/ymir work/ui/game/battle_pass/gauge/gauge_bpass.png", + "width": 16, + "height": 8 + } + ], + "item_type_checks": [ + { + "vnum": 6884, + "type": 18, + "subtype": 0 + }, + { + "vnum": 11300, + "type": 2, + "subtype": 0 + }, + { + "vnum": 19529, + "type": 36, + "subtype": 0 + } + ], + "limits": "Selected-load/type checks only, not all textures or gameplay. Existing Wolfman motion and background-music diagnostics remain." + }, + "channel": { + "file": "Client/channel.inf", + "value": "1 4 0", + "server_channel": 4, + "game_ports": [ + 13030, + 13031, + 13032 + ], + "p2p_ports": [ + 14030, + 14031, + 14032 + ], + "config_root": "/usr/metin2/server/channel4", + "verified": "Selected CONFIG fields only, not live login or service-health acceptance", + "remaining": "Original CH5 root serverInfo still has historical public address and channel keys 0/1; channel.inf alone does not establish CH4 routing. Match native --live-server endpoint and verify login before claiming CH4 acceptance." + }, + "gates": { + "HandshakeEnabled": false, + "ActorMutationAuditComplete": false, + "modern_crafting_enabled": false, + "release_ready": false + }, + "next_implementation": { + "source": "Candidate non-party ground-gold pickup after current distance and ownership validation; verified PickupItem->GiveGold->RemoveFromGround/destroy->Save ordering", + "requires": [ + "Stable source event identity and persistent sequence", + "fsync outbox before ground-gold removal; no duplicate local PointChange", + "Reliable retry, trusted enqueue reply and durable ACK", + "Crash/disk-fault/capacity/late-request and party-policy tests", + "ABORTED reconciliation and full asset freeze remain separate blockers" + ], + "implemented_this_batch": false + }, + "not_complete": [ + "End-to-end gold producer/outbox/ACK", + "Full actor quiescence and authority image application/thaw", + "ABORTED and cross-core ownership recovery", + "Actual crafting action/factory/copy/success-rate items", + "Matched live CH4 and Android acceptance", + "Won/Wolfman/Conqueror/five slots" + ] +} diff --git a/audit/xxf-ch5/quiver-sync-20261022.json b/audit/xxf-ch5/quiver-sync-20261022.json new file mode 100644 index 00000000..824131c0 --- /dev/null +++ b/audit/xxf-ch5/quiver-sync-20261022.json @@ -0,0 +1,74 @@ +{ + "schema_version": 1, + "status": "PARTIAL_NOT_RELEASED", + "date": "2026-10-22", + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "source_sha256": { + "src/platform/ScriptLib/QuiverMotionScript.inc": "0faf7aff5f2df375d5dc81577973c6a3c97722f94789be06b4a8ee395461b96c", + "src/platform/ScriptLib/InventoryPagesScript.inc": "c328445b7180142e0e084ca3593a1c37e182ef56607b96ca02585a19fa41c0da", + "src/port/UserInterface/PythonApplicationModule.cpp": "c51ba23fb1a558b68c96dd499d2f9f4f2a602ddd44be041db2b0c4f26c30dac1", + "src/port/UserInterface/InstanceBase.cpp": "1887751d5d80671937e68c1f0730a97ff35f90aeced0a63636639b93c10cedb4", + "src/port/UserInterface/NetworkActorManager.cpp": "a6f1a733c778033c83aa3c1e20e9d59c6e8d70cc2c32c0da220ca068314d406b", + "src/port/UserInterface/Packet.h": "9beec28ee5915210e908b43e32536f8f1f7a8a039905763b6ca96d3693efd6f4", + "src/port/UserInterface/PythonNetworkStreamPhaseGameActor.cpp": "506c77d3a9a9c7f1797bd3d595d094c5e193acc787c2f2e217305d9625b8a6cc", + "src/platform/ScriptLib/FeatureServiceScript.inc": "82791d754479191f6e56961025632fd596341f65d4bcbf9bab52476e6bf15ddd", + "tests/port/port_login_flow_test.cpp": "0615a879206542f776c662d9d7365673734877e1cfc4d20bba4b0b988f1dc143", + "tests/port/port_login_flow_server.cpp": "1ea0d285381a03328243ad0552e96cdd35c8b24aa9d14946a21b4d384ddb120f", + "tools/server/ava2-items/quiver_assets.py": "7c234dc776d044ad6e9396491ac1685cb5095e017170d1eddb3237396784388c", + "tools/server/ava2-items/stage_quiver_client.py": "24e544ca2f2248c165bd8d83b0426f12153f2e0d119e907299ffea5ffe236a10", + "tests/wiki/test_quiver_motion.py": "09efe27c043daea2b6ac3cd16c3e8b7a68cf9193520e4e7d944ca4fe81223627", + "tests/wiki/test_inventory_pages.py": "45a831fee8e1544e97644353de5f4aeae134c71dffaac4e8e640e961b5e24ff7", + "tools/server/ava2-items/tests/test_quiver_assets.py": "6d14cb5977ab355210c2ce11b448feed3c79906e8aa32057287bd28faf05e6a2", + "tools/server/ava2-items/tests/test_quiver_staging.py": "223abaaacec8ab20269c9d2a261bc67e79aed2ea10b8e68e597e93ffed6e0558" + }, + "server_source_sha256": { + "src/server/game/src/char.cpp": "031658f532c890cab651d72d6f64ae47b6c0fbf670fc3ea5e28f29771fb1854d", + "src/server/game/src/port_quiver_sync.inc": "bb1f74c551e6590ecb7ae407d4149fab9289c5f9b404a15ef941d909bc07814f", + "src/server/game/src/port_quiver.h": "1d258dbc74608d413f632580f8f8653daada4394751598709f6c7d8e35aabe64", + "tests/features/test_quiver_sync.py": "1a5e33c5676c4fda1b43bceb1ca133f8168a089eda3405d0617495b29333f990" + }, + "artifact_sha256": { + "build/port-gate/macos/src/port/port_login_flow_test": "6fb7c3acc008c86d4f687ea21bf2abef9d0246e993b13c0179a95c7f1e93e0bc", + "build/port-gate/macos/Testing/Temporary/LastTest.log": "99875bf0c57cca90d7380a58721e6e3b77bbff344da661f0b1597688c31f1f33", + "build/ch5-quiver-motion-native-20261022-r4.log": "5b461f36fb4b7c6b94f5a1bda696923d75e3d36578f66701e5466a3284846ff6", + "build/ch5-android-20261022-final.log": "6249e2ca7da2e7647fb1fafd26de59a1105ec2d6dfe7f8aa84a708809c787bdf", + "android/app/build/outputs/apk/debug/app-debug.apk": "836fc1ff19dc6d5da3da63d30bb702daf3110182289ae8e662fd475381d32a5a", + "build/ch5-quiver-motion-20261022/manifest.json": "12a131513b84c89a11897f12adf91f65eea0cafd089c56235322db9c0baac8f2", + "build/ch5-tests/20261022-175739-ozfowvps/report.json": "89b36ef72ae6c04563e72896215059026ad9d18475cf1422d379f815216e5c2f" + }, + "base_index_sha256": "02c49fda69adf9325fb5b3231f47c3544711185526fbf47985010d1c3e59cf7a", + "tests": { + "local_file_results": { + "pass": 116, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 352, + "top_level_probes": 33, + "source_changed_during_regression": false, + "native_ctest": "3/3 pass: login_flow, quiver_sync, python_ui_modules", + "private_ch5_native": "pass: automatic mode registration, both sexes MSA/FLY parsing, female archer bow mode 9/6/0/9, five inventory pages, Won dependent gate off", + "android": "Release native / debug-signed APK build passed; no deploy", + "post_regression_metadata": "Manifest generator and docs updated afterwards; feature manifest unittest rerun passed; no runtime source changed afterwards" + }, + "freebsd": { + "path": "/root/deploy-features/quiver-sync.KnSIU6", + "verification": "Prior full build completed; this turn read-only hash check of binaries and matching char.cpp/port_quiver_sync.inc", + "game_sha256": "89eeae618e8fb9c5fec890427c0587b2fc0933c9b887888f858c92ca81217a47", + "db_sha256": "bd979cf3b990587f31ed0e45dd9623b3e10df3011759b35a6bd7d5ed4d8609a9" + }, + "limitations": [ + "No matched real-server item lifecycle validation", + "No mounted/costume or multiplayer visual acceptance", + "No actual battle timing or rendered visual proof", + "No attached Android device; no installation", + "Existing non-batch sound/Wolfman motion warnings remain", + "No production deploy or item issuance; whole-feature gate remains 0", + "Other incomplete CH5 features remain incomplete" + ] +} diff --git a/audit/xxf-ch5/target-trade-20261022.json b/audit/xxf-ch5/target-trade-20261022.json new file mode 100644 index 00000000..e3b947b7 --- /dev/null +++ b/audit/xxf-ch5/target-trade-20261022.json @@ -0,0 +1,73 @@ +{ + "schema_version": 1, + "date": "2026-10-22", + "status": "PARTIAL_NOT_RELEASED", + "features": [ + "F03", + "F04" + ], + "client_head": "3784137b4f5dd36411cf56ecf1eb3c6a438985be", + "server_head": "e8ace59fcd2847d75aa9b6f4a70fb479ca3cbb35", + "source_sha256": { + "src/port/UserInterface/PythonExchange.cpp": "34c796febf3d465f9509a1260d628ed66695c100b4557faf2197eddeeda463bb", + "src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp": "07b030a6bd0df5dab751c290137d7f182e31182f62b26ef05662a97914c82dda", + "src/platform/ScriptLib/Ava2UICompatScript.inc": "c45ed09a400c2655ed50c4c860ea2d4ccb2ebb906c465d32196bf04142cb4ee5", + "src/platform/ScriptLib/TargetElementScript.inc": "e4a6e5abb7df111b2c0c6b4435f2f0640dc72951a3cb5040b9e87b308ddc6fae", + "src/port/CMakeLists.txt": "ef3a489c8583b2ae601f41b657801fa462d5bbcb27406b878fded06585e7dea6", + "tests/port/port_login_flow_test.cpp": "54e5aaeebb821968b9829ad3a4e26168206e1fda64d9cd9e9ba60b064f30a2e6", + "tests/port/port_login_flow_server.cpp": "a0d60c67fc7066fb3577c37a729fd7e6c62fa2cf554e4adc26a6ebdbf3050802", + "tests/wiki/test_trade_level.py": "578333a332f242f47687cbf914f8b6229b876c40785d60304b205f4199cb1e39", + "tests/wiki/test_trade_level_ui.py": "ffc7ed6667545fec7be464de969017dddc054f2e72acce212b40f1a1ab31eb74", + "tests/wiki/test_target_element.py": "16c95b66524e12b27f846a5a95f87130c8f9a0d2b2cd17dd382747d377d1add0" + }, + "server_source_sha256": { + "src/server/game/src/exchange.cpp": "1e8b1fb1c0400a817c2aff3442da3d86c3f5eb9772248993b8b4aff1e38eabaa", + "tests/features/test_trade_level.py": "5f3188fa55cf81858f456fe7b7f0c129749ccc99b13bc37ee3806411d89c8a5b" + }, + "artifact_sha256": { + "build/ch5-tests/20261022-182520-x8m30ahk/report.json": "4d9efdc17e8c41ef324010d5f74823920181a1857b00e46ca0fd1ba611bcdaf3", + "build/ch5-trade-element-ch5-native-20261022-r2.log": "2756149a5f611a84391f205107d92e59139ef3c4ff0bcecd22508eff6a0e2a2a", + "build/ch5-trade-element-ctest-final-20261022.log": "5f4d9dfd48f8372876d996462ed08125494ca36b141dd2df6e5ad9989beaa962", + "build/ch5-trade-element-android-20261022.log": "a7476ebd9d265733b67b905ef6ecb5f108c441f3f1e288f44e4f6dc5d56d9131", + "build/port-gate/macos/src/port/port_login_flow_test": "4504f72a662868f60f9a6a9f74eb4736f1e0c1a3a90d75623f794d3c938b5c86", + "android/app/build/outputs/apk/debug/app-debug.apk": "692a7420bd0044309c2b7cd2c49727acfbf06b35d7aab2ed585089a2c8e2bff9" + }, + "tests": { + "local": { + "pass": 120, + "partial": 0, + "fail": 0, + "timeout": 0, + "error": 0, + "unverified": 0, + "blocked": 0 + }, + "unittest_cases": 361, + "top_level_probes": 33, + "native": "4/4: login_flow, quiver_sync, trade_level, python_ui_modules", + "private_ch5": "PASS: repeated START/END levels, zero/invalid hidden; six actual image resources loaded with explicit race-flag substitutes, target lifecycle hiding", + "android": "Complete Release-native debug-signed APK; --no-deploy", + "source_changed_during_regression": false, + "post_regression_metadata": "Generator/docs changed afterwards; manifest unittest rerun passed; no runtime changes afterwards" + }, + "freebsd": { + "directory": "/root/deploy-features/trade-level.aXURA5", + "build": "Copied prior isolated full-build source/libs/objects; exchange.cpp recompiled and game relinked; not clean full-library rebuild", + "game_sha256": "a9051aa113883a07dfe6eb36caf6106f9ca5b9af8c5309e9664b045e2715fce5", + "exchange_sha256": "1e8b1fb1c0400a817c2aff3442da3d86c3f5eb9772248993b8b4aff1e38eabaa" + }, + "contracts": { + "trade": "Existing GC42 START0 arg3 DWORD = partner opening level 1..255 or 0 unknown; unchanged 51-byte layout; no actor-cache fallback; reset on END", + "elements": "Existing template attack-affinity flags electric/fire/ice/wind/earth/dark; lowest known flag priority, not weakness" + }, + "limitations": [ + "No deployment or economy/item rule change", + "No true two-player matching-server trade/reconnect validation", + "Own level snapshot exposed via API; title displays partner level only", + "Opening snapshots, not live level-up updates", + "Native elements use explicit test overrides; actual server template consistency pending", + "No rendered visual or Android-device proof; adb list empty", + "Existing sound/Wolfman-motion/compiler warnings remain", + "Other incomplete CH5 systems remain incomplete" + ] +} diff --git a/docs/AVA2-IMPLEMENTATION-SPEC.md b/docs/AVA2-IMPLEMENTATION-SPEC.md index d3c1ed79..05a09046 100644 --- a/docs/AVA2-IMPLEMENTATION-SPEC.md +++ b/docs/AVA2-IMPLEMENTATION-SPEC.md @@ -22,6 +22,30 @@ F19数据增量:专用工具仅生成两份AVA2归档一致的79502~79504候选,79501排除。输入必须绑定当前实际注册包的原型/清单/说明;既有型号替换必须显式开启并绑定原型SHA256,前后数值留档。五区79502买价550000改用AVA2归档0,移除当前未启用的狼人禁用位,其余限制保留;不意味着允许免费售卖。只生成隔离产物,不修改Index、服务器原型或商店。完整过程和门槛见[箭筒记录](XXF-CH5-QUIVER-20261022.md)。 +#### 同日后续:F19状态与动作契约 + +此节替代上文“专用外观尚未移植”的早期阶段描述。 + +- 不扩展既有角色parts、装备包或DB字段。能力位2048,经既有MTF1能力协商后发送 `/mt_features 1 REQ quiver`,空快照begin/end确认后启用该角色连接的瞬时同步。当前完整能力掩码4031;旧客户端没有请求,不接收新包。 +- 向已协商的可见玩家发送GC219:6字节、小端,header为1字节219、VID为4字节无符号、type为1字节(0无弹药、6普通箭、9可用箭筒)。自身初始快照、可见角色插入及更新均同步;观察者不向其他玩家广播。真实期限移除及持久化事件仍须实服验收。 +- 客户端只更新已登记VID,未知VID不缓存到未来角色;已知但尚未实例化的角色保存在现有actor缓存。无资源退回原弓模式;步行动作模式19追加在既有模式后,不重排老编号,不接管骑乘/变身状态。 +- 五区原35个包索引的103413条记录没有男女弓手`attack_special.msa`;`arrow_02.msf`存在。两份缺失MSA按允许的AVA2重建策略补入私有候选;46条动作/特效闭包的其余44条使用当前有效包内容,不宣称恢复五区原本缺失文件。 +- `stage_quiver_client.py`仅创建新隔离客户端目录,复制配置与补丁、链接基础资源,不改正式Index;核对候选散列和闭包依赖。此目录不是独立发行包。 +- 实际加载使用大小写敏感的`playerSettingModule`;特殊模式须由ASSASSIN加载阶段自动注册,不以事后手动Register充当接入证据。五页背包同时拦截普通/扩展布局;Won主宏与兑换窗口均关闭,避免半启用窗口阻断进游戏。 + +本批通过本地回归、原生离线协议/资源测试、Android离线构建;不是实服战斗时序、物品生命周期或手机验收。整体仍为PARTIAL,箭筒宏仍为0。见[状态与动作实施记录](XXF-CH5-QUIVER-SYNC-20261022.md)。 + + + +#### 同日后续:F03元素目标与F04交易等级 + +- F03按实际`uiTarget`模块挂接目标栏,不只修改大小写不同的孤立模块;同时替换五区内部调用的`SetRaceElement`,防止原始加载异常先于外层保护发生。读取既有mob_proto的ATT_ELEC/FIRE/ICE/WIND/EARTH/DARK标志,分别对应电/火/冰/风/地/暗,不称“光”或推导为元素弱点。多元素时按已知标志位从低到高选择一个,作为明确的兼容策略;不提供新动态服务端元素协议。无元素、玩家目标、重置或缺资源时隐藏旧图标。 +- F04保留既有GC_EXCHANGE包号42、51字节布局及所有子包编号。仅START(子包0)的既有DWORD arg3由0扩充为对方`CHARACTER::GetLevel()`;arg1仍为对方VID。旧客户端忽略此START字段,新客户端面对旧服的0隐藏等级。不重用ITEM_ADD等子包的数量语义,不修改物品或金币结算。 +- 客户端在START清理旧交易后读取服务端等级,合法范围1~255,其他作为未知0;不得回退到可见角色缓存或按显示名查询等级。自身等级取已接收的POINT_LEVEL,双方均为本次开始时快照,不是升级事件实时推送。END清除双方等级,下次START重新取值。当前标题显示对方等级,自身快照通过既有exchange API提供,不宣称已增加双方独立等级标签。 +- 此为本项目兼容适配:AVA2归档的`ExchangeStart`两份START.arg3仍是0,没有找到可复用的活动等级同步分支;不冒称恢复了五区原服务端封包。匹配两玩家实服、切线/重连及手机验收仍待执行,整体保持PARTIAL。 + +实施与验证见[目标与交易实施记录](XXF-CH5-TARGET-TRADE-20261022.md)。 + ## 1. 基线、范围和事实来源 @@ -484,3 +508,167 @@ test -f "$migration_run/wear40-plan.json" | G5 | Android状态门禁、APK与平台验收 | 只有显式PASS计通过;完整APK、同版资源和真机记录 | 阶段0的协议、状态及商品依赖清单仍须实际生成。范围明确、工具已加固且验证完成后,才能将对应阶段从待实施改为通过;文档中的命令和架构要求本身不是完成证据。 + + + +## 13. 2026-10-22:现代 Cube 配方与只读批量预检 + +后续增量:DB 内部 Arm/Submit 适配器及实际双主队列/异步队列回调已接入,见[SQL 排空接入记录](XXF-CH5-CUBE-FIFO-20261022.md)。它没有 game 调用入口,也不调用制作结算或释放锁定;游戏侧仍保持只读,不能视为完成在线制作。 + +2026-10-23 增量:内部 header78 的有界 LE 握手、game 准备状态机、VID/会话匹配、全自有窗口快照与最终保存顺序已编译接入,但 `HandshakeEnabled` 与 `ActorMutationAuditComplete` 均为 false;DB 真实入口在建立 Arm 之前拒绝。尚未完成所有直接变更/定时事件的资产冻结,不开放制作。当前状态见[准备握手实施记录](XXF-CH5-CUBE-HANDSHAKE-20261023.md),前一段是历史批次边界。 + +同日后续:接入定时物品/任务计时器/洗练等保守准入、整轮洗练暂缓及资产变更失效通知。内部 Invalidate 只终止可证明未受理的制作,不取消已接受回执。仍缺少 Submit 后合法变更的持久保留与恢复,两道门禁继续为 false。见[准入与变更审计记录](XXF-CH5-CUBE-ADMISSION-20261023.md)。 + +本次用户优先级为现代 Cube → Won → 狼人 → 征服者 → 五角色位;这是后续实现顺序,不代表这些功能已完成。F21 当前仅完成服务端实际配方分页、五区原布局加载及 1~100 次材料/金币需求预检。`ENABLE_CUBE_RENEWAL_WORLDARD` 仍为 0;capability4096 仅表示只读协议,绝不能解释为允许制作。经典制作窗口保持原行为。 + +`PortCubeQuery` 从经典 `Cube_init` 已载入的 `s_cube_proto` 读取同一份 `cube.txt`,不添加第二份易漂移的配方缓存。保留 WORLDARD 的 category/copy 元数据。校验 PC、已加载物品、制作窗口、实际 NPC/任务 NPC 同一对象、地图/距离、死亡/眩晕及其他交易窗口状态。暂不支持的多结果配方使该 NPC 的现代目录明确失败,不猜测随机权重。 + +MTF1 的 `cube NPC OFFSET` 每页最多8条。`recipe` 字段依次为 request/index/id/catalogue_revision/recipe_revision/reward/count/stackable/gold/percent/copy/category_hex/material_count,然后最多5组 vnum/count。两种 revision 均为规范化内容的16位小写十六进制 FNV-1a64陈旧检测指纹,不是签名或授权。客户端跨页校验目录指纹、总数与唯一身份,全部完成才发布列表;关闭/切换窗口后丢弃旧回复。 + +`cubecheck RECIPE_ID ATTEMPTS` 仍是只读查询,offset位置表达1~100次尝试数量而非分页。返回 revision_hi/lo、attempts、gold_required/available、materials_ok、gold_ok、reward_maximum、copy_required,以及 materialN/neededN/availableN。`mutation_enabled=0`、`capacity_reserved=0` 必须固定为0。用64位乘法计算费用与最大产出,按225格普通背包及物品ID去重,排除装备/锁定/交易中/不属于本人的材料;不是额外背包搜索,也不预留格子。客户端核对配方指纹、每项数量、费用及布尔一致性。 + +五区原16字段 `GetDates` 布局保持材料 vnum/count 交错排列。“制作”按钮在此独立只读入口标为“批量预检”,隐藏尚未支持的成功率道具区;聊天明确“未预留背包、未扣料、未制作”。旧服不支持时不打开现代预览。实际扣料/发奖、随机结果、复制属性、回执和重连恢复均未接通。详细来源、测试和下一阶段契约见 [Cube阶段记录](XXF-CH5-CUBE-CATALOG-20261022.md)。 + +### 13.1 候选耐久后端(尚未在线接线) + +后续新增的 `common/cube_batch.h` / `common/cube_store.h` 已实现并隔离测试PREPARED固定随机结果、整批成本/成功奖励/回执原子提交及SQL故障/进程退出重放;要求完整物品快照和匹配DB栅栏。它们没有被运行中的game/db分派调用,不改变上述只读协议。在线所有者隔离、缓存排空与提交后重同步、工厂/客户端动作协议及copy规则仍是开放阻断项。详见 [第二批记录](XXF-CH5-CUBE-BATCH-20261022.md),不能将后端测试计为在线制作验收。 + +### 13.2 DB隔离与重同步核心(候选schema v2) + +新增持久DRAINING/ABORTED/RELEASED阶段、完整原始批次/重同步图像、独立物品锁、双队列回调关联核心和准确ACK解锁;实际DB保存/销毁/加载/经济结算门禁已接入Cube.cpp,重启ID高水位覆盖尚未入item的锁定ID。schema缺失保留基线,部分/未知版本或SQL错误拒绝;schema变更须协调维护和重启。仍没有game冻结/最终快照/真实FIFO回调适配和图像应用,不开放制作。详见[第三批记录](XXF-CH5-CUBE-FENCE-20261022.md)。 + +### 13.3 当前推进状态(2026-10-23,覆盖上两节的阶段性状态) + +已编译并隔离测试实际 DB FIFO 排空与关闭的 game 准备握手、保守准入及粘性失效通知;仍未完成全部变更入口的冻结与合法奖励保留,`HandshakeEnabled=false`、`ActorMutationAuditComplete=false` 不变。详见[准入记录](XXF-CH5-CUBE-ADMISSION-20261023.md)。 + +新增正数金币奖励意图候选后端:独立可选 addon schema v1、稳定事件 ID 去重、按序原子加钱、崩溃后读取和回执重放;只有原制作回执可验证为 DONE、仍为 clean FROZEN 时才发放,未处理意图阻止 Resync/Release。DB 保存/账号加载门禁同时检查待处理金币,包含孤立意图。base Cube schema 仍为 v2;addon 缺失兼容原基线,部分/未知版本失败关闭,安装/卸载必须协调维护和重启。 + +该后端阶段不等于在线奖励完整闭环,不拦截已执行的 PointChange,也不自动处理 ABORTED、物品、经验或负数费用。后续生产者接线见下一节;原阶段记录见[延期金币记录](XXF-CH5-CUBE-DEFERRED-GOLD-20261023.md)。 + +### 13.4 地面金币持久交接候选(仍未开放制作) + +非组队且已 Submit 的持有角色,经过原 PickupItem 距离/归属检查及当前绑定复核后,候选路径先 fsync 稳定事件/序号,再删除地面金币;不再本地 GiveGold,也不发送旧金币 Save。普通角色保持原领取/分金/保存行为。core 私有 outbox 固定166字节版本记录、独占锁与文件/目录 fsync;确认历史保留序号,损坏/写入不确定时停止并隔离来源,不能自动丢弃记录。1024条/批次、8192历史事件、16MiB上限,未实现自动压缩。 + +内部 header78 新增 GoldEnqueue=7、GoldAck=8,GoldStored=8 / GoldApplied=9;102字节前缀不变,附129字节规范意图,总231字节,不扩展客户端制作能力。DB要求原peer/login/handle/session/cookie及批次身份,只在耐久入队/原Applied回执后确认;game严格匹配并落盘ACK。ACK只表示交接,不是到账或解冻。此未发布协议必须两端一致。 + +真实入口仍由两道false门禁关闭,当前没有实际制作或自动Apply调用。game/DB重启后的可信所有权接管、ABORTED对账及其他资产变更仍未完成;该阶段的来源关闭/排空缺口由下一节继续推进。详见[地面金币交接记录](XXF-CH5-CUBE-OUTBOX-20261023.md)。完成Cube并通过相应验收后,才按用户顺序推进Won、狼人、征服者和五角色位。 + +### 13.5 地面金币来源关闭与排空证明 + +匹配Frozen确认后,game先fsync来源CLOSING标记,随后拒绝本批新领取、继续重试旧意图;只有全部意图已有持久入队ACK,才发送有序事件ID的完整清单。内部header78增加GoldClose=9、GoldCloseAck=10及GoldClosed=10;清单为4字节数量加逐项32字节事件ID,最多32772字节,总帧最多32874字节,不使用摘要代替精确比较。来源ACK落盘也不等于解冻。 + +金币addon升到v2(base Cube仍v2),增加`port_cube_gold_sources`保存绑定与完整清单。关闭和入队共用账号锁,SQL清单必须与已保存的连续意图逐条一致;关闭后拒绝新事件但允许旧事件幂等重放。Resync/Release要求匹配的来源证明、全部意图已发及钱包一致;零奖励批次也不能靠SQL为空跳过来源关闭。CGO1固定166字节记录新增op3关闭/op4来源ACK,保留旧CLAIM/ACK读取,未知/损坏记录失败关闭,不自动降级或截断。 + +显式`gold-upgrade-v2.sql`保留addon v1意图/回执,不自动创建关闭证明;需停相关入口、维护和协调重启,部分/未知/非事务schema拒绝。该屏障只覆盖当前地面金币来源,不能代替其他变更入口的审核或可信重启接管。详情见[来源关闭记录](XXF-CH5-CUBE-SOURCE-CLOSE-20261023.md)。 + +### 13.6 持久所有权与保持锁定的恢复准备 + +新增独立owner-addon v1(三张InnoDB表),base v2和金币addon v2不变。实际Arm要求三套结构就绪;只在显式维护中安装`owner-schema.sql`,不自动为历史持有批次补造所有权。DB主线程的数据库级MySQL连接锁、随机启动nonce和单调generation隔离旧DB实例及SQL自动重连;Begin在同一账号事务中写入原批次、item锁和原始会话lease。RPC及SQL写入前在同一禁止重连的连接作用域复核所有权。 + +可信断线/账号结束回调可持久撤销;新broker仅能撤销严格旧generation。内部`CubeRecoveryClaim`只接受当前认证peer、尚未进入游戏的账号及其所属角色。接管要求持久撤销、fresh session、clean FROZEN/RESYNC、原始来源绑定与精确清单、可验证DONE回执、连续已发金币前缀及当前钱包一致;不重抽奖、不自动执行PREPARED、不加钱,也不放行普通加载或解冻。确认丢失重试返回同一持久grant。 + +所有登记lease(LIVE/REVOKED/ADOPTED)继续阻止普通保存/账号加载,旧Fence.Release不能删除其item锁。尚无owner-aware图像应用/ACK/thaw、公开恢复路由或game core启动身份撤销协议;不得将“允许准备接管”理解为可恢复游玩。两道false门禁及客户端制作宏仍关闭。详情和证据见[所有权阶段记录](XXF-CH5-CUBE-OWNER-20261023.md)。 + +### 13.7 接管会话再次断线与撤销调度 + +ADOPTED及提交结果不确定的Retry proposal现在登记为持有中的pre-load运行时会话,预期账号尚未IsPlay。接管确认尚未送达时断线也能撤销;提交未发生的重试复用原proposal cookie。只在持久撤销成功或重新读取账本证明该proposal已不是当前所有者后,回收其内存槽位;SQL lease、金币回执和item锁保持不变。 + +peer断线、当前peer的有效注销包、认证记录被删除/替换均先粘性标记会话失效,不同步执行SQL,避免同peer/账号复用漏过轮询。撤销与排空终结采用同一个64位任务键轮转队列,每tick至多两项SQL工作;失败退避5秒,不靠超时解锁。这是工作次数预算,不是单条SQL或墙钟延迟上限。实际恢复网络路由、旧core撤销、权威图像和解冻仍待接通。见[接管生命周期记录](XXF-CH5-CUBE-RECOVERY-LIFECYCLE-20261023.md)。 + +### 13.8 选角前恢复消息候选 + +内部header78增加RecoveryClaim=11/RecoveryAnswer=12;Granted=11/Clear=12为独立status,102字节前缀和既有消息不变。Claim仅传账号/角色/随机非零session,epoch/cookie为0、owner/token为规范32字节零串,不允许调用者指定旧批次。授权以160字节CRG1/LE格式返回完整OwnerGrant,包含broker/revision及原批次与新会话绑定;Granted总帧262字节,Held/Clear总帧102字节。 + +game在经典CharacterSelect发PLAYER_LOAD之前调用受两道false门禁保护的恢复协调器。DB只向当前peer、非IsPlay账号及所属角色回应;普通账号明确无内存/SQL持有记录才返回Clear,game随后只发送一次仍受原DB门禁检查的经典加载。持有批次走原持久接管校验,Granted只保留授权,不加载角色、不应用图像或解冻。错误/迟到响应、描述符复用、断线和超时均不授予加载资格。 + +本批同时修复实际game DB收包白名单原来只接受Answer的问题,允许既有GoldAck/GoldCloseAck与新RecoveryAnswer;反向请求帧仍拒绝。不得将后端夹具通过等同于原socket路径此前已正常。 + +尚未开放制作或恢复游玩:旧core撤销、恢复图像/准确ACK/thaw仍缺失。实际game/db必须匹配升级,入口门禁和客户端宏仍关闭。见[恢复消息记录](XXF-CH5-CUBE-RECOVERY-WIRE-20261023.md)。 + +### 13.9 授权绑定的金币/普通背包图像 + +内部消息增加RecoveryImageRequest=13/Answer=14和ImageReady状态13,160字节授权与金币/普通背包原格式一起传递;原始图像上限26335字节、封装body上限26497字节、总帧最多26599字节,无需扩大40000字节body限制。这里不是完整角色/装备等窗口数据。 + +DB在Fence.Resync同一账号事务和禁止重连的连接中验证当前ADOPTED授权、原来源绑定与完整清单、所有金币已发、可验证ok DONE及持久rolls重算计划、当前钱包和全部普通背包字节,以及旧输入/最坏输出/现存全部自有物品的ID锁和输出预留。零金币意图也检查钱包;零成功仍按已付费结果恢复,不制造奖励;非ok DONE仍待对账。已有RESYNC图像不同则拒绝,不能悄悄覆盖。 + +game取得Grant后自动请求图像,校验规范编码、原型和格子占用后只保留字节与完整授权;重复确认幂等,相同授权的不同图像使会话继续锁定。没有创建角色/物品、改金币、发送自动ACK或解冻。两道false门禁不变,仍需旧core撤销、全角色数据和应用/准确ACK/thaw闭环。见[图像阶段记录](XXF-CH5-CUBE-RECOVERY-IMAGE-20261023.md)。 + +### 13.10 原live所有者的Prepare/Execute内部接线 + +内部消息增加Prepare=15、Execute=16、CraftAnswer=17,状态Prepared=14/Complete=15。请求只有原session/cookie和不可变批次身份,不接收替代配方/快照/奖励。关闭入口只返回Held,不访问SQL。实际DB路由要求原live上下文、当前账号所有权、clean FROZEN、原来源完整封存,并在Prepare/Execute本身的账号事务和禁止重连连接中重新验证LIVE lease;不凭新generation或登录cookie自动执行旧PREPARED。 + +DB在新Prepare中用/dev/urandom的拒绝采样生成均匀1..100并持久化,确认丢失后同请求不再抽取。Execute只读取原SQL请求与rolls,实际扣料/收费/奖励及DONE回执原子提交。新增CCR1规范回执,game按原batch和proto验证费用、成功数及完整工厂奖励图像。game在持久来源关闭ACK后经实际Tick推进Prepare→Execute,重复/失败确认只重试原阶段;完成后仍保持actor锁定,不改本地资产、不发图像ACK、不解冻。 + +这一阶段还不是可点击制作:真实batch/奖励工厂/永久ID构造、客户端动作和能力入口、原actor图像应用/准确ACK/thaw及完整变更审核仍缺失。两道false门禁和客户端宏不变。详见[制作主链路记录](XXF-CH5-CUBE-LIVE-CRAFT-20261023.md)。 + +### 13.11 制作奖励的批量ID预留基础 + +新增game主线程专用`PortCubeReserveItemIDs`,通过实际`ITEM_MANAGER::GetNewID`的独立预留分支,一次整批消耗1..100个真实号段ID。普通单物品分配路径不变。预留先验证当前游标、完整可用数量、必要备用段的合法性/不重叠和所有输出ID的当前内存冲突;失败不移动游标、不替换输出,也不触发旧分配器的停机处理。跨段时原子切换并请求下一备用段,成功ID不在本进程内退回;不分配maximum哨兵、不发生32位回绕。 + +这是后续奖励工厂的ID基础,不是完整工厂或制作入口,当前尚无制作调用者。进程内消耗不等于跨重启持久预留:必须由原批次的DB fence/永久预留事务接受后,才能执行或对外使用;仍需恢复原批次,不得重新分配ID后重做。真实新物品的属性/socket/期限初始化、无保存/无事件副作用的模板路径、batch构造及应用/ACK/thaw仍未完成。详见[ID预留记录](XXF-CH5-CUBE-ITEM-IDS-20261023.md)。 + +### 13.12 真实新物品初始化的独立模板路径 + +新增`PortCubeBuildRewardTemplates`,整批预留真实ID后通过实际`ITEM_MANAGER::CreateItem`逐项生成完整metadata。采用归档AVA2活动WORLDARD的默认工厂选项,不启用额外TryMagic;保持id参数为0的新物品初始化分支,内部绑定预留ID,保留addon、socket、unique/实时/穿戴期限、blend、技能书和龙魂初始化。count=1的模板由持久结算计算实际奖励堆数量。 + +专用template标记在初始化后立即设置:不增加VID、不注册ID/VID映射、不保存或发送更新/socket与属性日志、不启动期限事件,但仍计算期限socket;销毁不发DB物品删除包、不擦除其他映射。逐项作用域释放所有瞬态物品,整批失败不替换输出,预留ID不退回;空技能目录在分配前拒绝。旧普通物品分支保持原行为。 + +工厂函数已编入game,不是以测试里的假工厂代替真实函数。但可信batch构造和用户动作尚无调用,仍不能制作;持久化前不得对外使用这些ID/图像,接受后必须恢复原图像而非重新生成。两个false门禁不变,尚缺原actor应用/ACK/thaw与完整变更审核。见[奖励工厂记录](XXF-CH5-CUBE-FACTORY-20261023.md)。 + +### 13.13 可信批次构造与内部Start入口 + +新增内部`PortCubeStart(ch, recipeId, revision, attempts)`,调用方不能传金币/背包/奖励/ID/rolls/所有者或会话。先检查两个门禁、当前角色和NPC配方、危险状态、全物品快照、材料与金币;再用服务端熵源产生owner/token/session,以真实工厂构造最坏输出模板并验证物理结算计划,最后调用实际PortCubeBegin再次校验完整配方和当前资产。重复正在处理的同批次只匹配原角色/配方版本/次数,不重新生成图像或发送Arm,由原Tick重试。 + +epoch采用受界限检查的实时时钟纳秒并在进程内严格递增;DB仍要求高于前一RELEASED fence,不能用新时间戳取代旧hold。跨core或重启时钟回退可能拒绝新批次,仍需时钟一致性/后续DB代次协商处理,不能自行重放或解锁。该函数仍无公开命令/客户端动作调用,两道门禁false时不消耗熵或ID;没有开放制作能力、原actor图像应用/ACK/thaw。见[内部发起记录](XXF-CH5-CUBE-START-20261023.md)。 + +### 13.14 原在线所有者的金币入账与精确图像 + +内部LiveImageRequest=18/Answer=19、LiveImageReady=16只带原session/cookie及批次身份;请求无body,成功回复为原金币+普通背包图像。实际DB入口关闭时返回Held且不访问SQL。当前原peer/handle/playing账号、原LIVE lease及来源绑定必须匹配,ADOPTED授权不能代替;原恢复ImageWithin仍只接受ADOPTED。 + +每次请求最多应用两笔已持久接受的正金币意图,使用同一账号事务/固定SQL连接中的所有权回调,连历史重放也先校验。所有意图完成后才允许同一事务中进行Resync与LIVE图像校验:固定rolls重算的ok DONE、原来源精确清单、完整钱包/道具、保留ID/物品锁及已发图像不可变。提交确认丢失重试不会再收费/发奖/重复金币。 + +game在ok回执后按同一有界Tick队列请求图像,以原批次、完整回执和已封存outbox金币总额重建精确预期,字节必须一致;错身份拒绝,冲突图像/失联保持Held。当前只保留已核验图像,不创建或应用物品、不改本地金币、不ACK或解冻。下一步仍是原actor应用/准确ACK/thaw,不能因此启用门禁。见[在线图像记录](XXF-CH5-CUBE-LIVE-IMAGE-20261023.md)。 + +### 13.15 原actor普通背包/金币的内存安装 + +原LIVE图像回复接入实际应用:先核对原全窗口封印,将持久图像恢复成未登记瞬态物品(不随机、不分配永久ID、不保存或起事件),预分配全部ID/VID映射节点后发布;再直接替换225格、物理格网与金币。其他拥有窗口不改,Cube/肩带/任务选择指针按旧永久ID重绑定,已消耗目标置空。退役对象标为瞬态后销毁,不删除新同ID映射或向DB发删除。 + +应用后重新捕获全窗口数据,验证普通背包+金币与图像完全一致,并验证所有其他窗口字节仍与原封印相同。只有读回通过才标Applied并保存新封印;相同回复不重复安装,冲突/读回失败仍Held,不发送ACK或解锁。新物品保留skip-save且期限事件暂停;还需准确ACK/所有权终态释放、普通保存恢复、到期事件与快捷栏/客户端发布,完整冻结审核仍为阻塞。 + +同时修复新肩带模板遗漏的首次加入角色吸收率:把原AddToCharacter的既有初始化原样共享给新工厂,恢复持久图像不调用该初始化、不重抽已接受结果。普通角色路径保持原公式与位置。详见[内存安装记录](XXF-CH5-CUBE-APPLY-20261023.md)。 + +### 13.16 原 LIVE 图像的持久精确 ACK(仍不释放) + +追加内部 LiveImageAck=20/Answer=21,成功状态 LiveImageAcknowledged=17;携带并回显完整规范图像。game 每次确认发送和初次回复前核对应用后的全窗口封印;状态只到 Acknowledged,角色继续 held,迟到重复图像不降级、不重复安装。 + +可选 image-ACK addon v1 在实际 Resync 同一账号事务/固定 SQL 连接中重新校验当前图像、原 LIVE grant/broker/sealed source/DONE/金币/物品锁,且已发 RESYNC 图像必须存在并完全相同。不可变记录完整 batch、owner grant 和图像;丢失提交回复可原身份重放,撤销后不得靠历史 ACK 绕过授权。不删 lease/item fence,不改变 RELEASED,不恢复保存/事件/客户端状态,不 thaw。终态释放仍需单独协议和当前所有权证明。详见[持久 ACK 记录](XXF-CH5-CUBE-IMAGE-ACK-20261023.md)。 + +### 13.17 原 LIVE 终态 SQL 释放(尚无 game 发送/resume) + +可选 release-addon v1 在实际 Fence.Release 同一账号事务内校验完整 ACK、原 LIVE 所有权、SQL 当前图像/已发 RESYNC、来源/DONE/ID 栅栏,原子写终态回执、退役 lease 和 item fences、标 RELEASED;永久 ID tombstones 保留。精确终态重放仍校验原 broker,冲突新批次、租约或遗留栅栏拒绝,不能拿历史 ACK 清除新持有状态。 + +内部22/23路由仍硬关闭;成功只更新 DB context 终态并保留内存 save/load gate。ID-only destroy/flush 也检查 held 批次的消耗/奖励 ID,以及其他非商城/仓库窗口的当前 SQL 拥有者,不能绕过待 resume 状态。提交后断线可只读对账确认不再需要 lease revocation,不能推断 thaw。game 仍停在 Acknowledged、尚不发释放请求,待保存/事件/快捷栏/客户端发布及 DB resume 完成。详见[终态 SQL 释放记录](XXF-CH5-CUBE-RELEASE-20261023.md)。 + +### 13.18 权威背包/快捷栏发布及完整数量(不 thaw) + +revision25 增加 GC93 op11 有界 LE 全量普通背包/gold64/36快捷栏发布,以及 op12 完整数量+69字节 extra companion;原 BYTE 经典包结构不变,旧 >=22 客户端保持 op10 回退。客户端仅内存 TItemData.count 改 DWORD,经典数量动作仍需扩展。名字展示有界,不修改 raw69。 + +实际 game 在持久 ACK 后,以原捕获快捷栏的永久 ID 生成计划,消耗项不绑定到复用格子的奖励;全封印与当前属性复核后一次入队,仍 held、skip-save、事件暂停、不发送释放22。实际客户端暂存全部 proto/格网/快捷栏校验后提交普通背包、快捷栏与 gold64,刷新标志在提交后设置;装备/其他窗口不改,重复/旧 epoch 不回滚后续状态,同 epoch 冲突拒绝。发布入队不是客户端收到/渲染或 thaw 的证据。详见[发布记录](XXF-CH5-CUBE-PRESENTATION-20261023.md)。 + +### 13.19 持有期间的恢复物品到期事件准备(不 resume) + +实际 actor 在 ACK 和发布后经既有有界队列调用整批恢复计划,前后核对全窗口封印。准备仅为已登记的普通背包物品创建暂停包装事件:REAL_TIME、已使用 first-use 和绝对 Unique 保留原期限,未使用 first-use/未装备穿戴期限/在线时长 Unique 不提前计时。skip-save 或当前 owner held 任一成立都暂停;真正激活后无 owner 的落地物品仍到期。逐项失败撤销本次事件,不改 metadata 或保存标志。 + +新增完整 owner/ID/VID/位置/metadata 验证后的无分配 skip-save 清除原语,但尚无运行时调用者,必须由经过认证的 DB resume 使用;它不发 Save、不解锁。事件构造失败负责释放 info/待入队节点,分发前脱离已释放队列节点,避免自取消访问悬挂指针。仍没有 game Release22 发送、DB resume 或 thaw,两个 false 门禁不变。见[生命周期准备记录](XXF-CH5-CUBE-LIFECYCLE-20261023.md)。 + +### 13.20 原 LIVE actor 发起终态 Release(不 resume) + +实际 game 在完整图像持久 ACK、权威发布与暂停事件准备之后,经原有界 Tick 发送内部 Release22/接收23;新 LiveReleaseFlow 固定原 session/cookie/批次和完整图像,Held 保留重试,冲突图像持有,准确重复终态幂等,成功后停止 SQL 重试。发送/重试/接收回复都核验原 actor、全窗口应用封印、金币+普通背包图像、当前恢复计划及36个永久 ID 重绑定后的快捷栏;不重新发 UI,也不重做制作。 + +复用实际 DB 账号事务释放路由;SQL 成功后仍保留 DB 内存门禁、actor hold、skip-save 与暂停事件。没有 resume grant、保存启用调用者或 thaw,不得将 LiveReleased 当作解锁授权;两个 false 门禁及现代 Cube 宏不变。见[在线释放记录](XXF-CH5-CUBE-LIVE-RELEASE-20261023.md)。 + +### 13.21 当前 SQL 恢复前复核与重启后终态 hold + +追加内部 ResumeCheck24/25、LiveResumeChecked=19,只作复核而不是 resume grant。实际 DB 路由绑定原 still-playing peer/handle/session/cookie/RELEASED context。Fence.CheckReleasedImage 在同一账号事务重新读当前普通225格+金币图像,ReleaseStore 同事务验证完整 ACK/终态回执、当前 broker/无租约栅栏、原封存金币来源和固定 rolls 的 ok DONE 重算、永久奖励 ID 预留。历史 Release 重放不能代替这次当前图像校验。Checked 不改 context、不清除保存/加载 hold;实际 game 尚无24发送或保存启用调用者。 + +同时修复 DB 重启丢内存 hold 的边界:可选 release-addon v1 存在时,当前 RELEASED fence 对应现代终态回执仍阻止角色保存/账号加载和当前/预留物品 ID 写入。完整缺失 addon 保持旧规则,部分/未知/失败拒绝;尚无 resume 完成标记或解除路径,不可通过删除回执绕过。仍需持久交接、原 peer/ID-only 保存路径、旧 core 与完整冻结审核,两个 false 门禁不变。见[恢复前复核记录](XXF-CH5-CUBE-RESUME-CHECK-20261023.md)。 diff --git a/docs/XXF-CH5-CUBE-ADMISSION-20261023.md b/docs/XXF-CH5-CUBE-ADMISSION-20261023.md new file mode 100644 index 00000000..2105e37d --- /dev/null +++ b/docs/XXF-CH5-CUBE-ADMISSION-20261023.md @@ -0,0 +1,60 @@ +# 五区 Cube:风险准入与资产变更失效 + +本批实施“完整资产冻结与恢复”的第一阶段,**不是已完成冻结**。没有开放客户端制作入口或部署生产,`HandshakeEnabled=false`、`ActorMutationAuditComplete=false`,F21 仍为 PARTIAL。 + +## 本批实际接入 + +| 路径 | 当前处理 | 不做的事 | +| --- | --- | --- | +| 自有物品定时事件/限制 | 遍历普通背包/装备、龙魂、Switchbot、专用背包;存在到期、销毁、归属事件或计时原型限制时拒绝准备 | 不取消、重排或延长有效期 | +| unique 类物品 | 保守拒绝准备,即使当前没有运行事件 | 不声称所有 unique 都有时限;这是候选限制,不是五区原规则 | +| 锁定、交易或 skip-save 物品 | 拒绝准备,不只检查配方材料 | 不把 usable 位当成可解锁权限 | +| 个人任务计时器/运行中任务 | 只读检查并拒绝准备;使用不创建 PC、不改变 Lua 当前角色的查找 | 不挂起或丢弃任意任务回调 | +| 自动洗练 | 活跃槽拒绝准备;处于持有状态的角色不开始新槽,已有轮次在修改 flags、RNG、消耗道具之前整体暂缓 | 不丢弃已经支付的轮次、不改变洗练速度常量 | +| 组队、当前战斗目标、死亡/眩晕/传送状态 | 保守拒绝准备 | 不声称无当前目标就不存在迟到战斗结算 | +| 经典 Cube_make | 持有期间在材料、金币、RNG 之前拒绝操作 | 不改普通角色的经典成功率/收费语义 | + +新增 `common/cube_mutation.h`、`game/src/port_cube_item.inc`、`port_cube_quest.h`,并在 game 准备入口、Arm ACK 前后及 Tick 复核风险。没有把“按时事件停止了”写进已有快照协议,也没有凭快照比对代替事件证明。 + +## 失效通知 + +已接入的通知点: + +- CItem::Save:通知当前 owner;无 owner 时按 last-owner 找当前角色。原 skip-save 与 DelayedSave 行为保留。 +- CHARACTER::PointChange 的非零金币请求:在原分支之前通知,原金币增减/上限检查继续执行。 +- 任务脚本 ExecuteQuestScript:进入脚本前通知;PC 的实际 flag 变化/删除与 AddTimer 同样通知。相同 flag 值不额外使准备失效。 +- WarpSet 与 Disconnect:在生命周期操作之前通知,不拦截正常传送/下线。 + +通知是粘性的位掩码:数值即使改变后又恢复(ABA),也不能重新让旧准备进入 Submit。尚未拿到 cookie 时保留等待 Arm 的状态,仅用于拿到正确确认后取消;已经 Submit 的批次只进入 Held,不能伪装成从未提交。 + +内部 header78 增加 Invalidate 操作(定长前缀仍为 102 字节,两端必须匹配;旧候选从未启用/发布)。game 仅在已提交且失效时发送,身份校验沿用账号/角色/handle/session/epoch/owner/token/cookie。DB 将排空所有权标记为失效;未准备的持久 FROZEN 可转 ABORTED,但**既有 PREPARED 回执绝不自动取消、退款或删除**。重复通知保留锁定。实际网络入口仍在门禁处拒绝,不会创建 Arm。 + +## 关键未完成项 + +上述代码防止使用已知失效的准备,**不保证 Submit 后的合法变更已经被可靠保存**。例如任务/战斗奖励在 Submit 后到来,旧 DB 保存门禁可能拒绝其快照;如果没有可靠的延期队列或持久账本与重启恢复,直接下线仍可能丢失合法奖励。因此不能开启任何真实批次。 + +仍需处理: + +1. Submit 后合法奖励/到期/其他变更的持久记录、执行顺序和崩溃恢复;或经过完整证明的无副作用入口延期。 +2. 直接 SetGold/SetExp、裸字段赋值、其他 setter、全服/服务器任务回调、组队和地面掉落归属等未闭环路径。 +3. 完整生命周期冻结、跨核心/重启接管、权威图像应用及精确 ACK/解冻。 +4. 真正工厂奖励模板/ID、Prepare/Execute 调用、copy/成功率道具及匹配版本真服/Android 验收。 + +不得在底层 setter 简单 return 来假装冻结,也不得将本次通知机制解释为“奖励已延迟且不会丢”。 + +## 可复核审计 + +`python3 tools/cube/audit_mutations.py` 只读扫描当前 game `.cpp/.h/.inc`,输出逐候选位置及源文件散列。首轮得到 90 个文件、735 条候选:金币 52、经验 22、物品归属 203、物品图像 282、任务 70、生命周期 106。摘要绑定在 `audit/xxf-ch5/cube-mutation-review-20261023.json`。 + +这是词法复核索引,包含定义/注释/未启用分支,漏掉别名、宏、间接调用和未列入的 setter;**不能用数量声称覆盖率或全部安全**。工具自身也明确输出 `activation_allowed=false`。 + +## 验证边界 + +- `test_cube_mutation.py` 编译实际物品准入、风险聚合、CItem::Save、任务 flag/timer 方法和洗练整轮入口;使用明确的角色/物品/任务管理替身,验证通知不吞原修改,四种到期回调与本仓库 HEAD 字节相同。 +- 既有握手测试新增失效后不能 Submit、旧值恢复不解除位掩码、提交后只持有;DB 测试新增未准备 fence 的失效终止及已接受 PREPARED 不可取消。经典收费测试验证持有期间零扣料/零扣金币。 +- FreeBSD 隔离目录 `/root/deploy-features/cube-admission.DyUKei`:全新 game 与 DB 对象目录,继承内部平台库;最终 game 另用 `.cube-admission-final-obj` 重新编译,消除构建期间头文件更新的混用。未启动或替换生产程序。 +- 本批未重新执行真实 MySQL、在线角色或 Android 验收;此前 MySQL 证据不能冒充本批运行证据。 + +`questpc.h/.cpp`、`questmanager.h/.cpp`、`cube.cpp` 保持原编码,仅做按 ASCII 锚点的窄插入;已有脏工作区不回退。最终源文件、构建与总回归绑定见 `audit/xxf-ch5/cube-admission-20261023.json`。 + +下一阶段应先选择并实现 Submit 后合法变更的可靠持久化/恢复策略,再继续补剩余变更入口;本批没有跳到 Won 等其他系统。 diff --git a/docs/XXF-CH5-CUBE-APPLY-20261023.md b/docs/XXF-CH5-CUBE-APPLY-20261023.md new file mode 100644 index 00000000..7017f88f --- /dev/null +++ b/docs/XXF-CH5-CUBE-APPLY-20261023.md @@ -0,0 +1,43 @@ +# Cube:原在线角色的权威图像内存安装 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。本批把原LIVE图像接到game角色的普通背包/金币安装;**没有准确ACK、终态释放、thaw或开放玩家制作**。 + +## 恢复不等于重新创建奖励 + +`PortCubeRestoreItem`使用专用restoring slot,调用真实CreateItem的非零持久ID路径;不分配新永久ID,不进行新物品addon/技能/龙魂随机初始化。保留template隔离:无VID/全局映射、保存/socket或属性日志、期限事件。随后直接复制持久count、3个socket、7项属性和全部69字节扩展数据。只允许精确指定的旧对象占据同ID,其他对象冲突拒绝。 + +`SaveSingleItem`对未发表template直接返回,避免未拥有的临时对象被当作物品删除发往DB。实际创建的普通物品原分支不受影响。 + +核对发现肩带首次吸收率原在AddToCharacter而非CreateItem:原条件/公式/number调用被移动到共享`PortCubeInitNewAttach`,普通AddToCharacter仍在原位置调用,新奖励模板也调用一次。品级4仍为11..19,其他品级仍为原常量。持久恢复不调用它,所以已经接受的图像(包括旧图像)不被修正或重抽。 + +## 发布及安装 + +`PortCubeInstallAuthoritative`只面向仍held的game主线程角色。先验证规范图像和当前proto,收集原普通背包,完整构造所有恢复物品。构造失败/异常释放临时对象,不动原角色。 + +`ITEM_MANAGER::PortCubeSwapRegistry`预分配所有临时ID/VID map节点,检查原注册指针、重复/外部ID冲突及VID耗尽。失败不修改注册表;发布阶段仅擦除原指针并转移兼容allocator节点,不分配、不回调、不发包、不写SQL。永久ID原样保留,新的VID只在成功发布时消费。 + +`CHARACTER::PortCubeInstallImage`先校验原225格实际指针与拥有者、锁/交换/时钟/skip-save状态、全部目标物理格网。发布后只做不会失败的直接字段赋值:替换普通背包和格网、设置owner/last-owner/window/cell及金币。Cube选择、肩带材料选择和quest-item指针仅对被替换对象按永久ID重绑定;已完全消耗项置空,非普通窗口的选择保留。不会调用普通SetItem/AddToCharacter/SetCount/PointChange产生保存、随机、事件或客户端局部包。 + +退役对象先脱离角色并标为template再销毁,不擦掉新同ID对象或发DB删除。新对象在安装后变为正常登记对象,避免登出清理时留下注册表悬挂指针;仍skip-save、事件暂停,不代表可以操作或保存。普通背包放入龙魂的错误图像拒绝,龙魂/其他窗口完整恢复仍待完成。 + +## 原actor读回与重复回复 + +实际LiveImageAnswer处理要求原身份、clean Frozen、submitted、未失效及ok制作回执。安装前再检查全窗口封印与原数据相等;安装后重捕获,普通背包/金币必须与DB图像逐字节相同,所有其他窗口必须仍与原封印相同。读回通过才标Applied并保留新全封印。重复同图像不重新安装;错身份、冲突、安装失败、分配异常或读回不符均维持Held,不伪造ACK,不回滚已提交的DB制作,不重新抽图像。 + +这是普通背包/金币的内存应用,不是完整角色同步或跨机器冻结证明。DB的RESYNC栅栏和LIVE lease依旧存在。未来必须核实Applied后的精确读回才能请求终态释放,不能把布尔“成功”或超时当作解锁。 + +## 验证边界 + +新增ASan/UBSan探针编译真实CreateItem/DestroyItem/metadata恢复/registry发布/CHARACTER安装函数。针对样本调用的每个分配点逐一bad_alloc注入,验证失败前原金币、物品指针、ID/VID注册与其他窗口不变;验证同ID替换、完整metadata、三格道具、锁定/重叠/VID溢出/外部ID拒绝、全消耗空背包及选择指针重绑定,且无RNG、新永久ID、普通保存/包/事件。 + +另一个探针编译实际actor应用helper和实际LiveImageAnswer分支,覆盖全封印前后检查、同回复只安装一次、冲突回复、其他窗口被改或安装后读回不符仍held;该探针的角色/capture/install为明确替身,前一个探针覆盖实际安装实现,不冒充联机。 + +FreeBSD隔离根`/root/deploy-features/cube-apply.0a597O`重编actor、apply、factory、item、item_manager五个实际翻译单元,链接此前匹配对象队列;这里只新增方法/内部slot,不改变CItem、CHARACTER或序列化布局,非全game/DB重编译。扩展原生离线探针使用真实CItem、真实新肩带初始化、持久同ID恢复、registry发布/退役和模板SaveSingleItem,使用合成proto且无DB描述符/期限事件;不启动game主流程,不证明真实actor冻结。最终来源及结果见`audit/xxf-ch5/cube-apply-20261023.json`。 + +旧item_manager源码/头使用可逆字节代理完成ASCII补丁,反向转换后非ASCII字节与模式保持,原副本在本地临时目录;未批量改动旧编码。 + +## 仍阻止开放 + +准确ACK、owner-aware终态释放、正常保存恢复、到期事件激活、快捷栏及客户端完整刷新/thaw尚未实现;不能解锁当前skip-save且暂停事件的角色。可靠冻结/合法变更延期与外部物品引用审计、旧core撤销、完整角色和非普通窗口恢复、PREPARED/异常DONE对账、copy/成功率道具、公开动作与能力UI、匹配联机及Android验收仍缺。 + +两道false门禁和客户端制作宏不变。无生产部署/重启/迁移/玩家资产修改,本批无DB/SQL源修改、不重算旧MySQL证据,后四项仍按原顺序等待Cube完成。 diff --git a/docs/XXF-CH5-CUBE-BATCH-20261022.md b/docs/XXF-CH5-CUBE-BATCH-20261022.md new file mode 100644 index 00000000..3283d9e2 --- /dev/null +++ b/docs/XXF-CH5-CUBE-BATCH-20261022.md @@ -0,0 +1,39 @@ +# 现代 Cube 第二批:候选耐久事务后端 + +状态:PARTIAL / NOT_RELEASED。延续 [配方与预检阶段](XXF-CH5-CUBE-CATALOG-20261022.md),本批实现的是独立 SQL 后端,不是在线制作入口。客户端继续只读;没有部署、重启正式服、写入玩家资产或启用制作宏。 + +## 本批实现 + +服务端新增 `common/cube_batch.h` 和 `common/cube_store.h`:规范化批次身份/完整物品快照、显式定宽编解码、固定随机结果、实际扣料与金币、成功次数对应奖励、物理背包格分配、耐久回执和身份级恢复。配方仍以活动 AVA2 规则重建,不声称找回五区原服务器实现。 + +采用两段事务:PREPARED 先保存全部尝试的随机数和完整请求;第二段在核对库存/金币后,一次提交所有成本、实际奖励和 DONE 回执。相同身份不同负载拒绝,相同身份重试读取原记录。部分成功只发成功份数;全失败仍支付全部尝试成本,且不提前创建奖励物品。事务失败则不扣成本。提交回包丢失后查询原身份,不能退款后另建一批或重新抽取已持久结果。 + +库存快照核对物品ID、格子、数量、vnum、全部socket/属性以及69字节扩展状态;多个材料堆可准确拆分扣除,锁定/不可用输入不参与。按五页5×9格及道具高度分配奖品,完整消耗的材料可释放空间,部分扣除不释放。候选规则暂不合并已有奖励堆、不使用特殊背包、不支持copy配方或成功率道具;这些是明确限制。 + +奖励ID使用工厂提供的稳定ID,先在现有经济系统保留表中形成永久墓碑;现有重启ID高水位算法已覆盖该表。未使用ID也不能清理复用。实际工厂、ID范围与客户端动作请求的接线仍未完成。 + +候选引擎要求DB拥有的FROZEN栅栏匹配账号/角色、owner、epoch与请求身份,否则拒绝;经济离线待结算请求也会阻止执行。但本批**没有实现真实在线冻结和缓存排空**:测试中的栅栏为显式夹具,不能等同于游戏中所有资产入口已被隔离。DONE后仍不自行删除栅栏,必须由未来协调器完成权威重同步。 + +数据库连接适配器增加SQL warning计数;仅新Cube后端将告警作为失败并回滚,防止非严格MySQL下静默截断。原有经济系统策略不变。DB Makefile补充Economy.o手写头依赖,避免改头后漏编。候选头在测试中真实编译执行,当前game/db运行分派尚未调用它们。 + +## 验证范围 + +本地ASan/UBSan执行真实C++后端,通过SQLite承载SQL事务,仅在测试边界转换方言。另在203新建独立socket-only MySQL实例,使用真实InnoDB、实际迁移SQL和生产连接适配器测试;不连接正式服socket。每次结束只关闭该独立实例,保留数据和日志。 + +覆盖:随机数固定/重复请求、部分与全失败、64位费用、多堆材料、锁定与不足、背包满/重叠、完整物品状态、身份/所有者/epoch不匹配、损坏请求与回执、Prepare/Execute每条SQL失败、提交被拒/回包丢失、扣料后/回执后/提交后退出及双进程并发重复执行。MySQL还验证非InnoDB、未知字段、错误版本和关闭严格模式后的真实截断告警回滚。 + +新测试已加入统一入口的F21映射。最终报告、源码与产物指纹见 [证据记录](../audit/xxf-ch5/cube-batch-20261022.json)。本批没有改客户端运行代码,原生UI/APK不冒充重新验收;上一批原生/Android证据仍仅适用于其绑定版本。 + +最终统一报告 `build/ch5-tests/20261022-222210-8kfwe9ij/report.json`:123个测试文件全部通过,371个unittest用例,另有33个顶层探针,运行前后源码快照一致,release_ready仍为false。此后只补充文档和证据。 + +FreeBSD候选源码与DB构建位于 `/root/deploy-features/cube-batch.j5nQbT`:在独立build-root复制此前构建的源码/内部库/对象,更新连接头和Makefile后重编Economy.cpp并链接db,不是全库干净重编;未安装运行该db。最终真实MySQL实例 `/tmp/ch5-cube-mysql.pmtMDQ` 的日志保留,实例已关闭、socket已消失,未清理其测试数据。 + +## 下一步,仍阻止开放 + +1. game/db所有者及连接代次绑定,在线冻结、全资产写入口隔离、完整保存与双队列排空;失败保存不能放行。 +2. 绑定实际NPC/配方版本与可信工厂快照,接入耐久请求及结果查询,拒绝客户端伪造物品状态;与离线经济结算协调。 +3. 提交后只向仍持有栅栏的正确角色恢复权威资产,再释放冻结;覆盖断线、换线、game/db重启与迟到包。 +4. 核实并接入copy属性和提升成功率道具;明确不合并已有奖励堆的适配差异是否保留。 +5. 匹配真实game/db往返故障注入、资产对账和Android真机验收后,才能开放实际制作。再依次推进Won、狼人、征服者和五角色位。 + +实现细节和复现命令见服务端 `tools/cube/README.md`;不要以安装候选schema或手工插入FROZEN代替在线协调器。 diff --git a/docs/XXF-CH5-CUBE-CATALOG-20261022.md b/docs/XXF-CH5-CUBE-CATALOG-20261022.md new file mode 100644 index 00000000..8f8beb5b --- /dev/null +++ b/docs/XXF-CH5-CUBE-CATALOG-20261022.md @@ -0,0 +1,47 @@ +# 现代 Cube:配方与只读批量预检 + +2026-10-22。本批为 F21 第一阶段,状态 PARTIAL / NOT_RELEASED。不是实际扣料、批量制作与失败恢复已完成;不部署、不投放道具、不启用整套制作宏。后续按用户指定顺序完成 Cube,再推进 Won、狼人、征服者和五角色位。 + +## 来源核实 + +参考本地 `AVA2/2. Backup SF+SRC and SQL/FILES+SRC.tgz` 中活动 `ENABLE_CUBE_RENEWAL_WORLDARD`、`ENABLE_CUBE_RENEWAL_COPY` 分支及 `cuberenewal.cpp`。活动加载路径为 locale 下的 **cube.txt**,不能因为归档同时存在 cube2.txt 就认定活动系统加载后者。 + +原批量规则:预先核验整个尝试数量的材料和费用,每次1~100随机数对比 percent,所有尝试(包括失败)都扣材料与费用,奖励数量应为成功次数乘单次产出。不是失败免费或必然成功。五区原服务端已丢失,因此这是可核实 AVA2 规则重建依据,不能宣称与五区历史规则完全一致。 + +归档不可直接复制:奖励物品在得知成功次数之前按尝试数创建,正确按成功数创建的语句被注释,导致部分成功时数量错误、全失败时遗留创建对象;初始化复制配方信息时也未复制已启用的 copyAttr 标志。后续必须修复这些问题,保留明确差异记录。 + +## 已实现 + +- 服务端从现有内存 s_cube_proto 提供真实 NPC 配方,不另建第二份来源;经典加载器额外保留 category/copy,其原有制作逻辑未被替换。 +- 配方规范化、重复材料合并、数量边界、单结果限制;目录与配方的稳定陈旧检测指纹;8条分页并由客户端完整校验后原子发布。 +- 1~100次批量需求计算,64位金币乘法、材料堆拆分计划及物品ID去重,排除锁定/交易/装备中物品。只扫描普通背包,不声称覆盖特殊仓储。 +- 真实角色/NPC/地图/距离/窗口状态检查;客户端拒绝混合版本、过期窗口回复、费用或材料数量不一致的预检回复。 +- 五区原制作布局的16字段接口已对齐,NPC打开经典窗口后可加载明确标为“批量预检”的只读现代界面。没有服务端能力或现代UI资源时保留经典入口;切换配方目录清除旧预检状态。 + +## 明确未实现 + +`mutation_enabled=0`、`capacity_reserved=0`,制作宏仍为0。没有随机抽取、实际金币/材料扣除、奖品创建、背包空间保证、copy属性转移、提升成功率道具、耐久回执或崩溃恢复。当前 `CubeRenewalMakeItem` 的兼容名称仅在显式只读入口转发需求预检;不得据名称认定已能制作。 + +已有 PortEconomy 采用退出/缓存排空后的离线结算,会拒绝在线资产变更,不能不改协议就复用于在线制作,也不能偷偷用强制下线冒充在线事务。禁止用客户端循环经典 cube make 或服务端循环旧 Cube_make 代替耐久批量制作。 + +## 下一阶段实施与验收约束 + +1. 建立在线资产隔离:跨 game/db 缓存拥有者、连接代次、角色/背包变更门禁与事务栅栏。制作等待期间所有相关资产写入口必须一致拒绝,不只是制作窗口禁按钮;失联不能自动解除已可能提交的冻结。 +2. 固定批次身份:账号/角色、随机请求ID、配方身份与版本、次数和输入物品完整状态快照。相同ID不同负载拒绝,同ID重试只能读同一回执。客户端版本不是授权,服务端重新计算全部条件。 +3. 核实并固定材料属性复制规则及源物品身份,不能将未初始化copy标志当规则。检查稀有/扩展字段、绑定/锁定、过期与堆叠键,拒绝暂不能无损表达的状态。 +4. 明确整批事务语义:按 AVA2 规则扣所有尝试成本,奖励只按成功次数;“合成失败”是已提交结果,不是事务失败。事务失败不扣资产。先持久确定随机结果及恢复身份,恢复和重试不重新抽取。全失败也必须有耐久成功提交回执。 +5. 在权威事务内核验余额、逐物品ID/数量/状态,预留实际可放奖品的格子与物品ID,统一提交材料、费用、奖励及回执;没有权威空间时不得只凭客户端预检放行。不能在DB事务之外先扣内存金币或先AutoGiveItem。 +6. 只有已提交账本结果可同步到在线缓存;回调丢失、game/db崩溃、换线/断线、重复请求与重连时先对账,保证已提交只应用一次、不覆盖其他资产。补偿只针对明确未提交状态,不能盲目退料后又发奖。 +7. 故障注入覆盖:不足/锁定/中途变化、费用溢出、背包满、0/100成功率、部分/全失败、复制属性、重复并发、不同负载复用ID,以及事务前/中/后和缓存同步前后每个中断点。最终真实MySQL/game/db往返、资产核对和Android设备验收完成后才开放制作宏。 + +这些是待实现契约,不是当前已有保障。只读预检快照不锁资产,也不保证下一次制作必然可执行。 + +## 本批验证 + +- 统一入口122个测试文件全部通过(370个unittest用例,另有33个顶层探针);最终报告 `build/ch5-tests/20261022-190031-6mw16lxl/report.json`。运行期间源码快照未变化;此后只补充文档/证据,没有改运行代码或功能元数据。 +- 服务端新测试编译真实 `cube_recipe.h` 和 `port_cube_catalog.inc`,在明确角色/物品替身下启用ASan/UBSan;覆盖NPC、距离、重复占格、锁定材料、64位费用与无资产写入。不冒充真实DB事务测试。 +- 原生五区资源专项最终日志 `build/ch5-cube-ch5-native-verified-20261022.log`:实际游戏窗口钩子、原CubeRenewal布局、配方接口、三次尝试需求预检及金币/材料不变。传输/配方使用FakeLoginServer显式夹具;不证明真实服务端联调完成,也不是画面美术验收。 +- macOS最终回归日志 `build/ch5-cube-native-tests-verified-20261022.log`;Android完整APK构建日志 `build/ch5-cube-android-20261022.log`,为debug签名,未安装部署,adb未连接设备。既有缺图、音频、狼人动作告警仍在,不宣称资源全就绪。 +- FreeBSD隔离构建目录 `/root/deploy-features/cube-catalog.7eDSki`,复制上一隔离构建的源码/内部库/对象后,更新本批文件并重建受影响game对象。不属于内部库全新干净重编,未替换生产程序。 + +最终构建、产物指纹与限制见 [证据记录](../audit/xxf-ch5/cube-catalog-20261022.json)。 diff --git a/docs/XXF-CH5-CUBE-DEFERRED-GOLD-20261023.md b/docs/XXF-CH5-CUBE-DEFERRED-GOLD-20261023.md new file mode 100644 index 00000000..4b355094 --- /dev/null +++ b/docs/XXF-CH5-CUBE-DEFERRED-GOLD-20261023.md @@ -0,0 +1,39 @@ +# 五区 Cube:延期正数金币意图候选后端 + +本批接续[资产准入与变更失效](XXF-CH5-CUBE-ADMISSION-20261023.md),完成“金币奖励可靠保留”的一段后端,不是完整在线闭环。F21 仍为 PARTIAL;`HandshakeEnabled=false`、`ActorMutationAuditComplete=false`,没有开放制作、部署生产或改动线上资产。 + +## 已实现的边界 + +1. 可信调用者提供稳定事件 ID 与正数金币意图,绑定账号/角色/epoch/owner/原批次 token。129 字节规范小端编码,金额不超过既有 GoldLimit,单批次最多 1024 条连续序号;同 ID 的不同内容拒绝,来源标签不是认证凭据。 +2. Enqueue 只写持久 QUEUED,不改钱包。允许匹配的 DRAINING/FROZEN/ABORTED 收纳意图;RESYNC/RELEASED 不接受新事件,防止权威图像生成后继续发奖。旧事件可只读查回原状态。 +3. Pending 重启后读取持久意图;Apply 只收事件身份,金额来自已保存的内容。必须仍是 clean FROZEN,且原制作 DONE 回执、固定随机数、费用与奖励图像全部校验通过;不会为了发奖自动执行 PREPARED 制作。 +4. 与 Cube/Economy 共用账号行锁,按连续序号发放。核对“原金币-制作费用+已发意图”的预期钱包,金币加法与 APPLIED 回执同一事务提交。提交确认丢失、重启或重复调用返回原结果,不再次加钱;历史重放不要求后来钱包仍等于旧回执。 +5. QUEUED 或异常历史阻止 Resync/Release;全部发完后权威图像包括新金币。Release 仍要求准确图像 ACK 和再次读取一致;已 RELEASED 的旧 ACK 可幂等重放。 +6. 实际 DB 玩家保存/账号加载门禁增加待发金币检查,包括 base fence 意外缺失但金币意图仍存在的情况;不能通过换角色绕过。此检查不是孤立记录的自动修复。 + +主要文件:server 的 `common/cube_gold_intent.h`、`cube_gold_store.h`、`db/src/CubeGold.cpp`、`Cube.cpp`;`cube_store.h` 提取只读 DONE 回执校验,`cube_fence.h` 增加重同步/解锁屏障。显式模板实例化让完整 DB 编译检查实际 Mysql 适配器,但没有生产调用者。 + +## 数据与运维约束 + +`tools/cube/gold-schema.sql` 是**可选 addon v1**,两表要求 InnoDB;base Cube 仍为 v2,没有自动安装或启动迁移。addon 不存在时保持原候选基线;部分表、未知版本、非事务引擎和查询错误失败关闭。实际 DB 门禁缓存 schema 发现结果,安装/卸载必须停相关入口、完成维护并协调重启;不能边发奖边安装、删表或手工清空未决记录。 + +这不是增加第二种货币,也不是 Won。overflow、钱包不一致、损坏回执或未知 schema 都保持未决,不退款、不删除意图、不超时解锁。ABORTED 可以保留奖励意图,但 Apply 明确拒绝自动处理:失败排空后钱包基线可能不可靠,后续需要单独的可信对账/恢复流程。达到 1024 条或持久化失败时,上游必须保留事件并施加背压,不能报告到账。 + +## 尚未完成,不能据此开启制作 + +- 实际战斗/任务/投递入口尚未接入;需要稳定事件生成、可信身份验证、生产者持久 outbox、重复发送与持久 ACK。仅 SQL 内“不重复加钱”不能保证事件产生后、入队前崩溃不丢奖。 +- 不把已执行 PointChange 的变动再次入队,不重放旧背包快照,不在底层 setter 简单吞操作。当前原金币变更仍照常执行及通知失效;新队列尚未替代任何现有发奖路径。 +- 物品、经验、负数费用、到期和全服/服务器回调,以及 ABORTED/跨核心所有权接管仍未闭环。 +- 在线工厂/ID、Prepare/Execute、权威图像应用、准确 ACK/解冻、copy 属性、成功率道具及真服/Android 验收仍待完成。 + +下一步先实现一个有可核实来源的发奖入口及其 durable outbox/ACK,证明从事件产生到金币入账的端到端恢复,再扩大到其他来源;不直接开启通用 PointChange 拦截。 + +## 验证与可追溯性 + +- 本地 `test_cube_gold.py` 编译 ASan/UBSan 探针:规范编码、去重/顺序、不可隐式制作、待发屏障、钱包冲突、异常回执、ABORTED、溢出、每个 SQL 失败位置、警告回滚、提交拒绝/确认丢失、独立进程退出/重启及并发重放。 +- `test_cube_db_guards.py` 提取实际 DB 门禁方法,以明确 SQL 边界替身验证 addon 缺失/部分/未知版本、孤立待发记录和账号隔离;不冒充联机角色验收。 +- FreeBSD 独立测试根 `/root/deploy-features/cube-gold.KpZPZN`;真实 MySQL 使用 `/tmp/ch5-cube-mysql.Etxbiv` 的专用 socket、`--no-defaults --skip-networking`,运行后只关闭此实例,保留数据/日志。运行实际 addon DDL、原批次/生命周期、延期金币以及真实 libsql FIFO 探针;没有连接生产 socket。 +- DB 使用全新 `.cube-gold-db-obj` 对象目录编译/链接,继承内部平台库;不是全部依赖库的干净重建。本批未改 game 源码,也未重新构建 game 或客户端。 +- 总回归报告目录 `build/ch5-tests/20261023-cube-gold-final/`;实际结果与源文件、schema、二进制和日志散列绑定在 `audit/xxf-ch5/cube-gold-20261023.json`。历史批次证据保留,不以旧散列冒充本批验证。 + +这些验证只覆盖候选后端与局部接线,不给出发布就绪或五区功能全部完成的结论。 diff --git a/docs/XXF-CH5-CUBE-FACTORY-20261023.md b/docs/XXF-CH5-CUBE-FACTORY-20261023.md new file mode 100644 index 00000000..8bffe385 --- /dev/null +++ b/docs/XXF-CH5-CUBE-FACTORY-20261023.md @@ -0,0 +1,41 @@ +# Cube:复用真实CreateItem的奖励模板工厂 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。本批补上前两批内部结算/ID预留之后的真实metadata工厂;**没有开放制作或完成整个Cube**。 + +## 来源与语义 + +核对本地`AVA2/2. Backup SF+SRC and SQL/FILES+SRC.tgz`中`home/Ava2_src/Srcs/Server/game/src/cuberenewal.cpp`:活动WORLDARD在第427行使用`CreateItem(vnum,count)`默认选项,不是经典`AutoGiveItem`的TryMagic=true。候选工厂因此保留当前真实CreateItem的默认新物品初始化,不另外提高随机魔法属性概率;保留原型addon与socket、unique/实时/穿戴期限、自动药水、blend、技能书及龙魂分支。没有照抄归档中按尝试总数发奖等旧缺陷,仍使用既有持久rolls和成功份数结算。 + +`PortCubeBuildRewardTemplates(vnum, slots, out)`只供game主线程使用,slots为最坏输出模板数1..100。先检查原型/非金币物品;技能书原型要求技能目录至少有候选,避免空目录导致旧随机选择无限重试。通过上批真实号段接口整批预留ID,逐项调用真实`ITEM_MANAGER::CreateItem(vnum,1,0,false,-1,true)`,不是零metadata或另写一份初始化算法。 + +内部单次slot把实际预留ID接到CreateItem,但**不把调用参数id改成非零**,否则会跳过新物品的addon/随机socket等分支。模板保留所有3个socket、7项基础属性和完整69字节扩展状态,count固定为1;最终堆数量由SQL结算决定。瞬态指针不会返回给调用者。 + +## 副作用隔离 + +仅设置bSkipSave原本不足:旧函数会重置skip-save、启动期限事件且销毁会删除ID映射。本批增加每物品独立template标记,在Initialize之后立刻置位,普通初始化重置为false: + +- 不生成VID、不注册全局ID/VID映射,预留ID冲突也拒绝。 +- CItem::Save在模板分支直接返回,不通知角色变更、不排延迟保存;UpdatePacket直接返回。 +- SetSocket、SetAttribute和SetForceAttribute保留值初始化,但不写未实际发放物品的操作日志。 +- 保留期限socket的计算,但不启动unique/real-time/wear事件。 +- 逐项作用域调用真实DestroyItem,模板不发DB删除包,也不擦除其他ID/VID映射;构建失败或异常同样释放已分配瞬态物品。整批成功才替换out;失败不返还已消耗ID。 + +旧普通物品不带标记,保存/日志/VID/事件与销毁分支不变。新增字段改变内部CItem布局,需要完整重编game所有对象,不能仅替换几个对象后链接。它不改变客户端或DB序列化结构。 + +旧item_manager.cpp包含混合遗留编码,使用可逆Latin1字节代理临时规范化、apply_patch改ASCII语句后原样反向转换;保留编辑前本地副本。最终非ASCII字节和原文件模式不变,没有把旧注释批量转码提交。 + +## 验证 + +`test_cube_craft.py`从当前源码编译实际CreateItem、DestroyItem、Save、SetSocket、SetAttribute、SetForceAttribute与工厂函数体,只有平台/物品基础方法、数据表和随机原语是明确替身。覆盖addon/extra、socket、unique/时钟、blend早退、技能书、龙魂、无保存/日志/计时/映射/VID、部分构建失败、SetCount失败、异常释放、保留旧输出、空技能目录、重入与预留ID冲突;另确认普通工厂继续保存/登记/起事件和正常销毁。这里不是加载真实item_proto/技能表后的联机验收。 + +原Save通知探针补充默认false的template字段和专用返回断言,所有旧通知/保存断言保留,不删除旧测试。统一报告、最终FreeBSD构建与源码哈希见`audit/xxf-ch5/cube-factory-20261023.json`。 + +FreeBSD隔离根`/root/deploy-features/cube-factory.LM5CPB`从空对象目录完整重编game,使用既有匹配平台依赖库,最多两项编译并发。首次编译暴露新翻译单元缺少char.h的类型依赖,已补齐;最终完整构建及更新工厂后的复核链接通过。没有启动该game,未重编无改动的DB。 + +新增`tools/cube/test_factory_native.sh GAME_SRC OBJECT_DIR PROBE_CPP`,为原生完整对象集合复制并重命名main.o中的入口符号,链接`tests/features/fixtures/cube_factory_native.cpp`为独立离线探针,既不替换原对象,也不执行原game main。探针使用合成内存proto,但调用真实分配器、CItem、addon/socket/期限/药水初始化、销毁和事件队列;保持DB描述符为空、事件数为0,检查ID/VID映射无模板残留,调用真实Update/GracefulShutdown后仍无DB访问。归档中真实blend/技能/DS配置未加载,相关分支只有明确替身探针覆盖,不冒充完整数据或联机验收。日志/产物留在脚本输出的新隔离目录。 + +## 仍待实现 + +工厂虽然编入game,仍没有来自可信batch builder或用户动作的调用。下一步把当前已加载NPC配方、角色完整快照、服务器生成身份、该工厂和PortCubeBegin接为单一可信入口,重复身份不得重建/重抽已接受图像。其后还需原actor权威应用/准确ACK/thaw、可靠冻结与变更延期、旧core撤销、完整恢复、copy/成功率道具及匹配联机/Android验收。 + +本函数的ID消耗仍是进程内状态,必须由原批次DB永久预留事务接受后才能使用;不能把瞬态模板等同于已持久物品或发奖。两道false门禁和客户端制作宏不变;不部署、重启、迁移或改玩家资产。本批未推进后四项。 diff --git a/docs/XXF-CH5-CUBE-FENCE-20261022.md b/docs/XXF-CH5-CUBE-FENCE-20261022.md new file mode 100644 index 00000000..33e1d29b --- /dev/null +++ b/docs/XXF-CH5-CUBE-FENCE-20261022.md @@ -0,0 +1,34 @@ +# 现代 Cube 第三批:DB 持久隔离与重同步核心 + +状态 PARTIAL / NOT_RELEASED。延续[候选事务后端](XXF-CH5-CUBE-BATCH-20261022.md)。本批没有开放制作,没有部署/重启正式服或修改正式玩家资产;Won、狼人、征服者和五角色位仍在Cube之后。 + +## 已实现的代码 + +- `cube_drain.h`:按完整批次、传输会话代次、两次编号main回调和async回调关联排空状态;旧/重复/乱序回调不能提前完成。失败epoch变化或所有者丢失会阻止进入可扣料状态。这是回调核心,**不等于实际game/db FIFO适配器已接通**。 +- `cube_fence.h`:DRAINING/FROZEN/ABORTED/RESYNC/RELEASED持久生命周期。进入DRAINING即保留完整原始批次、物品锁及奖励ID墓碑;失败排空不扣费,只能走明确失败后的权威重同步。未准备批次可以在FROZEN时明确拒绝;已PREPARED的不能盲目取消。 +- `db/src/Cube.cpp` 已加入DB构建,实际接入既有角色/任务保存、物品保存/销毁/flush、选角加载、角色删除、经济请求和离线结算门禁。被扣掉的材料ID无需再有item行也会保持锁定;孤立物品锁也阻止相关角色和账号加载。其他无关ID/账号不被统一封锁。 +- 重启ID高水位包含Cube物品锁,保护尚未落到item表的脏缓存ID;奖励ID在DRAINING时便进入永久保留表,不能等Prepare后才保留。Prepare只接受同一身份的既有保留项,不允许借用其他请求的ID。 +- 权威重同步图像包括金币和普通背包的完整持久元数据及合法物理网格;解锁须匹配原owner/epoch/身份、准确ACK图像,并在SQL锁内重读仍一致,最后原子删除物品锁/记录RELEASED。旧ACK不能释放新批次。提交回包丢失可重放,超时不能自动解锁。 +- `Recover` 从SQL读取并核对原批次及阶段,不依赖原进程内存;它本身不授权更换game所有者。已失败排空的来源标志持久化,避免ABORTED→RESYNC后再次查询被误当成必须有DONE回执的成功路径。 + +schema已升级为候选v2,经济schema仍为v1。新库使用schema.sql,已有候选v1用明确的upgrade-v2.sql;拒绝未解决的旧栅栏/PREPARED,支持部分DDL后的重试,保留历史。没有自动填充丢失的五区规则或自动抹除旧持有者。 + +## 测试边界 + +实际C++批次/生命周期核心用ASan/UBSan与SQL执行,DB三个门禁方法也真实编译执行(SQLMsg、连接发现为显式替身);静态入口检查确认调用路径,不冒充实际网络包与在线角色验证。真实MySQL使用独立socket-only进程及实际迁移SQL,未连接正式服socket。 + +覆盖旧/重复/乱序回调、失败epoch、失去所有者、缺失物品锁、已消耗/孤立ID、部分schema/旧版本、不同账号与表后缀、权威图像变化、错误/重复ACK、单调epoch、新旧批次交错、Prepare/生命周期SQL失败点及独立进程恢复;保留前批全部扣料/随机数/崩溃测试。 + +本批发现macOS系统SQLite/日志库在fork后的初始化偶发崩溃。测试已改用posix_spawn启动新进程,不继承运行库内存和SQL连接;失败记录未冒充通过。最终证据记录使用修复后的源码。 + +最终报告、FreeBSD干净DB对象构建(内部库沿用隔离基线)、MySQL日志及指纹见[证据记录](../audit/xxf-ch5/cube-fence-20261022.json)。未改客户端运行代码,不重新声称原生UI、APK或Android真机验收完成。前两批证据是历史绑定版本,不能视作当前源码指纹。 + +最终统一本地报告 `build/ch5-tests/20261022-230645-miudzocm/report.json`:125个文件全部通过,374个unittest用例及33个顶层探针,源码快照未变化,release_ready仍为false;随后仅补文档和证据。修复后的批次/生命周期ASan专项各连续8轮通过。真实MySQL最终实例 `/tmp/ch5-cube-mysql.cPcG99` 已关闭,socket已消失,测试数据/日志保留;未连接正式服。FreeBSD候选DB位于 `/root/deploy-features/cube-fence.wGvs6m/build-root/bin/db`,使用新的.cube-v2-obj目录编译全部DB对象,补编最终ID高水位修订后链接,内部库沿用已知隔离基线。 + +## 仍未完成,禁止开放制作 + +game实际角色冻结、所有资产变更入口/异步事件隔离、可信最终保存握手、真实双SQL队列回调适配、工厂/动作协议、图像向正确仍冻结角色的应用与ACK,以及跨服/掉线/换所有者恢复仍未接线。持有表与DB门禁不是完整在线事务,也没有偷偷强制下线结算。 + +特别是:失败计数基线必须在最终保存开始前取得;DRAINING后普通保存包会被门禁拒绝,因此不能先Begin再直接ch->Save()。必须有绑定owner/epoch的单次可信快照接收与缓存排空流程。图像也不包含运行时锁/事件,不能据usable位解锁原物品,后续批次必须从真实CItem重新采样。 + +下一批应接入并验证这些运行时适配,再补copy属性/成功率道具及匹配game/db/Android资产验收,之后才能开放制作并推进Won等功能。服务端复现与维护说明在tools/cube/README.md。 diff --git a/docs/XXF-CH5-CUBE-FIFO-20261022.md b/docs/XXF-CH5-CUBE-FIFO-20261022.md new file mode 100644 index 00000000..c78f2f36 --- /dev/null +++ b/docs/XXF-CH5-CUBE-FIFO-20261022.md @@ -0,0 +1,39 @@ +# 五区现代 Cube:数据库 SQL 排空接入 + +状态:**F21 部分完成,不具备发布或开启在线制作的条件**。承接配方、批量事务候选及持久锁定三批实现;本批不更改客户端制作权限,不部署生产、不修改玩家资产、不提交 Git。 + +## 本批代码 + +服务端新增 `db/src/CubeRuntime.h/.cpp`、`db/src/SQLFences.h` 和 `common/sql_fence_router.h`,接入实际 DB 主查询结果分派、周期 Tick 和 RemovePeer。现有 Economy 改为通过同一个 PLAYER 异步队列的分类路由收取回包,而不是直接取走所有回包。 + +内部流程: + +1. `CubeDrainArm` 校验当前核心连接、正在游戏的账号及角色归属,绑定不可复用的进程内 cookie、game handle 和 session;在最终保存交接**之前**记录两条 SQL 队列的失败计数及路由失败计数。 +2. Arm 阶段限制换角色、其他核心保存、删除及并发经济写入,但允许原核心发送最终普通保存。未来 game 必须先冻结全部相关资产变更,得到 Arm 确认后再保存,并在同一 peer FIFO 上提交。 +3. `CubeDrainSubmit` 比较 DB 缓存与不可变批次:钱包、普通背包、物品 ID/数量/位置、全部镶孔/属性/69 字节扩展数据;保存全部自有缓存 ID,包括装备和删除标记。原生 long 镶孔逐个检查 int32 范围,不按宿主宽度直接复制。 +4. 持久化 DRAINING 与逐物品锁之后,直接排出并移除旧缓存,再提交第一主队列屏障。第一次回调触发第二主屏障及**同一个实际 PLAYER 异步 FIFO**屏障;编号阻止重复第一次回调冒充第二次。 +5. 两个主回调与异步回调齐全且失败计数不变、原连接仍有效,才持久化 FROZEN;否则持久化 ABORTED。FinishDrain 提交确认丢失时读取原始持久结果,不重新猜测结局。 + +异步关联号不作为指针解引用,同一 DB 进程不复用;分类消费者不会互取回包,未知/重复回包计入失败。队列满会重试,不能假装异步保存已完成。DB 退出清理路由持有的回包。Makefile 补齐了 ClientManager 布局及新头文件的对象依赖。 + +## 不可越过的边界 + +- Arm/Submit **尚无 game 协议入口或调用方**。DB 只能校验账号/核心连接,不能替代 game 对当前角色 generation、NPC/配方、物品事件和完整冻结状态的验证。 +- `usable` 不是持久化字段,缓存比对只比较 SQL 图像;不能据此解锁或认定定时事件已停止。 +- 本批不调用 Prepare/Execute,不生产道具、不扣料、不随机抽取结果;也没有在线图像应用/确认、解冻或新连接接管。 +- 未开始 Begin 的 Arm 可在断线或 60 秒后清理;**一旦尝试 Begin,包括失败或提交确认不明,就不按超时解锁**。FROZEN/ABORTED 均保留阻塞,等待完整恢复与确认链路。128 个上下文上限是保守保护,不是可上线的常驻调度器;终态清理/恢复尚需实现。 +- 原连接丢失标记不可逆,即使连接 handle 再出现也不会恢复旧授权。旧 cookie 回包不能关联新的 Arm。 +- 整体宏仍关闭,现有客户端继续只读配方与批量预检;经典 Cube 行为不变。 + +## 验证范围 + +- `test_sql_fence_router.py`:ASan/UBSan 下的分类隔离、内存所有权、容量限制、未知/重复回包、不回绕和 Clear 后不复用。 +- `test_cube_runtime.py`:编译实际 CubeRuntime.cpp 方法,明确替换 peer/cache/连接边界,覆盖最终缓存不匹配、两屏障回调、异步入队失败重试、保存/回包失败、断线、旧 cookie、Arm 超时、Begin/FinishDrain 提交确认丢失及真正提交失败;不启动在线角色。 +- FreeBSD 隔离构建目录 `/root/deploy-features/cube-fifo.MFbPU1`,全新 `.cube-fifo-obj` 编译所有 DB 对象,使用已存在的内部平台库,再链接本批最终恢复代码;不是重新编译全部底层库。 +- 独立 socket-only MySQL `/tmp/ch5-cube-mysql.DGgvHs`:既有批量事务/恢复/升级测试,以及新增真实 libsql 工作线程测试。后者校验实际 socket,使用同一工作线程交错设置并读取会话变量,验证分类回包及失败计数。测试实例已关闭,数据/日志保留;未使用生产连接。 + +最终源码散列、构建散列与本地总回归报告绑定见 `audit/xxf-ch5/cube-fifo-20261022.json`。自动化通过不等于真服联机或 Android 验收。 + +## 下一步 + +继续 Cube:实现 game 全变更路径冻结与可信最终保存握手,随后接入工厂预留 ID、持久化 Prepare/Execute、权威图像应用/精确 ACK、断线/重启接管及解冻,再完成 copy 属性/成功率道具和匹配版本联机验收。Cube 闭环后,按用户顺序推进 Won、狼人、征服者、五角色位;这些并未在本批完成。 diff --git a/docs/XXF-CH5-CUBE-HANDSHAKE-20261023.md b/docs/XXF-CH5-CUBE-HANDSHAKE-20261023.md new file mode 100644 index 00000000..1accc425 --- /dev/null +++ b/docs/XXF-CH5-CUBE-HANDSHAKE-20261023.md @@ -0,0 +1,49 @@ +# 五区现代 Cube:准备状态机与最终保存握手 + +日期:2026-10-23。承接上一批 DB FIFO 排空适配。本批完成**准备状态机、内部分派和最终保存交接代码**,不等于完成角色全路径冻结或开放制作。F21 继续为 PARTIAL,生产未部署,玩家资产未改动。 + +## 实现范围 + +- `common/cube_handshake.h`:内部 header78,Arm / Submit / Poll / Cancel / Answer;102 字节定宽 LE 前缀加不超过 40000 字节批次体。显式编码而非原生结构体拷贝,校验总长、版本、保留位、消息方向、账号/角色、session、epoch、owner/token、cookie 和 body 的身份一致性。game 在等待完整包体前就拒绝超长/负长度前缀。 +- `db/src/CubeRuntime.cpp`:同核心/账号/角色及 handle/session/epoch 绑定;相同 Arm 重试返回原 cookie,不替换批次体。Submit 后驱动已有 SQL 排空链;Poll 返回原状态。只有从未尝试 Begin 的上下文可确认 Cancel,保留短期取消墓碑,避免丢确认后误执行迟到 Submit。开始过 Begin 的取消请求只返回 Held。 +- `game/src/port_cube_actor.cpp`:准备状态机与 VID/descriptor/账号/会话回包匹配;同一角色 ID 不能接管旧内存会话。重新检查当前 NPC、任务 NPC、地图、距离及实际已加载配方的完整编码,不拿 UI 的 FNV 指纹当授权。 +- 快照覆盖普通背包/装备、龙魂、Switchbot 和五类专用背包。记录数量、位置、窗口、原 vnum、3 镶孔、7 属性及全部 69 字节扩展数据,连同可用/锁定状态形成内存封印;多格物品去重,同 ID 不同物品拒绝。宿主 long 镶孔显式检查 int32 范围。 +- Arm ACK 后先核对封印,排空角色延迟保存(没有待保存时强制 SaveReal),再排空此玩家的延迟物品保存,并强制保存全部当前自有窗口物品。再次比对封印后,先将内存标记为“已提交”,再发送 Submit;网络丢失不能把它当成从未提交。 +- 新增 `FlushDelayedSaveForPlayer`,覆盖专用背包和脱离角色后等待删除的条目;只凭 last-owner 不得排出现在属于其他玩家的物品。旧 `FlushDelayedSaveItem` 只遍历当前普通背包/装备,不能直接代替。 +- 周期 Tick、DB 回包分派、角色 Destroy 和 CanHandleItem 接入准备状态。等待取消只重试取消,等待排空可重发同一 Submit;未知、超时、断线、失败和终态回包均不授权自动解冻。只有匹配的明确 pre-Begin Cancelled ACK 可清除准备。 + +## 为什么仍然关闭入口 + +`HandshakeEnabled=false`、`ActorMutationAuditComplete=false`。两个门禁均为编译期常量,无命令或运行配置开关;实际 DB ingress 在 Arm/SQL 操作前返回 Held,game 的 Begin 不会启动。没有新增玩家操作入口,不更改客户端 capability,也不调用 Prepare/Execute。 + +本次检查确认,下列路径不能被 CanHandleItem 或背包按钮冻结覆盖: + +| 类别 | 当前源路径 | 必须解决的问题 | +| --- | --- | --- | +| 物品到期与消耗 | item.cpp 的 unique / wear / real_time / accessory 到期事件 | 不能推迟真实有效期,也不能丢弃事件或复活已过期物品 | +| 战斗与队伍奖励 | char_battle.cpp、party.cpp 等 | 其他角色的结算可能直接给金币/经验/物品,不能仅拦本人的输入 | +| 任务与定时回调 | questpc / questmanager / questlua_* | 非交互脚本仍可直改资产和标志,不能仅要求 PC 当前不运行任务 | +| 后台与在线回包 | switchbot、商店/领取、各 input_db 分支 | 必须明确执行前置排空、延期或拒绝的所有权及恢复语义 | +| 生命周期与保存 | Disconnect、Warp、Destroy、延迟保存队列 | 不能在 Submit 后重新发送旧资产图像;断线不能无证据解除持久锁 | + +本批**没有**在 PointChange、SetCount 或其他底层 setter 中静默丢弃修改,没有暂停全服主循环、强制下线或把在线角色当成离线角色。封印比对是交接前的校验,不是期间没有发生资产变更的证明;定时事件、战斗/任务奖励等全部实现受控静止前,不能把两个常量改为 true。 + +## 仍未完成 + +1. 所有直接资产变更及事件的可恢复冻结/排空,安全解除与一致性恢复。 +2. 可信工厂 ID/奖励模板生成、实际批量 Prepare/Execute 调用。 +3. 结算后权威图像应用、精确 ACK、解冻、终态清理。 +4. 断线、跨核心和进程重启后的新 owner 接管;当前超时/失败只保守保留阻塞,不能作为上线调度器。 +5. copy 属性、成功率道具及匹配 game/db/Android 实机验收。 + +## 验证与记录 + +- `test_cube_handshake.py`:有界编码/截断/错字段、准备状态机、不同会话/epoch/旧回包、超时/断线/迟到取消;编译实际 game 快照逻辑与实际玩家延迟物品保存方法,使用明确的角色/物品替身。 +- `test_cube_runtime.py`:编译实际 DB 方法,新增内部路由的 Arm 幂等、篡改 body 拒绝、取消墓碑、迟到 Submit/Cancel,以及真实入口关闭前不执行 SQL 的断言。内部路由测试不表示生产入口已启用。 +- `test_cube_catalog.py`:实际加载配方的完整编码匹配与篡改拒绝。 +- FreeBSD 隔离目录 `/root/deploy-features/cube-handshake.O7iqNe`:game 在继承对象树上编译受影响对象并链接;DB 用全新 `.cube-handshake-obj` 编译所有对象。底层平台库继承,未重建全部库,不启动服务。初次 game 构建出现主机时钟偏移提示,完成后另跑 make 复核。 +- 当前源文件/原生产服务均未部署;本批没有重新运行在线角色、实服资产或 Android 验收。 + +最终自动回归、源码和原生二进制散列绑定见 `audit/xxf-ch5/cube-handshake-20261023.json`。`item_manager.h/.cpp` 保持原非 UTF-8 编码,仅按 ASCII 锚点插入声明和 include,新方法在 UTF-8 的 `.inc` 中维护。 + +下一批仍优先完成全资产变更路径的冻结与恢复,不跳到 Won、狼人、征服者或五角色位,也不能据本批准备代码宣布 Cube 在线闭环完成。 diff --git a/docs/XXF-CH5-CUBE-IMAGE-ACK-20261023.md b/docs/XXF-CH5-CUBE-IMAGE-ACK-20261023.md new file mode 100644 index 00000000..46fc24fc --- /dev/null +++ b/docs/XXF-CH5-CUBE-IMAGE-ACK-20261023.md @@ -0,0 +1,27 @@ +# Cube:原在线所有者的持久图像 ACK + +接续普通背包/金币内存安装,保持 Cube → Won → 狼人 → 征服者 → 五角色位顺序。本批实现完整图像的内部确认;不是终态释放或可玩验收,后四项尚未推进。 + +## 完整确认与事务 + +内部 header78 追加 LiveImageAck=20、LiveImageAckAnswer=21、LiveImageAcknowledged=17,已有编号和包版本不变。请求携带完整规范背包/金币图像,而不是哈希或成功布尔;成功回复回显相同完整图像,Held 回复无 body。仍使用原 account/player/session/epoch/owner/token/cookie,DB 另外匹配实际 peer、handle、playing-account 和原 LIVE context。伪造回复方向不进入请求处理。 + +新增可选 `tools/cube/image-ack-schema.sql`,包含 InnoDB 版本表和不可变确认表,记录 request、完整 batch、160 字节 owner grant 与完整图像。依赖 Cube v2、gold v2、owner v1;不替换旧版本,不启动时建表,不为历史持有状态伪造确认。缺表、部分表、非事务引擎、未知版本均保持 Held。本批仅在隔离测试库执行,不迁移生产。 + +`ImageAckStore::AcknowledgeLive`通过实际 Fence.Resync 的同一账号事务/固定连接,重新读取当前 SQL 钱包/背包,执行原 LIVE 所有权证明(broker、lease、sealed gold source、ok DONE 与固定 rolls、金币已应用、ID fences/reservations);必须与请求图像逐字节一致。确认前已存在的 fence 必须是 RESYNC 且已发 image 相同,不能借 ACK 首次生成图像。首次插入确认;重试只接受完整 batch/grant/image 全相同。任何回调失败、warning、拒绝提交都回滚;提交成功但回复丢失可原身份重试,仍重新验证所有权与当前数据。 + +确认操作不会删除 lease、item fence、永久 ID reservation 或经济历史,不改终态为 RELEASED,不允许旧 Release 绕过所有权。本表不是将来终态释放的充分条件:释放仍必须有当前所有权、精确状态和完整可恢复/可发布角色证明,不能只查询 token 对应的历史 ACK。 + +## game 路径 + +LiveImageFlow 追加 AckWaiting/Acknowledged。仅 Applied 的精确读回能进入 AckWaiting;实际 actor 每次重发前重新捕获全部拥有窗口封印,与应用后的封印相等,并重编码普通背包/金币逐字节比较。初次确认回复处理也先做相同读回。仍沿原轮询队列,每 tick 最多发送两项制作/图像/ACK 请求,每角色两秒重试。超时或 Held 不被解释为完成。 + +成功回复只到 Acknowledged,ActorHandshake 继续 BlocksActions。延迟重复的图像回复不会把 AckWaiting/Acknowledged 降回 Ready,也不会重新安装;精确重复确认可重放,错 cookie/身份忽略,图像冲突保持 Held。新物品仍 skip-save、事件暂停;没有正常保存恢复、客户端刷新或 thaw。 + +## 验证与限制 + +ASan/UBSan 使用真实 store/game helper/实际 DB 路由,数据库、连接锁、peer/角色边界明确区分真实实现和替身。覆盖确认丢失、重复提交、全部 SQL 查询失败/warning、提交拒绝、事务前后进程退出、错误 peer/session/revision/broker、已撤销/接管所有者、变更 SQL 钱包/属性/已发图像/历史确认、缺失已发状态、缺失/未知/非事务 schema。实际 actor helper 覆盖逐次读回、其他窗口变化拒绝、重复回复不降级,实际 DB ingress 两门关闭时不执行 SQL。 + +隔离 FreeBSD 编译实际 CubeRuntime/port_cube_actor 翻译单元,链接匹配的前批对象队列;仅新增非虚方法和内部枚举,不改变实例/序列化布局,不冒充全量重编译或联机。原生环境首次发现旧头中 false 为 int 导致 lambda 推断冲突,已显式声明 bool 返回类型;构建闭包补齐 locale.hpp,DB 手工链接保留 pthread。最终结果及来源散列见 `audit/xxf-ch5/cube-image-ack-20261023.json`。 + +下一步:owner-aware 终态释放/重放,保存和到期事件恢复,快捷栏/完整客户端发布后安全解锁;全冻结与外部引用审核、完整角色/其他窗口恢复、异常 DONE 对账、copy/成功率道具、公开动作与匹配联机/Android 验收仍缺。两道 false 门禁和客户端制作宏不变,不部署/重启生产,不改玩家资产。 diff --git a/docs/XXF-CH5-CUBE-ITEM-IDS-20261023.md b/docs/XXF-CH5-CUBE-ITEM-IDS-20261023.md new file mode 100644 index 00000000..5cf0daa3 --- /dev/null +++ b/docs/XXF-CH5-CUBE-ITEM-IDS-20261023.md @@ -0,0 +1,21 @@ +# Cube:真实号段的整批ID预留 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。上批已接通内部Prepare/Execute;本批开始补真实奖励工厂所需ID基础,不开放制作,不声称Cube完成。 + +## 实现 + +- `PortCubeReserveItemIDs(count, ids)`只允许game主线程同步调用,数量1..100,与Batch最大工厂模板数一致。实际进入原`ITEM_MANAGER::GetNewID`的专用分支,使用同一私有游标/当前段/备用段/现存ID映射,不维护脱离原分配器的第二个游标。 +- 先规划并完整检查,再一次提交游标。当前段足够时不要求备用段;需要备用段时检查合法边界、总容量、两段含边界不重叠、DB描述符存在。所有计划ID必须未出现在当前物品映射。 +- 失败不改变输出/游标/号段,不调用旧的killscript或shutdown。成功后整个批次的ID在本进程内被消耗,普通分配不会重新使用;跨段只请求一次新备用段,携带旧maximum,与原协议相同。 +- 使用原分配器的maximum排除语义,拒绝0、反向/越界游标、超过100项、备用段冲突;uint32最大值仅可为耗尽哨兵,不能分配或回绕。 +- 同步作用域桥接只存在于该翻译单元,拒绝重入,异常退栈清理;不会修改非UTF8的旧item_manager头文件或改变其注释编码。既有普通分配的行为保持原样。 + +## 验证及边界 + +`test_cube_craft.py`新增编译实际`item_manager_idrange.cpp`的ASan/UBSan探针,仅替换平台声明及描述符;遍历跨段容量与输出顺序,检查旧普通分配与批量预留交错、冲突、缺段、断描述符、整批失败原状态、UINT32边界、桥接重入和异常清理。既有Cube回归33项通过。 + +FreeBSD隔离目录`/root/deploy-features/cube-item-ids.hSwxYp`编译真实修改的翻译单元,并用上批`cube-live-craft.x0vRrX`已验证对象/依赖库替换该单个对象后重新链接完整game成功。不是新一轮全量game/DB重编译,DB/SQL没有修改;未启动生成的game,未部署或重启生产服务。原生最多单个编译/链接任务,原对象和产物保持不变。 + +**本API没有持久化ID**,也没有创建奖励物品或SQL物品行。在DB fence/永久预留事务接受前不得对外暴露或执行;进程退出时必须遵守已有原批次恢复与持久预留,不以重新抽ID代替恢复。这个接口当前尚无制作调用者,不是完整可信batch builder。 + +下一步仍是真实工厂:保留实际CreateItem的新物品属性/socket/期限初始化,同时隔离保存、定时事件、映射注册和销毁发包副作用;不能直接用`bSkipSave=true`或全零metadata替代。随后接batch构造和用户动作,再补原actor应用/准确ACK/thaw及完整变更审核。两道false门禁与客户端制作宏不变,其他四项本批未推进。 diff --git a/docs/XXF-CH5-CUBE-LIFECYCLE-20261023.md b/docs/XXF-CH5-CUBE-LIFECYCLE-20261023.md new file mode 100644 index 00000000..27de3f4e --- /dev/null +++ b/docs/XXF-CH5-CUBE-LIFECYCLE-20261023.md @@ -0,0 +1,46 @@ +# Cube 恢复物品生命周期准备(2026-10-23) + +本批只推进 Cube,顺序仍为 Cube → Won → 狼人 → 征服者 → 五角色位。不是可开放制作或完整恢复的验收记录。 + +## 实际接线 + +`port_cube_actor.cpp` 的原 LIVE actor 在持久图像 ACK 和权威背包/快捷栏发布后,利用既有每 tick 最多两个作业的队列,准备恢复物品的到期事件。准备前后都验证全窗口封印;失败仍 held,不发送终态释放22、不清理 DB 内存 hold、不解冻。 + +`port_cube_restore.{h,cpp}` 捕获225格普通背包的完整物品 metadata,以及 owner PID/VID、物品指针/永久 ID/VID/位置。事件准备和恢复保存接口均验证当前管理器登记及完整图像。准备失败取消本次准备的事件,保持所有 skip-save,不改金币、数量、socket、属性或 extra69。取消节点依旧按原队列机制保留到出队,不能把取消说成队列立即清空。 + +`PortCubeEnableRestoredInventory` 是**尚无运行时调用者**的可信最终交接原语。必须先得到经过认证的 DB resume,重新验证整批,才可无分配地清除 skip-save。接口本身不保存、不解冻、不证明 DB 授权,不能接到客户端请求或单凭历史 SQL Release 成功调用。 + +## 到期语义 + +| 物品 | 准备行为 | +| --- | --- | +| REAL_TIME | 保留绝对期限 socket,挂接暂停包装事件 | +| 已首次使用的 first-use | 同上,不重新计算有效期 | +| 尚未首次使用的 first-use | 不启动事件,不消耗时长 | +| 绝对时间 Unique | 保留期限和首次检查余量;首次实际运行时才调用旧 socket 重置及旧回调 | +| 游戏在线时长 Unique、未装备穿戴期限/饰品 | 不提前启动,保留原装备路径的时长语义 | + +事件在 `skip-save || 当前 owner 被 Cube 持有` 时暂停。两者都解除后,调用原真实到期回调,保留原 `<`/`<=` 边界;持有期间不延长期限。解除后丢到地上的物品没有 owner,仍继续到期,不因 owner 为空永久暂停。普通角色/CItem/EVENT/队列没有新增实例字段。 + +## 队列安全修复 + +- `event_create_ex` 接收 info 后即负责其所有权,EVENT 或队列分配失败都释放它。 +- 队列插入失败释放待入队节点和引用,不留下悬挂事件。 +- 分发回调前把已出队节点从 EVENT 脱离,修复到期回调销毁物品、进而取消自身时访问已释放队列节点的问题。该问题由实际事件调度代码的 ASan 测试发现。 +- 旧源码非 ASCII 字节保持原编码;不宣称所有 reschedule/reset-time 分配异常路径已被全面修复。 + +## 验证与边界 + +`tests/features/test_cube_restore.py` 编译实际 event/event_queue、原到期回调、准备方法和整批恢复计划,使用明确替代的 CHARACTER/CItem/DB 平台边界。ASan+UBSan 覆盖事件创建各分配失败点、整批准备逐分配点失败、等时事件顺序、重复准备、身份/metadata 改变拒绝、持有与 skip-save 双重暂停、原期限不改、预备保存启用幂等和落地到期。它不是实际 DB resume 或在线游戏验收。 + +FreeBSD i386 在 `/root/deploy-features/cube-lifecycle.rqxKH1` 重编译 actor/restore/item/event/event_queue,与上一批匹配对象链接候选 game,最多两个编译任务;未替换运行程序、未重启或迁移生产数据库。二进制 SHA256 为 `b88de5fff66c1836b8d7c4bf3168cdbede5f7f45868f47548ef51d185d3b1b38`。客户端无运行时代码变化,不把上一批 macOS/Android 构建算成本批重建。 + +全量回归及源码哈希见 `audit/xxf-ch5/cube-lifecycle-20261023.json`。 + +## 下一步与仍未完成项 + +1. 完整 actor quiescence 审核,特别是提交后合法奖励/变更的持久保留、直接 setter、全局回调、其他窗口和旧 core 撤销。 +2. 基于当前身份的 game Release 请求/答复、DB resume 交接、丢包/断线对账;在明确授权后启用保存并解除 actor hold,不能只看到 SQL RELEASED 就放行。 +3. 经典 BYTE 数量动作扩展、公开制作能力入口、特殊配方及成功率物品、真实 game/DB 与 Android 真机验收。 + +`HandshakeEnabled`、`ActorMutationAuditComplete` 和现代 Cube 客户端宏继续关闭。Won、狼人、征服者和五角色位未在本批推进。 diff --git a/docs/XXF-CH5-CUBE-LIVE-CRAFT-20261023.md b/docs/XXF-CH5-CUBE-LIVE-CRAFT-20261023.md new file mode 100644 index 00000000..6783cd7d --- /dev/null +++ b/docs/XXF-CH5-CUBE-LIVE-CRAFT-20261023.md @@ -0,0 +1,39 @@ +# Cube:原live所有者的Prepare/Execute内部主链路 + +按Cube → Won → 狼人 → 征服者 → 五角色位继续。本批把已有事务后端接入实际game/DB调用,补上此前冻结后仅轮询、不会Prepare/Execute的缺口。**仍不是用户可点击制作或上线许可**。 + +## 状态与授权 + +内部header78增加Prepare=15、Execute=16、CraftAnswer=17;Prepared=14、Complete=15为新status。请求body为空,只带原账号/角色/epoch/owner/token/session/cookie。客户端不能通过此内部消息指定替代配方、快照、奖励或rolls。实际入口两道门禁关闭时返回CraftAnswer/Held,不访问SQL。 + +实际DB路由检查当前peer、原handle/session/cookie、非recovery原live上下文、clean FROZEN以及当前仍在游戏中的账号归属。随后在Prepare/Execute实际账号事务和同一个禁止重连SQL连接中再次验证broker/LIVE lease、完整原batch和原来源精确关闭清单;既不以单独可重连的预检代替事务内授权,也不以新generation、重复登录或token本身作为执行权限。 + +- Prepare只在新接受的请求中生成并持久化1..100 rolls,不扣资产。使用/dev/urandom并拒绝200..255后取模,无弱随机回退;EINTR重读,EOF/打开失败或持续拒绝返回0,使事务拒绝。确认丢失或已有PREPARED/DONE重放不再调用draw。 +- Prepare重放还检查持久状态确为PREPARED或DONE,不接受只有相同body但未知状态的记录。 +- Execute只加载原SQL请求、固定rolls和原工厂图像,调用现有原子扣料/收费/实际奖励/DONE事务。提交确认丢失后重试返回原回执,不重复扣料、收费或创建奖励。 +- 来源关闭前不能Prepare;来源证明、原lease、FROZEN或账号身份失效后不能执行。已入队金币仍留在独立意图账本,本批不偷偷调用Apply。 +- 通用后端API保留可选授权回调用于隔离旧基线夹具;实际新增运行时路径始终传入真实所有权回调,不暴露直接无授权的客户端调用。 + +## game回执与重试 + +新增CCR1回执:4字节魔数、结果码1、成功数1、费用8、数量2及最多100项117字节奖励,body最多11716,总帧最多11818。结果只接受既有八类;非ok结果必须费用/成功数/奖励均为0。规范字节、ID/格子唯一、数量和完整metadata都受验证。 + +game以原batch和当前proto验证成功数的合法范围、应付全批费用、完整工厂图像及应有奖励位置/数量,不把普通成功回包当作可解冻信号。实际actor Tick只有在干净Frozen确认且金币来源关闭ACK已fsync后才启动Prepare;Prepared推进Execute,Held按原阶段重试。每tick最多两条到期制作请求,按角色轮转并间隔2秒。完成后不再循环发送Execute;丢连接或本地变更使制作flow继续Held。 + +本地CHARACTER金币、背包、物品均不在回执处理时改变;原actor仍阻止行动/普通保存。非ok DONE只记录结果,不擅自退款、重算或再收费。尚无原actor的实际图像应用、准确ACK或thaw。 + +## 验证边界 + +`test_cube_craft.py`编译真实授权事务探针、实际actor Tick及共同状态机:来源ACK门槛、准备/执行阶段、错误身份、CCR1、完整奖励图像/费用、重复/冲突回执、断线保持锁定;另验证熵源拒绝采样、EINTR/失败/边界。Tick的审核/角色/来源有明确替身,不是完整冻结证明。 + +`test_cube_runtime.py`运行实际DB消息路由体:关闭入口无SQL、缺来源拒绝、无Prepare不执行、Prepare与Execute提交拒绝/确认丢失、旧会话/伪造回复拒绝和重复结算不再扣资产;peer/cache/SQL/FIFO仍为明确夹具。`cube_craft_probe.cpp`同样接入独立MySQL,覆盖所有授权SQL失败/警告、原owner撤销、非ok DONE及Prepare/Execute写入后和COMMIT后的进程退出。新broker不能自动Execute/重抽旧PREPARED;该恢复权限闭环仍待完成。 + +既有outbox夹具因回执分发条件扩展而失去旧提取边界,已改为明确断言新边界后提取同一金币ACK处理体,保留所有原断言,不把新制作分支的缺失依赖混入金币测试。 + +隔离根`/root/deploy-features/cube-live-craft.x0vRrX`,新game/DB对象目录、已有匹配依赖库;最多两个原生编译任务。为恢复磁盘空间,只移除已核实全为.o的五个旧对象目录(约1.2GB);源码、二进制、日志、SQL证据和依赖库保留,对象可重新编译。统一报告`build/ch5-tests/20261023-cube-live-craft/`,来源及产物证据见`audit/xxf-ch5/cube-live-craft-20261023.json`。 + +## 仍未完成与下一步 + +`PortCubeBegin`仍要求可信game调用者提供完整batch;真正从已加载配方构造batch、通过实际奖励工厂初始化metadata、永久ID分配和用户动作/能力入口尚未接通。因此这还不是普通玩家可操作的完整现代Cube。下一步优先补工厂/ID及发起批次,再接原actor图像应用/准确ACK/thaw;不能以零模板代替真实工厂。 + +完整冻结/可靠延期、跨core旧actor撤销、完整角色恢复、PREPARED及ABORTED/非ok DONE对账、copy/成功率道具、能力版本和状态UI、真实socket/匹配玩家联机/Android验收仍待完成。两道false门禁及客户端制作宏不变;无生产部署/重启/迁移/玩家资产变更,不重计客户端或Android构建。Cube完成后才进入后四项。 diff --git a/docs/XXF-CH5-CUBE-LIVE-IMAGE-20261023.md b/docs/XXF-CH5-CUBE-LIVE-IMAGE-20261023.md new file mode 100644 index 00000000..d46addf7 --- /dev/null +++ b/docs/XXF-CH5-CUBE-LIVE-IMAGE-20261023.md @@ -0,0 +1,36 @@ +# Cube:原在线所有者的金币入账与权威图像 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。本批接通结算后原在线角色的图像请求和已接受金币意图入账,仍未实现角色应用/ACK/thaw,**不开放制作**。 + +## 所有权与事务 + +内部header78增加LiveImageRequest=18/Answer=19,LiveImageReady=16,原值不变。请求使用原账号/角色/owner/epoch/token/session/cookie,body为空;成功回复使用既有金币+普通背包图像(最多26335字节,总帧最多26437)。不接受客户端替换奖励或金币数。实际入口在两道false门禁下只返回Held,不访问SQL。 + +DB路由核对当前peer指针/channel、原handle/session/cookie/批次、当前playing账号及原干净FROZEN/已发RESYNC运行时。随后使用同一个禁止重连MySQL连接: + +1. 读取持久pending金币意图,每请求最多应用两笔,其他等待下一次重试;金额和顺序均来自原SQL记录。 +2. 每次Gold.Apply在自己的账号事务内调用真实所有权校验:原LIVE grant、当前broker/连接代次、原peer及原来源绑定、clean FROZEN和来源精确关闭清单;历史已发记录的回调也不能跳过授权。未授权、失败/告警或提交不明均保持Held。 +3. 所有意图已发后调用Fence.Resync,并在同一个账号事务中调用Owner.LiveImageWithin。它与原ADOPTED恢复路径共享全部回执/资产证明,但明确区分LIVE与ADOPTED;原peer/binding必须相同,撤销或新授权不能冒用。 +4. 校验原sealed source完整事件顺序、固定rolls和ok DONE、实际成功奖励metadata、全部金币已发后的钱包(零金币也查)、普通背包完整字节、旧输入/最坏输出/当前自有物品的ID锁及永久预留;已有RESYNC图像不能覆盖。写成功后运行时记RESYNC,不再允许原制作阶段重入。 + +账本信用与图像不是同一个大事务:每笔入账可独立持久,后续失败仍留在原fence中,重试从剩余记录继续;图像只有全量完成并验证后才可发。确认丢失不重发奖励、不重复入账,不重抽rolls,不自动解锁。通用Gold.Apply可选回调保留旧可信隔离夹具接口;新增运行时入账路径始终传入真实回调,不暴露无授权调用。 + +## game核对 + +ok制作回执之后,原actor Tick在已持久来源关闭ACK下启动LiveImageFlow。与Prepare/Execute共用每tick最多两条请求、角色轮转和2秒重试期限。以原batch/已核验CCR1回执/原outbox封存总额,重建材料剩余、成功奖励、位置和费用后的精确图像,再与DB完整字节比较。没有使用模糊hash或只比较金币/数量。 + +身份错误直接拒绝;相同图像重复接受,冲突图像转Held;断线、角色变更或冲突回执使图像失效。期望构造失败也转Held,避免每帧重新计算。Ready后停止请求,但原actor仍被锁定。本批没有改本地金币/背包、创建物品、普通保存、发送资产ACK或thaw;非ok DONE仍等待单独对账。 + +## 验证与环境 + +- 真实DB路由探针:入口关闭无SQL、错session、三笔金币按2+1推进、金币COMMIT确认丢失、图像COMMIT确认丢失、精确重试、无重复奖励/金币、原peer失联拒绝。peer/cache/SQL队列是明确替身,不是联机冻结证明。 +- image事务探针:LIVE/ADOPTED互拒、原peer/binding/撤销、每条LIVE图像SQL失败及warning、已发图像不可变、金币事务授权(包括历史重放);原恢复图像的资产/ID证明和进程退出测试保留。 +- 图像flow与实际Tick:完整预期/metadata、金币总额与溢出、错cookie、冲突图像、0成功付费、断线仍Held、Ready不再发送且不解锁。基础快照/金币ACK探针只补新类型与分发边界,原断言保留。 + +原生隔离根`/root/deploy-features/cube-live-image.tYdTWx`,DB使用新空对象目录完整构建;game重编actor/input_db/recovery及其新内联协议,复用上一批匹配对象及更新后的cube.o链接。没有改CItem或协议结构布局,不冒充全game重编。真实MySQL脚本只使用新socket-only实例,结束后关闭并保留数据/日志。最终结果及哈希见`audit/xxf-ch5/cube-live-image-20261023.json`。 + +为腾出隔离构建空间,已验证并删除旧`cube-live-craft.x0vRrX/.../.cube-live-craft-game-obj`中的约292MB `.o`,没有删除源码、二进制、日志或数据库;对象可重编恢复。当前factory对象基线和平台依赖库保留。 + +## 尚未完成 + +下一步为原actor权威应用/准确ACK/所有者终态释放和thaw,需保证其他窗口/完整角色状态、期限事件与新物品注册不会越过持久栅栏。可靠冻结/合法变更延期、旧core撤销、PREPARED及异常DONE对账、copy/成功率道具、公开用户动作/能力UI、匹配联机和Android验收仍缺。Start依旧无公开调用,两道false门禁和客户端制作宏不变,无生产部署/重启/迁移/玩家资产修改,其他四项本批未推进。 diff --git a/docs/XXF-CH5-CUBE-LIVE-RELEASE-20261023.md b/docs/XXF-CH5-CUBE-LIVE-RELEASE-20261023.md new file mode 100644 index 00000000..682556d5 --- /dev/null +++ b/docs/XXF-CH5-CUBE-LIVE-RELEASE-20261023.md @@ -0,0 +1,40 @@ +# Cube 原 LIVE actor 终态释放请求(2026-10-23) + +本批推进 Cube → Won → 狼人 → 征服者 → 五角色位的第一项。接续生命周期准备,不代表 Cube 已能开放制作。 + +## 真实调用链 + +实际 `port_cube_actor.cpp` 的原 LIVE actor 依次经过:持久完整图像 ACK → 权威背包/金币/快捷栏发布 → 暂停到期事件准备 → 本批新增的内部 Release22 请求/23 回复。使用原每 tick 最多两个作业的轮转队列和两秒重试间隔,不增加无界循环或公开客户端动作。 + +`cube_live_image.h` 增加 `LiveReleaseFlow`。只有 `LiveImageFlow::Acknowledged` 且本地 readiness 成立才能启动;复制原 session/cookie/批次身份和完整已确认图像,重试不能生成新身份、奖励或期限。状态 Waiting 可以接受 Held 并重试;正确且完整一致的 LiveReleased 才进入 Released。外来身份或 cookie 忽略,相同身份但冲突图像进入 Held。成功的重复回复幂等,迟到 Held 不降级已确认终态。断线/角色失配/变更通知保持持有,不以超时推断成功。 + +## 发送与回复校验 + +实际 `releaseReady` 在每次发送、重试及收到终态回复时检查: + +- 两个硬门禁、原 descriptor handle/账号/角色/VID、DB 连接、已提交且无变更失效、完整制作回执和持久图像 ACK; +- 已发布、已准备且**未启用保存**的恢复计划,通过 ID/VID 管理器、位置、owner 和完整 metadata 的实际复核; +- 全拥有窗口的应用后封印与当前数据完全一致,普通背包+金币编码与已确认图像完全一致; +- 原36个快捷栏按永久 ID 重绑定后的完整计划与当前快捷栏一致,不只校验背包封印。消耗项清除,不能指向复用格子的奖励;技能及其他窗口位置保留。 + +检查不重新发布 UI,不写资产、不启用保存。分配/序列化失败保留 Held。成功发送只是向 DB 入队,不是持久提交证据。 + +## SQL 释放与恢复交接的区别 + +本批复用上批实际 DB 路由和 `ReleaseStore`,不改变其事务规则:原 LIVE 授权、完整 ACK、当前 SQL 图像、来源/DONE/ID 栅栏在账号事务中校验,终态回执与删除 lease/item fences 原子提交,永久 ID tombstones 保留。丢失提交回复后,以同一身份重试完整事务;没有回到 Prepare/Execute 再扣料或抽奖。 + +**LiveReleased 仅确认 SQL 终态。** DB 内存 save/load gate、game actor hold、物品 skip-save 和暂停事件继续保留。没有调用 `PortCubeEnableRestoredInventory`,没有恢复普通保存、清理 DB context、解冻角色或打开制作能力。历史终态不能替代当前 DB resume 授权。后续交接还必须处理双方进程断线/重启、旧 core 缓存、延迟合法奖励和其他角色数据,不得仅凭本批成功状态解锁。 + +## 证据 + +`test_cube_craft.py` 新增实际 `releaseReady`/`acceptRelease` 函数体的 ASan+UBSan 探针;显式替代 actor、快照、恢复计划及 DB 边界。测试原七项身份/cookie、36栏一致性、金币/extra/其他窗口变化、事件准备与保存标志、完整 ACK 前不得发起、Held 重试、冲突/迟到回复、成功重复回复和持续锁定。实际 Tick 探针覆盖发送顺序、原字节重试、终态后停止发送、准备只做一次、变更后停止请求及断线持有;不把平台替身称为完整冻结证明。 + +全量回归还运行原真实 DB 路由/SQL 模拟探针,包含 Release COMMIT 拒绝、确认丢失重放、撤销与换身份拒绝、终态后 DB 保存/读取门禁仍保留。未进行在线制作或 Android 真机验收。 + +FreeBSD i386 候选构建目录 `/root/deploy-features/cube-live-release.DB7CaE`;重编译实际 actor,链接生命周期批次的匹配对象。game SHA256:`f25dfe18028fde44e6c8ffabde2c09d1f3050111b80e13ea49b31f5d139579d5`。只启动一个编译器,未部署/运行候选 game、未重启生产、未迁移数据库。DB 与客户端运行时代码本批未改,不把旧构建称为本批重建。 + +完整源码哈希、回归结果与限制见 `audit/xxf-ch5/cube-live-release-20261023.json`。 + +## 后续 + +继续完成当前身份授权的 DB resume/保存恢复/安全解冻协议和失败恢复;完整 actor quiescence、合法延迟变更持久保留、旧 core 撤销、BYTE 数量动作、公开制作动作、特殊配方与真机验收仍缺。两个 false 硬门禁和现代 Cube 客户端宏保持关闭。Won、狼人、征服者、五角色位本批未推进。 diff --git a/docs/XXF-CH5-CUBE-OUTBOX-20261023.md b/docs/XXF-CH5-CUBE-OUTBOX-20261023.md new file mode 100644 index 00000000..57bb8eed --- /dev/null +++ b/docs/XXF-CH5-CUBE-OUTBOX-20261023.md @@ -0,0 +1,52 @@ +# 五区 Cube:地面金币来源持久交接 + +按用户顺序继续 Cube → Won → 狼人 → 征服者 → 五角色位。本批只推进 Cube,新增一个实际来源的**关闭门禁候选接线**,不是开放全功能或完成在线制作。 + +## 本批实现 + +- `CHARACTER::PickupItem` 保留原距离/归属检查。普通角色继续 GiveGold → 删除地面金币 → Save,组队分金规则不改。已 Submit 的持有角色才可能进入新路径;准备期、组队或生命周期异常时拒绝本次领取,不把失败伪装成奖励到账。 +- `PortCubeDeferGroundGold` 再验证角色/账号绑定、距离/归属、非组队、实际金币类型与保守余额空间;创建128位随机稳定事件ID,绑定批次、epoch、owner、session、cookie、handle及地面VID/vnum/map。只接收服务器实际地面金币,不接受客户端自报金额。 +- 核心私有 `cube-gold-outbox/journal` 的 CLAIM 落盘并 fsync 成功后,才允许同步删除该金币;延期分支**不调用 GiveGold,也不发旧金币 Save**,避免重复加钱或被DB保存门禁拒绝后污染排空证明。这里不是在已执行的 PointChange 后补写日志。 +- 内部 header78 的 GoldEnqueue 发规范129字节意图;DB检验当前已认证peer/login以及原handle/session/cookie和完整批次,调用耐久Enqueue,只有Stored/Applied才回GoldAck。提交确认丢失时同事件重试,不改内容或再生成事件。 +- game验证完整意图与handle/session/cookie后,先持久ACK再停止重试。ACK只是DB接收交接,不是已加钱,也不喂入角色解冻状态机。已接收意图仍由SQL队列保护,Apply依旧要求原制作DONE及clean FROZEN。 +- Tick启动恢复和重试仅在两道门禁同时允许且DB连接就绪时运行;每3秒最多发送2条,轮转处理。当前两道门禁仍为false,普通运行不会创建该日志或启用新协议入口。 + +## 日志与故障边界 + +`common/cube_gold_outbox.h` 使用固定166字节CGO1规范小端记录(157字节来源交接体),独占生命周期锁、O_NOFOLLOW、普通/单链接/当前所有者/不可被组或其他用户写入的文件检查,初始化时同步数据文件、锁文件和目录。每条CLAIM/ACK分别fsync;校验和用于检测损坏,**不是来源认证**。 + +同事件不同内容拒绝;序号必须连续,ACK历史保留,因此重启后不能从1重新发奖。单批最多1024条,全日志最多8192个历史事件/16MiB,尚未实现安全压缩和历史清理。纯入队前拒绝保持地面金币可供后续正常处理;写入/同步不确定时停止该writer并隔离地面VID,其他玩家也不能领取该不确定来源。损坏尾部、未知操作、损坏内容、越界文件均失败关闭,**不截断、不删除、不超时解除**。 + +保守金币空间使用“制作前金币+本批全部已记录奖励”,不预支未确认制作费可腾出的空间;不满足时拒绝此次领取而不删金币。原物品到期机制没有改动,不宣称磁盘故障期间所有未接受的地面金币会无限保留。 + +## 仍不完整,禁止据此启用制作 + +1. game/DB重启、断线或换核心会失去原内存所有权绑定。日志可以恢复,但DB明确拒绝凭旧cookie自动接管。需要可信持久所有权恢复/对账;不是“恢复到任意新角色连接就可发奖”。 +2. Resync之前还必须有**来源关闭与排空屏障**:证明没有本地已持久、尚未送到DB的金币。SQL队列为空不代表game outbox为空;本批没有接通Resync/Release,也未用“队列为空”绕过这项要求。 +3. ABORTED的可信余额对账、其他金币入口、组队、任务/经验/物品/到期/全服回调及完整生命周期冻结仍未闭环。 +4. 在线工厂/ID、Prepare/Execute、权威图像应用、准确ACK/解冻、copy与成功率道具、匹配版本真服和Android验收仍待完成。 + +`HandshakeEnabled=false`、`ActorMutationAuditComplete=false`,客户端制作宏与只读能力不变。本批无生产部署、重启、配置/数据迁移、强制登出或玩家资产操作。后续先补来源关闭屏障及可信重启接管,再继续真正制作流程,不能直接跳到Won。 + +## 验证与复现 + +`test_cube_outbox.py` 编译ASan/UBSan探针: + +- 提取实际地面领取helper、原Pickup金币分支与实际GoldAck处理体;角色/物品与“已审核门禁”使用明确替身,只在测试编译单元替换门禁表达式。验证普通路径不变、延期零本地加钱/零旧Save、fsync失败不删金币、跨玩家隔离、错误handle/session/cookie不能确认,正确确认仍不解锁。 +- 实际outbox编码、互斥锁、冲突内容/序号、短写/EINTR、写入/同步失败、损坏/撕裂尾部、超限文件、符号/硬链接;不自动修复或丢弃记录。 +- 独立进程在CLAIM和ACK真实fsync后退出,重启找回待发或已确认状态;意图→SQL提交确认丢失→重启重试→持久ACK→已验证制作回执→一次加钱→准确图像释放,SQL与角色边界明确,不冒充在线角色冻结。 + +`test_cube_runtime.py` 同时验证实际DB route:错误来源身份/handle/session、关闭的真实入口、丢失提交确认、重复事件、冲突金额、伪造ACK及重启丢失绑定均不误确认或加钱。 + +```sh +python3 -m unittest discover -s tests/features -p 'test_cube_outbox.py' +python3 -m unittest discover -s tests/features -p 'test_cube_runtime.py' +python3 -m unittest discover -s tests/features -p 'test_cube_handshake.py' +CUBE_TEST_SQL_WORKER=1 sh tools/cube/test_mysql.sh +``` + +FreeBSD隔离根 `/root/deploy-features/cube-outbox.405sXZ` 使用全新game/DB对象目录、继承平台内部库,最终另强制重编actor以绑定最后的outbox头文件。MySQL脚本仅用新建临时目录的独立socket实例;最终结果、日志/产物散列及真实MySQL目录以 `audit/xxf-ch5/cube-outbox-20261023.json` 为准。普通Makefile仍含`-w`,不是严格警告审查。 + +统一回归最终目录 `build/ch5-tests/20261023-cube-outbox-final/`。未修改客户端运行代码,不重新宣称本批macOS/Android构建或设备验收;历史资源/构建证据保持原边界。 + +`char_item.cpp` 保留原编码,按唯一ASCII锚点窄替换领取/保存分支,没有整文件转码;其他已有未提交改动均保留。 diff --git a/docs/XXF-CH5-CUBE-OWNER-20261023.md b/docs/XXF-CH5-CUBE-OWNER-20261023.md new file mode 100644 index 00000000..9ac4c7a9 --- /dev/null +++ b/docs/XXF-CH5-CUBE-OWNER-20261023.md @@ -0,0 +1,35 @@ +# 五区 Cube:持久所有权与保持锁定的恢复准备 + +顺序仍为 Cube → Won → 狼人 → 征服者 → 五角色位。本批只推进 Cube 的所有权隔离;**不是可上线制作或完整断线恢复**。 + +## 本批实现 + +- 独立 owner-addon v1:version、broker、leases 三张 InnoDB 表,显式 `tools/cube/owner-schema.sql` 安装。base Cube v2、gold-addon v2 不变;实际 Arm 要求三套结构就绪。缺失、部分、未知版本或 SQL 错误失败关闭。启动不自动安装,也不为历史 fence 补造 lease。 +- 每数据库一个 MySQL 连接级命名锁,配合随机 DB 启动 nonce、单调 generation 和实际 CONNECTION_ID。新启动或重连后必须产生新 generation;其他连接不能抢占存活锁。避免对同连接重复 GET_LOCK,兼容旧版单连接用户锁语义。 +- Fence.Begin 同一账号事务原子保存 fence、item 锁和原始 lease,包含不可变批次、原 peer/session/cookie/handle、当前 broker 和 revision。确认丢失只验证原记录;已有 fence 缺 lease 时拒绝“补登记”。 +- 原 peer 断开、实际账号所有者结束可持久撤销;普通 Invalidate 包、SQL 暂时失败或超时不是撤销证明。严格新 generation 可以撤销旧 broker 记录,同 generation 不能仅靠等待或相同句柄接管。 +- 内部 `CubeRecoveryClaim` 要求当前认证 peer、非游戏中账号及其所属角色。接管须有持久撤销和 fresh session,并验证原 batch、clean FROZEN/RESYNC、原金币来源绑定和完整有序清单、可验证 DONE 回执、已发金币连续前缀与当前钱包;未发意图保留,不在接管时偷偷发放。 +- 接管提交确认丢失,重试返回已保存的相同 grant/cookie/revision。接管仍是 ADOPTED **持有状态**,不加载玩家、不加钱、不自动执行 PREPARED、不重新抽取随机数、不解锁。 +- 所有登记 lease(LIVE/REVOKED/ADOPTED)均阻止普通保存和账号加载,包含孤立 lease。旧 Fence.Release 不能删除这些记录对应的 item 锁。新增路径尚无终结/清理 API,不能通过删表或改 phase 绕过。 + +RPC 的初步所有权检查之后,金币入队、来源关闭及 drain 完成还在实际 SQL 操作的同一禁止重连连接作用域再次验证,防止两次连接包装之间自动重连产生权限空隙。旧 generation 的排队回调不能完成 drain;当前 broker 可将已撤销来源的未完成 drain保守终结为 ABORTED,不因断线生成 clean proof。 + +## 测试与证据 + +`tests/features/test_cube_owner.py` 编译候选实际后端,覆盖绑定/撤销/接管逐个 SQL 失败和警告、提交确认丢失、绑定事务提交前后进程退出、来源缺失/错绑、无 DONE、钱包偏差、ABORTED、旧连接代次及已发/待发金币恢复。SQLite 的连接 ID 和命名锁明确为替身,不能作为真实锁竞争证据。 + +`test_cube_runtime.py` 编译实际 DB 方法体,覆盖缺 addon 拒绝 Arm、可信断线撤销、Invalidate 不充当撤销、非游戏中账号及角色归属、旧 session 拒绝、接管确认丢失与同 grant 重试;peer/cache/SQL FIFO 仍有明确夹具边界,不是在线玩家验收。`test_cube_db_guards.py` 另覆盖孤立 LIVE/REVOKED/ADOPTED lease、部分及未知 owner schema 拒绝。 + +FreeBSD 隔离根 `/root/deploy-features/cube-owner.qlOExe`。仅复制所需源码,外部和内部依赖库引用上一批平台匹配目录;DB使用新的 `.cube-owner-db-obj`,不是完整依赖库重建。首轮原生编译发现旧 false 宏导致 lambda 返回类型推导冲突,已显式标注 bool 后修复;日志保留。主机时钟与本地文件时间差会触发 gmake clock-skew 警告,不能宣称严格警告验收。 + +`tools/cube/test_mysql.sh` 仅创建独立 socket-only、no-defaults、skip-networking MySQL,实际执行 DDL 和真实连接级锁竞争;与既有批次、金币、outbox、来源、SQL FIFO及显式升级测试一起运行。详细运行结果与源码/产物散列由 `audit/xxf-ch5/cube-owner-20261023.json` 记录;统一回归使用新目录 `build/ch5-tests/20261023-cube-owner/`,不覆盖历史报告。 + +复现:server 根目录 `python3 -m unittest discover -s tests/features -p 'test_cube_*.py'`;FreeBSD 匹配依赖库的隔离根运行 `CUBE_TEST_SQL_WORKER=1 sh tools/cube/test_mysql.sh`。 + +## 仍需继续 + +没有公开恢复网络路由、game core 启动身份与旧 actor/cache 撤销闭环、owner-aware 权威图像应用/准确 ACK/thaw,也没有已恢复账号的再次断线接管闭环。本批不能让玩家恢复游玩。只有原绑定已持久封存的来源可准备接管;core 崩溃前未封存来源仍保持锁定,不自动推断队列为空。 + +任务/经验/物品到期/直接 setter/全服和组队回调的完整冻结或可靠延期、ABORTED 对账、实际工厂和 ID、Prepare/Execute/Apply 在线接线、copy/成功率道具仍未完成。没有新增制作权限,`HandshakeEnabled=false`、`ActorMutationAuditComplete=false` 与客户端制作宏继续关闭;无生产部署/重启/迁移/角色资产变动,未重跑客户端或 Android 构建和真机验收。 + +下一步继续 Cube 的旧 core/actor 撤销与 owner-aware 图像恢复,再完成实际制作闭环和验收;不能因本批通过就开启制作或跳到 Won。 diff --git a/docs/XXF-CH5-CUBE-PRESENTATION-20261023.md b/docs/XXF-CH5-CUBE-PRESENTATION-20261023.md new file mode 100644 index 00000000..204c1096 --- /dev/null +++ b/docs/XXF-CH5-CUBE-PRESENTATION-20261023.md @@ -0,0 +1,37 @@ +# Cube:权威背包/金币/快捷栏发布与完整数量 + +顺序仍是 Cube → Won → 狼人 → 征服者 → 五角色位。本批接入持久 ACK 后的实际 game 发布及客户端应用;保存/期限事件、game 释放发送与 DB resume/thaw 仍未完成,制作门禁不变。 + +## 先修复数量截断 + +现有 SQL/Cube 支持一堆 2000 件,而经典 item-set/update 和客户端内部 `TItemData.count` 是 BYTE。直接重发这些包会把 256~2000 截断。本批仅将**客户端内存数据**的 count 改为 DWORD;经典封包结构与大小不变。 + +客户端 revision 改为 `mt20261025`,保留原数字时间戳前缀及 revision24 的 64-bit money 协议。原 Start/Begin 在熵、ID/SQL 工作前拒绝不支持发布的版本,不能扣料后才发现旧客户端无法接收图像。服务端现有 `PortItemExtraSend` 对 >=25 版本发送 GC93 op12:原 window/cell/vnum/id 加 uint16 count 及完整69字节 extra,总包88字节、body83字节。所有原已调用该 helper 的 item set/update 路径获得完整数量;旧 >=22 版本仍发原 op10,不改变旧包布局。客户端验证窗口/范围/数量;当前非零 ID 与消息冲突时忽略,避免相同 vnum 的旧消息覆盖新身份。 + +附加数据保持全部69原始字节。新版名字展示 getter 仅暴露前24字节并独立补 NUL,仓库 getter 使用有界长度,不能为显示安全而改写权威数据末字节。旧 op10 的既有解析回退保持原行为。 + +这尚未扩宽经典 move/split/drop/give 等带 count 的动作封包,不能把本批称为全部大堆叠动作完成;尤其显式子数量 >255 的动作还需要单独协议/边界检查。基础旧服务端也不会凭客户端改宽内存自动补足原来已截断的数据。 + +## 一份完整发布 + +两仓库同步的 `cube_presentation.h`/`CubePresentation.h` 实现相同有界 LE codec。GC93 op11 body 为:op11、`CCP1`、epoch64、gold64、物品数量16、快捷栏数量8(固定36)、36条 type8/cell16,以及最多225条物品记录。每条122字节:cell16、count16、id/vnum/flags/anti各32、3个socket32、7对type8/value16、extra69。body最小132、最大27582,总包最大27587,低于既有32768上限;不依赖原生 long/padding。身份、数量、排序、重复ID、金币上限、快捷栏类型和完整长度都校验;proto/物理格网由两侧实际适配再校验。 + +实际 actor 在安装前一次捕获原36条快捷栏。发布计划按原物品永久 ID 找存活目标;消耗掉的物品快捷键清空,即使奖励复用同一格,也不绑定到奖励。非普通背包的快捷键、技能、表情保留。重试始终使用原捕获,不从新格子猜原身份。 + +持久 ACK 后,现有联合轮转队列以每 tick 最多两项制作/图像/ACK/发布任务执行;发布前后再次比对完整应用封印。`PortCubePublishAuthoritative`核对规范图像、实际当前物品 ID/vnum/count/flags/sockets/属性/extra,并检查当前快捷栏仍是原计划或已发布计划。序列化完整包成功后才直接改快捷栏并一次入队;不调用普通 SetItem/Save/随机/期限事件。拒绝旧版客户端和失效描述符,入队后还检查 GAME phase。失败仍 held,可复核已安装状态,不恢复已消耗输入或重发奖励。 + +`published` **只是服务器验证后入队成功,不是客户端收到、渲染或接受的确认**。game 仍不发送22,也不因此撤销 DB 内存拦截或取消 ActorHandshake hold。 + +## 客户端原子提交 + +实际 GC93 receiver 先解码全部消息,再调用实际 `CPythonPlayer::PORT_ApplyCubeView`。该方法预构造225格新数据,逐项检查当前 proto/大小/可堆叠性/物理格网,以及36条快捷栏范围和普通格引用。任何错误在写入前返回;全部通过才一次逻辑提交普通背包、快捷栏和64位金币,不触动装备、其他窗口、技能、页码或其他状态;完成后才设置 UI 刷新标志。 + +每个 player 保存最后 epoch 与完整规范字节:精确重复只返回成功,不重装(避免覆盖随后正常更新);旧 epoch 忽略;相同 epoch 不同内容拒绝。Clear 时清除该记录。不是客户端制作能力或 thaw ACK,也不证明 UI 实际已渲染。 + +## 验证及余项 + +新增 ASan/UBSan 探针编译真实 codec/Rebind、真实客户端提交和 GC93 receiver、真实服务端发布与完整数量 helper,proto/角色/descriptor边界明确为替身。覆盖空/满225格、2000数量、64位金币、所有截断、signed socket/attr、raw69、重复/旧 epoch/冲突、缺 proto/重叠格/坏快捷键拒绝、其他窗口保持、队列异常后的计划重试及旧版本回退。原实际 actor Tick 探针扩展为 ACK 后发布一次且不解锁。 + +原生构建范围、最终用例数与源码散列见 `audit/xxf-ch5/cube-presentation-20261023.json`;不把编译、替身探针或入队当成匹配联机/Android 真机验收。没有生产部署、重启、SQL迁移或玩家资产修改,本批不修改 DB/SQL 源码,不重用旧 MySQL结果声称重跑。 + +仍需正常保存/到期事件恢复、释放前完整就绪证明及原身份 DB resume、全 actor 冻结/合法变更延期/外部引用审计、旧 core/完整角色和其他窗口恢复、异常 DONE 对账、copy/成功率道具、带数量动作封包、公开制作和匹配联机/真机验收,然后才能完成 Cube 并进入 Won。 diff --git a/docs/XXF-CH5-CUBE-RECOVERY-IMAGE-20261023.md b/docs/XXF-CH5-CUBE-RECOVERY-IMAGE-20261023.md new file mode 100644 index 00000000..c1d96ec8 --- /dev/null +++ b/docs/XXF-CH5-CUBE-RECOVERY-IMAGE-20261023.md @@ -0,0 +1,38 @@ +# Cube:授权绑定的金币/普通背包图像 + +仍按Cube → Won → 狼人 → 征服者 → 五角色位推进。本批使接管授权可以获取并在game中校验、保留Cube涉及的资产图像;**不是完整角色恢复,也不放行玩家或制作**。 + +## 原子验证与持久行为 + +`FenceStore::Resync`增加事务内验证回调,实际恢复路由只使用内存登记的原batch和完整grant,不接受调用者提交替代快照。在同一账号事务、同一禁止重连连接中验证: + +1. 当前broker连接/generation及ADOPTED lease完整相同,原账号/会话/peer/handle仍有效。 +2. 原来源绑定和精确有序事件清单仍一致,所有金币意图已发,没有隐藏的待发前缀;从已验证DONE费用及连续回执计算当前钱包。**零金币意图批次也检查钱包**,不沿用旧通用空意图路径的较弱检查。 +3. DONE必须是可验证的ok结果,使用原持久rolls和当前匹配proto重新计算同一制作计划,不调用随机数、不重新Execute。逐字节比较实际普通背包与应有扣料/奖励结果,包括ID、位置、数量、socket、七项属性和69字节extra。 +4. 原输入ID、全部最坏输出ID仍有匹配epoch/request的物品锁,输出ID预留完整;现存所有自有物品(含其他窗口,MALL/SAFEBOX除外)也必须仍有该锁。额外锁不表示可解锁,只继续持有。 +5. 金币和实际图像读取、验证与RESYNC持久图像写入在同一事务完成。提交确认丢失返回Held,重试读取相同图像;已有owner路径RESYNC图像与当前结果不一致时拒绝,不能自动覆盖。 + +这些验证不删除lease或item锁,不修改玩家金币/物品。零成功但结果ok仍按已扣费用和材料恢复;非ok DONE、ABORTED、未封存来源、未发金币等继续等待对账,不伪造退款或奖励。已有登记lease时,无所有权回调的旧Resync也拒绝,不能通过较弱接口改写持久图像;仅无owner记录的旧兼容基线保留。 + +## 消息与game行为 + +- header78增加RecoveryImageRequest=13、RecoveryImageAnswer=14,成功status RecoveryImageReady=13。请求和Held回复带完整160字节CRG1授权;成功body为授权+2字节图像长度+图像,完整匹配外层账号/角色/session/cookie/epoch/owner/token。 +- 原始图像是金币8字节+数量2字节+最多225项(每项117字节),最大26335;body最大26497,总帧最大26599。沿用原40000字节body限制和102字节前缀,无分片或结构体裸拷贝。编码中的usable=1只是既有图像格式的规范值,不是允许角色行动。 +- game取得Grant后按有预算的原重试队列请求图像,Held仍遵守3秒退避。校验规范ID/顺序/数量、物品原型、堆叠和多格占用。未知原型、重叠或相同授权下的冲突图像停止该会话恢复资格,不退回普通加载。 +- 通过后仅保留原始字节和授权供后续恢复协调器使用。重复相同图像幂等;没有创建CHARACTER/物品、改本地金币、自动发送图像ACK或解冻。实际DB入口、选角入口和收包分发已接线,但两道门禁仍为false。 + +主要实现:`common/cube_image.h`、`cube_owner.h`、`cube_fence.h`、`cube_recovery.h`、内部握手及game/DB实际恢复路由。 + +## 验证与证据 + +`cube_image_probe.cpp`/`test_cube_image.py`编译实际事务后端,覆盖原授权、错误钱包/物品/metadata、缺锁/预留、坏来源/回执、撤销授权、保存图像损坏、逐SQL失败/警告、提交拒绝/确认丢失、图像写入后/COMMIT后进程退出和新broker接管后重读。另验证零成功付费、不恢复非ok DONE、待发金币阻止图像和已发金币正确计入钱包。SQLite连接/锁有明确替身;同一探针亦加入独立MySQL脚本。 + +实际game控制体测试覆盖自动图像请求、失败回复保留重试间隔、最大帧、proto/grid、重复/冲突图像和不发load/ACK;实际DB路由体测试覆盖关闭入口无SQL、旧授权/错误handle拒绝、精确图像和丢失COMMIT确认。descriptor、审核门禁、SQL方言/队列边界仍为明确夹具,不能当作真实socket或玩家验收。 + +隔离构建根`/root/deploy-features/cube-recovery-image.5bISSS`,使用新game/DB对象目录和已有匹配依赖库。为控制磁盘空间,只删除上一批本任务生成的约335MB编译对象;上一批源码、二进制、日志和数据库证据全部保留,对象可重新编译。首轮报告`build/ch5-tests/20261023-cube-recovery-image/`保留;补上旧Resync降级拦截后,最终统一报告使用新目录`build/ch5-tests/20261023-cube-recovery-image-final/`。来源/产物散列和原生/独立MySQL结果在`audit/xxf-ch5/cube-recovery-image-20261023.json`。 + +## 仍需完成 + +图像仅金币和普通背包;装备、其他窗口及完整角色字段尚未构成受控加载协议。仍缺旧core/actor/cache撤销、图像实际应用、准确ACK、持久终结/thaw,以及恢复后的生命周期和能力/版本/状态UI。当前获取图像不能用于绕过普通加载门禁。 + +其他资产变更入口的完整冻结/可靠延期、ABORTED/非ok DONE对账、实际工厂/永久ID/Prepare/Execute/Apply在线接线、copy/成功率道具和匹配联机/Android验收仍待完成。无生产部署/重启/迁移/玩家资产变动,无客户端/Android新构建。先继续Cube恢复与制作闭环,再依序推进后四项。 diff --git a/docs/XXF-CH5-CUBE-RECOVERY-LIFECYCLE-20261023.md b/docs/XXF-CH5-CUBE-RECOVERY-LIFECYCLE-20261023.md new file mode 100644 index 00000000..3d8b1cc9 --- /dev/null +++ b/docs/XXF-CH5-CUBE-RECOVERY-LIFECYCLE-20261023.md @@ -0,0 +1,27 @@ +# Cube:接管会话的再次断线与撤销调度 + +按 Cube → Won → 狼人 → 征服者 → 五角色位继续。本批补上一批所有权候选的运行时缺口,不开放制作或玩家加载。 + +## 行为 + +1. 内部 `CubeRecoveryClaim` 接管成功后登记持有中的 recovery 会话。其预期账号尚未进入游戏,不能套用普通 drain 的 IsPlay 检查立即将它撤销。重复确认返回原 grant,不重复分配 cookie;旧会话已被标记失效时不再返回它的成功确认。 +2. Adopt 返回 Retry 时也登记相同 proposal,因为 COMMIT 可能已经发生。连接在首次重试之前断开也能撤销该授权。若 COMMIT 未发生,后续同会话重试复用原 proposal/cookie,而不是不断制造新内存记录。 +3. peer 关闭、合法当前peer注销以及认证记录删除/替换先粘性标记失效;即使同peer/账号很快被重新使用,也不能把旧授权当成新会话。注销通知校验包长、NUL终止、账号和peer,不接受其他peer的通知。通知不改变经典注销语义,不发 SQL。 +4. 撤销和排空终结共享一个按 cookie/任务种类构成的64位键轮转队列,每 tick 最多两项工作,失败退避5秒。持续失败的撤销不能饿死其他排空任务,UINT32_MAX cookie不会令任务键回绕。这是工作预算,**不是两条SQL或固定毫秒时延保证**。 +5. 撤销结果不确定时保留内存会话重试。只有持久撤销完成,或再次读取权威账本证明本 proposal 未被接受/已不是当前所有者,才回收 recovery 内存槽位。不删除 lease、来源证明、制作回执或 item 锁;普通保存/加载和旧 Release 仍被阻止。 +6. 连续 pre-load 接管可以形成 revision 3→撤销4→接管5→撤销6→接管7,始终校验同一原始来源和DONE回执。不会重新抽奖、扣料、发钱或解冻。容量仍为128个运行时上下文,满容量时拒绝新接管,不先提交一个无法登记的新授权。 + +实际代码:`db/src/CubeRuntime.cpp`、`CubeRuntime.h`、`ClientManager.{h,cpp}`;`common/cube_owner_types.h`提供统一完整grant比较。旧Arm重放也复核当前broker/lease,不仅返回旧内存状态。无需修改SQL schema,仍为base v2、gold-addon v2和owner-addon v1。 + +## 验证范围 + +- 实际 DB 方法体的ASan/UBSan夹具:多轮接管、再次断线、提交确认丢失后首次重试前断线、提交拒绝与同cookie重试、未接受proposal的持久对账回收、撤销提交拒绝/确认丢失/查询警告、退避不热循环、旧grant拒绝、非法注销通知、同peer认证替换、满容量拒绝、两项预算与联合队列公平性/64位键。peer/cache/FIFO/SQLite SQL方言与连接锁仍有明确替身,不是在线玩家验收。 +- 原生MySQL owner探针新增多轮ADOPTED撤销/再接管及提交拒绝/确认丢失/警告,验证原binding不变、只有一次制作结算、钱包不重复变化,旧Release仍拒绝。 +- FreeBSD隔离根`/root/deploy-features/cube-recovery-life.GSOyx6`,新DB对象目录、平台依赖库引用已有匹配构建;仅DB本批重建,不冒充game/client/Android新验收。独立socket MySQL脚本运行后只关闭该临时实例,不改正式服。 +- 最终统一报告目录`build/ch5-tests/20261023-cube-recovery-life/`;来源/产物散列和结果在`audit/xxf-ch5/cube-recovery-lifecycle-20261023.json`。旧报告和上一阶段证据保持原样。 + +## 仍未完成 + +这是恢复准备阶段的会话生命周期闭环,**不是公开恢复消息协议或恢复游玩**。尚无game core启动身份及旧actor/cache撤销闭环、恢复数据加载、owner-aware权威图像应用/准确ACK/thaw和已加载恢复角色的再次断线控制。不能因本批测试通过放行普通加载或删除持有记录。 + +其他资产变更入口冻结/可靠延期、未封存来源及ABORTED对账、实际工厂/ID/Prepare/Execute/Apply在线接线、copy/成功率道具、匹配联机和Android真机验收仍待完成。两道false门禁和客户端制作宏不变,无生产部署/重启/迁移/角色资产变动。下一步继续Cube恢复消息和权威图像流程,随后完成制作验收,再推进后四项。 diff --git a/docs/XXF-CH5-CUBE-RECOVERY-WIRE-20261023.md b/docs/XXF-CH5-CUBE-RECOVERY-WIRE-20261023.md new file mode 100644 index 00000000..6bfa8c6d --- /dev/null +++ b/docs/XXF-CH5-CUBE-RECOVERY-WIRE-20261023.md @@ -0,0 +1,30 @@ +# Cube:选角前恢复消息候选 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。本批把内部接管API接到game/DB消息与实际选角入口;**不开放制作或恢复游玩**。 + +## 协议与实际路径 + +- header78沿用102字节前缀。新增RecoveryClaim=11、RecoveryAnswer=12;status RecoveryGranted=11、RecoveryClear=12。Claim只含非零账号/角色/随机session,epoch/cookie为0、owner/token必须是32字节零串、body为空。不接受游戏端指定的旧owner/token、epoch或grant。 +- `OwnerGrant`以CRG1魔数、32字节boot、LE generation/connection/peer/revision、96字节绑定序列化,固定160字节;验证后重新编码必须完全相同。Granted消息总262字节,Held/Clear为102字节。既有状态、GoldClose大帧和版本前缀不变;此未发布内部协议需匹配game/db,不能与旧候选混用。 +- DB实际入口先解析方向和规范编码;两道门禁关闭时仅回复RecoveryAnswer/Held,**不查询或修改SQL**。内部路由验证当前peer、非游戏中账号和所属角色。只有普通账号通过内存与实际SQL保存/加载门禁、确认无持有记录,才返回Clear;失败不能降级为Clear。持有批次调用既有持久接管API并返回完整绑定授权;PREPARED、ABORTED、未封存来源等仍保持锁定。 +- game实际CharacterSelect在发送经典PLAYER_LOAD之前接入恢复检查;两道门禁关闭时立即走原经典分支,不增加恢复请求。启用后的候选协调器固定descriptor指针、连接handshake、账号、角色、选角index和随机64位session。不同选角不能替换在途身份,旧handle/session/描述符响应不能加载新角色。 +- Clear只允许发送一次经典PLAYER_LOAD,该请求仍会重新运行现有DB保存/加载门禁。Granted只保留grant供后续恢复图像协调器使用,**不发送普通加载、不改资产、不解冻**。收到Grant后不能被迟到Clear降级放行。检测到DB断线后停止自动恢复资格,不能靠等待或负面回答加载。 +- game协调器最多128个上下文,每tick最多两个到期重试、间隔3秒并轮转;描述符失效后移除的仅是game内存,DB持有记录仍受此前注销/撤销机制保护。 + +## 一并发现并修复的真实路径问题 + +`CInputDB::Process`之前只允许header78普通Answer,实际会拦截已定义的GoldAck/GoldCloseAck。这不是后端或提取处理体的测试能证明已打通的路径。现改为明确的DB→game回复白名单:Answer、GoldAck、GoldCloseAck、RecoveryAnswer;反向请求帧仍使连接失败关闭。Analyze分发恢复回答到新协调器,其他回答保留原Actor/outbox处理。未知/坏帧仍拒绝。 + +主要代码:`common/cube_recovery.h`、`cube_owner_types.h`、`cube_handshake.h`;`game/src/port_cube_recovery.{h,cpp}`、实际input_login/input_db/main;`db/src/CubeRuntime.cpp`实际消息入口和路由。无需SQL schema变化。 + +## 验证范围 + +`test_cube_recovery.py`编译实际game协调器和规范codec:160字节grant/极值/逐字节截断、规范Claim、方向白名单、错误handle/session、重复Clear只加载一次、Grant不加载、不允许迟到Clear、描述符handshake复用、断线保持锁定和公平重试。审核门禁、descriptor及DB发送有明确替身,不是玩家联机验收。`test_cube_runtime.py`编译实际DB路由,覆盖关闭入口无SQL、授权回包、错误账号/游戏中账号Held和伪造回复不作为请求;Clear的SQL loadability替身单独标明,真正SQL门禁由既有guard探针覆盖。 + +FreeBSD隔离根`/root/deploy-features/cube-recovery-wire.1PaNsl`使用新game/DB对象目录,平台依赖库引用已有匹配构建;不修改正式服。统一报告使用`build/ch5-tests/20261023-cube-recovery-wire/`,最终源码/产物散列、构建及独立socket MySQL结果记录在`audit/xxf-ch5/cube-recovery-wire-20261023.json`。不把原生链接或提取体测试当作真实socket联机/Android验收。 + +## 未完成与启用限制 + +实际恢复图像、完整角色数据受控加载、旧core/actor/cache撤销、owner-aware准确ACK和终结/thaw仍未实现。现有通路不能让持有角色恢复游玩;未封存来源仍不自动补造证明。还需客户端/服务端能力和版本协商、选角恢复状态提示及真实socket故障联调后才可启用。 + +其他变更入口的完整冻结/可靠延期、ABORTED对账、实际工厂/ID/Prepare/Execute/Apply、copy/成功率道具及匹配联机/Android验收仍待完成。两道false门禁和客户端制作宏不变;未部署、重启正式服,未改玩家资产。下一步继续Cube权威图像和旧core撤销,再完成实际制作闭环,之后依序推进后四项。 diff --git a/docs/XXF-CH5-CUBE-RELEASE-20261023.md b/docs/XXF-CH5-CUBE-RELEASE-20261023.md new file mode 100644 index 00000000..258b1d92 --- /dev/null +++ b/docs/XXF-CH5-CUBE-RELEASE-20261023.md @@ -0,0 +1,33 @@ +# Cube:原 LIVE 所有者的终态 SQL 释放 + +接续持久精确 ACK,仍按 Cube → Won → 狼人 → 征服者 → 五角色位推进。本批实现终态事务与 DB 内部路由;**game 尚不发送释放请求,角色不 thaw,保存/事件/客户端发布与恢复交接仍未完成**。 + +## 事务边界 + +新增可选 release-addon v1,两张 InnoDB 表,显式维护时安装,依赖 Cube v2、gold v2、owner v1 和 image-ACK v1。记录完整 batch、160 字节 grant 与完整规范图像,不用 token 或成功布尔代替证据。缺表、部分表、非事务引擎、未知版本拒绝,不在启动时迁移。 + +`ReleaseStore::ReleaseLive`调用实际 Fence.Release 的所有权回调,始终共享同一账号锁、SQL 连接和事务。首次释放要求:原 fence/完整 batch/RESYNC 已发图像匹配;所有正金币意图完成;当前 SQL 钱包/背包与 ACK 图像相同;完整 ACK 三元组匹配;当前原 LIVE grant/broker、原 sealed source、ok DONE/固定 rolls、所有物品锁与 ID reservations 仍有效。跨角色的同请求物品栅栏也拒绝。 + +同一事务写入不可变终态回执,删除精确 LIVE lease,删除该角色/epoch/request 的 item fences,再将 fence 改成 RELEASED。SQL 错误、warning、提交拒绝或提交前进程退出,不得留下半删除状态。永久输出 ID reservations、制作回执、金币历史及 ACK 保留,不能回收永久 ID 或重新抽奖/扣料/发奖。 + +提交成功但回复丢失时,仅允许同一完整身份读取已提交终态:完整 ACK、终态回执、原 RELEASED fence/image 都相同,broker 仍为原 generation/connection,且没有冲突 lease 或 item fence。出现较新批次、接管、损坏历史、遗留栅栏则拒绝;绝不修改新批次。历史重放是旧结果查询,不重新比较后来正常玩法已改变的钱包,更不是重新应用旧图像或解锁新角色的权限。 + +原有无所有权回调的 Fence.Release 路径保留原约束:存在 owner lease 就拒绝。不会因为新增表或旧 ACK 自动进入新协议。 + +## 实际内部路由与未接部分 + +追加 LiveReleaseRequest=22、LiveReleaseAnswer=23、LiveReleased=18,已有编号/包版本不变;请求与成功回复均携带完整图像,Held body 为空。实际 DB ingress 仍被两道 false 门禁拦在 SQL 之前。内部 route 匹配实际 peer/handle/account-playing/session/cookie/batch 和原非 recovery context,仅允许 RESYNC 或已 RELEASED 的精确重试。 + +成功后 DB context 记 RELEASED、无需再撤销已退役 lease,但**保留 began 和内存 save/load 拦截**。若 SQL release COMMIT 后恰遇 peer 断开、内存尚记 RESYNC,受信生命周期回调的有界工作队列可重读完整终态证据,将撤销工作记为已完成;仅凭空 lease 或 token 不可这样处理,内存保存/加载拦截依然保留。 + +ID-only 的旧式 destroy/flush 入口也保留内存保护:began 且未取消的 context 阻止批次全部原普通背包 ID(包括已消耗项)、全部保留奖励 ID;其他当前 SQL 非 MALL/SAFEBOX 物品按 owner_id 匹配仍被持有的角色,不能把仓库/商城的账号 ID 误当角色 ID。SQL 查询失败拒绝,未 Begin 的 Arm 不阻止最后保存,其他角色的 ID 不受影响。不存在 SQL 行的非批次 ID 本身无法被 ID-only delete/flush 重建;带 owner 的普通 save 仍走角色保存拦截。这不代替全 actor/队列/外部引用审计。 + +game 的 Tick 目前停在 Acknowledged,尚无发送22的调用,也不把23当成 thaw。这是必要的未接环节:新物品还处于 skip-save 和事件暂停状态,必须完成真实保存/到期事件恢复、快捷栏/客户端发布、精确读回,以及 DB resume 的原身份交接之后才能继续玩法。不能只开宏或取消内存拦截。完整冻结/合法变更延期、外部 CItem 引用审核、旧 core 撤销、完整角色/其他窗口、异常 DONE、copy/成功率道具、匹配联机及 Android 验收仍是阻塞。 + +## 验证范围 + +ASan/UBSan 的实际 store 探针覆盖精确 ACK/终态、丢失提交回复、每条首次与重放 SQL 查询失败/warning、提交拒绝、回执写入/lease 删除/item-fence 删除/提交后的进程退出,检查原子结局。缺失/损坏 ACK、过期 peer/session/revision/broker、已撤销/接管所有者、当前钱包/道具/已发图像变化、新批次和跨角色栅栏均不能错误释放;永久 ID tombstones 不删除。 + +实际 CubeRuntime 路由探针明确使用 peer/cache/SQL-FIFO 适配替身,覆盖关闭 ingress 零 SQL、失败/丢失提交重试、重复成功、peer-gone 后只读终态对账及内存 save/load 仍阻止。协议覆盖完整图像、截断及请求/回复方向检查;不冒充可玩联机。 + +FreeBSD 使用隔离源码根和匹配旧对象队列,重编实际 CubeRuntime、Cube、input_db、port_cube_actor、port_cube_recovery,链接 game/db;非全量重编译,无实例或序列化布局变化。真实 MySQL 测试只复用已停止的专用隔离数据目录,no-defaults/socket-only/skip-networking,结束关闭。来源、哈希和最终结果见 `audit/xxf-ch5/cube-release-20261023.json`;未部署、重启或迁移生产。 diff --git a/docs/XXF-CH5-CUBE-RESUME-CHECK-20261023.md b/docs/XXF-CH5-CUBE-RESUME-CHECK-20261023.md new file mode 100644 index 00000000..ab0f1709 --- /dev/null +++ b/docs/XXF-CH5-CUBE-RESUME-CHECK-20261023.md @@ -0,0 +1,49 @@ +# Cube 恢复前当前状态复核与重启门禁(2026-10-23) + +接续原 LIVE actor Release,继续按 Cube → Won → 狼人 → 征服者 → 五角色位推进。本批不是恢复保存或解冻的交付。 + +## 为什么不能直接使用 Release 回执 + +原 `ReleaseLive` 的终态重放校验历史完整 ACK/Release、当前 broker 和无冲突租约/栅栏,但不重新读取当前物品图像。因此历史回执仍可成立,而当前钱包或物品已发生变化。测试明确构造了“Release 重放成功、当前钱包不同”的情况。不能把该重放当作 resume 许可。 + +另一个边界是 DB 重启:`m_cubeDrains` 内存 hold 会消失,原 SQL `RELEASED` 和已删除的租约/item fences 本身无法表达“尚未交接”。本批补齐这两个阻塞项,不通过超时或忽略门禁解决。 + +## 实际 DB 复核 + +`FenceStore::CheckReleasedImage` 使用同一 pinned SQL 连接和账号事务,锁定当前 fence,核对原完整 batch、RELEASED、drain_state=1 和原图像,重读当前普通225格背包及钱包,再在同一事务调用所有权校验。提交或确认不确定时返回 Retry,不返回通过。 + +`ReleaseStore::CheckResumeLive` 在该事务内核对: + +- 完整 ACK 与 Release 历史的 batch/owner grant/image 字节完全一致; +- 当前 DB broker 的 boot/generation/connection 和原 grant 仍匹配,无当前账号/角色/request 的 lease、无原 request/角色遗留 item fences; +- 原金币来源绑定和封存 manifest、每笔金币已应用且 before/after 连续; +- 持久固定 rolls 的 ok DONE 能重算出同一扣料、收费、成功数和完整奖励; +- 当前钱包与普通背包精确匹配重建结果,所有奖励永久 ID tombstones 仍在。 + +复用原 `OwnedImageWithin` 的结算核验逻辑,增加独立的 released 模式:此时要求原租约/item fences 已消失,不能要求或重新创建它们;仍核验原来源、DONE、钱包、奖励预留和完整普通背包。其他窗口只作已有 ID 查询界限检查,不因此宣称其完整 metadata 或整个角色已恢复。 + +## 内部路由,不是恢复授权 + +header78 追加 ResumeCheckRequest=24/Answer=25、LiveResumeChecked=19。请求与成功回复携带原完整普通背包+金币图像,Held 回复无 body;有界 LE 编码、cookie 和方向检查不变。 + +实际 DB 路由要求原 still-playing peer、账号成员、handle/session/cookie/批次身份、原 RELEASED context 和已确认 lease 退役状态。两个硬门禁关闭时只回复 Held,**不访问 SQL**。读取复核成功只回显图像,不改 context、不授予保存/加载权限、不清除任何 hold。 + +**Checked 是当前事务的只读复核结果,不是可缓存的 resume grant。** 实际 game 本批没有发送24,也没有接受该结果后启用保存的调用者。未来真正交接必须在当前授权事务重新使用同等校验,并完成持久状态与保存/加载路径的联动,不能拿本批历史 Checked 回复解锁。 + +## 重启后持久门禁 + +`Cube.cpp` 现在识别可选 release-addon v1。当前 fence 为 RELEASED 且存在对应现代终态回执时,即使 DB 内存 hold 为空,也拒绝该角色保存、该账号/角色普通加载,以及当前普通/装备等非商城仓库拥有物品与该批永久奖励预留 ID 的旧式写/删/flush。正常未使用现代终态回执的旧 Cube 路径保持原门禁规则。 + +缺失整个 addon 保持原基线;部分表、未知版本、非事务引擎或查询失败拒绝。沿用“缺失 schema 可缓存,安装/移除需要协调重启”的策略。本批**没有**完成 resume receipt 或自动解除路径,不可手工删终态回执来让角色上线。后续恢复提交必须提供明确的持久完成标记,使这些门禁能在旧 core 安全边界内解除。 + +## 验证范围 + +- `test_cube_resume.py` 编译实际事务/所有权核验模板,使用 SQLite SQL 边界替身和 ASan+UBSan:当前钱包/socket 改变、历史缺失或损坏、旧来源/rolls、ID tombstones 缺失、错误 grant/新批次拒绝;逐个 SQL 查询故障/warning、提交拒绝及确认丢失不产生资产写入;24/25截断与方向校验。 +- `test_cube_runtime.py` 编译实际 DB 路由,验证关闭入口无 SQL、原身份核验、当前资产变化拒绝、确认不确定重试,成功后内存保存/加载门禁依旧拒绝。 +- `test_cube_db_guards.py` 编译实际 SQL 门禁,子进程在空内存 hold 下验证现代终态角色/账号/物品/预留 ID 仍被锁定;部分/未知 addon 拒绝、其他角色及商城仓库边界不变。不是实际 DB 重启/全游戏验收。 + +完整回归、候选 FreeBSD game/db 构建及哈希记录于 `audit/xxf-ch5/cube-resume-check-20261023.json`。没有部署生产、迁移数据库、运行在线制作或进行 Android 真机验收。 + +## 下一步 + +实现持久 resume 完成协议与原 peer 保存交接,覆盖 ID-only 删/flush、延迟保存与旧 core、断线/重启和丢失回复;在完整角色冻结及合法延迟变更持久保留审核通过后,才能调用保存启用原语并安全解冻。公开制作入口、BYTE 数量动作、特殊配方、完整角色恢复和联机/真机验收仍缺。两道 false 门禁与现代 Cube 客户端宏不变。 diff --git a/docs/XXF-CH5-CUBE-SOURCE-CLOSE-20261023.md b/docs/XXF-CH5-CUBE-SOURCE-CLOSE-20261023.md new file mode 100644 index 00000000..9d7a32fb --- /dev/null +++ b/docs/XXF-CH5-CUBE-SOURCE-CLOSE-20261023.md @@ -0,0 +1,50 @@ +# 五区 Cube:地面金币来源关闭与排空屏障 + +继续 Cube → Won → 狼人 → 征服者 → 五角色位;本批仍只推进 Cube。上批完成地面金币 outbox,但SQL暂时没有QUEUED记录不代表game端没有尚未送达的持久意图。本批补这一来源的关闭证明,**不是完整角色冻结或上线制作**。 + +## 实现顺序与持久证据 + +1. game收到匹配身份的Frozen确认后,先在outbox fsync来源CLOSING。来源绑定账号/角色/epoch/owner/批次及原session/cookie/handle;此后该批新金币领取被拒绝且不删地面金币,旧意图仍重试。不是等队列偶然为空才停止来源。 +2. 本地所有该批意图都有持久GoldAck后,才生成GoldClose,内容为**完整有序事件ID清单**;零奖励批次也显式关闭。不能只发送数量、摘要或“当前没有待发”布尔值。 +3. DB仍验证原peer/login/handle/session/cookie及批次所有权;关闭与新增入队共用账号行锁。清单必须与SQL已保存的连续序号事件逐条相同,缺少、增加、重复、乱序均不接受。封存后拒绝新事件,只允许完全相同的历史事件重放。 +4. game fsync严格匹配的GoldCloseAck,重启能恢复“关闭中/已确认关闭”。来源ACK不修改金币,不喂给ActorHandshake解冻,也不能代替权威图像ACK。 +5. gold-addon v2路径的Resync/Release要求来源证明与全部意图一致,且意图全部发放、回执/钱包一致。未封存的零奖励批次同样拒绝;损坏或不一致的证明保留锁定。实际DB Arm现在要求addon v2:仅有base表、addon缺失/v1不能启动新来源。普通运行的缺表兼容基线不是现代制作权限。 + +主要代码为`common/cube_gold_source.h`、`cube_gold_outbox.h`、`cube_gold_intent.h`、`cube_gold_store.h`以及game/DB实际握手路由。 + +## 协议与文件格式 + +- 内部header78新增GoldClose=9、GoldCloseAck=10、GoldClosed=10;既有102字节前缀不变。清单为4字节数量+每项32字节规范小写十六进制事件ID,最多1024项,最大body32772字节、总帧32874字节,低于当前握手上限。不添加客户端制作能力,不允许旧game/db混用此未发布协议。 +- CGO1继续固定166字节,新增op3来源关闭/op4来源确认。来源记录为96字节绑定+4字节数量+57字节规范零填充,事件清单由前面的不可变CLAIM/ACK按序恢复。关闭记录在旧意图ACK之前也能持久化,但只有旧ACK齐全才能发关闭请求。 +- 读取旧CGO1 CLAIM/ACK不变;同一来源的session/cookie/handle必须一致。关闭后出现新CLAIM、未知/重复/乱序关闭、未排空就出现来源ACK、损坏或撕裂记录均失败关闭,不截断、丢弃或重新开放来源。旧程序无法理解op3/4时也应拒绝,不能用删日志降级。 +- 事件与来源历史仍保留;本批不增加自动压缩、清理、超时解锁或人工代填证明。 + +## 数据库版本与显式迁移 + +base Cube仍为v2;**金币addon从v1升到v2**,新增InnoDB表`port_cube_gold_sources`,保存原绑定与完整清单。版本/三表/引擎不匹配失败关闭,实际保存/加载门禁同步识别新结构。 + +新安装使用`tools/cube/gold-schema.sql`。旧候选使用`gold-upgrade-v2.sql`,须停相关入口、维护并协调重启;启动不自动安装。新DDL不会自动抬升已有v1版本行。迁移保留所有意图/回执,不创建任何关闭证明;未知版本、非事务基础表或部分来源表拒绝,允许明确修复后重跑。旧未决批次不能因升级版本就解除锁定。 + +测试脚本只在新建的独立socket MySQL中建立v1/部分DDL/MyISAM夹具并演练;没有对203正式数据库做迁移。 + +## 验证边界 + +- `test_cube_source.py` / `cube_source_probe.cpp`:零奖励必须关闭、迟到本地意图排空、SQL提交确认丢失、重启恢复CLOSING与ACK、错误清单/绑定、新事件拒绝和旧事件重放、损坏证明不生成图像;逐个关闭SQL失败/警告位置、提交拒绝、插入后/COMMIT后进程退出、双进程并发封存;最大精确清单、重复/超长/坏帧和旧addon拒绝。 +- 原outbox测试新增**实际game来源ACK处理体**:错误handle或清单不能确认,正确来源ACK仍不解冻,关闭后实际领取helper不接收新金币。 +- 实际DB route测试覆盖关闭入口仍关闭、stale session、丢失close COMMIT确认、重复关闭、封存后新意图拒绝以及伪造GoldCloseAck;仅基础schema和旧addon无法Arm。角色/SQL/已审核门禁仍有明确替身,不能当成在线玩家验收。 +- FreeBSD隔离根`/root/deploy-features/cube-source.iDdvhO`,全新game/DB对象目录,继承平台内部库;最终另强制重编DB runtime绑定最后的Arm准入检查。不是完整依赖库重建或严格警告审查。 +- 真MySQL脚本运行原批次/生命周期/金币/outbox/来源关闭探针及libsql FIFO,另演练base与gold-addon显式升级。最终结果、临时实例路径及产物散列绑定在`audit/xxf-ch5/cube-source-close-20261023.json`,统一回归目录`build/ch5-tests/20261023-cube-source-verified/`。 + +首轮全回归`20261023-cube-source-final/`保留了一项真实失败:旧economy/view共享探针在fork子进程打开macOS SQLite时,ASan崩在`_os_log_preferences_refresh`。已将该测试夹具改为posix_spawn独立映像,传递原1976字节请求和相同退出边界,保留十类操作的190个SQL退出/重放断言,以及并发购买/同单结算断言;view入口同样分发测试worker,不跳过失败用例。此改动只影响测试夹具,不修改经济运行代码。SQLite/ASan专项复验通过;本批Cube真MySQL结果不能冒充重新执行旧经济MySQL专项。 + +复现:server根目录运行`python3 -m unittest discover -s tests/features -p 'test_cube_*.py'`;FreeBSD匹配源/库目录运行`CUBE_TEST_SQL_WORKER=1 sh tools/cube/test_mysql.sh`。 + +## 仍未完成 + +这只关闭当前地面金币来源;没有证明所有任务、经验、物品、到期、直接setter、全服回调或组队来源已冻结/可靠延期。ABORTED的来源封存也不构成clean drain或自动补发资格。 + +重启/跨核心后可信所有权接管仍未接通:旧内存cookie不能被新连接自动采用。需要将持久关闭证据与原批次回执、旧所有者撤销、当前账号会话及权威图像恢复结合验证,不能仅凭token发钱或解锁。 + +实际工厂/ID、Prepare/Execute调用、在线Apply与权威图像应用/准确ACK、copy/成功率道具及匹配真服/Android验收仍待完成。`HandshakeEnabled=false`、`ActorMutationAuditComplete=false`、客户端制作宏保持关闭;本批无生产部署/重启/角色资产操作,也不重计macOS或Android构建。 + +下一步继续可信重启所有权恢复与实际制作/回执流程,不能据本批通过便开启Cube或跳到Won。整个五项移植目标仍未完成。 diff --git a/docs/XXF-CH5-CUBE-START-20261023.md b/docs/XXF-CH5-CUBE-START-20261023.md new file mode 100644 index 00000000..13d90956 --- /dev/null +++ b/docs/XXF-CH5-CUBE-START-20261023.md @@ -0,0 +1,32 @@ +# Cube:可信批次构造与内部发起入口 + +继续Cube → Won → 狼人 → 征服者 → 五角色位。本批将真实奖励工厂接入`PortCubeStart → PortCubeBegin`内部链路,补上此前Begin要求调用者自行提供完整batch的缺口。**仍不是可点击制作或上线完成**。 + +## 服务端构造 + +调用方只提供角色指针、配方编号、只读版本和1..100次。两道false门禁在最前面,关闭时不读熵源、不调用工厂、不消耗ID、不登记所有者。通过门禁后: + +1. 核对角色、DB连接、物品已加载、危险状态和窗口;已有原角色批次只允许相同配方/版本/次数的重复查询,不重建模板、不生成新身份、不重复Arm;失效/其他归属拒绝。 +2. `PortCubeResolveRecipe`只取同一个已加载s_cube_proto目录、当前NPC/任务NPC/地图距离等上下文。版本只用于陈旧检查,不是授权;copy配方仍拒绝。解析失败不替换输出。 +3. 使用真实capture得到普通背包与全窗口封印,拒绝时钟/锁定/交易/skip-save物品;按真实金币与材料数量预检,超出GoldLimit也提前拒绝。 +4. 原owner/token及64位非零session来自服务端/dev/urandom,不接受客户端替代。epoch经时钟/溢出检查并在本进程严格递增。 +5. 按最坏输出数量计算1..100个模板,调用上批真实新物品工厂;按当前proto计算全部可能成功时的扣料与物理放置计划。0%配方没有可能奖励,但仍付全批材料/费用。 +6. 调用实际PortCubeBegin:再次核对完整规范配方、角色身份、危险状态、金币与背包完整字节;登记不可变owner后发送原Arm。后续只由既有同身份Tick驱动排空、来源封存、Prepare/Execute。 + +失败不扣角色资产、不发奖;已经消耗的工厂ID不返还。只有进入Begin并保留原owner后才进行内部发送;已接受身份不能重新生成metadata或随机制作结果。手工调用旧Begin仍属于可信C++内部API,不是公开协议。 + +## epoch边界 + +使用CLOCK_REALTIME纳秒并限制到INT64_MAX,检查系统调用失败、负秒/负纳秒及纳秒上界;本进程回退取lastEpoch+1。它不是跨重启的持久分配器:DB原fence仍要求新epoch严格高于前一RELEASED记录,且任何非RELEASED旧hold都不能被替换。跨主机时钟不一致/重启回退可能拒绝新请求,需后续时钟一致性或DB代次协商;不能以超时、重登或新timestamp自动解除旧hold。 + +## 验证范围 + +`test_cube_catalog.py`增加真实resolver的版本/编号/copy拒绝和不改输出断言。`test_cube_craft.py`编译实际Start函数:禁用无熵/ID、材料金币/上界/连接/次数检查、熵失败/零session/时钟失败、完整metadata、工厂失败、旧角色归属/invalidated拒绝、同批次重复无再生成,以及进程内时钟回退仍严格递增。 + +另一个探针同时编译实际Start及实际Begin,验证真实owner登记和Arm完整批次字节,保留角色金币、不重复工厂/Arm、最终配方变化时拒绝。角色/快照/奖励工厂/发送仍为明确替身,不把这当成真实冻结或完整线上制作验收;工厂本身已有上一批真实game对象离线探针。 + +FreeBSD隔离根`/root/deploy-features/cube-start.mURCqf`重编actor与cube两个实际翻译单元,替换上批全量game对象集合中的对应对象后重新链接完整game。仅添加自由函数声明,没有改变CItem/协议结构布局;不是又一轮全game/DB重编译。源码和产物记录见`audit/xxf-ch5/cube-start-20261023.json`。 + +## 仍缺少 + +Start已成为工厂与Begin之间的真实内部调用者,但Start本身仍无客户端动作/公开命令调用,制作能力仍为0。下一步优先接原live所有者的权威图像、应用/准确ACK/thaw,然后完成可靠冻结与变更延期、旧core撤销、恢复/异常对账、copy/成功率道具、版本/状态UI及匹配联机/Android验收,再开放用户入口。两道false门禁保持不变,没有生产部署/重启/迁移/玩家资产变更,后四项本批未推进。 diff --git a/docs/XXF-CH5-POST-PULL-20261023.md b/docs/XXF-CH5-POST-PULL-20261023.md new file mode 100644 index 00000000..3e9f00a6 --- /dev/null +++ b/docs/XXF-CH5-POST-PULL-20261023.md @@ -0,0 +1,47 @@ +# 五区移植:远端合并后验证 + +本批先执行合并验收,没有切换任何发奖入口、启用现代制作或部署生产。 + +## 代码基线 + +- client:`c1de05dc`,已包含远端 `7270366a` 的三个更新提交;server:`6924dc9`,已包含 `aa0afef` 的离线商店管理器初始化。两端均保留原本本地提交及未提交的五区移植代码。 +- 恢复 stash 时唯一冲突是 Won 兑换窗口旁的注释,两边均将窗口关闭;保留原本地注释,没有开启 Won。 +- 合并前 stash 备份仍保留:client `41c65cd046bd4d4bbf028d725454cba1a9774d19`,server `96a3b05a4303c8ef66e4d46fe7f5d5e77aef93b0`。恢复后不得再次盲目 apply。 + +## 已执行的检查 + +1. 客户端现有 CMake Release 目标 `mt_native_render` 构建通过;原生测试目标重新编译。沿用本项目 SDL3/Vulkan/CMake 路径,没有引入不适用的 Swift/Xcode 工程或额外 Run 配置。 +2. `port.grp_resource`、`port.python_ui_modules` 通过。当前五区 Client 目录的 FakeLoginServer Cube 原布局、3 次预检、材料/金币不变检查通过;只在回环假服执行,不是生产制作验收。 +3. 新增 `MT_TEST_CH5_PACKS=1` 原生断言,实际 `grpImage.Generate` 加载 `cream/pages/page_1_down.png`(26×26)及战令 `gauge_bpass.png`(16×8),检查新增 6884/11300 和重分类 19529 的 type/subtype。它覆盖真正的 CPythonResource PNG 注册,不只检查文件头;不表示 type36 等全部玩法已经实现。 +4. 读取实际包并使用本仓库原型解析工具比对:原五区 11,545 条、AVA2 7,626 条,覆盖后 12,059 条;新增 514 个编号、重分类 303 个编号,逐条结果与 AVA2 来源一致。`locale_zh_ava2` 注册在 `locale_zh` 前,44 个已登记包的 eix/epk 均存在;未重新生成或覆盖正式资源包。 +5. 旧 Solution B 探针将物品数写死为 11,545,已增加严格十进制、正数、无溢出的 `MT_TEST_EXPECT_ITEM_COUNT` 参数;默认仍检验原五区数量。本批显式传入独立比对得到的 12,059,8/8 模型 GR2 解析及中文/原型/配方/图标读取通过,不用“任意非零数量”掩盖覆盖失败。 +6. FreeBSD `/root/deploy-features/ch5-post-pull.ptruOK`,从平台匹配隔离树复制依赖库并覆盖当前源文件;全新 `.post-pull-game-obj`、`.post-pull-db-obj`,每次最多 2 个编译任务,game 和 DB 均重新编译/链接。产物仅在该目录的 `bin`,未替换或启动正式服务。 + +原生复现(仓库根目录): + +```sh +cmake --build build/release --target mt_native_render -j4 +cmake --build build/native --target port_login_flow_test port_python_ui_modules_test port_grp_resource_test port_solution_b_verify_test -j4 +ctest --test-dir build/native --output-on-failure -R '^port\.(python_ui_modules|grp_resource)$' +MT_ASSETS_STRICT=1 MT_TEST_WIKI=1 MT_TEST_CUBE=1 MT_TEST_CUBE_LAYOUT=1 MT_TEST_CH5_PACKS=1 \ + build/native/src/port/port_login_flow_test "$PWD/Client" "$PWD/build/native/python27.zip" +MT_TEST_EXPECT_ITEM_COUNT=12059 build/native/src/port/port_solution_b_verify_test "$PWD/Client" +``` + +这些构建不是严格警告验收;既有警告、Wolfman 动作缺失及背景音乐错误仍出现在日志中。不能把退出码 0 写成“所有资源/所有玩法完整”。本批没有重新执行 MySQL 测试、在线启动/登录、Android 或视觉验收,之前的 MySQL 记录仍为历史证据。 + +## 频道 4 的边界 + +`Client/channel.inf` 保持远端的 `1 4 0`。只读核对 203 的 channel4 三个 CONFIG,确有频道 4、game 端口 13030/13031/13032、P2P 14030/14031/14032;未改 CONFIG、数据库或进程。 + +不能据此宣称客户端已经连到 CH4:原五区 root 的 serverInfo 仍是历史公网配置,频道键为 0/1;`channel.inf` 不是可靠的地址配置。原生外服启动参数 `--live-server HOST:AUTH_PORT:GAME_PORT` 独立指定连接端点,必须在匹配启动方式下验收。没有擅自重写原五区脚本或把历史公网地址当成本服地址。此差异列为联机验收待办。 + +## 后续实施切入点 + +继续金币可靠交接前已核实:当前 `CHARACTER::PickupItem` 校验地面物品距离/归属后调用 `GiveGold`,成功才移除/销毁地面金币并 Save;`GiveGold` 本身还承担组队分配。不能只在 PointChange 后补写 outbox,否则可能重复加钱;也不能只让 GiveGold 返回 true 后删掉地面金币。 + +下一批应以**非组队、通过原距离/归属验证的地面金币领取**作为一个明确的可信来源,设计并接通:稳定来源身份 → fsync 持久意图/序号 → 不再执行原本地加钱 → 重试至 DB 入队确认 → 持久 ACK;崩溃/磁盘故障/队列上限/迟到请求均不得吞奖或释放旧批次。先证明这一个来源,再扩到组队、任务或其他奖励。现有 PointJournal 可参考文件锁、目录 fsync 与错误停发,但其商城点数请求/终态语义不能直接冒充 Cube 金币协议。 + +这仍需实际实现与故障测试;本批没有把该设计写成已接线。`HandshakeEnabled=false`、`ActorMutationAuditComplete=false` 保持不变。 + +最终统一回归目录为 `build/ch5-tests/20261023-post-pull-final/`,源文件、资源、构建日志和结果绑定见 `audit/xxf-ch5/post-pull-20261023.json`。早于新增原生断言的 `20261023-post-pull/` 报告只作为前置检查,不冒充最终源版本。 diff --git a/docs/XXF-CH5-QUIVER-20261022.md b/docs/XXF-CH5-QUIVER-20261022.md index 1fb3d937..37b2c5a6 100644 --- a/docs/XXF-CH5-QUIVER-20261022.md +++ b/docs/XXF-CH5-QUIVER-20261022.md @@ -2,6 +2,8 @@ 状态:弹药核心已接入,整体功能部分实现,未部署生产;不等于五区全部功能完成。 +后续状态与动作批次见[新实施记录](XXF-CH5-QUIVER-SYNC-20261022.md)。下文保留前两批的历史边界,“专用同步未移植”等描述不再代表新批次代码;真实生命周期、战斗时序及手机验收仍未完成。 + ## 活动来源及适配边界 来源为`AVA2/2. Backup SF+SRC and SQL/FILES+SRC.tgz`: diff --git a/docs/XXF-CH5-QUIVER-SYNC-20261022.md b/docs/XXF-CH5-QUIVER-SYNC-20261022.md new file mode 100644 index 00000000..05c3a322 --- /dev/null +++ b/docs/XXF-CH5-QUIVER-SYNC-20261022.md @@ -0,0 +1,48 @@ +# 五区继续移植:箭筒状态、动作与启动缺口修复 + +状态:本批代码和本地验证完成,F19整体仍为部分实现,未启用整体宏、未部署生产。不代表其他五区未完成系统已经完成。 + +## 本批完成 + +1. 验证既有GC219/能力2048协商及0/6/9状态接收;新增独立CTest `port.quiver_sync`,无需手动设置环境变量即可回归。 +2. 服务端直接编译实际 `port_quiver_sync.inc`,ASan/UBSan验证未协商客户端不收包、可见玩家快照、自身快照、非玩家/观察者排除、空/普通箭/箭筒/过期/断线处理。替身只提供实体、连接与物品接口,不把它算作真实物品持久化验收。 +3. 特殊动作包装器改用实际加载的 `playerSettingModule`(不是另一个大小写不同的模块);测试不再事后强制注册来掩盖加载阶段遗漏。 +4. 新增46项动作/特效闭包的回归:路径规范、相对引用、循环引用、数量上限、缺失拒绝、保留现有资源。拒绝额外盘符/绝对路径依赖。现有候选只有两份缺失MSA来自AVA2,其他44项来自当前有效资源。 +5. `stage_quiver_client.py`核对候选全部文件及基础依赖SHA256,再创建新私有客户端;基础包链接、Index和配置单独复制,补丁优先挂载。拒绝旧输出、污染基础目录、损坏包、过期Index。私有目录不是可分发完整资源包。 +6. 实际五区资源联机假服测试发现并修复Won主宏关闭但兑换窗口仍开启的问题;现两者均为0,不以伪窗口或假钱包遮蔽缺口。 +7. 五页背包拦截增加 `InventoryWindowEx.py`;之前只拦截普通布局,五区扩展背包第五页无法绑定。原生测试确认五个页签、第五页切换及返回;同时增加页码边界检查。保留本服既定225格,不重建未核实的五区解锁钥匙规则。 + +## 本轮验证 + +- 全量统一入口:116个测试文件全部通过,352个unittest用例;另有33个顶层脚本(其内部C++/Lua断言不伪造为unittest计数)。此前缺失的生物学家原版源码依赖通过归档中两个精确成员解到隔离build目录补齐,并显式传入入口。 +- 本地全量报告:`build/ch5-tests/20261022-175739-ozfowvps/report.json`,执行中代码快照未改变。报告中的功能状态仍不是完整行为/实服/设备通过。 +- macOS原生:`port.login_flow`、`port.quiver_sync`、`port.python_ui_modules` 3/3通过。 +- 私有五区资源测试:从真实登录/加载流程自动注册男女弓手模式19;实际MSA动作及FLY事件可解析、arrow_02.msf可加载;女性弓手佩戴2000号弓时,9切特殊模式、6/0切普通弓模式。检查五页背包及Won依赖闸门。日志 `build/ch5-quiver-motion-native-20261022-r4.log`。这是无窗口渲染的引擎/协议测试,不是动作画质或真实伤害时序验收。 +- Android:`JOBS=4 ./android/build.sh Release --no-deploy` 完整APK构建通过,输出仍为debug签名;没有安装或推送资源,adb没有已连接设备。 +- FreeBSD:此前独立目录 `/root/deploy-features/quiver-sync.KnSIU6` 全量库/game/db构建完成,本轮只读核对产物及char.cpp/同步实现散列,匹配本地运行代码。没有重复声称本轮重新编译或修改正式服。详细散列见下方证据。 + +原有编译警告、五区非本批资源的缺失声音/狼人技能动作及额外技能名称日志仍存在。本批测试通过不意味着清零所有资源/渲染告警。 + +## 复现 + +```sh +python3 scripts/test_xxf_all.py --ava2-game-source build/ch5-ava2-reference-20261022 +python3 tools/server/ava2-items/stage_quiver_client.py \ + --base Client --candidate build/ch5-quiver-motion-20261022 \ + --output build/ch5-quiver-test-client-NEW \ + --packer build/port-gate/macos/src/port/eterpack_pack +MT_ASSETS_STRICT=1 MT_TEST_WIKI=1 MT_TEST_QUIVER=1 MT_TEST_QUIVER_MOTION=1 \ + build/port-gate/macos/src/port/port_login_flow_test \ + "$PWD/build/ch5-quiver-test-client-NEW" "$PWD/build/port-gate/macos/python27.zip" +``` + +候选先按[生成工具说明](../tools/server/ava2-items/QUIVER.md)生成,并增加 `--with-motion-assets`。缺失测试源/资源必须失败或明确阻塞,不能通过修改预期值绕过。 + +## 仍未关闭的门槛 + +- 匹配实际game/db的隔离联机:真实获得、装备/卸下、仓库/移动限制、重登、离线到期及到期移除后的状态恢复。 +- 骑乘/下马、武器时装、双端旁观、断线/换线及重用VID等组合;特殊动作实际播放、投射物命中和技能伤害时序。 +- Android设备操作、实际画面及性能;APK和匹配资源整包交付。 +- 79501规则冲突仍排除;三个限时型号未投放,不新增免费售卖/获得途径。 + +证据:[quiver-sync-20261022.json](../audit/xxf-ch5/quiver-sync-20261022.json)。下一步先在独立测试环境完成这些门槛;Won、狼人、征服者、五角色位、现代Cube等仍按原清单待实施,不随本批自动完成。 diff --git a/docs/XXF-CH5-TARGET-TRADE-20261022.md b/docs/XXF-CH5-TARGET-TRADE-20261022.md new file mode 100644 index 00000000..dfb22714 --- /dev/null +++ b/docs/XXF-CH5-TARGET-TRADE-20261022.md @@ -0,0 +1,43 @@ +# 五区继续移植:目标元素与交易等级 + +本批实现F03/F04的客户端和服务端缺口,整体仍为PARTIAL,未部署生产。本文件不替代此前箭筒历史证据,也不表示Won、狼人、现代Cube等已经完成。 + +## F04:由服务端提供交易等级 + +原客户端虽有GetLevelFromSelf/Target,却在收到交易START后从场景实例读取对方等级;服务端START.arg3一直为0。这不是本次交易的权威快照,旧角色缓存可能错误或缺失。 + +现服务端两方向START分别附带真实对方GetLevel(),不改既有51字节布局、子包或金额/物品行为。新客户端只接受该字段的1~255,0和异常值作为未知,不从角色缓存猜测;自身等级来自已收到的POINT_LEVEL。取消/结束清除双方等级,下次开始清理并覆盖。界面继续显示对方等级,自身快照留在API中,不宣称添加了双方独立标签。 + +这是本项目的兼容适配,不是找回五区原协议:AVA2归档exchange.cpp两处START的arg3也是0,common/CommonDefines.h未发现活动LEVEL_IN_TRADE分支。旧客户端忽略START.arg3,旧服务端提供0时新界面只显示对方名字,不显示Lv.0或缓存值。等级是开始时快照;交易过程中升级不会改写此快照,不创建未核实的即时升级协议。 + +服务端exchange.cpp为旧编码,仅机械替换两处调用参数,保留其他字节。实际ExchangeStart和exchange_packet在显式人物/连接替身下编译,ASan/UBSan验证双方方向、51字节、开始快照及现有自交易/距离/繁忙/拒绝守卫;不是两名真实玩家的资产往返验收。 + +客户端测试编译真实CPythonExchange及START分支,角色替身故意不提供GetLevel(),防止重新引入缓存回退。另测等级边界、旧服、重复开始、结束清理、未知角色、快照与物品/金币状态清理。标题测试兼容经典单参数和五区双参数语言格式,不把名字中的百分号当格式指令。 + +## F03:接通实际目标栏并清理残留图标 + +元素适配器改为挂接游戏实际使用的uiTarget模块;五区SetEnemyVID内部会调用SetRaceElement,故内部加载入口也替换为有失败保护的实现。切到无元素、玩家目标、无效目标或重置后隐藏上次图标;缺失资源/加载失败也隐藏,不保留旧目标信息。 + +六种是电/火/冰/风/地/暗,来自模板的ATT_*标志;不是“光”、完整弱点表或伤害倍率。多标志选最低已知元素位,记录为确定性兼容策略。当前只使用已有模板,没有实现动态元素状态推送。 + +Python替身测试覆盖六图映射、多元素优先级、换目标、重置、无效VID及缺图。原生测试使用实际游戏目标栏和真实101号怪物实例,显式替换查询返回的元素位来遍历六种情况,再加载真实.sub/贴图;测试结束恢复原查询。它证明实际挂接、资源与隐藏生命周期,不证明服务器101号怪物真实具有六种元素或战斗克制正确。 + +## 验证与产物 + +- 统一本地入口:120个测试文件全部通过,361个unittest用例,另有33个顶层脚本。执行期间源码快照未改变;报告 `build/ch5-tests/20261022-182520-x8m30ahk/report.json`。随后只更新文档/功能元数据,并单独回归生成器测试。 +- 五区私有资源原生专项:四次开始/结束(87、旧服0、异常999、再次开始31),标题显示或隐藏及结束清理通过;六种实际元素图像加载/显示与切换隐藏通过。最终日志 `build/ch5-trade-element-ch5-native-20261022-r2.log`。早期失败日志保留,不冒充成功证据。 +- macOS CTest:登录链、箭筒、交易等级、Python UI模块均执行回归,最终结果见证据JSON。 +- FreeBSD:从既有已完成全量构建的隔离目录复制源码/内部库和对象到新目录 `/root/deploy-features/trade-level.aXURA5`,仅重编exchange.cpp并重新链接game。不是全新内部库全量重编,也没有替换旧候选或生产程序。远端源码SHA256与本地一致。 +- Android:`JOBS=4 ./android/build.sh Release --no-deploy` 完整APK构建通过,仍为debug签名;未连接设备,未安装/同步。 + +复现专项(需先按箭筒记录准备新的私有资源目录): + +```sh +MT_ASSETS_STRICT=1 MT_TEST_WIKI=1 MT_TEST_TRADE_LEVEL=1 MT_TEST_TARGET_ELEMENT=1 \ + build/port-gate/macos/src/port/port_login_flow_test \ + "$PWD/build/ch5-quiver-test-client-20261022" "$PWD/build/port-gate/macos/python27.zip" +``` + +仍需匹配真实game/db的两玩家交易/取消/换对象、升级快照/重连与Android操作验收,元素模板一致性和实际画面也未完成;已有缺失音频/狼人动作及编译告警未被本批清零。没有部署、投放道具或改变经济规则。 + +证据:[target-trade-20261022.json](../audit/xxf-ch5/target-trade-20261022.json)。 diff --git a/scripts/build_xxf_features_json.py b/scripts/build_xxf_features_json.py index 22d90792..a84f85ad 100644 --- a/scripts/build_xxf_features_json.py +++ b/scripts/build_xxf_features_json.py @@ -28,7 +28,7 @@ def make_record(fid, name, subfeature, scope, owner, sources, rules, deps, impl, observation_and_shutdown_ref=None, blockers=None, rollback_ref=None): # Historical declarations below describe interfaces, not measured results. # Regeneration must never promote a constant or stub to verified gameplay. - reviewed_partial = {'F02','F16','F17','F18','F19','F20','F21','F22','F23', + reviewed_partial = {'F02','F03','F04','F16','F17','F18','F19','F20','F21','F22','F23', 'F24','F27','F28','F30','F31','F32','F33'} status = dict(source='pending_review', implementation='partial' if fid in reviewed_partial else 'pending_review', build='pending', unit='pending', live='pending', device='pending', release='not_released') @@ -666,14 +666,73 @@ def main(): ] for feature in features: + if feature['id'] == 'F03': + feature['source'][0]['reachable_import'] = 'uiTarget' + feature['rules']['accepted_differences'] = ['Electric/fire/ice/wind/earth/dark attack-affinity flags, not inferred weakness or drop rates; lowest known flag wins for multi-element templates'] + feature['implementation']['resources'] = 'd:/ymir work/ui/game/12zi/element/*.sub' + feature['implementation']['entrypoints'] = ['uiTarget.TargetBoard.SetEnemyVID', 'uiTarget.TargetBoard.SetRaceElement', 'uiTarget.TargetBoard.ResetTargetBoard'] + feature['status']['source'] = 'partially_verified' + feature['blockers'] = ['Actual server template consistency, rendered visual and Android device acceptance pending'] + feature['protocol_contract_ref'] = 'AVA2-IMPLEMENTATION-SPEC.md#ch5-target-trade' + if feature['id'] == 'F04': + feature['source'][0].update(symbol='ExchangeDialog.OpenDialog', reachable_import='uiExchange') + feature['implementation']['server'] = 'src/server/game/src/exchange.cpp' + feature['implementation']['entrypoints'] = ['CHARACTER::ExchangeStart', 'CPythonNetworkStream::RecvExchangePacket', 'CPythonExchange::SetTargetLevel', 'uiExchange.ExchangeDialog.OpenDialog'] + feature['rules']['provenance'] = 'XXF-CH5 display with PORT server snapshot adaptation; not recovered original CH5 wire' + feature['rules']['accepted_differences'] = ['51-byte GC_EXCHANGE START.arg3 carries partner opening-level snapshot, 0 legacy/unknown; never actor-cache fallback; levels 1..255; not a live level-up feed'] + feature['status']['source'] = 'partially_verified' + feature['blockers'] = ['Matched two-player real-server trade/cancel/reconnect and Android device acceptance pending; title shows partner level, self snapshot exposed through API'] + feature['protocol_contract_ref'] = 'AVA2-IMPLEMENTATION-SPEC.md#ch5-target-trade' if feature['id'] == 'F19': feature['implementation']['server'] = 'src/server/game/src/port_quiver.h' feature['implementation']['client'] = 'src/port/UserInterface/PythonPlayerSkill.cpp' - feature['implementation']['entrypoints'] = ['CHARACTER::GetArrowAndBow', 'CHARACTER::UseArrow', 'CPythonPlayer::__HasEnoughArrow'] - feature['rules']['unresolved'] = ['79501 excluded due conflicting price/duration metadata; timed 79502-79504 candidate generated but not installed', 'Native arrow-type visual sync and matched live/device/item-lifecycle acceptance'] - feature['rules']['accepted_differences'] = ['AVA2 active quiver9 semantics; claw8 reserved only; explicit pre-shot expiry checks; classic arrow visual fallback; whole-feature macro stays off'] + feature['implementation']['entrypoints'] = ['CHARACTER::GetArrowAndBow', 'CHARACTER::UseArrow', 'CHARACTER::PortEnableQuiverSync', 'CPythonPlayer::__HasEnoughArrow', 'CPythonNetworkStream::RecvQuiverState', 'mt_quiver_motion.LoadGameData'] + feature['rules']['unresolved'] = ['79501 excluded due conflicting price/duration metadata; timed 79502-79504 candidate generated but not installed', 'Matched real-server item lifecycle, mounted/costume weapon combinations, actual attack timing and Android device acceptance'] + feature['rules']['accepted_differences'] = ['AVA2 active quiver9 semantics; claw8 reserved only; pre-shot expiry checks; capability2048 negotiated GC219 instead of expanding legacy parts; AVA2 special MSA missing in CH5; classic fallback when assets absent; whole-feature macro stays off'] feature['blockers'] = list(feature['rules']['unresolved']) feature['status']['source'] = 'partially_verified' + if feature['id'] == 'F21': + feature['protocol_contract_ref'] = 'AVA2-IMPLEMENTATION-SPEC.md#ch5-cube-catalogue' + feature['implementation']['server'] = 'src/server/game/src/port_cube_catalog.inc' + feature['implementation']['server_ownership'] = ['src/server/db/src/Cube.cpp', 'src/server/common/cube_drain.h', 'src/server/common/cube_fence.h', 'src/server/db/src/CubeRuntime.cpp', 'src/server/db/src/SQLFences.h', 'src/server/common/sql_fence_router.h', 'src/server/common/cube_handshake.h', 'src/server/game/src/port_cube_actor.cpp', 'src/server/game/src/port_cube_flush.inc'] + feature['implementation']['entrypoints'] = ['game.GameWindow.BINARY_Cube_Open', 'cube_renewal.OpenPreview', 'cube_renewal.CheckBatch', 'PortCubeQuery', 'PortCubeStart'] + feature['rules']['version'] = '2.0-read-only' + feature['implementation']['server_ownership'] += ['src/server/common/cube_mutation.h', 'src/server/game/src/port_cube_item.inc', 'src/server/game/src/port_cube_quest.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_gold_intent.h', 'src/server/common/cube_gold_store.h', 'src/server/db/src/CubeGold.cpp'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_gold_outbox.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_gold_source.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_owner.h', 'src/server/common/cube_owner_types.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_recovery.h', 'src/server/game/src/port_cube_recovery.cpp', 'src/server/game/src/port_cube_recovery.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_image.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_live_image.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_image_ack.h', 'tools/cube/image-ack-schema.sql'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_release.h', 'tools/cube/release-schema.sql'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_presentation.h', 'src/server/game/src/port_cube_publish.cpp', 'src/server/game/src/port_cube_publish.h'] + feature['implementation']['client_presentation'] = ['src/port/common/CubePresentation.h', 'src/port/UserInterface/PythonPlayerCubeView.inc', 'src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp', 'src/port/UserInterface/GameType.h'] + feature['implementation']['server_ownership'] += ['src/server/game/src/port_cube_restore.h', 'src/server/game/src/port_cube_restore.cpp', 'src/server/game/src/port_cube_lifecycle.inc', 'src/server/game/src/event.cpp', 'src/server/game/src/event_queue.cpp'] + feature['implementation']['server_ownership'] += ['src/server/game/src/port_cube_apply.cpp', 'src/server/game/src/port_cube_apply.h', 'src/server/game/src/port_cube_registry.inc', 'src/server/game/src/char.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_craft.h', 'src/server/common/cube_receipt.h', 'src/server/common/cube_random.h'] + feature['implementation']['server_ownership'] += ['src/server/common/cube_item_ids.h', 'src/server/game/src/port_cube_ids.h', 'src/server/game/src/item_manager_idrange.cpp'] + feature['implementation']['server_ownership'] += ['src/server/game/src/port_cube_factory.cpp', 'src/server/game/src/port_cube_factory.h', 'src/server/game/src/item_manager.cpp', 'src/server/game/src/item.cpp', 'src/server/game/src/item.h', 'src/server/game/src/item_attribute.cpp'] + feature['rules']['provenance'] = 'AVA2 active WORLDARD/COPY branches; actual locale/cube.txt; current classic s_cube_proto' + feature['rules']['unresolved'] = ['Complete game actor quiescence, especially durable retention of legitimate post-Submit mutations/rewards and direct setters/global callbacks; conservative admission and invalidation are not a freeze proof; both gates remain false', 'Game release-readiness and DB resume handoff, saving/expiry-event restoration and thaw; classic count-bearing action packets still BYTE; full character/non-normal-window recovery; copy attributes and success-rate items', 'Matched live game/db plus Android device asset consistency and presentation acceptance'] + feature['rules']['accepted_differences'] = ['Game/client runtime remains read-only catalogue and 1..100-attempt preview; no craft action', 'Candidate SQL backend has fixed draws and atomic costs/rewards; v2 lifecycle adds durable per-item locks, correlated drain core and exact-image resync ACK', 'DB runtime guard methods are wired into saves/loads/deletes/economy and item flush; absent schema preserves baseline, partial schema fails closed', 'DB Arm/Submit adapter drives actual SQL FIFOs; internal header78 bounded LE handshake and game preparation/seal/final-save order are compiled but ingress is disabled, not a complete actor-freeze implementation', 'Only explicit pre-Begin cancellation ACK may clear preparation; timeout/lost transport/late cancel retain hold; detached dirty items included before Submit', 'Candidate reserves normal-inventory cells without merging reward stacks; copy recipes explicitly refused', 'Refuse unsupported multi-reward recipes rather than guessing semantics', 'Do not copy archived reward-count/item-allocation/copy-initialization bugs'] + feature['activation_and_shutdown'] = {'client_gate': 'Capability4096 only enables labeled read-only preview; ENABLE_CUBE_RENEWAL_WORLDARD remains 0', 'server_gate': 'No public crafting action; internal Start/settlement/live-image handlers remain behind both false hard gates', 'safe_default': 'Classic Cube unchanged; unsupported server does not open modern preview'} + feature['rules']['accepted_differences'].append('ResumeCheck24/25 is an internal read-only preflight, NOT a resume grant: one pinned account transaction rechecks current normal inventory/gold, exact terminal ACK/history, current broker/no lease/fence, sealed source/applied credits, fixed-roll DONE reconstruction and permanent ID reservations. Runtime requires original still-playing peer/handle/session/ownership and RELEASED context, retaining all memory holds. Modern terminal RELEASED receipts also quarantine player/account saves/loads and current/reserved item IDs after DB restart, when memory holds disappear; no activation receipt or unlock path exists yet. No actual game sender or save-enable/thaw; both ingress gates remain false.') + feature['rules']['accepted_differences'].append('Candidate original-LIVE game now sends immutable terminal Release22 only after durable image ACK, authoritative publication and paused-event preparation. Every send/retry and accepted reply validates complete applied seal/image, registered restoration plan and all36 identity-rebound shortcuts; bounded shared Tick retries retain original session/cookie/batch/image. LiveReleased stops SQL retries but leaves actor held, item skip-save and DB memory gates intact. No DB resume grant, save-enable runtime caller or thaw; both ingress gates remain false.') + feature['rules']['accepted_differences'].append('Candidate held actor prepares registered restored-item expiry events only after publication and exact full-seal checks. Real-time, started-first-use and absolute unique clocks preserve persisted deadlines and remain paused while either held or skip-save. Unequipped wear, unstarted-first-use and played-time unique durations do not start. Exact owner/item/VID/full-metadata plan validation precedes an allocation-free skip-save clearing primitive, which has NO runtime caller pending authenticated DB resume. Actual event creation owns info on allocation failure and queue insertion cleans pending nodes; dispatch detaches a dequeued node before callbacks may cancel it. This is preparation, not save/event activation or thaw.') + feature['rules']['accepted_differences'].append('Revision25 GC93 op11 candidate publishes one bounded LE gold64/225-normal-inventory/36-shortcut view after durable ACK and full actor-seal recheck. Shortcut bindings captured before replacement are remapped by permanent item ID; consumed inputs never bind to a reward reusing the cell. Client stages full proto/grid/shortcut validation and commits without callbacks, preserves other windows and ignores exact/stale replay without overwriting later state. Internal client item counts widen only in memory; classic wire structs remain BYTE, with revision25 op12 full-count/extra companions on existing item set/update paths and old op10 fallback. Enqueue is not client receipt/rendering or thaw; ordinary save/expiry clocks and resume remain paused.') + feature['rules']['accepted_differences'].append('Candidate original-LIVE terminal SQL release uses optional release-addon v1: inside one account transaction it revalidates full ACK/current SQL/current LIVE grant, writes immutable batch/grant/image receipt, retires the lease and item fences, and sets RELEASED. Permanent item-ID tombstones remain. Exact replay checks current broker and refuses any conflicting newer lease/fence/history. Internal messages22/23 stay hard-gated; the candidate game sender waits for exact publication and paused-event preparation, without activating saving/events. DB memory save/load hold survives SQL release; trusted disconnect can reconcile lost release-COMMIT replies without inventing revocation or thaw. Resume, full actor readiness and gameplay acceptance remain incomplete.') + feature['rules']['accepted_differences'].append('Candidate original LIVE normal-inventory/gold image now installs persisted metadata without reward RNG or save/event side effects and verifies all-window readback. Internal LiveImageAck=20/Answer=21 carries the complete canonical image; optional image-ACK addon v1 stores immutable full batch/grant/image inside the same account Resync transaction after current SQL and original LIVE authority proof. Lost commit reply retries revalidate ownership. Actor rechecks full applied seal before every bounded ACK retry and initial ACK answer. Acknowledged is still held: no item-fence removal, owner release, save/event resume, UI publication or thaw.') + feature['rules']['accepted_differences'].append('Conservative admission denies item clocks/locks, PC timers, running quests, switchbot, party/combat/lifecycle hazards; whole switchbot rolls defer before cost/RNG. Gold/item/quest/lifecycle notifications latch invalidation; internal Invalidate aborts only unprepared fences, never accepted receipts. Both ingress gates remain false.') + feature['rules']['accepted_differences'].append('Gold-addon v2 / base Cube v2: positive intents persist and SQL credit follows verified DONE on clean FROZEN. Candidate non-party ground-gold pickup fsyncs outbox before removal, skips local credit/save, and retries exact bound enqueue/ACK. Frozen reply durably closes this source; only after every delivery ACK may its exact ordered event-ID manifest be sealed in SQL. Empty batches also need closure; new events after sealing are rejected and Resync/Release require matching seal plus completed credits. Real ingress remains disabled; trusted owner recovery, other mutations, ABORTED and actual crafting/image pipeline remain incomplete.') + feature['rules']['accepted_differences'].append('Owner-addon v1 candidate adds database-scoped connection lock and boot/connection generation, atomic fence+lease binding, trusted disconnect revocation and authenticated non-playing-account held adoption after exact original source/DONE/wallet checks. Adopted owners remain held; all registered owner rows block legacy release and ordinary loads/saves. No public recovery transport, owner-aware image/thaw or core-boot old-cache revocation is enabled.') + feature['rules']['accepted_differences'].append('Held adoption and ambiguous Retry proposals are now registered before returning, so repeated disconnect/logout/auth-record replacement can revoke them without a client ACK. Rejected commits reuse the same proposal cookie; durable non-ownership proof permits retiring only obsolete in-memory recovery slots. Peer/logout callbacks perform no SQL; a joint round-robin queue permits at most two revoke/finalize jobs per tick, with five-second failure backoff. This is pre-load lifecycle recovery, not restored gameplay or an absolute SQL latency guarantee.') + feature['rules']['accepted_differences'].append('Disabled internal header78 recovery preflight is wired before classic character load. Canonical RecoveryClaim=11/RecoveryAnswer=12 uses a 160-byte LE owner grant; only explicit unheld RecoveryClear allows one still-guarded classic load. Granted never loads/thaws. Game pins descriptor pointer/handshake/account/player/session and bounds retries; actual DB reply parser now permits GoldAck, GoldCloseAck and RecoveryAnswer as well as Answer, rejecting request-direction messages. Old core revocation and authoritative image restore remain incomplete; both gates stay false.') + feature['rules']['accepted_differences'].append('RecoveryImageRequest=13/Answer=14 now transports only gold+normal-inventory image, not full character restoration. Resync validates the current adopted grant inside the same account transaction, original sealed source, verified ok DONE and fixed-draw settlement, exact expected item bytes, all applied credits/current wallet even for zero credits, item locks/reservations. Previously issued owner image cannot be overwritten. Game validates item proto/grid and retains bytes without loading, applying, acknowledging or thawing; old core/full data/ACK release remain incomplete.') + feature['rules']['accepted_differences'].append('Disabled original-live-owner Prepare=15/Execute=16/CraftAnswer=17 now calls the actual durable backend with authorization inside the same account transaction/pinned SQL connection. Requires clean FROZEN, current LIVE grant and original exact sealed source; fixed DB entropy draws persist once, identity-only Execute/replay returns canonical CCR1 receipt. Actual actor Tick advances only after durable source-close ACK, validates receipt against batch/proto, bounds request retries and retains actor hold after completion. Batch/factory/permanent-ID construction, public craft action, local apply/ACK/thaw and full mutation audit remain incomplete.') + feature['status']['source'] = 'partially_verified' + feature['blockers'] = list(feature['rules']['unresolved']) for source in feature['source']: path = os.path.join(os.path.dirname(repo_root), source['path']) source['sha256'] = sha256_file(path) diff --git a/scripts/test_xxf_all.py b/scripts/test_xxf_all.py index 72ec88fa..ada65b42 100644 --- a/scripts/test_xxf_all.py +++ b/scripts/test_xxf_all.py @@ -21,16 +21,16 @@ MARKER = 'CH5_TEST_RESULT=' ASSOCIATIONS = { 'F01': ['test_feature_manifest', 'test_model_preview'], 'F02': ['test_queries', 'test_drops'], - 'F03': [], 'F04': [], 'F05': [], 'F06': [], 'F07': [], 'F08': [], - 'F09': ['test_special_storage', 'test_legacy_item_ids'], + 'F03': ['test_target_element'], 'F04': ['test_trade_level', 'test_trade_level_ui'], 'F05': [], 'F06': [], 'F07': [], 'F08': [], + 'F09': ['test_special_storage', 'test_legacy_item_ids', 'test_inventory_pages'], 'F10': ['test_channel', 'test_native_channel', 'test_ava2_channel_registry', 'test_live_endpoint'], 'F11': ['test_catalogue', 'test_chest', 'test_ava2_chest', 'test_pickup', 'test_ava2_pickup', 'test_drops', 'test_queries'], 'F12': ['test_attr_lock', 'test_attr_lock_snapshots', 'test_attr_lock_ui', 'test_attr_lock_use', 'test_attr_lock_views', 'test_switchbot', 'test_switchbot_matching'], 'F13': ['test_sash'], 'F14': ['test_pendant', 'test_applies'], 'F15': ['test_costume_slots', 'test_mount', 'test_product_costume_runtime', 'test_costume_products', 'test_costume_attr'], 'F16': ['test_shop_appearance'], 'F17': ['test_extended_items'], - 'F18': ['test_extended_items'], 'F19': ['test_quiver', 'test_quiver_runtime'], - 'F20': ['test_magic_reduction'], 'F21': ['test_cube_gold_debit'], + 'F18': ['test_extended_items'], 'F19': ['test_quiver', 'test_quiver_runtime', 'test_quiver_sync', 'test_quiver_motion', 'test_quiver_assets', 'test_quiver_staging'], + 'F20': ['test_magic_reduction'], 'F21': ['test_cube_gold_debit', 'test_cube_catalog', 'test_cube_batch', 'test_cube_fence', 'test_cube_db_guards', 'test_cube_runtime', 'test_sql_fence_router', 'test_cube_handshake', 'test_cube_mutation', 'test_cube_gold', 'test_cube_outbox', 'test_cube_source', 'test_cube_owner', 'test_cube_recovery', 'test_cube_image', 'test_cube_craft', 'test_cube_presentation', 'test_cube_restore', 'test_cube_resume'], 'F22': ['test_dragonsoul_alchemy'], 'F23': ['test_dragonsoul_alchemy'], 'F24': ['test_rank', 'test_rank_runtime'], 'F25': [], 'F26': ['test_ticket_shop', 'test_ava2_ticket_shop', 'test_gaya_market', 'test_gaya_runtime', 'test_gaya_catalog'], diff --git a/src/platform/ScriptLib/Ava2UICompatScript.inc b/src/platform/ScriptLib/Ava2UICompatScript.inc index f6d9a9da..4b8863f4 100644 --- a/src/platform/ScriptLib/Ava2UICompatScript.inc +++ b/src/platform/ScriptLib/Ava2UICompatScript.inc @@ -536,6 +536,10 @@ try: if getattr(app, 'ENABLE_LEVEL_IN_TRADE', 0) and getattr(self, 'TitleName', None): target_name = exchange.GetNameFromTarget() target_lvl = exchange.GetLevelFromTarget() + if not target_lvl: + # An old server did not supply START.arg3. Never display cached or fabricated Lv.0. + self.TitleName.SetText(target_name) + return title_fmt = getattr(localeInfo, 'EXCHANGE_TITLE', '%s (%d)') try: if '%' in title_fmt and title_fmt.count('%') >= 2: diff --git a/src/platform/ScriptLib/CubeRenewalScript.inc b/src/platform/ScriptLib/CubeRenewalScript.inc index 89a60ff4..559b4a7b 100644 --- a/src/platform/ScriptLib/CubeRenewalScript.inc +++ b/src/platform/ScriptLib/CubeRenewalScript.inc @@ -1,28 +1,153 @@ -// PORT: Modern Cube Renewal (F21) script module "cube_renewal". -// Provides data structures and entrypoints for uicuberenewal.py. +// PORT: server-backed modern Cube recipe preview, NOT a crafting backend. static const char c_szCubeRenewalScript[] = R"PY(# -*- coding: utf-8 -*- -_dates = [] -_handler = None +import game +import chat +import mt_feature_service +from mt_biolog import L -def CountDates(): - return len(_dates) +_dates=[] +_recipes=[] +_handler=None +_window=None +_epoch=0 +_npc=0 +_readonly=False +_last_preflight=None +_last_error=None +_check_serial=0 + +def CountDates():return len(_dates) def GetDates(index): - if 0 <= index < len(_dates): - return _dates[index] - # (vnum_reward, count_reward, item_reward_stackable, - # vnum_material_1..5, count_material_1..5, gold, percent, category) - return (0, 0, False, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "None") + if 0<=index=n*attempts for i,(v,n) in enumerate(recipe['materials'],1)) + if set(values)!=keys or values['gold_available']>2000000000000000 or bool(values['gold_ok'])!=(values['gold_available']>=values['gold_required']) or bool(values['materials_ok'])!=material_ok:_last_error='bad_preflight' + if not _last_error:_last_preflight=values + if callback:callback(_last_preflight,_last_error) + return service.Request('cubecheck',recipe['id'],attempts,receive) + +def CubeRenewalMakeItem(index_craft,count_item,index_improve=0): + # Original UI name; only our labeled preview can use it, for a read-only check. + if not _readonly:raise RuntimeError('Cube Renewal requires an implemented durable server crafting contract') + if index_improve not in (0,-1): + chat.AppendChat(chat.CHAT_TYPE_INFO,L('预检暂不支持成功率道具;未扣除材料。'));return 0 + def checked(result,error): + if error:chat.AppendChat(chat.CHAT_TYPE_INFO,L('配方预检失败,未扣料、未制作:')+str(error));return + chat.AppendChat(chat.CHAT_TYPE_INFO,L('只读预检:尝试 %d 次,需金币 %d;材料%s,金币%s。未预留背包、未扣料、未制作。')% + (result['attempts'],result['gold_required'],L('充足' if result['materials_ok'] else '不足'),L('充足' if result['gold_ok'] else '不足'))) + return CheckBatch(index_craft,count_item,checked) + +def OpenPreview(npc): + def loaded(rows,error): + global _window,_readonly,_last_error + if error: + if error!='unsupported':chat.AppendChat(chat.CHAT_TYPE_INFO,L('制作配方预览不可用:')+str(error)) + return + try: + if _window is None: + import uiCubeRenewal + _window=uiCubeRenewal.CubeRenewalWindows() + SetCubeRenewalHandler(_window) + _window.BINARY_CUBE_RENEWAL_LOADING() + _window.button_ok.SetText(L('批量预检')) + _window.slot_improve.Hide();_window.imporve_slot.Hide() + _window.SetCenterPosition();_window.Show();_readonly=True + except Exception: + _readonly=False;_last_error='cube_ui_unavailable';SetCubeRenewalHandler(None) + if _window:_window.Hide() + _window=None + chat.AppendChat(chat.CHAT_TYPE_INFO,L('现代制作界面资源不可用,保留原制作窗口;未扣料、未制作。')) + return + chat.AppendChat(chat.CHAT_TYPE_INFO,L('现代制作只读预览:当前不扣料、不发奖;原制作窗口保持不变。')) + return LoadCatalogue(npc,loaded) + +_open=game.GameWindow.BINARY_Cube_Open +_close=game.GameWindow.BINARY_Cube_Close +_game_close=game.GameWindow.Close +def Open(self,npc): + _open(self,npc);OpenPreview(npc) +def Close(self): + CubeRenewalClose();return _close(self) +def GameClose(self): + CubeRenewalClose();return _game_close(self) +game.GameWindow.BINARY_Cube_Open=Open +game.GameWindow.BINARY_Cube_Close=Close +game.GameWindow.Close=GameClose )PY"; diff --git a/src/platform/ScriptLib/FeatureServiceScript.inc b/src/platform/ScriptLib/FeatureServiceScript.inc index e63c5251..5a4ff47c 100644 --- a/src/platform/ScriptLib/FeatureServiceScript.inc +++ b/src/platform/ScriptLib/FeatureServiceScript.inc @@ -7,7 +7,7 @@ import ui import binascii from mt_wiki_data import Number -BITS={'mob':1,'chest':2,'stats':4,'sources':8,'dungeons':16,'calendar':32,'bosses':256,'travel':512,'rank':1024,'quiver':2048} +BITS={'mob':1,'chest':2,'stats':4,'sources':8,'dungeons':16,'calendar':32,'bosses':256,'travel':512,'rank':1024,'quiver':2048,'cube':4096,'cubecheck':4096} WHOLE=('stats','dungeons','bosses','quiver') # one reply with every row; no subject or page g_service=None g_tick=None @@ -33,6 +33,8 @@ class Service(object): callback(None,'invalid');return 0 if kind=='rank' and (subject>=10 or offset): callback(None,'invalid');return 0 + if kind in ('cube','cubecheck') and (not subject or (kind=='cubecheck' and not 1<=offset<=100)): + callback(None,'invalid');return 0 _serial=(_serial%2147483647)+1 self.queue.append(dict(id=_serial,kind=kind,subject=subject,offset=offset,callback=callback,retries=0)) return _serial @@ -84,16 +86,17 @@ class Service(object): elif op=='begin' and len(w)==9 and p['kind']!='cap': if 'result' in p or w[3]!=p['kind'] or Number(w[4])!=p['subject'] or Number(w[5])!=p['offset']: raise ValueError('mismatched response') - total=Number(w[6],10 if p['kind']=='rank' else 128 if p['kind'] in WHOLE else 256 if p['kind']=='calendar' else 4096) - if total=limit or Number(w[3])!=p['offset']+len(rows):raise ValueError('invalid row order') - if op=='row' and len(w)==12 and p['kind'] not in WHOLE+('calendar','rank'): + limit=result['total'] if p['kind'] in WHOLE+('rank','cubecheck') else min(8,result['total']-p['offset']) + base=0 if p['kind']=='cubecheck' else p['offset'] + if len(rows)>=limit or Number(w[3])!=base+len(rows):raise ValueError('invalid row order') + if op=='row' and len(w)==12 and p['kind'] not in WHOLE+('calendar','rank','cube','cubecheck'): values=[Number(v) for v in w[4:]] if values[2] not in (0,1,2,3,4,5,10,11,20,21) or not values[0]:raise ValueError('invalid row') rows.append(values) @@ -107,9 +110,25 @@ class Service(object): values=[Number(w[4]),Number(w[5]),Signed(w[6]),Signed(w[7])]+[Number(v) for v in w[8:]] if not values[0] or not values[1] or values[4]>255 or values[6]>255 or values[5]>values[6] or not values[8]:raise ValueError('invalid boss') rows.append(values) - elif op=='stat' and len(w)==6 and p['kind'] in ('stats','dungeons'): - if not w[4].replace('_','').isalpha() or len(w[4])>32 or any(r[0]==w[4] for r in rows):raise ValueError('invalid stat') + elif op=='stat' and len(w)==6 and p['kind'] in ('stats','dungeons','cubecheck'): + key=w[4].replace('_','') + if not (key.isalnum() if p['kind']=='cubecheck' else key.isalpha()) or len(w[4])>32 or any(r[0]==w[4] for r in rows):raise ValueError('invalid stat') rows.append((w[4],Signed(w[5]))) + elif op=='recipe' and p['kind']=='cube' and len(w)>=17: + count=Number(w[14],5) + if not count or len(w)!=15+count*2:raise ValueError('invalid recipe materials') + for token in w[5:7]: + if len(token)!=16 or any(c not in '0123456789abcdef' for c in token):raise ValueError('invalid recipe revision') + rid=Number(w[4],4096);reward=Number(w[7],4294967295);qty=Number(w[8],2000) + stack=Number(w[9],1);gold=Number(w[10],4294967295);chance=Number(w[11],100);copy=Number(w[12],1) + if not rid or not reward or not qty or (not stack and qty!=1):raise ValueError('invalid recipe reward') + if not 2<=len(w[13])<=48 or len(w[13])%2 or any(c not in '0123456789abcdef' for c in w[13]):raise ValueError('invalid recipe category') + category=binascii.unhexlify(w[13]).decode('ascii') + if not category.replace('_','').isalnum():raise ValueError('invalid recipe category') + materials=[(Number(w[i],4294967295),Number(w[i+1],2000)) for i in range(15,len(w),2)] + if any(not v or not n for v,n in materials) or len(set(v for v,n in materials))!=len(materials):raise ValueError('invalid recipe materials') + if any(r['id']==rid or r['catalogue']!=w[5] for r in rows):raise ValueError('mixed recipe snapshot') + rows.append(dict(id=rid,catalogue=w[5],revision=w[6],reward=reward,count=qty,stackable=bool(stack),gold=gold,percent=chance,copy=bool(copy),category=category,materials=materials)) elif op=='rank' and len(w)==7 and p['kind']=='rank': if not 2<=len(w[4])<=48 or len(w[4])%2 or any(c not in '0123456789abcdef' for c in w[4]):raise ValueError('invalid rank name') name=binascii.unhexlify(w[4]) @@ -119,7 +138,7 @@ class Service(object): rows.append((name,empire,value)) else:raise ValueError('invalid row format') elif op=='end' and len(w)==4 and 'result' in p: - result=p['result'];expected=result['total'] if p['kind'] in WHOLE+('rank',) else min(8,result['total']-p['offset']) + result=p['result'];expected=result['total'] if p['kind'] in WHOLE+('rank','cubecheck') else min(8,result['total']-p['offset']) if Number(w[3])!=expected or len(result['rows'])!=expected:raise ValueError('incomplete reply') if p['kind']=='dungeons': values=dict(result['rows']) @@ -129,9 +148,14 @@ class Service(object): weekly=('weekly_end','weekly_hunt_end','weekly_active','weekly_npc','weekly_map') if any(k in values for k in weekly) and any(k not in values or values[k]<0 for k in weekly):raise ValueError('incomplete weekly state') if values.get('weekly_active',0)>1:raise ValueError('invalid weekly state') + if p['kind']=='cubecheck': + values=dict(result['rows']) + required=('revision_hi','revision_lo','attempts','gold_required','gold_available','materials_ok','gold_ok','mutation_enabled','reward_maximum','capacity_reserved','copy_required') + if any(k not in values or values[k]<0 for k in required):raise ValueError('incomplete cube preflight') + if values['attempts']!=p['offset'] or values['revision_hi']>4294967295 or values['revision_lo']>4294967295 or values['mutation_enabled'] or values['capacity_reserved'] or values['materials_ok']>1 or values['gold_ok']>1 or values['copy_required']>1:raise ValueError('invalid cube preflight') self.Finish(result) else:raise ValueError('unknown response') - except (ValueError,TypeError,IndexError,OverflowError): + except (ValueError,TypeError,IndexError,OverflowError,UnicodeError): if p and self.pending is p: if p['kind']=='cap':self.mask=0;self.pending=None else:self.Finish(None,'bad_reply') diff --git a/src/platform/ScriptLib/InventoryPagesScript.inc b/src/platform/ScriptLib/InventoryPagesScript.inc index cc2aeeb4..0016d951 100644 --- a/src/platform/ScriptLib/InventoryPagesScript.inc +++ b/src/platform/ScriptLib/InventoryPagesScript.inc @@ -100,7 +100,7 @@ def _InstallScriptPatch(): def ExecFile(fileName, dict): execfile(fileName, dict) - if fileName.replace("\\", "/").split("/")[-1].lower() == "inventorywindow.py" and "window" in dict: + if fileName.replace("\\", "/").split("/")[-1].lower() in ("inventorywindow.py", "inventorywindowex.py") and "window" in dict: _PatchInventoryWindow(dict["window"]) ui.execfile = ExecFile @@ -126,6 +126,8 @@ def _InstallInventoryWindow(): dbg.TraceError("mt_inventory: cannot bind the page tabs") def SetInventoryPage(self, page): + if page < 0 or page >= PAGE_COUNT: + return self.inventoryPageIndex = page for i in xrange(len(self.inventoryTab)): if i != page: diff --git a/src/platform/ScriptLib/QuiverMotionScript.inc b/src/platform/ScriptLib/QuiverMotionScript.inc index ce123414..99b80872 100644 --- a/src/platform/ScriptLib/QuiverMotionScript.inc +++ b/src/platform/ScriptLib/QuiverMotionScript.inc @@ -3,7 +3,8 @@ static const char c_szQuiverMotionScript[] = R"PY( import chr import chrmgr import pack -import playersettingmodule +# Packed scripts import this case-sensitive Python module name during loading. +import playerSettingModule as playersettingmodule loaded={} FILES=(('MOTION_WAIT','wait.msa',70),('MOTION_WAIT','wait_1.msa',30), diff --git a/src/platform/ScriptLib/TargetElementScript.inc b/src/platform/ScriptLib/TargetElementScript.inc index 24905fca..14733eed 100644 --- a/src/platform/ScriptLib/TargetElementScript.inc +++ b/src/platform/ScriptLib/TargetElementScript.inc @@ -3,8 +3,9 @@ static const char c_szTargetElementScript[] = R"PY(# -*- coding: utf-8 -*- import app import chr import nonplayer +import pack import ui -import uitarget +import uiTarget as uitarget ELEMENTAL_PATH = "d:/ymir work/ui/game/12zi/element/{}.sub" @@ -24,9 +25,10 @@ def GetElementalFilename(mobVnum): if not mobVnum: return "" dwRaceFlag = nonplayer.GetMonsterRaceFlag(mobVnum) - for k, v in SUB_RACE_FLAG_TO_FILENAME.iteritems(): + # Deterministic single-icon compatibility policy: lowest known elemental flag first. + for k in sorted(SUB_RACE_FLAG_TO_FILENAME): if HAS_FLAG(dwRaceFlag, k): - return v + return SUB_RACE_FLAG_TO_FILENAME[k] return "" def _EnsureElementImage(targetBoard): @@ -44,11 +46,14 @@ def SetRaceElement(targetBoard, vid): if not mobVnum: mobVnum = chr.GetVirtualNumber(vid) imagePath = GetElementalFilename(mobVnum) - if imagePath: + if imagePath and pack.Exist(imagePath): try: elementImage.LoadImage(imagePath) elementImage.SetPosition(-elementImage.GetWidth(), 0) - elementImage.Show() + if elementImage.GetWidth() > 0: + elementImage.Show() + else: + elementImage.Hide() except Exception: elementImage.Hide() else: @@ -69,6 +74,10 @@ def Hooked_SetTargetVID(self, vid): uitarget.TargetBoard.SetEnemyVID = Hooked_SetEnemyVID uitarget.TargetBoard.SetTargetVID = Hooked_SetTargetVID +# The CH5 original SetEnemyVID invokes this method internally. Replace that unsafe +# loader as well, so a missing image cannot fail before the outer hook runs. +if hasattr(uitarget.TargetBoard, 'SetRaceElement'): + uitarget.TargetBoard.SetRaceElement = SetRaceElement if _orig_ResetTargetBoard: def Hooked_ResetTargetBoard(self): _orig_ResetTargetBoard(self) diff --git a/src/port/CMakeLists.txt b/src/port/CMakeLists.txt index 471f8222..0cac35a6 100644 --- a/src/port/CMakeLists.txt +++ b/src/port/CMakeLists.txt @@ -314,6 +314,15 @@ if(BUILD_TESTING AND CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME) add_test(NAME port.login_flow COMMAND $ ${MT_40250_CLIENT} ${MT_PYTHON_STDLIB_ZIP}) set_tests_properties(port.login_flow PROPERTIES SKIP_RETURN_CODE 77) + add_test(NAME port.quiver_sync + COMMAND $ ${MT_40250_CLIENT} ${MT_PYTHON_STDLIB_ZIP}) + set_tests_properties(port.quiver_sync PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT "MT_TEST_QUIVER=1") + add_test(NAME port.trade_level + COMMAND $ ${MT_40250_CLIENT} ${MT_PYTHON_STDLIB_ZIP}) + set_tests_properties(port.trade_level PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT "MT_TEST_TRADE_LEVEL=1") + add_test(NAME port.cube_catalog + COMMAND $ ${MT_40250_CLIENT} ${MT_PYTHON_STDLIB_ZIP}) + set_tests_properties(port.cube_catalog PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT "MT_TEST_CUBE=1") add_test(NAME port.autohunt_batch COMMAND $ ${MT_40250_CLIENT} ${MT_PYTHON_STDLIB_ZIP}) set_tests_properties(port.autohunt_batch PROPERTIES SKIP_RETURN_CODE 77 diff --git a/src/port/UserInterface/GameType.h b/src/port/UserInterface/GameType.h index 75c71317..6cacbfaa 100644 --- a/src/port/UserInterface/GameType.h +++ b/src/port/UserInterface/GameType.h @@ -412,7 +412,7 @@ typedef struct TPlayerItemAttribute typedef struct packet_item { DWORD vnum; - BYTE count; + DWORD count; // PORT: internal-only full count; classic wire structs remain BYTE. DWORD flags; DWORD anti_flags; LONG alSockets[ITEM_SOCKET_SLOT_MAX_NUM]; // PORT: LONG, the 32-bit Win32 long diff --git a/src/port/UserInterface/PythonApplicationModule.cpp b/src/port/UserInterface/PythonApplicationModule.cpp index 7fe67ef0..fa0e309f 100644 --- a/src/port/UserInterface/PythonApplicationModule.cpp +++ b/src/port/UserInterface/PythonApplicationModule.cpp @@ -1595,7 +1595,7 @@ void initapp() PyModule_AddIntConstant(poModule, "ENABLE_VIEW_TARGET_DECIMAL_HP", 1); PyModule_AddIntConstant(poModule, "ENABLE_VIEW_TARGET_PLAYER_HP", 1); PyModule_AddIntConstant(poModule, "ENABLE_WINDOW_SLIDE_EFFECT", 0); - // PORT: the Won exchange window binds the cheque slot, so it follows ENABLE_CHEQUE_SYSTEM (off). + // PORT: Won wallet/transactions are gated off; its dependent window must be off too. PyModule_AddIntConstant(poModule, "ENABLE_WON_EXCHANGE_WINDOW", 0); PyModule_AddIntConstant(poModule, "BL_MOVE_COSTUME_ATTR", 1); PyModule_AddIntConstant(poModule, "DISABLE_CHEQUE_DROP", 0); diff --git a/src/port/UserInterface/PythonExchange.cpp b/src/port/UserInterface/PythonExchange.cpp index fbb262f0..a1faedbb 100644 --- a/src/port/UserInterface/PythonExchange.cpp +++ b/src/port/UserInterface/PythonExchange.cpp @@ -23,12 +23,12 @@ char * CPythonExchange::GetNameFromTarget() void CPythonExchange::SetSelfLevel(DWORD level) { - m_self.level = level; + m_self.level = level >= 1 && level <= 255 ? level : 0; } void CPythonExchange::SetTargetLevel(DWORD level) { - m_victim.level = level; + m_victim.level = level >= 1 && level <= 255 ? level : 0; } DWORD CPythonExchange::GetLevelFromSelf() @@ -255,6 +255,9 @@ void CPythonExchange::Start() void CPythonExchange::End() { m_isTrading = false; + // PORT: snapshots belong to this trade only, not a future partner/session. + m_self.level = 0; + m_victim.level = 0; } bool CPythonExchange::isTrading() @@ -285,4 +288,4 @@ CPythonExchange::CPythonExchange() } CPythonExchange::~CPythonExchange() { -} \ No newline at end of file +} diff --git a/src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp b/src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp index 93700a75..8ab2dd38 100644 --- a/src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp +++ b/src/port/UserInterface/PythonNetworkStreamPhaseGame.cpp @@ -1910,6 +1910,8 @@ bool CPythonNetworkStream::RecvExchangePacket() CPythonExchange::Instance().Start(); CPythonExchange::Instance().SetSelfName(CPythonPlayer::Instance().GetName()); CPythonExchange::Instance().SetSelfLevel(CPythonPlayer::Instance().GetStatus(POINT_LEVEL)); + // PORT: START.arg3 is the server's partner-level snapshot; zero means legacy/unknown. + CPythonExchange::Instance().SetTargetLevel(exchange_packet.arg3); { CInstanceBase * pCharacterInstance = CPythonCharacterManager::Instance().GetInstancePtr(exchange_packet.arg1); @@ -1917,7 +1919,6 @@ bool CPythonNetworkStream::RecvExchangePacket() if (pCharacterInstance) { CPythonExchange::Instance().SetTargetName(pCharacterInstance->GetNameString()); - CPythonExchange::Instance().SetTargetLevel(pCharacterInstance->GetLevel()); } } @@ -4529,7 +4530,7 @@ bool CPythonNetworkStream::SendClientVersionPacket() kVersionPacket.header = HEADER_CG_CLIENT_VERSION2; strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1); // PORT: revision mt20261024 adds 64-bit shop prices, fixed offline records and 64-bit exchange/guild money; preserve the numeric prefix for atoi version checks. - strncpy(kVersionPacket.timestamp, "1215955205 mt20261024", sizeof(kVersionPacket.timestamp)-1); // # python time.time 앞자리 + strncpy(kVersionPacket.timestamp, "1215955205 mt20261025", sizeof(kVersionPacket.timestamp)-1); // PORT: revision25 adds full-count and Cube presentation companions. //strncpy(kVersionPacket.timestamp, __TIMESTAMP__, sizeof(kVersionPacket.timestamp)-1); // old_string_ver //strncpy(kVersionPacket.timestamp, "1218055205", sizeof(kVersionPacket.timestamp)-1); // new_future //strncpy(kVersionPacket.timestamp, "1214055205", sizeof(kVersionPacket.timestamp)-1); // old_past @@ -4543,7 +4544,7 @@ bool CPythonNetworkStream::SendClientVersionPacket() kVersionPacket.header = HEADER_CG_CLIENT_VERSION; strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1); // PORT: 64-bit money protocol requires mt20261024; older AVA2 services retain their own revision gates. - strncpy(kVersionPacket.timestamp, "mt20261024", sizeof(kVersionPacket.timestamp)-1); + strncpy(kVersionPacket.timestamp, "mt20261025", sizeof(kVersionPacket.timestamp)-1); // PORT: revision25 is backward-compatible with revision24 money. if (!Send(sizeof(kVersionPacket), &kVersionPacket)) Tracef("SendClientReportPacket Error"); diff --git a/src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp b/src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp index 25326418..28c17718 100644 --- a/src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp +++ b/src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp @@ -4,6 +4,7 @@ #include #include "PythonPlayer.h" #include "PythonSafeBox.h" +#include "../common/CubePresentation.h" bool CPythonNetworkStream::SendAva2DropQuery(BYTE subheader,LONG vnum) { if (!PORT_IsGamePhase() || (subheader!=0 && subheader!=1 && subheader!=6 && subheader!=7 && subheader!=8 && subheader!=9 && subheader!=10) || vnum<0)return false; @@ -32,6 +33,25 @@ bool CPythonNetworkStream::RecvAva2ItemShop() { if (!Recv(sizeof(p),&p) || p.size32768)return false; std::vector data(p.size-sizeof(p)); if (!Recv(data.size(),data.data()))return false; + if(uint8_t(data[0])==11) { + // PORT: full Cube presentation is validated before any player mutation. + PortCubeView::Frame frame; + if(!PortCubeView::Decode(std::string(data.begin(),data.end()),frame)||!CPythonPlayer::Instance().PORT_ApplyCubeView(frame))return false; + __RefreshInventoryWindow();__RefreshStatus();return true; + } + if(uint8_t(data[0])==12) { + // PORT: full count companion; classic byte-sized item packets stay intact. + if(data.size()!=83)return false;const std::string bytes(data.begin(),data.end());PortCubeView::Reader r{bytes};r.at=1; + const auto window=uint8_t(r.n(1));const auto cell=uint16_t(r.n(2));const auto vnum=uint32_t(r.n(4)),id=uint32_t(r.n(4));const auto count=uint16_t(r.n(2)); + if(!r.ok||!vnum||!id||!count||count>2000)return false;PortItemExtra extra;std::memcpy(&extra,bytes.data()+r.at,69); + TItemData* target=nullptr; + if(window==SAFEBOX){if(!CPythonSafeBox::Instance().GetItemDataPtr(cell,&target))return false;} + else if(window==MALL){if(!CPythonSafeBox::Instance().GetMallItemDataPtr(cell,&target))return false;} + else {TItemPos pos(window,cell);if(!pos.IsValidCell())return false;target=const_cast(CPythonPlayer::Instance().GetItemData(pos));} + if(!target||target->vnum!=vnum||(target->portId&&target->portId!=id))return true; // PORT: stale same-vnum companion cannot replace a newer identity. + target->count=count;target->portId=id;target->extra=extra; + if(window==SAFEBOX)__RefreshSafeboxWindow();else if(window==MALL)__RefreshMallWindow();else __RefreshInventoryWindow();return true; + } if(uint8_t(data[0])==10) { #pragma pack(push,1) struct Extra {uint8_t op,window;uint16_t cell;uint32_t vnum,id;PortItemExtra extra;}; diff --git a/src/port/UserInterface/PythonPlayer.cpp b/src/port/UserInterface/PythonPlayer.cpp index 7598fe16..809c7fb3 100644 --- a/src/port/UserInterface/PythonPlayer.cpp +++ b/src/port/UserInterface/PythonPlayer.cpp @@ -5,6 +5,7 @@ #include "../EterBase/Timer.h" #include "AbstractPlayer.h" +#include "../common/CubePresentation.h" enum { @@ -21,6 +22,8 @@ enum const DWORD POINT_MAGIC_NUMBER = 0xe73ac1da; +#include "PythonPlayerCubeView.inc" + void CPythonPlayer::SPlayerStatus::SetPoint(UINT ePoint, long lPoint) { m_alPoint[ePoint]=lPoint ^ POINT_MAGIC_NUMBER; @@ -750,7 +753,9 @@ DWORD CPythonPlayer::GetItemID(TItemPos Cell) const char* CPythonPlayer::GetItemNewName(TItemPos Cell) { const auto item=Cell.IsValidCell() ? GetItemData(Cell) : nullptr; - return item ? item->extra.name : ""; + // PORT: keep all69 authoritative bytes; expose only the 24 display bytes. + static thread_local char name[25];std::memset(name,0,sizeof(name)); + if(item)std::memcpy(name,item->extra.name,24);return name; } DWORD CPythonPlayer::GetItemMetinSocket(TItemPos Cell, DWORD dwMetinSocketIndex) @@ -1754,6 +1759,7 @@ void CPythonPlayer::ClearSkillDict() void CPythonPlayer::Clear() { + m_portCubeViewEpoch=0;m_portCubeViewBytes.clear(); // PORT: character/session boundary. memset(&m_playerStatus, 0, sizeof(m_playerStatus)); m_i64Gold = 0; NEW_ClearSkillData(true); diff --git a/src/port/UserInterface/PythonPlayer.h b/src/port/UserInterface/PythonPlayer.h index e82d1248..d0a41c7b 100644 --- a/src/port/UserInterface/PythonPlayer.h +++ b/src/port/UserInterface/PythonPlayer.h @@ -5,6 +5,7 @@ #include "PythonSkill.h" class CInstanceBase; +namespace PortCubeView {struct Frame;} /* * 메인 캐릭터 (자신이 조정하는 캐릭터) 가 가진 정보들을 관리한다. @@ -286,6 +287,7 @@ class CPythonPlayer : public CSingleton, public IAbstractPlayer void SetStatus(DWORD dwType, long lValue); int GetStatus(DWORD dwType); void SetGold64(int64_t gold); + bool PORT_ApplyCubeView(const PortCubeView::Frame&); void ChangeGold64(int64_t amount); int64_t GetGold64() const; bool IsConqueror() const { return const_cast(this)->GetStatus(POINT_CONQUEROR_LEVEL) >= 1; } @@ -629,6 +631,8 @@ class CPythonPlayer : public CSingleton, public IAbstractPlayer TPlayerStatus m_playerStatus; int64_t m_i64Gold; + uint64_t m_portCubeViewEpoch=0; // PORT: presentation replay guard, reset on player Clear. + std::string m_portCubeViewBytes; UINT m_iComboOld; DWORD m_dwVIDReserved; diff --git a/src/port/UserInterface/PythonPlayerCubeView.inc b/src/port/UserInterface/PythonPlayerCubeView.inc new file mode 100644 index 00000000..b450e04c --- /dev/null +++ b/src/port/UserInterface/PythonPlayerCubeView.inc @@ -0,0 +1,34 @@ +// PORT: one validated presentation commit; no Python callbacks while staging. +bool CPythonPlayer::PORT_ApplyCubeView(const PortCubeView::Frame& f) +{ + static_assert(QUICKSLOT_MAX_NUM==PortCubeView::Quickslots,"Cube quickslot contract"); + if(!PortCubeView::Valid(f))return false; + if(f.epoch staged{};std::array grid{}; + for(const auto& row:f.items) { + CItemData* proto=nullptr; + if(!CItemManager::Instance().GetItemDataPointer(row.vnum,&proto)||!proto)return false; + const auto size=proto->GetSize(); + if(size<1||size>3||(row.cell%45)/5+size>9||(!proto->IsFlag(CItemData::ITEM_FLAG_STACKABLE)&&row.count!=1))return false; + for(unsigned n=0;n=grid.size()||grid[at])return false;grid[at]=true;} + auto& item=staged[row.cell];item.vnum=row.vnum;item.count=row.count;item.portId=row.id;item.flags=row.flags;item.anti_flags=row.anti; + for(unsigned n=0;n<3;++n)item.alSockets[n]=row.sockets[n]; + for(unsigned n=0;n<7;++n){item.aAttr[n].bType=row.types[n];item.aAttr[n].sValue=row.values[n];} + static_assert(sizeof(item.extra)==69,"complete presentation metadata");std::memcpy(&item.extra,row.extra,69); + } + for(const auto& slot:f.quickslots) { + if(slot.type==SLOT_TYPE_INVENTORY) { + bool valid=slot.cell=c_Belt_Inventory_Slot_Start&&slot.cell=SKILL_MAX_NUM)return false; + } + for(unsigned cell=0;cellextra.name); + return Py_BuildValue("s#", pInstance->extra.name,int(strnlen(pInstance->extra.name,24))); // PORT: raw metadata need not be NUL-terminated. } PyObject * safeboxGetItemCount(PyObject * poSelf, PyObject * poArgs) diff --git a/src/port/common/CubePresentation.h b/src/port/common/CubePresentation.h new file mode 100644 index 00000000..3a9f64e6 --- /dev/null +++ b/src/port/common/CubePresentation.h @@ -0,0 +1,69 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include + +// PORT: GC93 bounded LE presentation only. Never a craft request or thaw ACK. +namespace PortCubeView { +constexpr unsigned Slots=225,Quickslots=36,Maximum=32768; +constexpr int64_t GoldLimit=2000000000000000LL; +struct Quickslot {uint8_t type=0;uint16_t cell=0;}; +inline bool operator==(const Quickslot& a,const Quickslot& b){return a.type==b.type&&a.cell==b.cell;} +struct Item { + uint16_t cell=0,count=0;uint32_t id=0,vnum=0,flags=0,anti=0; + int32_t sockets[3]={};uint8_t types[7]={};int16_t values[7]={};uint8_t extra[69]={}; +}; +struct Frame {uint64_t epoch=0,gold=0;std::vector items;std::array quickslots={};}; +inline bool Valid(const Frame& f) { + if(!f.epoch||f.gold>uint64_t(GoldLimit)||f.items.size()>Slots)return false; + int last=-1;std::set ids; + for(const auto& i:f.items)if(i.cell>=Slots||int(i.cell)<=last||!i.id||!i.vnum||!i.count||i.count>2000||!ids.insert(i.id).second)return false;else last=i.cell; + for(const auto& q:f.quickslots)if(q.type>3||(!q.type&&q.cell))return false; + return true; +} +struct Writer {std::string bytes;void n(uint64_t v,unsigned width){for(unsigned j=0;j>(8*j));}}; +struct Reader {const std::string& bytes;size_t at=0;bool ok=true;uint64_t n(unsigned width){if(at+width>bytes.size()){ok=false;return 0;}uint64_t v=0;for(unsigned j=0;j(i.extra),69); + } + return w.bytes.size()+5<=Maximum?w.bytes:std::string{}; +} +inline bool Decode(const std::string& bytes,Frame& out) { + out={};if(bytes.size()<132||bytes.size()+5>Maximum||uint8_t(bytes[0])!=11||bytes.substr(1,4)!="CCP1")return false; + Reader r{bytes};r.at=5;Frame f;f.epoch=r.n(8);f.gold=r.n(8);const auto count=r.n(2); + if(count>Slots||r.n(1)!=Quickslots||bytes.size()!=132+122*count)return false; + for(auto& q:f.quickslots){q.type=uint8_t(r.n(1));q.cell=uint16_t(r.n(2));} + for(unsigned j=0;j& before,const Frame& after,const std::array& original,std::array& result) { + if(!Valid(after))return false;std::set cells;std::set ids; + for(const auto& i:before)if(i.cell>=Slots||!i.id||!cells.insert(i.cell).second||!ids.insert(i.id).second)return false; + auto plan=original; + for(auto& q:plan) { + if(q.type>3||(!q.type&&q.cell))return false;if(q.type!=1||q.cell>=Slots)continue; + const auto old=std::find_if(before.begin(),before.end(),[&](const Item& i){return i.cell==q.cell;}); + const auto next=old==before.end()?after.items.end():std::find_if(after.items.begin(),after.items.end(),[&](const Item& i){return i.id==old->id;}); + if(next==after.items.end())q={};else q.cell=next->cell; + } + result=plan;return true; +} +inline std::string Packet(const Frame& f){const auto body=Encode(f);if(body.empty())return {};Writer w;w.n(93,1);w.n(body.size()+5,4);return w.bytes+body;} +} diff --git a/tests/port/port_login_flow_server.cpp b/tests/port/port_login_flow_server.cpp index d93a559b..3ef249bf 100644 --- a/tests/port/port_login_flow_server.cpp +++ b/tests/port/port_login_flow_server.cpp @@ -481,7 +481,7 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) auto main = zeroed(); main.header = HDR_GC_MAIN_CHARACTER; main.vid = kMainVID; - main.race = 0; + main.race = std::getenv("MT_TEST_QUIVER_MOTION") ? 1 : 0; std::strncpy(main.name, kCharacterName, sizeof(main.name) - 1); main.x = kX; main.y = kY; @@ -525,7 +525,7 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) actor.x = kX; actor.y = kY; actor.type = 6; // CHAR_TYPE_PC (common/length.h ECharType) - actor.race = 0; // warrior male + actor.race = std::getenv("MT_TEST_QUIVER_MOTION") ? 1 : 0; // opt-in female archer actor.moving_speed = 100; actor.attack_speed = 100; GCCharAddInfo info = zeroed(); @@ -534,11 +534,13 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) std::strncpy(info.name, kCharacterName, sizeof(info.name) - 1); info.empire = 1; info.level = 10; + if (std::getenv("MT_TEST_QUIVER_MOTION")) info.parts[1]=2000; GCCharacterUpdate update = zeroed(); update.header = HDR_GC_CHARACTER_UPDATE; update.vid = kMainVID; update.moving_speed = 100; update.attack_speed = 100; + if (std::getenv("MT_TEST_QUIVER_MOTION")) update.parts[1]=2000; if (!c.Send(actor) || !c.Send(info) || !c.Send(update)) return Fail(name + ": send main actor"); @@ -747,6 +749,7 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) if (mobile_fixture && !item_set(2, 19)) return Fail(name + ": mobile weapon fixture"); int quest_page = 0; // the quest dialogue's last page sent (1 question, 2 next, 3 done) bool safebox_open = false; + unsigned trade_starts=0; std::uint32_t safebox0 = kSafeboxItemVnum; std::int32_t safebox_gold = kSafeboxMoney; // CQuestManager::SendScript: packet_script {header, size, skin, src_size} and the script text. @@ -875,6 +878,10 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) { out.subheader = EXCHANGE_GC_START; out.arg1 = ex.arg1; + if(std::getenv("MT_TEST_TRADE_LEVEL")) { + const std::uint32_t levels[]={87,0,999,31}; + out.arg3=levels[(trade_starts++)%4]; + } ok = c.Send(out); out.subheader = EXCHANGE_GC_ITEM_ADD; out.arg1 = kExchangeItemVnum; @@ -942,7 +949,21 @@ bool FakeLoginServer::ServeGame(Connection& c, int index) return c.Send(chat)&&c.Send(cmd.c_str(),cmd.size()+1); }; const std::string r=std::to_string(request); - if(kind=="cap") {if(!reply("MTF1 cap "+r+" 1 "+(std::getenv("MT_TEST_QUIVER")?"2111":"63")+" 1700000000"))return Fail(name+": feature cap");} + if(kind=="cap") {if(!reply("MTF1 cap "+r+" 1 "+(std::getenv("MT_TEST_CUBE")?"4159":std::getenv("MT_TEST_QUIVER")?"2111":"63")+" 1700000000"))return Fail(name+": feature cap");} + else if(kind=="cube" && std::getenv("MT_TEST_CUBE")) { + if(!reply("MTF1 begin "+r+" cube 20383 0 1 0 1700000000")|| + !reply("MTF1 recipe "+r+" 0 1 1111111111111111 2222222222222222 19 1 0 100 50 0 574f524c44415244 1 30006 1")|| + !reply("MTF1 end "+r+" 1"))return Fail(name+": cube catalogue"); + } + else if(kind=="cubecheck" && std::getenv("MT_TEST_CUBE")) { + std::vector> rows={{"revision_hi",0x22222222},{"revision_lo",0x22222222}, + {"attempts",offset},{"gold_required",int64_t(offset)*100},{"gold_available",1000},{"materials_ok",1}, + {"gold_ok",1},{"mutation_enabled",0},{"reward_maximum",offset},{"capacity_reserved",0},{"copy_required",0}, + {"material1",30006},{"needed1",offset},{"available1",offset}}; + if(!reply("MTF1 begin "+r+" cubecheck "+std::to_string(subject)+" "+std::to_string(offset)+" "+std::to_string(rows.size())+" 0 1700000000"))return Fail(name+": cube preflight begin"); + for(unsigned i=0;iGetArrowType()):-1;}; CHECK(pump_until(8,[&] {return type()==9 || failed();})); CHECK(type()==9 && !failed()); + if (std::getenv("MT_TEST_QUIVER_MOTION")) { + CHECK(py("import app\nassert not app.ENABLE_CHEQUE_SYSTEM and not app.ENABLE_WON_EXCHANGE_WINDOW")); + // Do not call Register here: loading-phase registration itself must have worked. + CHECK(py("import mt_quiver_motion\nassert mt_quiver_motion.loaded == {1: True, 5: True}")); + CHECK(py("_bag=_stream.curPhaseWindow.interface.wndInventory\nassert len(_bag.inventoryTab)==5\n_bag.SetInventoryPage(4)\nassert _bag.GetInventoryPageIndex()==4\n_bag.SetInventoryPage(0)")); + for (DWORD raceID:{1u,5u}) { + CRaceData* race=nullptr;CRaceMotionData* motion=nullptr; + CHECK(CRaceManager::Instance().GetRaceDataPointer(raceID,&race)); + if(race) { + CHECK(race->GetMotionDataPointer(CRaceMotionData::MODE_BOW_SPECIAL, + CRaceMotionData::NAME_COMBO_ATTACK_1,0,&motion)); + CHECK(motion); + if(motion) { + bool found=false; + for(DWORD i=0;iGetMotionEventDataCount();++i) { + const CRaceMotionData::TMotionEventData* event=nullptr; + CHECK(motion->GetMotionEventDataPointer(BYTE(i),&event)); + if(event && event->iType==CRaceMotionData::MOTION_EVENT_TYPE_FLY) { + auto* fly=static_cast(event); + CHECK(fly->strFlyFileName=="d:/ymir work/pc/assassin/effect/arrow_02.msf"); + CHECK(fly->dwFlyIndex!=0); + CFlyingData data;CHECK(data.LoadScriptFile(fly->strFlyFileName.c_str())); + found=true; + } + } + CHECK(found); + } + } + } + auto* actor=CPythonCharacterManager::Instance().GetInstancePtr(FakeLoginServer::kMainVID); + CHECK(actor && actor->HasQuiverMotion()); + if(actor)CHECK(actor->GetGraphicThingInstancePtr()->GetMotionMode()==CRaceMotionData::MODE_BOW_SPECIAL); + } for (int expected:{6,0,9}) { CHECK(py("net.SendChatPacket('/quiver_test "+std::to_string(expected)+"')")); CHECK(pump_until(5,[&] {return type()==expected || failed();})); CHECK(type()==expected && !failed()); + if(std::getenv("MT_TEST_QUIVER_MOTION")) { + auto* actor=CPythonCharacterManager::Instance().GetInstancePtr(FakeLoginServer::kMainVID); + CHECK(actor); + if(actor)CHECK(actor->GetGraphicThingInstancePtr()->GetMotionMode()== + (expected==9?CRaceMotionData::MODE_BOW_SPECIAL:CRaceMotionData::MODE_BOW)); + } } CHECK(py("import app\napp.Exit()")); pump_until(2,[] {return !PythonBoot::IsAppLooping();}); @@ -460,6 +499,73 @@ int main(int argc, char** argv) std::printf("quiver negotiated packet fixture: %s\n",g_failures?"FAILED":"PASS"); return g_failures?1:0; } + if (server && std::getenv("MT_TEST_TRADE_LEVEL")) { + if(std::getenv("MT_TEST_TARGET_ELEMENT")) { + CHECK(py("import game, uiTarget, mt_target_element as _element, nonplayer\n" + "_board=_stream.curPhaseWindow.targetBoard\n" + "assert game.uiTarget is uiTarget, 'game target module differs'\n" + "assert type(_board).SetEnemyVID.im_func is _element.Hooked_SetEnemyVID, 'target hook not installed'\n" + "_race_flag=nonplayer.GetMonsterRaceFlag\n" + "try:\n" + " for _bit,_name in enumerate(('elect','fire','ice','wind','earth','dark'),11):\n" + " nonplayer.GetMonsterRaceFlag=lambda race,bit=_bit:1<0\n" + " nonplayer.GetMonsterRaceFlag=lambda race:0\n" + " _board.SetEnemyVID("+std::to_string(FakeLoginServer::kMobVID)+")\n" + " assert not _board.elementImage.IsShow()\n" + " _board.SetTargetVID("+std::to_string(FakeLoginServer::kMainVID)+")\n" + " assert not _board.elementImage.IsShow()\n" + " _board.ResetTargetBoard()\n" + " assert not _board.elementImage.IsShow()\n" + "finally:\n nonplayer.GetMonsterRaceFlag=_race_flag")); + } + for(int expected:{87,0,0,31}) { + CHECK(py("import net\nnet.SendExchangeStartPacket("+std::to_string(FakeLoginServer::kMainVID)+")")); + CHECK(pump_until(3,[] {return CPythonExchange::Instance().isTrading();})); + CHECK(CPythonExchange::Instance().GetLevelFromSelf()==10); + CHECK(CPythonExchange::Instance().GetLevelFromTarget()==DWORD(expected)); + CHECK(py("import exchange\n_trade=_stream.curPhaseWindow.interface.dlgExchange\nassert _trade.IsShow()\n_title=_trade.TitleName.GetText()\n"+ + (expected?"assert '"+std::to_string(expected)+"' in _title":"assert _title==exchange.GetNameFromTarget()"))); + CHECK(py("net.SendExchangeExitPacket()")); + CHECK(pump_until(3,[] {return !CPythonExchange::Instance().isTrading();})); + CHECK(CPythonExchange::Instance().GetLevelFromTarget()==0 && CPythonExchange::Instance().GetLevelFromSelf()==0); + } + CHECK(!failed()); + CHECK(py("import app\napp.Exit()")); + pump_until(2,[] {return !PythonBoot::IsAppLooping();});PythonBoot::Stop(); + std::printf("trade authoritative level fixture: %s\n",g_failures?"FAILED":"PASS"); + return g_failures?1:0; + } + if (server && std::getenv("MT_TEST_CUBE")) { + // PORT: opt-in verification of the merged CH5/AVA2 pack overlay and + // the real CPythonResource PNG factory, not a header-only decoder. + if(std::getenv("MT_TEST_CH5_PACKS")) { + CHECK(py("import grpImage, item\n" + "for _pack_png, _pack_dims in [('cream/pages/page_1_down.png',(26,26)),('d:/ymir work/ui/game/battle_pass/gauge/gauge_bpass.png',(16,8))]:\n" + " _pack_image=grpImage.Generate(_pack_png)\n" + " try:\n" + " assert (grpImage.GetWidth(_pack_image),grpImage.GetHeight(_pack_image))==_pack_dims\n" + " finally:\n" + " grpImage.Delete(_pack_image)\n" + "for _pack_vnum, _pack_type in [(6884,18),(11300,2),(19529,36)]:\n" + " item.SelectItem(_pack_vnum)\n" + " assert item.GetItemType()==_pack_type and item.GetItemSubType()==0, (_pack_vnum,item.GetItemType(),item.GetItemSubType())\n")); + } + CHECK(py("import cube_renewal, app, player\nassert not app.ENABLE_CUBE_RENEWAL_WORLDARD\n_cube_gold=player.GetElk()\n_cube_materials=player.GetItemCountByVnum(30006)\ncube_renewal.LoadCatalogue(20383)")); + CHECK(pump_until(8,[] {return py_true("cube_renewal.CountDates()==1");})); + CHECK(py("assert cube_renewal.GetDates(0)==(19,1,False,30006,1,0,0,0,0,0,0,0,0,100,50,'WORLDARD')")); + if(std::getenv("MT_TEST_CUBE_LAYOUT")) { + CHECK(py("_stream.curPhaseWindow.BINARY_Cube_Open(20383)")); + CHECK(pump_until(8,[] {return py_true("cube_renewal._window is not None and cube_renewal._window.IsShow() and cube_renewal._readonly");})); + CHECK(py("cube_renewal.CubeRenewalMakeItem(0,3)")); + } else CHECK(py("cube_renewal.CheckBatch(0,3)")); + CHECK(pump_until(8,[] {return py_true("cube_renewal._last_preflight is not None");})); + CHECK(py("assert cube_renewal._last_error is None\nassert cube_renewal._last_preflight['gold_required']==300\nassert cube_renewal._last_preflight['mutation_enabled']==0\nassert player.GetElk()==_cube_gold\nassert player.GetItemCountByVnum(30006)==_cube_materials\nassert cube_renewal.CheckBatch(0,101)==0\ncube_renewal.CubeRenewalClose()\nassert cube_renewal.CountDates()==0\napp.Exit()")); + pump_until(2,[] {return !PythonBoot::IsAppLooping();});PythonBoot::Stop(); + std::printf("cube read-only catalogue/preflight fixture: %s\n",g_failures?"FAILED":"PASS");return g_failures?1:0; + } if (server && std::getenv("MT_TEST_AUTOHUNT_BATCH")) { CHECK(CPythonPlayer::Instance().NEW_GetMainActorPtr()); CHECK(CPythonCharacterManager::Instance().GetInstancePtr(FakeLoginServer::kMobVID)); diff --git a/tests/port/port_solution_b_verify_test.cpp b/tests/port/port_solution_b_verify_test.cpp index eaef26a3..bd5c395f 100644 --- a/tests/port/port_solution_b_verify_test.cpp +++ b/tests/port/port_solution_b_verify_test.cpp @@ -126,7 +126,22 @@ int main(int argc, char** argv) CHECK(fourcc == MAKEFOURCC('M', 'I', 'P', 'X')); CHECK(version == 1); CHECK(stride == 156); - CHECK(elements == 11545); + // PORT: the original CH5 pack has 11545 records; a verified AVA2 + // overlay may add records. Keep an explicit expectation, never accept + // any count merely because the current pack happens to contain it. + const char* expected_count = std::getenv("MT_TEST_EXPECT_ITEM_COUNT"); + unsigned expected_elements = 11545; + if (expected_count) { + unsigned parsed = 0; + bool valid = *expected_count != '\0'; + for (const unsigned char* p = reinterpret_cast(expected_count); *p && valid; ++p) { + if (*p < '0' || *p > '9' || parsed > (UINT32_MAX - (*p - '0')) / 10) valid = false; + else parsed = parsed * 10 + (*p - '0'); + } + CHECK(valid && parsed > 0); + if (valid && parsed > 0) expected_elements = parsed; + } + CHECK(elements == expected_elements); std::printf("[PASS] XXF Chinese item_proto loaded: %u bytes, FourCC=MIPX, elements=%u, stride=%u\n", item_proto_xxf.Size(), elements, stride); } diff --git a/tests/wiki/test_cube_catalog.py b/tests/wiki/test_cube_catalog.py new file mode 100644 index 00000000..85264c57 --- /dev/null +++ b/tests/wiki/test_cube_catalog.py @@ -0,0 +1,93 @@ +"""Run the real modern Cube controller with explicit transport/UI substitutes.""" +from pathlib import Path +import sys +import types +import unittest +from unittest.mock import patch + +ROOT=Path(__file__).resolve().parents[2] + + +class CubeCatalogueTests(unittest.TestCase): + def setUp(self): + self.requests=[];self.replies=[] + mods={n:types.ModuleType(n) for n in ('game','chat','mt_feature_service','mt_biolog')} + mods['game'].GameWindow=type('GameWindow',(),dict(BINARY_Cube_Open=lambda s,n:None,BINARY_Cube_Close=lambda s:None,Close=lambda s:None)) + mods['chat'].CHAT_TYPE_INFO=1;mods['chat'].AppendChat=lambda *a:None + mods['mt_biolog'].L=lambda text:text + class Service: + def Request(service,*args):self.requests.append(args);return len(self.requests) + mods['mt_feature_service'].g_service=Service() + raw=(ROOT/'src/platform/ScriptLib/CubeRenewalScript.inc').read_text() + self.ns={} + with patch.dict(sys.modules,mods):exec(raw.split('R"PY(',1)[1].rsplit(')PY";',1)[0],self.ns) + + def row(self,i=1,revision='2222222222222222',catalogue='1111111111111111'): + return dict(id=i,catalogue=catalogue,revision=revision,reward=19,count=1,stackable=False, + gold=100,percent=50,copy=False,category='WORLDARD',materials=[(30006,2)]) + + def page(self,rows,total=None,offset=0): + self.requests[-1][3](dict(rows=rows,total=len(rows) if total is None else total,offset=offset),None) + + def load(self): + self.ns['LoadCatalogue'](20383,lambda d,e:self.replies.append((d,e))) + self.page([self.row()]) + + def result(self,**changes): + values=dict(revision_hi=0x22222222,revision_lo=0x22222222,attempts=3,gold_required=300, + gold_available=1000,materials_ok=1,gold_ok=1,mutation_enabled=0,capacity_reserved=0, + reward_maximum=3,copy_required=0,material1=30006,needed1=6,available1=6) + values.update(changes);return dict(rows=list(values.items())) + + def test_no_partial_catalogue_and_exact_original_tuple(self): + self.ns['LoadCatalogue'](20383) + self.page([self.row(i) for i in range(1,9)],9) + self.assertEqual(self.ns['CountDates'](),0) + self.page([self.row(9)],9,8) + self.assertEqual(self.ns['CountDates'](),9) + self.assertEqual(self.ns['GetDates'](0),(19,1,False,30006,2,0,0,0,0,0,0,0,0,100,50,'WORLDARD')) + + def test_mixed_pages_and_stale_callback_never_commit(self): + self.ns['LoadCatalogue'](20383) + self.page([self.row(i) for i in range(1,9)],9) + self.page([self.row(9,catalogue='aaaaaaaaaaaaaaaa')],9,8) + self.assertEqual(self.ns['CountDates'](),0) + self.ns['LoadCatalogue'](20383);callback=self.requests[-1][3] + self.ns['CubeRenewalClose']();callback(dict(rows=[self.row()],total=1,offset=0),None) + self.assertEqual(self.ns['CountDates'](),0) + + def test_missing_ui_preserves_classic_without_enabling_crafting(self): + self.ns['OpenPreview'](20383) + with patch.dict(sys.modules,{'uiCubeRenewal':None}):self.page([self.row()]) + self.assertEqual(self.ns['_last_error'],'cube_ui_unavailable') + self.assertFalse(self.ns['_readonly']) + self.assertIsNone(self.ns['_handler']) + self.assertIsNone(self.ns['_window']) + + def test_preflight_is_read_only_and_revision_bound(self): + self.load();self.ns['CheckBatch'](0,3,lambda d,e:self.replies.append((d,e))) + self.assertEqual(self.requests[-1][:3],('cubecheck',1,3)) + self.requests[-1][3](self.result(),None);self.assertIsNone(self.replies[-1][1]) + for update in (dict(revision_lo=1),dict(gold_required=301),dict(materials_ok=0),dict(available1=5),dict(extra=1)): + self.ns['CheckBatch'](0,3,lambda d,e:self.replies.append((d,e))) + self.requests[-1][3](self.result(**update),None) + self.assertIsNone(self.replies[-1][0]);self.assertIsNotNone(self.replies[-1][1]) + with self.assertRaises(RuntimeError):self.ns['CubeRenewalMakeItem'](0,3) + self.ns['_readonly']=True;self.ns['CubeRenewalMakeItem'](0,3) + self.assertTrue(all(r[0] in ('cube','cubecheck') for r in self.requests)) + + def test_newer_check_or_closed_window_discards_old_reply(self): + self.load();self.ns['CheckBatch'](0,3);old=self.requests[-1][3] + self.ns['CheckBatch'](0,4);old(self.result(),None) + self.assertIsNone(self.ns['_last_preflight']) + latest=self.requests[-1][3];self.ns['CubeRenewalClose']();latest(self.result(attempts=4),None) + self.assertIsNone(self.ns['_last_preflight']) + self.load();self.ns['CheckBatch'](0,3);self.requests[-1][3](self.result(),None) + self.assertIsNotNone(self.ns['_last_preflight']) + self.ns['LoadCatalogue'](20384) + self.assertIsNone(self.ns['_last_preflight']) + self.assertEqual(self.ns['CheckBatch'](0,3),0) + self.assertEqual(self.ns['_last_error'],'invalid') + + +if __name__=='__main__':unittest.main() diff --git a/tests/wiki/test_cube_presentation.py b/tests/wiki/test_cube_presentation.py new file mode 100644 index 00000000..f5a51e13 --- /dev/null +++ b/tests/wiki/test_cube_presentation.py @@ -0,0 +1,100 @@ +"""Real presentation codec/player/receiver/publisher bodies; explicit platform boundaries.""" +import re +import subprocess +import tempfile +import unittest +from pathlib import Path + +ROOT=Path(__file__).resolve().parents[2] +SERVER=ROOT.parent/'metin2-server' + +class CubePresentation(unittest.TestCase): + def run_cpp(self,source): + with tempfile.TemporaryDirectory() as folder: + cpp=Path(folder)/'view.cpp';exe=Path(folder)/'view';cpp.write_text(source) + subprocess.run(['c++','-std=c++17','-fsanitize=address,undefined','-fno-sanitize-recover=all','-I'+str(ROOT),'-I'+str(SERVER),str(cpp),'-o',str(exe)],check=True) + subprocess.run([str(exe)],check=True) + + def test_codec_and_permanent_id_shortcuts(self): + self.assertEqual((ROOT/'src/port/common/CubePresentation.h').read_bytes(),(SERVER/'src/server/common/cube_presentation.h').read_bytes()) + self.run_cpp(r''' +#include "src/port/common/CubePresentation.h" +#include +#include +using namespace PortCubeView; +int main(){Frame f;f.epoch=UINT64_MAX;f.gold=GoldLimit;Frame decoded;auto bytes=Encode(f);assert(bytes.size()==132&&Decode(bytes,decoded)); + for(unsigned n=0;n<225;++n){Item row;row.cell=n;row.id=n+1;row.vnum=100;row.count=2000;row.sockets[0]=INT32_MIN;row.types[0]=255;row.values[0]=INT16_MIN;row.extra[68]=255;f.items.push_back(row);} + bytes=Encode(f);assert(bytes.size()==27582&&Decode(bytes,decoded)&&decoded.items[224].count==2000&&decoded.items[0].sockets[0]==INT32_MIN&&decoded.items[0].values[0]==INT16_MIN&&decoded.items[0].extra[68]==255); + for(size_t n=0;n before(2);before[0].id=10;before[0].cell=0;before[1].id=11;before[1].cell=224; + std::array original{},result{};original[0]={1,0};original[1]={1,224};original[2]={2,7};original[3]={3,32000};original[4]={1,300};original[5]={1,22}; + assert(Rebind(before,after,original,result)&&result[0].type==0&&result[1].cell==224&&result[2]==original[2]&&result[3]==original[3]&&result[4]==original[4]&&!result[5].type); + after.items[1].cell=17;assert(Rebind(before,after,original,result)&&result[1].cell==17);const auto saved=result;before[1].id=10;assert(!Rebind(before,after,original,result)&&result==saved); + puts("PASS canonical bounded LE codec, complete2000 counts/metadata, all truncations; consumed shortcuts never rebind to reward occupying same cell");} +''') + + def test_actual_player_commit_and_receive(self): + apply=(ROOT/'src/port/UserInterface/PythonPlayerCubeView.inc').read_text() + receive=(ROOT/'src/port/UserInterface/PythonNetworkStreamPhaseGameAva2Queries.cpp').read_text().split('bool CPythonNetworkStream::RecvAva2ItemShop()',1)[1] + receive='bool CPythonNetworkStream::RecvAva2ItemShop()'+receive + self.run_cpp(r''' +#include "src/port/common/CubePresentation.h" +#include "src/port/common/PortItemExtra.h" +#include +#include +using BYTE=uint8_t;using DWORD=uint32_t; +constexpr unsigned INVENTORY=1,SAFEBOX=3,MALL=4,SLOT_TYPE_INVENTORY=1,SLOT_TYPE_SKILL=2,QUICKSLOT_MAX_NUM=36,SKILL_MAX_NUM=255,c_ItemSlot_Count=225; +struct TItemPos{unsigned window_type,cell;TItemPos(unsigned w,unsigned c):window_type(w),cell(c){}bool IsValidCell(){return window_type==INVENTORY&&cell<400;}}; +struct TItemData{uint32_t vnum=0,count=0,flags=0,anti_flags=0,portId=0;int32_t alSockets[3]={};struct Attr{uint8_t bType=0;int16_t sValue=0;}aAttr[7];PortItemExtra extra{};}; +struct CItemData{enum{ITEM_FLAG_STACKABLE=4};unsigned size=1;bool stack=true;unsigned GetSize(){return size;}bool IsFlag(unsigned){return stack;}}; +struct CItemManager{static CItemManager& Instance(){static CItemManager m;return m;}bool GetItemDataPointer(unsigned v,CItemData** p){static CItemData normal,tall{3,false};if(v==999)return false;*p=v==200?&tall:&normal;return true;}}; +struct CPythonPlayer {struct Status{TItemData aItem[400];struct Quick{uint8_t Type=0;uint16_t Position=0;}aQuickSlot[36];int page=7;}m_playerStatus;uint64_t m_portCubeViewEpoch=0;std::string m_portCubeViewBytes;int64_t gold=50; + static CPythonPlayer& Instance(){static CPythonPlayer p;return p;}bool PORT_ApplyCubeView(const PortCubeView::Frame&);void SetGold64(int64_t v){gold=v;}const TItemData* GetItemData(TItemPos p){return &m_playerStatus.aItem[p.cell];}}; +struct CPythonSafeBox{TItemData safe,mall;static CPythonSafeBox& Instance(){static CPythonSafeBox b;return b;}bool GetItemDataPtr(unsigned cell,TItemData** p){*p=&safe;return cell<10;}bool GetMallItemDataPtr(unsigned cell,TItemData** p){*p=&mall;return cell<10;}}; +#pragma pack(push,1) +struct TPacketGCAva2Events{uint8_t header;uint32_t size;}; +#pragma pack(pop) +unsigned pythonCalls=0;void* Py_BuildValue(const char*,...){return nullptr;}void PyCallClassMemberFunc(void*,const char*,void*){++pythonCalls;}constexpr unsigned PHASE_WINDOW_GAME=0; +struct CPythonNetworkStream{std::string input;size_t at=0;unsigned inventory=0,status=0,safe=0,mall=0;void* m_apoPhaseWnd[1]={};bool Recv(size_t n,void* out){if(at+n>input.size())return false;std::memcpy(out,input.data()+at,n);at+=n;return true;}bool RecvAva2ItemShop();void __RefreshInventoryWindow(){++inventory;}void __RefreshStatus(){++status;}void __RefreshSafeboxWindow(){++safe;}void __RefreshMallWindow(){++mall;}bool receive(const std::string& wire){input=wire;at=0;return RecvAva2ItemShop();}}; +'''+apply+receive+r''' +int main(){auto& p=CPythonPlayer::Instance();p.m_playerStatus.aItem[225].vnum=888;PortCubeView::Frame f;f.epoch=3;f.gold=PortCubeView::GoldLimit;PortCubeView::Item row;row.id=9;row.cell=5;row.vnum=100;row.count=2000;row.sockets[0]=-123;row.types[0]=255;row.values[0]=-32768;row.extra[68]=255;f.items.push_back(row);f.quickslots[0]={1,5};f.quickslots[1]={2,7}; + CPythonNetworkStream n;assert(n.receive(PortCubeView::Packet(f))&&p.m_playerStatus.aItem[5].count==2000&&p.m_playerStatus.aItem[225].vnum==888&&p.m_playerStatus.page==7&&p.gold==PortCubeView::GoldLimit&&p.m_playerStatus.aQuickSlot[0].Position==5&&reinterpret_cast(&p.m_playerStatus.aItem[5].extra)[68]==255&&n.inventory==1&&n.status==1&&!pythonCalls); + p.m_playerStatus.aItem[5].count=1999;p.gold=100;assert(n.receive(PortCubeView::Packet(f))&&p.m_playerStatus.aItem[5].count==1999&&p.gold==100);auto conflict=f;conflict.items[0].count=1;assert(!n.receive(PortCubeView::Packet(conflict))&&p.m_playerStatus.aItem[5].count==1999);conflict=f;conflict.epoch=2;assert(n.receive(PortCubeView::Packet(conflict))&&p.gold==100); + auto invalid=f;invalid.epoch=4;invalid.items[0].vnum=999;assert(!n.receive(PortCubeView::Packet(invalid))&&p.m_portCubeViewEpoch==3&&p.gold==100);invalid=f;invalid.epoch=4;invalid.quickslots[0].cell=22;assert(!n.receive(PortCubeView::Packet(invalid))&&p.m_playerStatus.aItem[5].count==1999); + invalid=f;invalid.epoch=4;invalid.items[0].vnum=200;invalid.items[0].count=1;auto overlap=invalid.items[0];overlap.cell=10;overlap.id=10;invalid.items.push_back(overlap);assert(!n.receive(PortCubeView::Packet(invalid))&&p.m_portCubeViewEpoch==3); + PortCubeView::Writer w;w.n(93,1);w.n(88,4);w.n(12,1);w.n(1,1);w.n(5,2);w.n(100,4);w.n(9,4);w.n(2000,2);std::string extra(69,'\0');extra[68]=char(255);w.bytes+=extra; + assert(n.receive(w.bytes)&&p.m_playerStatus.aItem[5].count==2000&&reinterpret_cast(&p.m_playerStatus.aItem[5].extra)[68]==255);auto stale=w.bytes;stale[13]=char(10);stale[17]=1;stale[18]=0;assert(n.receive(stale)&&p.m_playerStatus.aItem[5].count==2000&&p.m_playerStatus.aItem[5].portId==9);assert(!n.receive(w.bytes.substr(0,w.bytes.size()-1)));auto zero=w.bytes;zero[17]=zero[18]=0;assert(!n.receive(zero)&&p.m_playerStatus.aItem[5].count==2000); + puts("PASS actual client atomic player install and GC93 receiver:2000 count, gold64, metadata, quickslots, untouched gear/page, missing proto/grid/shortcut rejection, duplicate/stale no rollback, count companion and malformed refusal; explicit platform/proto boundaries");} +''') + + def test_actual_server_publication_and_count_companion(self): + publisher=re.sub(r'^#include[^\n]*\n','',(SERVER/'src/server/game/src/port_cube_publish.cpp').read_text(),flags=re.M) + item=(SERVER/'src/server/game/src/item.cpp').read_text() + extra='void PortItemExtraSend('+item.split('void PortItemExtraSend(',1)[1].split('\nvoid CItem::SendPortExtra()',1)[0] + self.run_cpp(r''' +#include "src/server/common/cube_presentation.h" +#include "src/server/common/cube_image.h" +#include +#include +#include +#include +using BYTE=uint8_t;using WORD=uint16_t;constexpr unsigned QUICKSLOT_MAX_NUM=36,INVENTORY=1,PHASE_GAME=1,ITEM_FLAG_STACKABLE=4; +struct PortItemExtra{uint8_t bytes[69]={};};struct CHARACTER; +struct Desc{std::string wire,version="mt20261025";bool fail=false,game=true;bool IsPhase(unsigned){return game;}const char* GetClientVersion(){return version.c_str();}void Packet(const void* p,size_t n){if(fail)throw std::runtime_error("enqueue");wire.assign(static_cast(p),n);}}; +struct CItem{CHARACTER* owner=nullptr;PortEconomy::Reward value;unsigned cell=0;PortItemExtra extra;struct Attr{uint8_t bType;int16_t sValue;}attrs[7]={};unsigned GetID(){return value.id;}unsigned GetVnum(){return value.vnum;}unsigned GetOriginalVnum(){return value.vnum;}unsigned GetCount(){return value.count;}unsigned GetFlag(){return 4;}unsigned GetAntiFlag(){return 0;}CHARACTER* GetOwner(){return owner;}unsigned GetWindow(){return 1;}unsigned GetCell(){return cell;}bool PortCubeIsTemplate(){return false;}int32_t GetSocket(unsigned n){return value.sockets[n];}Attr* GetAttributes(){return attrs;}const PortItemExtra& GetPortExtra(){return extra;}}; +struct CHARACTER{Desc desc;int64_t gold=700;CItem* items[225]={};struct Quick{uint8_t type=0;uint16_t pos=0;}m_quickslot[36];Desc* GetDesc(){return &desc;}int64_t GetGold(){return gold;}CItem* GetInventoryItem(unsigned cell){return items[cell];}bool PortCubePublishFrame(const PortCubeView::Frame&,const PortCubeView::Frame&);}; +bool held=true;bool PortCubeActorHeld(CHARACTER*){return held;}struct Proto{unsigned bSize=1,dwFlags=4;};struct ITEM_MANAGER{static ITEM_MANAGER& instance(){static ITEM_MANAGER m;return m;}const Proto* GetTable(unsigned){static Proto p;return &p;}}; +'''+publisher+extra+r''' +int main(){CHARACTER ch;PortCube::Batch b;b.epoch=9;PortCube::Item old;old.cell=0;old.value.id=10;b.inventory.push_back(old);old.cell=224;old.value.id=11;b.inventory.push_back(old); + CItem a,c;a.owner=c.owner=&ch;a.cell=0;c.cell=224;a.value.id=100;c.value.id=11;a.value.vnum=c.value.vnum=100;a.value.count=2000;c.value.count=2;a.extra.bytes[68]=255; + ch.items[0]=&a;ch.items[224]=&c;PortCube::InventoryImage image;image.gold=700;for(auto* item:{&a,&c}){PortCube::Item row;row.cell=item->cell;row.value=item->value;std::memcpy(row.value.extra,&item->extra,69);image.items.push_back(row);}const auto bytes=PortCube::EncodeInventoryImage(image); + std::array slots{};slots[0]={1,0};slots[1]={1,224};slots[2]={2,7};for(unsigned n=0;n<36;++n){ch.m_quickslot[n].type=slots[n].type;ch.m_quickslot[n].pos=slots[n].cell;} + ch.desc.version="mt20261024";assert(!PortCubePublishAuthoritative(&ch,b,bytes,slots)&&ch.desc.wire.empty()&&ch.m_quickslot[0].type==1);ch.desc.version="mt20261025"; + ch.desc.fail=true;try{PortCubePublishAuthoritative(&ch,b,bytes,slots);assert(false);}catch(const std::runtime_error&){}assert(ch.m_quickslot[0].type==0);ch.desc.fail=false; + assert(PortCubePublishAuthoritative(&ch,b,bytes,slots)&&ch.m_quickslot[0].type==0&&ch.m_quickslot[1].pos==224&&ch.m_quickslot[2].pos==7);PortCubeView::Frame f;assert(PortCubeView::Decode(ch.desc.wire.substr(5),f)&&f.items[0].count==2000&&f.items[0].extra[68]==255); + const auto saved=ch.desc.wire;a.value.count=1999;assert(!PortCubePublishAuthoritative(&ch,b,bytes,slots)&&ch.desc.wire==saved);a.value.count=2000;ch.m_quickslot[2].pos=8;assert(!PortCubePublishAuthoritative(&ch,b,bytes,slots));ch.m_quickslot[2].pos=7;held=false;assert(!PortCubePublishAuthoritative(&ch,b,bytes,slots));held=true; + PortItemExtraSend(&ch,&a,1,0);assert(ch.desc.wire.size()==88&&uint8_t(ch.desc.wire[5])==12&&uint8_t(ch.desc.wire[17])==208&&uint8_t(ch.desc.wire[18])==7);ch.desc.version="mt20261022";PortItemExtraSend(&ch,&a,1,0);assert(ch.desc.wire.size()==86&&uint8_t(ch.desc.wire[5])==10); + puts("PASS actual held server publisher/count companion: deterministic ID shortcut plan, one complete view enqueue, legacy revision refusal/fallback, raw69/count2000, pending save/event state untouched, enqueue failure retry and current-data/shortcut refusal; explicit actor/descriptor/item boundaries");} +''') + +if __name__=='__main__':unittest.main() diff --git a/tests/wiki/test_feature_manifest.py b/tests/wiki/test_feature_manifest.py index 6b8b711c..98eff5d6 100644 --- a/tests/wiki/test_feature_manifest.py +++ b/tests/wiki/test_feature_manifest.py @@ -1,7 +1,10 @@ """Prevent generated migration inventory from manufacturing completion evidence.""" import importlib.util +import builtins +import io from pathlib import Path import unittest +from unittest.mock import patch ROOT=Path(__file__).resolve().parents[2] spec=importlib.util.spec_from_file_location('ch5_manifest', ROOT/'scripts/build_xxf_features_json.py') @@ -10,6 +13,21 @@ spec.loader.exec_module(manifest) class ManifestTests(unittest.TestCase): + def test_generated_cube_lifecycle_and_release_notes_survive_initialization(self): + def opened(path,mode='r',*args,**kwargs): + if 'w' in mode: + return io.StringIO() + return builtins.open(path,mode,*args,**kwargs) + with patch.object(manifest,'open',side_effect=opened,create=True), patch.object(manifest.json,'dump') as dump: + manifest.main() + features=dump.call_args[0][0]['features'] + cube=next(row for row in features if row['id']=='F21') + notes='\n'.join(cube['rules']['accepted_differences']) + self.assertIn('paused-event preparation',notes) + self.assertIn('NO runtime caller pending authenticated DB resume',notes) + self.assertIn('LiveReleased stops SQL retries',notes) + self.assertEqual(cube['status']['release'],'not_released') + def test_historical_status_is_not_current_acceptance(self): record=manifest.make_record('F21','Cube',[], 'dual','port_team',[], dict(unresolved=['durable batch progress missing']),[],{},None,{}, diff --git a/tests/wiki/test_inventory_pages.py b/tests/wiki/test_inventory_pages.py new file mode 100644 index 00000000..0036a7c2 --- /dev/null +++ b/tests/wiki/test_inventory_pages.py @@ -0,0 +1,48 @@ +"""Exercise both classic and CH5 extended layout interception without rewriting packed scripts.""" +import copy +from pathlib import Path +import sys +import types +import unittest +from unittest.mock import patch + +ROOT=Path(__file__).resolve().parents[2] + + +class InventoryPageTests(unittest.TestCase): + def load(self): + mods={n:types.ModuleType(n) for n in ('constInfo','player','ui','uiInventory','uiselectitem','item')} + mods['player'].INVENTORY_PAGE_COUNT=5 + mods['player'].EQUIPMENT_SLOT_START=225 + raw=(ROOT/'src/platform/ScriptLib/InventoryPagesScript.inc').read_text() + code=raw.split('R"PY(',1)[1].rsplit(')PY";',1)[0].rsplit('__Install()',1)[0] + ns={'xrange':range} + with patch.dict(sys.modules,mods):exec(code,ns) + return ns,mods + + def test_classic_and_extended_loaders_both_generate_five_tabs(self): + for name,count,slot in [('InventoryWindow.py',2,90),('InventoryWindowEx.py',4,225)]: + with self.subTest(name=name): + ns,mods=self.load() + tabs=[dict(name='Inventory_Tab_%02d'%(i+1),y=224) for i in range(count)] + template=dict(name='InventoryWindow',children=[dict(name='board',children=[ + dict(name='EquipmentSlot',slot=[dict(index=slot)]),*tabs])]) + mods['ui'].execfile=lambda file,d:d.update(window=copy.deepcopy(template)) + ns['_InstallScriptPatch']() + out={};mods['ui'].execfile('UIScript/'+name,out) + ns['_PatchInventoryWindow'](out['window']) # idempotent on repeated patch + board=out['window']['children'][0] + self.assertEqual([x['name'] for x in board['children'] if x['name'].startswith('Inventory_Tab_')], + ['Inventory_Tab_%02d'%(i+1) for i in range(5)]) + self.assertEqual(ns['_Find'](out['window'],'EquipmentSlot')['slot'][0]['index'],225) + + def test_unrelated_layout_not_changed(self): + ns,mods=self.load() + template=dict(name='other',children=[]) + mods['ui'].execfile=lambda file,d:d.update(window=copy.deepcopy(template)) + ns['_InstallScriptPatch']() + out={};mods['ui'].execfile('UIScript/ShopWindow.py',out) + self.assertEqual(out['window'],template) + + +if __name__=='__main__':unittest.main() diff --git a/tests/wiki/test_quiver_motion.py b/tests/wiki/test_quiver_motion.py new file mode 100644 index 00000000..45a66d90 --- /dev/null +++ b/tests/wiki/test_quiver_motion.py @@ -0,0 +1,60 @@ +"""Run the installed motion wrapper with explicit registration/pack substitutes.""" +from pathlib import Path +import sys +import types +import re +from unittest.mock import patch +import unittest + +ROOT = Path(__file__).resolve().parents[2] + + +class QuiverMotionTests(unittest.TestCase): + def test_disabled_wallet_also_disables_dependent_window(self): + source=(ROOT/'src/port/UserInterface/PythonApplicationModule.cpp').read_text() + for name in ('ENABLE_CHEQUE_SYSTEM','ENABLE_WON_EXCHANGE_WINDOW'): + values=re.findall(r'PyModule_AddIntConstant\(poModule,\s*"'+name+r'",\s*(\d+)\)',source) + self.assertEqual(values,['0']) + + def load(self, missing=None): + names = ['chr', 'chrmgr', 'pack', 'playerSettingModule'] + mods = {n: types.ModuleType(n) for n in names} + calls = [] + chr = mods['chr'] + chr.MOTION_MODE_BOW_SPECIAL = 19 + for i, n in enumerate(['MOTION_WAIT', 'MOTION_WALK', 'MOTION_RUN', 'MOTION_DAMAGE', + 'MOTION_DAMAGE_BACK', 'MOTION_COMBO_ATTACK_1']): + setattr(chr, n, i) + for n in ['SelectRace', 'SetPathName', 'RegisterMotionMode', 'RegisterCacheMotionData', + 'ReserveComboAttackNew', 'RegisterComboAttackNew']: + setattr(mods['chrmgr'], n, lambda *args, n=n: calls.append((n, args))) + mods['pack'].Exist = lambda p: p != missing + setting = mods['playerSettingModule'] + setting.RACE_ASSASSIN_W = 1 + setting.RACE_ASSASSIN_M = 5 + setting.LoadGameData = lambda n: calls.append(('original', (n,))) or 7 + raw = (ROOT / 'src/platform/ScriptLib/QuiverMotionScript.inc').read_text() + ns = {} + with patch.dict(sys.modules, mods): + exec(raw.split('R"PY(', 1)[1].rsplit(')PY";', 1)[0], ns) + return setting, ns, calls + + def test_original_loader_and_complete_both_sexes(self): + setting, ns, calls = self.load() + self.assertEqual(setting.LoadGameData('WARRIOR'), 7) + self.assertEqual(calls, [('original', ('WARRIOR',))]) + self.assertEqual(setting.LoadGameData('ASSASSIN'), 7) + self.assertEqual(ns['loaded'], {1: True, 5: True}) + self.assertEqual(sum(n == 'RegisterCacheMotionData' for n, _ in calls), 18) + self.assertEqual([a for n, a in calls if n == 'RegisterComboAttackNew'], + [(19, 0, 0, 5), (19, 0, 0, 5)]) + + def test_missing_motion_does_not_register_partial_mode(self): + setting, ns, calls = self.load('d:/ymir work/pc/assassin/bow/attack_special.msa') + setting.LoadGameData('ASSASSIN') + self.assertEqual(ns['loaded'], {1: False, 5: True}) + self.assertEqual([a for n, a in calls if n == 'SelectRace'], [(5,)]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/wiki/test_service.py b/tests/wiki/test_service.py index 773682c6..cbccbea5 100644 --- a/tests/wiki/test_service.py +++ b/tests/wiki/test_service.py @@ -193,5 +193,41 @@ class ServiceTests(unittest.TestCase): self.s.Request('delete',0,0,lambda d,e:self.replies.append((d,e))) self.assertEqual(self.replies[-1],(None,'invalid')) + def test_cube_recipe_and_read_only_preflight(self): + self.s.mask=4096;rid=self.request('cube',20383) + self.s.Receive('MTF1 begin %d cube 20383 0 1 0 1700000000'%rid) + self.s.Receive('MTF1 recipe %d 0 1 1111111111111111 2222222222222222 19 1 0 4294967295 50 1 574f524c44415244 1 30006 2'%rid) + self.assertFalse(self.replies) + self.s.Receive('MTF1 end %d 1'%rid) + row=self.replies[-1][0]['rows'][0] + self.assertEqual(row['gold'],4294967295);self.assertEqual(row['materials'],[(30006,2)]) + values=dict(revision_hi=1,revision_lo=2,attempts=100,gold_required=429496729500,gold_available=500000000000, + materials_ok=1,gold_ok=1,mutation_enabled=0,reward_maximum=100,capacity_reserved=0,copy_required=1) + rid=self.request('cubecheck',1,100) + self.s.Receive('MTF1 begin %d cubecheck 1 100 %d 0 1700000000'%(rid,len(values))) + for i,(k,v) in enumerate(values.items()):self.s.Receive('MTF1 stat %d %d %s %d'%(rid,i,k,v)) + self.s.Receive('MTF1 end %d %d'%(rid,len(values))) + self.assertIsNone(self.replies[-1][1]);self.assertEqual(dict(self.replies[-1][0]['rows']),values) + + def test_cube_malformed_snapshots_and_mutation_claims_reject(self): + self.s.mask=4096 + good='MTF1 recipe {r} 0 1 1111111111111111 2222222222222222 19 1 0 100 50 0 574f524c44415244 1 30006 2' + for bad in [good.replace('2222222222222222','xyz'),good.replace('30006 2','30006 0'), + good.replace(' 1 30006 2',' 2 30006 2'),good.replace('574f524c44415244','ff'), + good.replace(' 100 50 0 ',' 100 101 0 ')]: + rid=self.request('cube',20383) + self.s.Receive('MTF1 begin %d cube 20383 0 1 0 1'%rid);self.s.Receive(bad.format(r=rid)) + self.assertEqual(self.replies[-1],(None,'bad_reply')) + for attempts in (0,101): + self.s.Request('cubecheck',1,attempts,lambda d,e:self.replies.append((d,e))) + self.assertEqual(self.replies[-1],(None,'invalid')) + values=dict(revision_hi=1,revision_lo=2,attempts=1,gold_required=100,gold_available=100, + materials_ok=1,gold_ok=1,mutation_enabled=1,reward_maximum=1,capacity_reserved=0,copy_required=0) + rid=self.request('cubecheck',1,1) + self.s.Receive('MTF1 begin %d cubecheck 1 1 %d 0 1'%(rid,len(values))) + for i,(k,v) in enumerate(values.items()):self.s.Receive('MTF1 stat %d %d %s %d'%(rid,i,k,v)) + self.s.Receive('MTF1 end %d %d'%(rid,len(values))) + self.assertEqual(self.replies[-1],(None,'bad_reply')) + if __name__=='__main__':unittest.main() diff --git a/tests/wiki/test_target_element.py b/tests/wiki/test_target_element.py new file mode 100644 index 00000000..7e65f17f --- /dev/null +++ b/tests/wiki/test_target_element.py @@ -0,0 +1,67 @@ +"""Exercise the actual target wrapper on the same case-sensitive module used by game.py.""" +from pathlib import Path +import sys +import types +import unittest +from unittest.mock import patch + +ROOT=Path(__file__).resolve().parents[2] + + +class TargetElementTests(unittest.TestCase): + def setUp(self): + self.mods={n:types.ModuleType(n) for n in ('app','chr','nonplayer','pack','ui','uiTarget')} + self.flags=0;self.available=True;self.fail_image=False + test=self + class Image: + def SetParent(self,p):self.parent=p + def Hide(self):self.visible=False + def Show(self):self.visible=True + def GetWidth(self):return 16 + def SetPosition(self,x,y):self.position=(x,y) + def LoadImage(self,p): + if test.fail_image:raise RuntimeError('missing image') + self.path=p + class Board: + def SetTargetVID(self,v):self.vid=v + def SetEnemyVID(self,v):self.SetTargetVID(v);self.SetRaceElement(v) + def SetRaceElement(self,v):raise AssertionError('unsafe CH5 loader must be replaced') + def ResetTargetBoard(self):self.vid=0 + self.mods['ui'].ImageBox=Image + self.mods['uiTarget'].TargetBoard=Board + self.mods['pack'].Exist=lambda p:self.available + self.mods['nonplayer'].GetVnumByVID=lambda vid:101 if vid else 0 + self.mods['nonplayer'].GetMonsterRaceFlag=lambda race:self.flags if race else 0 + self.mods['chr'].GetVirtualNumber=lambda vid:0 + for i,name in enumerate(('ELEC','FIRE','ICE','WIND','EARTH','DARK'),11): + setattr(self.mods['nonplayer'],'RACE_FLAG_ATT_'+name,1< +#include +#include +#include +using BYTE=uint8_t;using DWORD=uint32_t;using int64_t=std::int64_t; +enum {CHARACTER_NAME_MAX_LEN=24,ITEM_SOCKET_SLOT_MAX_NUM=3,ITEM_ATTRIBUTE_SLOT_MAX_NUM=7,POINT_LEVEL=1,PHASE_WINDOW_GAME=0}; +struct TPlayerItemAttribute{BYTE bType;short sValue;}; +templatestruct CSingleton{static T& Instance(){static T value;return value;}}; +HEADER +STORE +struct CPythonPlayer:CSingleton{int level=10;const char* GetName(){return "self";}int GetStatus(int){return level;}}; +// No GetLevel(): compilation would fail if the receiver reused a stale actor cache again. +struct CInstanceBase{const char* GetNameString(){return "partner";}}; +struct CPythonCharacterManager:CSingleton{CInstanceBase actor;bool known=true; + CInstanceBase* GetInstancePtr(int64_t vid){return known&&vid==123?&actor:nullptr;}}; +int opened=0;void* Py_BuildValue(const char*){return nullptr;} +void PyCallClassMemberFunc(void*,const char* name,void*){assert(std::strcmp(name,"StartExchange")==0);++opened;} +struct Packet{int64_t arg1;DWORD arg3;}; +void ReceiveStart(Packet exchange_packet){void* m_apoPhaseWnd[1]={nullptr};do {START}while(false);} +int main(){ + auto& ex=CPythonExchange::Instance(); + ex.SetTargetLevel(1);assert(ex.GetLevelFromTarget()==1);ex.SetTargetLevel(255);assert(ex.GetLevelFromTarget()==255); + for(DWORD bad:{0u,256u,UINT_MAX}){ex.SetTargetLevel(bad);assert(ex.GetLevelFromTarget()==0);} + ReceiveStart({123,87});assert(ex.isTrading()&&ex.GetLevelFromSelf()==10&&ex.GetLevelFromTarget()==87); + assert(std::strcmp(ex.GetNameFromTarget(),"partner")==0); + ex.SetElkToSelf(900);ex.SetItemToSelf(0,19,1); + CPythonPlayer::Instance().level=11;assert(ex.GetLevelFromSelf()==10); // opening snapshot + ex.End();assert(!ex.isTrading()&&ex.GetLevelFromSelf()==0&&ex.GetLevelFromTarget()==0); + ReceiveStart({123,0});assert(ex.GetLevelFromTarget()==0&&ex.GetLevelFromSelf()==11); // legacy, never cached actor level + assert(ex.GetElkFromSelf()==0&&ex.GetItemVnumFromSelf(0)==0); + ReceiveStart({123,999});assert(ex.GetLevelFromTarget()==0); + CPythonCharacterManager::Instance().known=false;ReceiveStart({123,99}); + assert(ex.GetLevelFromTarget()==99&&ex.GetNameFromTarget()[0]==0); // level is not resolved by display name + assert(opened==4);ex.End(); +} +'''.replace('HEADER',header).replace('STORE',store).replace('START',start) + code=code.replace('#include ','#include \n#include ') + with tempfile.TemporaryDirectory() as folder: + p=Path(folder);(p/'probe.cpp').write_text(code) + subprocess.run(['c++','-std=c++17','-fsanitize=address,undefined','-fno-sanitize-recover=all', + str(p/'probe.cpp'),'-o',str(p/'probe')],check=True) + subprocess.run([str(p/'probe')],check=True) + + +if __name__=='__main__':unittest.main() diff --git a/tests/wiki/test_trade_level_ui.py b/tests/wiki/test_trade_level_ui.py new file mode 100644 index 00000000..be5fc36f --- /dev/null +++ b/tests/wiki/test_trade_level_ui.py @@ -0,0 +1,41 @@ +"""The installed title wrapper must hide unknown levels and survive both locale formats.""" +from pathlib import Path +import sys +import types +import unittest +from unittest.mock import patch + +ROOT=Path(__file__).resolve().parents[2] + + +class TradeLevelUITests(unittest.TestCase): + def run_case(self, level, fmt): + modules={n:types.ModuleType(n) for n in ('uiExchange','exchange','localeInfo','app')} + class Text: + def SetText(self,s):self.text=s + class Dialog: + def __init__(self):self.TitleName=Text();self.opened=0 + def OpenDialog(self):self.opened+=1;self.TitleName.SetText('old title') + modules['uiExchange'].ExchangeDialog=Dialog + modules['exchange'].GetNameFromTarget=lambda:'player%name' + modules['exchange'].GetLevelFromTarget=lambda:level + modules['localeInfo'].EXCHANGE_TITLE=fmt + modules['app'].ENABLE_LEVEL_IN_TRADE=1 + raw=(ROOT/'src/platform/ScriptLib/Ava2UICompatScript.inc').read_text() + code='try:\n import uiExchange'+raw.split('try:\n import uiExchange',1)[1].split('try:\n import introselect',1)[0] + with patch.dict(sys.modules,modules):exec(code,{}) + dialog=Dialog();dialog.OpenDialog();self.assertEqual(dialog.opened,1) + return dialog.TitleName.text + + def test_known_level_classic_and_ch5_format(self): + self.assertEqual(self.run_case(87,'%s trading'),'player%name (Lv.87)') + self.assertEqual(self.run_case(87,'%s (%d)'),'player%name (87)') + + def test_unknown_level_is_not_fabricated(self): + self.assertEqual(self.run_case(0,'%s (%d)'),'player%name') + + def test_bad_locale_format_does_not_break_open(self): + self.assertEqual(self.run_case(87,'%d %d'),'player%name') + + +if __name__=='__main__':unittest.main() diff --git a/tools/server/ava2-items/QUIVER.md b/tools/server/ava2-items/QUIVER.md index cb449cee..7ee02e3e 100644 --- a/tools/server/ava2-items/QUIVER.md +++ b/tools/server/ava2-items/QUIVER.md @@ -41,6 +41,8 @@ python3 tools/server/ava2-items/make_quiver.py \ 测试: +可追加 `--with-motion-assets` 解析46条动作/特效闭包,仅补入当前包缺失的两份AVA2特殊MSA。使用 `stage_quiver_client.py` 生成私有测试客户端,不手改正式Index。步骤、当前验证及限制见[状态与动作记录](../../../docs/XXF-CH5-QUIVER-SYNC-20261022.md)。 + ```sh python3 -m unittest discover -s tools/server/ava2-items/tests ``` diff --git a/tools/server/ava2-items/quiver_assets.py b/tools/server/ava2-items/quiver_assets.py index 93cc0421..c82e4e04 100644 --- a/tools/server/ava2-items/quiver_assets.py +++ b/tools/server/ava2-items/quiver_assets.py @@ -13,6 +13,8 @@ def dependencies(path,raw): out=[] for value in REFERENCE.findall(raw): name=value.decode('ascii').lower().replace('\\','/') + if name.startswith('/') or (':' in name and not name.startswith('d:/ymir work/')): + raise ValueError('invalid quiver dependency: '+name) if not name.startswith(('d:/','sound/','icon/')): name=posixpath.dirname(path)+'/'+name name=posixpath.normpath(name) diff --git a/tools/server/ava2-items/stage_quiver_client.py b/tools/server/ava2-items/stage_quiver_client.py new file mode 100644 index 00000000..c3b6a466 --- /dev/null +++ b/tools/server/ava2-items/stage_quiver_client.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Create a private quiver test client, leaving the registered production assets untouched.""" +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import subprocess +import tempfile + + +def digest(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def stage(base, candidate, output, packer): + base, candidate, output, packer = [Path(p).resolve() for p in (base, candidate, output, packer)] + if output.exists(): + raise ValueError('private output must not exist') + if output == base or base in output.parents or output == candidate or candidate in output.parents: + raise ValueError('output must be separate from base and candidate') + report = json.loads((candidate / 'manifest.json').read_text()) + if not report.get('motion_assets'): + raise ValueError('candidate requires --with-motion-assets') + if not {'quiver.eix', 'quiver.epk'} <= set(report['files']): + raise ValueError('candidate manifest must bind both pack files') + if digest(base / 'pack/Index') != report['effective_client_base']['index_sha256']: + raise ValueError('base Index changed; regenerate/review candidate') + for name, expected in report['files'].items(): + path = (candidate / name).resolve() + if candidate not in path.parents or not path.is_file() or digest(path) != expected: + raise ValueError('candidate integrity error: ' + name) + with tempfile.TemporaryDirectory(prefix='quiver-stage-check-') as folder: + for i, (name, record) in enumerate(report['motion_assets'].items()): + if record['origin'] == 'ava2_reference': + source = (candidate / 'assets' / name).resolve() + if candidate not in source.parents or digest(source) != record['sha256']: + raise ValueError('candidate motion changed: ' + name) + elif record['origin'] == 'registered_client': + probe = Path(folder) / str(i) + subprocess.run([str(packer), '--read-client', str(base), name, str(probe)], + check=True, capture_output=True) + if digest(probe) != record['sha256']: + raise ValueError('base dependency changed: ' + name) + else: + raise ValueError('unknown motion origin') + # Separate writable configs/Index; pack content and large loose resources are read-only links. + output.mkdir(parents=True, exist_ok=False) + (output / 'pack').mkdir() + for source in (base / 'pack').iterdir(): + if source.is_file() and source.suffix.lower() in ('.eix', '.epk'): + (output / 'pack' / source.name).symlink_to(source.resolve()) + stem = 'ch5_quiver_candidate' + for suffix in ('.eix', '.epk'): + target = output / 'pack' / (stem + suffix) + if target.exists(): + raise ValueError('candidate pack name conflicts with base') + shutil.copy2(candidate / ('quiver' + suffix), target) + lines = (base / 'pack/Index').read_bytes().splitlines() + if not lines or lines[0] not in (b'PACK', b'FILE'): + raise ValueError('unsupported base Index') + (output / 'pack/Index').write_bytes(b'\n'.join([b'PACK', b'*', stem.encode(), *lines[1:]]) + b'\n') + for source in base.iterdir(): + if source.is_file() and (source.suffix == '.cfg' or source.name == 'channel.inf'): + shutil.copy2(source, output / source.name) + elif source.is_dir() and source.name in ('sound', 'BGM', 'bgm', 'ymir work'): + (output / source.name).symlink_to(source.resolve(), target_is_directory=True) + result = dict(base=str(base), candidate=str(candidate), candidate_manifest_sha256=digest(candidate / 'manifest.json'), + index_sha256=digest(output / 'pack/Index'), production_modified=False, + warning='Local test checkout with links to base assets; not a distributable bundle or live acceptance') + (output / 'quiver-test-staging.json').write_text(json.dumps(result, indent=2) + '\n') + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + for key in ('base', 'candidate', 'output', 'packer'): + parser.add_argument('--' + key, type=Path, required=True) + args = parser.parse_args() + print(json.dumps(stage(args.base, args.candidate, args.output, args.packer))) + + +if __name__ == '__main__': + main() diff --git a/tools/server/ava2-items/tests/test_quiver_assets.py b/tools/server/ava2-items/tests/test_quiver_assets.py new file mode 100644 index 00000000..a557ebbb --- /dev/null +++ b/tools/server/ava2-items/tests/test_quiver_assets.py @@ -0,0 +1,45 @@ +from pathlib import Path +import sys +import unittest + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import quiver_assets as q + + +class QuiverAssetTests(unittest.TestCase): + def test_relative_windows_paths_and_cycles(self): + files = {'d:/ymir work/pc/assassin/bow/' + n: b'' for n in q.MOTIONS} + files.update({'d:/ymir work/pc2/assassin/bow/' + n: b'' for n in q.MOTIONS}) + special = 'd:/ymir work/pc/assassin/bow/attack_special.msa' + raw = b'MotionFileName "attack.gr2"\nEffect "d:\\ymir work\\pc\\assassin\\effect\\arrow_02.msf"' + files['d:/ymir work/pc/assassin/bow/attack.gr2'] = b'existing-model' + files['d:/ymir work/pc/assassin/effect/arrow_02.msf'] = b'Effect "../bow/attack_special.msa"' + del files[special] + missing, records = q.collect(files.get, lambda p: raw if p == special else None) + self.assertEqual(missing, {special: raw}) + self.assertEqual(len(records), 20) + self.assertEqual(records[special]['origin'], 'ava2_reference') + + def test_current_artwork_is_never_overridden(self): + def reference(p): + raise AssertionError('should not consult reference') + missing, records = q.collect(lambda p: b'current', reference) + self.assertEqual(missing, {}) + self.assertEqual(len(records), 18) + + def test_missing_dependency_rejects(self): + with self.assertRaisesRegex(ValueError, 'missing quiver dependency'): + q.collect(lambda p: None, lambda p: None) + + def test_path_escape_rejects(self): + for raw in [b'"../../../../../private.tga"', b'"e:/private.tga"']: + with self.assertRaises(ValueError): + q.dependencies('d:/ymir work/pc/assassin/bow/attack_special.msa', raw) + + def test_closure_limit(self): + with self.assertRaisesRegex(ValueError, 'exceeds limit'): + q.collect(lambda p: b'', lambda p: None, maximum=1) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/server/ava2-items/tests/test_quiver_staging.py b/tools/server/ava2-items/tests/test_quiver_staging.py new file mode 100644 index 00000000..e4969723 --- /dev/null +++ b/tools/server/ava2-items/tests/test_quiver_staging.py @@ -0,0 +1,52 @@ +from pathlib import Path +import hashlib +import json +import sys +import tempfile +import unittest + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import stage_quiver_client as q + + +class StagingTests(unittest.TestCase): + def setup_tree(self, root): + base=root/'base';candidate=root/'candidate' + (base/'pack').mkdir(parents=True);candidate.mkdir() + (base/'pack/Index').write_bytes(b'PACK\n*\nroot\n') + (base/'pack/root.eix').write_bytes(b'base index') + (base/'pack/root.epk').write_bytes(b'base data') + (base/'locale.cfg').write_bytes(b'1 936 zh') + for name in ('quiver.eix','quiver.epk'):(candidate/name).write_bytes(name.encode()) + path='d:/ymir work/pc/assassin/bow/attack_special.msa' + asset=candidate/'assets'/path;asset.parent.mkdir(parents=True);asset.write_bytes(b'motion') + report=dict(files={p.relative_to(candidate).as_posix():q.digest(p) + for p in candidate.rglob('*') if p.is_file()}, + effective_client_base=dict(index_sha256=q.digest(base/'pack/Index')), + motion_assets={path:dict(origin='ava2_reference',sha256=q.digest(asset))}) + (candidate/'manifest.json').write_text(json.dumps(report)) + return base,candidate + + def test_private_overlay_does_not_modify_base(self): + with tempfile.TemporaryDirectory() as folder: + root=Path(folder);base,candidate=self.setup_tree(root) + original=(base/'pack/Index').read_bytes() + q.stage(base,candidate,root/'test',root/'unused-packer') + self.assertEqual((base/'pack/Index').read_bytes(),original) + self.assertEqual((root/'test/pack/Index').read_bytes(),b'PACK\n*\nch5_quiver_candidate\n*\nroot\n') + self.assertTrue((root/'test/pack/root.epk').is_symlink()) + self.assertFalse((root/'test/locale.cfg').is_symlink()) + with self.assertRaisesRegex(ValueError,'must not exist'): + q.stage(base,candidate,root/'test',root/'unused-packer') + + def test_stale_index_or_corrupt_pack_rejects_before_output(self): + for corrupt in ('base','candidate'): + with self.subTest(corrupt=corrupt),tempfile.TemporaryDirectory() as folder: + root=Path(folder);base,candidate=self.setup_tree(root) + path=base/'pack/Index' if corrupt=='base' else candidate/'quiver.epk' + path.write_bytes(b'changed') + with self.assertRaises(ValueError):q.stage(base,candidate,root/'test',root/'unused-packer') + self.assertFalse((root/'test').exists()) + + +if __name__ == '__main__':unittest.main()