From adae5a7f83269ae71e1c1a9af3d98e6f4136fcc6 Mon Sep 17 00:00:00 2001 From: ghptc Date: Tue, 27 Oct 2026 09:46:58 -0300 Subject: [PATCH 1/2] feat(zombies): enable human-only native map voting --- .github/workflows/validate.yml | 1 + docs/zombies-voting.md | 24 ++++++++++++++++++++++++ modes/zombies/server.cfg | 14 ++++++++++++-- tests/test_zombies_voting.py | 26 ++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 docs/zombies-voting.md create mode 100644 tests/test_zombies_voting.py diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ecd6be2..f130b49 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -25,3 +25,4 @@ jobs: python3 contract/scripts/modes.py select catalog "${mode##*/}" done python3 -m unittest discover -s contract/tests -p test_modes.py + python3 -m unittest discover -s catalog/tests -p 'test_*.py' diff --git a/docs/zombies-voting.md b/docs/zombies-voting.md new file mode 100644 index 0000000..685392b --- /dev/null +++ b/docs/zombies-voting.md @@ -0,0 +1,24 @@ +# Zombies native map voting + +Enable existing native voting for `/callvote map mp_crash` (select next map) +and `/callvote map_rotate` (switch through the existing engine transition). +Only rotation maps are accepted. Killhouse remains excluded; native BTD startup +fails in its waypoint loader and supervised gameplay is not qualified. + +Zombies mode sets configurable `g_voteCooldown=5`, `g_voteTime=30`, +`g_voteMaxVotes=2`, `g_voteAbstainWeight=1`. Kick, restart and gametype votes +are disabled. The engine excludes bots from calling, casting and quorum. +Promod configuration is unchanged; no wave globals are manipulated by this change. + +Baseline config master: `9fd5c9d`. Catalog policy test and 22 discovery contract +tests passed. Companion engine native vote/rotation tests passed. Local BTD +integration passed 89/89 checks across 15 supported maps and process restart: +`/tmp/cod4-btd-qualified-18naigad`. This checks policy, map startup, purity, +eight integrity headers and absence of script errors. It does not certify +real-client vote UI or vote-driven transitions during combat. + +Keep `bot_enable=0` until a separate BTD ally adapter is implemented and qualified. +Require independent review, green mandatory Configuration tests and owner merge. +Operator-supervised gameplay and explicit approval remain necessary for deployment. +Rollback by reverting this focused policy change through the existing reviewed +workflow. No running service was changed. diff --git a/modes/zombies/server.cfg b/modes/zombies/server.cfg index f56177d..48e8e2d 100644 --- a/modes/zombies/server.cfg +++ b/modes/zombies/server.cfg @@ -10,8 +10,18 @@ set g_gametype "war" set sv_mapRotation "gametype war map mp_convoy gametype war map mp_bloc gametype war map mp_bog gametype war map mp_broadcast gametype war map mp_countdown gametype war map mp_crash gametype war map mp_creek gametype war map mp_crossfire gametype war map mp_farm gametype war map mp_overgrown gametype war map mp_pipeline gametype war map mp_showdown gametype war map mp_strike gametype war map mp_vacant gametype war map mp_cargoship" // Zombies are provided by BTD; never attach the Promod Bot Warfare integration. set bot_enable "0" -set g_allowVote "0" -set g_oldVoting "0" +// Native vote UI; only rotation maps may be selected. Bots are ineligible. +set g_allowVote "1" +set g_oldVoting "1" +set g_voteAllowMap "1" +set g_voteAllowMaprotate "1" +set g_voteAllowRestart "0" +set g_voteAllowGametype "0" +set g_voteAllowKick "0" +set g_voteTime "30" +set g_voteMaxVotes "2" +set g_voteAbstainWeight "1" +set g_voteCooldown "5" set scr_teambalance "0" set scr_war_scorelimit "0" set scr_war_timelimit "0" diff --git a/tests/test_zombies_voting.py b/tests/test_zombies_voting.py new file mode 100644 index 0000000..da96a87 --- /dev/null +++ b/tests/test_zombies_voting.py @@ -0,0 +1,26 @@ +"""Mode policy contract; native voting behavior is tested in the engine suite.""" +from pathlib import Path +import re +import unittest + +ROOT = Path(__file__).resolve().parents[1] + + +class ZombiesVoting(unittest.TestCase): + def test_native_map_votes_only(self): + cfg = (ROOT / 'modes/zombies/server.cfg').read_text() + pairs = re.findall(r'^set (\w+) "([^"\n]*)"$', cfg, re.M) + values = dict(pairs) + self.assertEqual(len(pairs), len(values), 'ambiguous repeated mode setting') + expected = {'g_allowVote': '1', 'g_oldVoting': '1', + 'g_voteAllowMap': '1', 'g_voteAllowMaprotate': '1', + 'g_voteAllowRestart': '0', 'g_voteAllowGametype': '0', + 'g_voteAllowKick': '0', 'g_voteCooldown': '5', + 'g_voteAbstainWeight': '1', 'sv_pure': '1', 'bot_enable': '0'} + for name, value in expected.items(): + with self.subTest(name=name): + self.assertEqual(values[name], value) + maps = re.findall(r'\bmap (mp_\w+)', values['sv_mapRotation']) + self.assertIn('mp_crash', maps) + self.assertNotIn('mp_killhouse', maps, 'requires supervised qualification') + self.assertEqual(len(maps), 15) From 0b3347d62db9750e5434f3df601f9253120a9f49 Mon Sep 17 00:00:00 2001 From: ghptc Date: Tue, 27 Oct 2026 09:51:42 -0300 Subject: [PATCH 2/2] docs(zombies): record lifecycle and Promod regression evidence --- docs/zombies-voting.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/zombies-voting.md b/docs/zombies-voting.md index 685392b..50224b6 100644 --- a/docs/zombies-voting.md +++ b/docs/zombies-voting.md @@ -17,6 +17,13 @@ integration passed 89/89 checks across 15 supported maps and process restart: eight integrity headers and absence of script errors. It does not certify real-client vote UI or vote-driven transitions during combat. +Additional local evidence: BTD lifecycle passed with the proposed policy at +`/tmp/btd-death-regression-uh2phcph` (death, respawn, wave two, admission and +administrative map transitions). Fresh pinned Promod overlays passed 53/53 +integration checks at `/tmp/cod4x-promod-integration-6yoxi62_`, including ready-up, +voting and administration. An older prepared runtime failed ready-up checks; +its overlay differs from current preparation and is retained as historical evidence. + Keep `bot_enable=0` until a separate BTD ally adapter is implemented and qualified. Require independent review, green mandatory Configuration tests and owner merge. Operator-supervised gameplay and explicit approval remain necessary for deployment.