diff --git a/.forgejo/workflows/plugins.yml b/.forgejo/workflows/plugins.yml index e7079999..91b0ec9d 100644 --- a/.forgejo/workflows/plugins.yml +++ b/.forgejo/workflows/plugins.yml @@ -2,23 +2,7 @@ name: DuneRealms Plugin CI on: workflow_dispatch: push: - branches: [main] - paths: - - '.forgejo/workflows/plugins.yml' - - 'Dune*/**' - - 'JarvisConnector/**' - - 'gui-common/**' - - 'citizens-common/**' - - 'network/resource-pack/shared/**' - - 'network/resource-pack/mcgui/**' - - 'network/resource-pack/central/**' - - 'network/resource-pack/vanilla-art/**' - - 'tools/generate-vanilla-dune-art.py' - - 'tools/build-unified-resourcepack.py' - - 'network/content-assets/planet-artwork/profiles.json' - - 'tools/*gameplay*' - - 'tools/*plugin*' - - 'tools/*menu*' + branches: ['**'] jobs: plugins: @@ -65,6 +49,7 @@ jobs: shell: bash run: | set -euo pipefail + python3 tools/test_plugin_ci_policy.py -v python3 tools/test_plugin_fleet_install.py -v python3 tools/test_plugin_menu_pack.py -v python3 tools/test_plugin_backend_abi.py -v diff --git a/DuneTerrain/docs/ARRAKIS-RESET-20261129.md b/DuneTerrain/docs/ARRAKIS-RESET-20261129.md index fc12908a..45584bf4 100644 --- a/DuneTerrain/docs/ARRAKIS-RESET-20261129.md +++ b/DuneTerrain/docs/ARRAKIS-RESET-20261129.md @@ -24,7 +24,7 @@ Candidate descriptor: **DuneTerrain 1.0.14-arrakis2**. The dedicated `arrakis-te Verified layout is `arrakis/{data,dimensions,players,datapacks,level.dat,level.dat_old,session.lock}`. Player storage is `players/{data,stats,advancements}`. There is no root `uid.dat` or old root `region` folder. The only actual dimension is `dimensions/minecraft/overworld`, containing `data`, `region`, `entities`, `poi` and its `paper-world.yml`. -The built helper makes a complete private, hash-verified world snapshot while the exact service is stopped. It then archives **only** the overworld `region`, `entities` and `poi` directories and installs the single source-pinned Terrain JAR into the original installed filename. It leaves all other world files byte-for-byte untouched before restart, including player files, root/dimension persistent data, `level.dat` seed/identity, datapacks and dimension settings. It never runs SQL or changes central identities/claims/economy. Retaining identity also preserves coordinate-based historical proof and personal-loot keys. Paper may normally rewrite metadata after restart; do not claim whole-world byte equality after the game resumes. +The built helper makes a complete private, hash-verified world snapshot while the exact service is stopped. It then archives **only** the overworld `region`, `entities` and `poi` directories and installs the single source-pinned Terrain JAR into the original installed filename. It leaves all other world files byte-for-byte untouched before restart, including player files, root/dimension persistent data, `level.dat`, datapacks and dimension settings. On the verified Paper26.2 runtime, seed settings are stored in `dimensions/minecraft/overworld/data/minecraft/world_gen_settings.dat` and Paper identity metadata in `dimensions/minecraft/overworld/data/paper/metadata.dat`; both were retained with the dimension data. It never runs SQL or changes central identities/claims/economy. Retaining identity also preserves coordinate-based historical proof and personal-loot keys. Paper may normally rewrite metadata after restart; do not claim whole-world byte equality after the game resumes. Original JAR mode/owner are preserved. All other JAR hashes/owners/modes and configurations are checked. Paper's generated `server.properties` comment timestamp is ignored when checking its actual settings. No recursive delete occurs. Old chunk directories and a complete snapshot remain in a root-private backup. Receipt rollback restores old chunk directories/Terrain while retaining **current** player/world metadata, and archives any newly generated chunk directories rather than deleting them. diff --git a/docs/FINAL-RELEASE-20261129.md b/docs/FINAL-RELEASE-20261129.md new file mode 100644 index 00000000..3dbda20d --- /dev/null +++ b/docs/FINAL-RELEASE-20261129.md @@ -0,0 +1,47 @@ +# Final release evidence — 29 November 2026 + +## Source and build + +Atlas fix PR17 is pinned to 67db68218c206dce239181a5b201bbc75b18a620. Canonical CI47/API1039 passed; artifact7519 contains the release. The pack is 21,105,197 bytes, 3,570 entries, SHA256 97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b. All four plugin binaries match the prior bcab release. The only pack-entry change from the previous artwork pack is registration of dunerealms:entity/jerboa in the item atlas. All six servers installed this release and completed startup. Post-install client appearance is not yet verified. + +## Arrakis reset + +The coordinator installed Terrain source78dea2fb774f1fa2924ea9c6e17c894a150fd870 through the built reset helper after verifying a complete private world snapshot. Only Arrakis overworld region/entities/poi were regenerated. Eight player files, other plugin binaries and metadata, configuration, and world generation/Paper identity metadata were preserved. No other world was reset. + +Five saved terrain columns across a 128-chunk scan showed four regular sand blocks over three sandstone blocks. Paper reached startup completion. On Paper26.2 the preserved seed settings are in dimensions/minecraft/overworld/data/minecraft/world_gen_settings.dat; Paper identity metadata is in dimensions/minecraft/overworld/data/paper/metadata.dat. Do not describe these as level.dat seed fields. + +One BrushableBlockEntity/AIR warning was newly observed during generated chunk loading, compared with zero in six reviewed prior logs. Existing populator interaction is a hypothesis, not an established cause. Six no-safe-quest-NPC-spawn warnings per prior log were verified pre-existing. No repeated fatal/startup failure was established. + +## Rihla and website boundaries + +The coordinator restored the original CMS publisher through web484f121 and configured Rihla through web0097a85. The Rihla setup created an audited zero-opening-balance backing account and enabled three persisted settings. A read-only cash_recent_deposit request returned200/ok with no voucher. This proves service availability, not a cash withdrawal or deposit. + +At the owner's request, six Exchange listings were removed after private stock/key archival. Stock was archived, not returned to inventories. Paid-delivery records and balances were untouched. Official CMS sales target the existing in-game treasury; ordinary player resales retain player settlement. + +## Final fleet verification and acceptance limits + +Chat sourcebcab was installed on lobby and reached startup completion. Only DuneMenus changed in that installation. No Minecraft game window was available during the operator check; no connected-client chat or financial action was performed by the agent. Local renderer checks used the pinned private MCGUI runtime; they are not an enforced CI renderer check. + +Source67db was merged and artifact7519 was independently checked before deployment. Every one of the other3,569 ZIP entries was byte-identical to the prior pack. All six installer helpers were unchanged. The immutable publication used the built publisher; nginx backup: `/etc/nginx/snippets/dunerealms-gui-download-v3.conf.before-menu-20261129T132842.960693Z`. The resulting snippet hash was `45acdd77d0d872bbe1b048b4044017b9857ad29e4647c76fea2738cbc452679b`. + +| Server | Paper startup completion (Europe/Brussels, UTC+1) | Changed runtime JARs versus its previous installation | +| --- | --- | --- | +| Lobby | 14:33:09 | None; already on the same frontend bytes | +| Arrakis | 14:35:06 | DuneMenus and DunerealmsGUI | +| Caladan | 14:35:49 | DuneMenus and DunerealmsGUI | +| Giedi Prime | 14:35:47 | DuneMenus and DunerealmsGUI | +| Kaitain | 14:35:54 | DuneMenus and DunerealmsGUI | +| Sigma Draconis IV | 14:35:55 | DuneMenus and DunerealmsGUI | + +All six now run DuneMenus2.0.6 and DunerealmsGUI1.1.39 with the exact pack hash above. Non-pack server properties were semantically preserved; Paper may rewrite comments/timestamps, so full-file byte equality is not claimed. Every other JAR hash and owner/mode was preserved, including Arrakis Terrainb0777941e5c320e16731e447101b4157fb8af917951fc0e3128c4e6b73710b4f. Lobby retained two known JARVIS food/brewing errors and Kaitain25 known Typewriter errors; the other four startup captures had no errors. These counts are not a claim that every gameplay action was tested. + +Raw log times in the JSON evidence remain UTC. Exact receipts and sanitized verification are in [the evidence directory](evidence/final-release-20261129/). These are operator-produced count/hash/status records, not full private world receipts or player-file maps. No financial transactions were run by the agent. Final client visual, chat, deposit and withdrawal acceptance remain unobserved while the owner is away. + +This follow-up changes CI policy and evidence only. Do not deploy its artifact. Verify the real branch-push status before enabling the proposed main protection. Back up the exact finished source/deployed manifest before opening Beta1.0.2.0 — The Pillager Update. + + +## Earlier canaries and operational recovery + +Earlier313/6807/7a/146/bcab installations were limited canaries and were not equivalent to this final fleet state. The final release retains the focused Rihla pages, actual operation button above denomination choices, chat RIA input, native service callbacks and pending-purchase identity. + +Before the earlier PR11 merge, the coordinator diagnosed a latched Forgejo LevelDB ENOSPC error after confirming free space and service-user write/fsync. Only Forgejo was gracefully stopped/restarted; the queue was privately archived, not deleted. Recovery archive SHA256: a1821abd5b493316b6963ebcf04aeb96abe7b6531bea83e2139cc7177964ff1d. No manual Git merge bypass or game-host change was part of that recovery. diff --git a/docs/PREMERGE-PLUGIN-CI-20261129.md b/docs/PREMERGE-PLUGIN-CI-20261129.md new file mode 100644 index 00000000..71d4ffb2 --- /dev/null +++ b/docs/PREMERGE-PLUGIN-CI-20261129.md @@ -0,0 +1,13 @@ +# Pre-merge plugin build coverage + +The canonical workflow remains `DuneRealms Plugin CI`, job `plugins`. Every branch push runs the same exact-revision build, including documentation-only branches. There are no path filters. Manual dispatch remains available, but it is not a substitute for the real push status. + +The coordinator observed the Forgejo status context `DuneRealms Plugin CI / plugins (push)` on the merged67db push. Before enabling protection, verify this exact context also succeeds on this PR head from its branch push. Do not invent a check name or treat workflow-dispatch success as a populated commit status. + +The build still compiles and tests all eight first-party source modules and runs the existing retained-backend ABI, installer/rollback, resource-pack, artwork and pack-property regression checks. The new policy tests reject narrowed branch/path coverage, context renames, missing modules/checks, unpinned checkout and skipped/ignored validation failures. + +The proposed main protection requires the observed push context, blocks direct pushes including administrators, requires current-base candidates, blocks rejected reviews, and requires zero human approvals. This records the intended configuration; it does not establish that the server setting has been applied. The coordinator must verify the actual server configuration separately. + +Real MCGUI renderer checks use the pinned private runtime locally. This workflow does not install or expose that runtime and does not claim renderer or connected-client acceptance in CI. Preserve the existing local renderer requirements in AGENTS.md. + +This change affects CI policy and release evidence only. Do not install its documentation build over the verified runtime release. Complete the final deployment evidence and backup before starting the separate Beta1.0.2.0 Pillager Update PR. diff --git a/docs/evidence/final-release-20261129/arrakis-reset-verification.json b/docs/evidence/final-release-20261129/arrakis-reset-verification.json new file mode 100644 index 00000000..41ef661d --- /dev/null +++ b/docs/evidence/final-release-20261129/arrakis-reset-verification.json @@ -0,0 +1,98 @@ +{ + "sourceCommit": "78dea2fb774f1fa2924ea9c6e17c894a150fd870", + "receipt": "/opt/dunerealms/servers/arrakis/backups/arrakis-reset-78dea2f-20261129T131315.180646Z/receipt.json", + "fullWorldSnapshotVerifiedBeforeReset": true, + "startupDone": true, + "terrainSha256": "b0777941e5c320e16731e447101b4157fb8af917951fc0e3128c4e6b73710b4f", + "retainedJarHashesMetadataAndConfigs": true, + "preservedPlayerFiles": 8, + "allPlayerFileHashesPreserved": true, + "worldGenerationAndPaperIdentityMetadataBytesPreserved": true, + "identityMetadataPaths": [ + "dimensions/minecraft/overworld/data/minecraft/world_gen_settings.dat", + "dimensions/minecraft/overworld/data/paper/metadata.dat" + ], + "terrainDirectoriesReset": [ + "region", + "entities", + "poi" + ], + "actualLayerVerification": { + "savedChunkSamples": [ + { + "x": -62, + "z": -46, + "surfaceY": 69, + "layers": [ + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sandstone", + "minecraft:sandstone", + "minecraft:sandstone" + ] + }, + { + "x": -54, + "z": -38, + "surfaceY": 67, + "layers": [ + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sandstone", + "minecraft:sandstone", + "minecraft:sandstone" + ] + }, + { + "x": -51, + "z": -35, + "surfaceY": 66, + "layers": [ + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sandstone", + "minecraft:sandstone", + "minecraft:sandstone" + ] + }, + { + "x": -46, + "z": -46, + "surfaceY": 68, + "layers": [ + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sandstone", + "minecraft:sandstone", + "minecraft:sandstone" + ] + }, + { + "x": -43, + "z": -43, + "surfaceY": 67, + "layers": [ + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sand", + "minecraft:sandstone", + "minecraft:sandstone", + "minecraft:sandstone" + ] + } + ], + "chunksScanned": 128, + "actualFourSandThreeSandstone": true + }, + "knownWarning": "One BrushableBlockEntity/AIR warning on generated chunk load; existing populator interaction suspected, unproven", + "otherWorldsReset": false +} \ No newline at end of file diff --git a/docs/evidence/final-release-20261129/chat-lobby-verification.json b/docs/evidence/final-release-20261129/chat-lobby-verification.json new file mode 100644 index 00000000..4ac09f41 --- /dev/null +++ b/docs/evidence/final-release-20261129/chat-lobby-verification.json @@ -0,0 +1,12 @@ +{ + "sourceCommit": "bcab979127939ce31efc4b636e9ae0ccb8deace4", + "startupDone": true, + "changedJarBytesAndMetadata": [ + "DuneMenus.jar" + ], + "otherJarsPreserved": true, + "nonPackPropertiesPreserved": true, + "receipt": "/opt/dunerealms/backups/gui-bcab979/20261129T130559.684587Z/lobby/receipt.json", + "cashTransactionsTested": false, + "chatClientAcceptance": "pending" +} \ No newline at end of file diff --git a/docs/evidence/final-release-20261129/cms-rihla-live-verification.json b/docs/evidence/final-release-20261129/cms-rihla-live-verification.json new file mode 100644 index 00000000..38c9e0e3 --- /dev/null +++ b/docs/evidence/final-release-20261129/cms-rihla-live-verification.json @@ -0,0 +1,46 @@ +{ + "cms": { + "scopedGrantCount": 9, + "sealedOfficialListing": 9, + "liveVerified": true, + "sealedDestinationVerifiedReadOnly": true, + "grantBackup": "/root/dunerealms-cms-access-backups/2026-11-29T12-51-16-218Z", + "treasury": "sys_game_treasury", + "treasuryAccountId": "10", + "pullRequest": 628, + "sealBackup": "/root/dunerealms-cms-publication-backups/2026-11-29T12-52-02-047Z", + "hostTestsPassed": 1871, + "canonicalCI": 937, + "source": "484f121fccb9aeaaa235e8aa40d5a4d65ac18cc1" + }, + "ownerRequestedExchangeClear": { + "backup": "/root/dunerealms-exchange-withdrawals/2026-11-29T13-05-13-740Z", + "stockArchived": true, + "officialDefinitionKeyWithdrawn": true, + "paidDeliveryRecordsUntouched": true, + "stockReturnedToInventory": false, + "removedItemListings": 6, + "remainingItemListings": 0 + }, + "rihla": { + "backingAccountId": "40", + "nativeResponseOk": true, + "openingBalanceMinor": "0", + "canonicalCI": 938, + "nativeResponseStatus": 200, + "source": "0097a856f7c3f006ac7dc7c8fb14bb146c75cfaf", + "environmentBackup": "/root/dunerealms-rihla-configuration-backups/2026-11-29T13-08-49-732Z", + "forkCI": 54, + "restart": "Active cp-blue process 29 only; existing --env-file launch verified", + "liveVerified": true, + "initialProblem": "Three required activation settings absent and no backing account", + "backingSystemKey": "sys_rihla_cash", + "readOnlyNativeAction": "cash_recent_deposit", + "pullRequest": 629 + }, + "financialTransactionsPerformedByAgent": false, + "cashIssuedByAgent": false, + "playerOrRoleReset": false, + "realPurchaseOrCashAcceptance": "Not tested by agent; requires actual user action", + "actualRendererChecks": "Pinned local MCGUI runtime; not an enforced CI renderer check" +} diff --git a/docs/evidence/final-release-20261129/final-arrakis-menu-verification.json b/docs/evidence/final-release-20261129/final-arrakis-menu-verification.json new file mode 100644 index 00000000..4c6f5c36 --- /dev/null +++ b/docs/evidence/final-release-20261129/final-arrakis-menu-verification.json @@ -0,0 +1,23 @@ +[ + { + "server": "arrakis", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:35:06] [Server thread/INFO]: Done (23.408s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133439.803187Z/arrakis/receipt.json", + "changedJarBytesOrMetadata": [ + "DunerealmsGUI.jar", + "DuneMenus.jar" + ], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 0, + "jarvisServerLoadErrors": 0, + "clientVisualAcceptance": "not observed" + } +] \ No newline at end of file diff --git a/docs/evidence/final-release-20261129/final-lobby-verification.json b/docs/evidence/final-release-20261129/final-lobby-verification.json new file mode 100644 index 00000000..64b78acb --- /dev/null +++ b/docs/evidence/final-release-20261129/final-lobby-verification.json @@ -0,0 +1,20 @@ +[ + { + "server": "lobby", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:33:09] [Server thread/INFO]: Done (91.305s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133132.205536Z/lobby/receipt.json", + "changedJarBytesOrMetadata": [], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 2, + "jarvisServerLoadErrors": 2, + "clientVisualAcceptance": "not observed" + } +] \ No newline at end of file diff --git a/docs/evidence/final-release-20261129/final-planets-verification.json b/docs/evidence/final-release-20261129/final-planets-verification.json new file mode 100644 index 00000000..80519d5e --- /dev/null +++ b/docs/evidence/final-release-20261129/final-planets-verification.json @@ -0,0 +1,86 @@ +[ + { + "server": "caladan", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:35:49] [Server thread/INFO]: Done (44.202s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133501.232684Z/caladan/receipt.json", + "changedJarBytesOrMetadata": [ + "DunerealmsGUI.jar", + "DuneMenus.jar" + ], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 0, + "jarvisServerLoadErrors": 0, + "clientVisualAcceptance": "not observed" + }, + { + "server": "giedi_prime", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:35:47] [Server thread/INFO]: Done (40.541s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133501.232684Z/giedi_prime/receipt.json", + "changedJarBytesOrMetadata": [ + "DunerealmsGUI.jar", + "DuneMenus.jar" + ], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 0, + "jarvisServerLoadErrors": 0, + "clientVisualAcceptance": "not observed" + }, + { + "server": "kaitain", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:35:54] [Server thread/INFO]: Done (44.520s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133501.232684Z/kaitain/receipt.json", + "changedJarBytesOrMetadata": [ + "DunerealmsGUI.jar", + "DuneMenus.jar" + ], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 25, + "jarvisServerLoadErrors": 0, + "clientVisualAcceptance": "not observed" + }, + { + "server": "sigma_draconis_iv", + "sourceCommit": "67db68218c206dce239181a5b201bbc75b18a620", + "startupDone": true, + "doneLog": "[13:35:55] [Server thread/INFO]: Done (42.616s)! For help, type \"help\"", + "receipt": "/opt/dunerealms/backups/atlas-67db682/20261129T133501.232684Z/sigma_draconis_iv/receipt.json", + "changedJarBytesOrMetadata": [ + "DunerealmsGUI.jar", + "DuneMenus.jar" + ], + "allOtherJarHashesAndMetadataPreserved": true, + "nonPackPropertiesPreserved": true, + "menuVersions": { + "DuneMenus": "2.0.6", + "DunerealmsGUI": "1.1.39" + }, + "packSha256": "97212da292b7533d73132ecd0971271f5b15ec72e0c94984c29ad7f5a0e6009b", + "errorCount": 0, + "jarvisServerLoadErrors": 0, + "clientVisualAcceptance": "not observed" + } +] \ No newline at end of file diff --git a/tools/test_plugin_ci_policy.py b/tools/test_plugin_ci_policy.py new file mode 100644 index 00000000..cac4b999 --- /dev/null +++ b/tools/test_plugin_ci_policy.py @@ -0,0 +1,79 @@ +"""Guard the real push status required before merging plugin changes. + +Intentionally checks the committed workflow without a third-party YAML loader. +The restricted trigger form makes exclusions and event/job renames fail closed. +""" +from pathlib import Path +import re +import unittest + +WORKFLOW = Path(__file__).resolve().parents[1] / '.forgejo/workflows/plugins.yml' +CHECKS = ( + 'test_plugin_ci_policy.py', 'test_plugin_fleet_install.py', + 'test_plugin_menu_pack.py', 'test_plugin_backend_abi.py', + 'test_plugin_fleet_rollback.py', 'test_plugin_resource_pack.py', + 'test_plugin_vanilla_art.py', 'test_plugin_pack_properties.py', + 'test_gameplay_resourcepack.py', +) + + +def validate(text): + lines = [line for line in text.splitlines() if line.strip() and not line.lstrip().startswith('#')] + normalized = '\n'.join(lines) + expected = "name: DuneRealms Plugin CI\non:\n workflow_dispatch:\n push:\n branches: ['**']\njobs:\n plugins:\n runs-on: dune-ci\n steps:" + if not normalized.startswith(expected + '\n'): + raise ValueError('Keep the plugins push check on every branch, without path/event/job exclusions') + for command in ('fetch --depth=1', '"$GITHUB_SHA"', 'git checkout --detach FETCH_HEAD', + 'gradle --no-daemon -p "$module" test jar'): + if command not in text: + raise ValueError('Missing exact-source build: ' + command) + modules = re.search(r'^\s*modules=\(([^)]+)\)', text, re.M) + if not modules or set(modules[1].split()) != { + 'DuneEss', 'DuneLobby', 'DuneNPC', 'DuneRealms-minecraft-only', + 'DuneRealmsGUI', 'DuneTerrain', 'JarvisConnector', 'DuneMenus', + }: + raise ValueError('All eight source modules must retain tests and compilation') + for script in CHECKS: + if 'python3 tools/' + script + ' -v' not in text: + raise ValueError('Missing release regression check: ' + script) + if re.search(r'^\s*(continue-on-error|if):', text, re.M): + raise ValueError('Do not skip or ignore required build steps') + # Both shell groups must propagate a failed test/build to the commit status. + if text.count('set -euo pipefail') != 3: + raise ValueError('Exact checkout and both validation groups must fail on errors') + + +class PluginCIPolicyTests(unittest.TestCase): + def setUp(self): + self.text = WORKFLOW.read_text(encoding='utf-8') + + def test_committed_workflow_covers_feature_and_documentation_pushes(self): + validate(self.text) + + def test_main_only_and_path_filtered_pushes_are_rejected(self): + for replacement in ('branches: [main]', "branches: ['**']\n paths: ['Dune*/**']", + "branches: ['**']\n paths-ignore: ['docs/**']"): + with self.subTest(replacement=replacement), self.assertRaises(ValueError): + validate(self.text.replace("branches: ['**']", replacement)) + + def test_status_context_renames_and_dispatch_only_are_rejected(self): + for old, new in (('name: DuneRealms Plugin CI', 'name: Renamed'), + (' plugins:', ' build:'), (' push:', ' pull_request:')): + with self.subTest(new=new), self.assertRaises(ValueError): + validate(self.text.replace(old, new, 1)) + + def test_regression_check_removal_and_ignored_failures_are_rejected(self): + for script in CHECKS: + with self.subTest(script=script), self.assertRaises(ValueError): + validate(self.text.replace('python3 tools/' + script + ' -v', 'true')) + with self.assertRaises(ValueError): + validate(self.text.replace(' runs-on:', ' continue-on-error: true\n runs-on:', 1)) + + def test_missing_module_and_unpinned_checkout_are_rejected(self): + for old, new in ((' DuneMenus)', ')'), ('git checkout --detach FETCH_HEAD', 'git checkout main')): + with self.subTest(old=old), self.assertRaises(ValueError): + validate(self.text.replace(old, new)) + + +if __name__ == '__main__': + unittest.main()