Files
EscapistsReintroduced/docs/environment-restart-fixture.md
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

3.7 KiB

Native next-round environment fixture

--project core --smoke environment-restart --rounds 2 is a bounded, opt-in check of two actual ERR_GameMode initializations. Use the existing private Workbench profile and headless runner. This is a native script fixture, not manual or multiplayer acceptance.

Production adds only protected string SettingsPath() with the unchanged ERR_Settings.PATH default; the constructor uses that path. A WORKBENCH-only override selects $profile:erri-environment-restart.json only when both errBaseSmoke=1 and errSmokeOutcome=environment-restart are present. All other runs retain the production path. The probe records the authored environment before normal service startup; it never substitutes a sample environment service or edits the normal unified Escapists.json.

The runner refuses any existing fixture settings, .bak, .tmp, or erri-environment-restart-round.json marker, including broken symlinks. It requires exactly two Core rounds. Round one checks authored defaults and original 14:00 / 1x clock defaults, saves 2000-02-29 and overcast through the real mode settings owner and production environment command helper, reloads the private file to verify persistence, and waits 2.5 seconds. The active environment must remain authored while the native clock advances at its original rate. Only after these assertions does it write a round-one completion marker and request the ordinary test defeat/reset.

The next real mode initialization opens the same file through the production settings constructor. Its ordinary environment service must record the saved date/profile and apply the exact leap date plus native Overcast family. Another 2.5 seconds proves continuing clock progression. Successful round two deletes only the fixture settings/backup/temp/marker and verifies their absence. Failures leave fixture evidence untouched for diagnosis; preserve or move that evidence before rerunning. The persistent marker is for this explicit runner workflow; it does not authenticate arbitrary files supplied outside it. No general settings-path CLI has been introduced.

The assertion compares authored weather across a short first-round interval; an authored weather transition coinciding with that interval could require investigation rather than indicating a settings mutation. Second-round weather uses the production forced family and loops normally. Clock rate checks do not benchmark simulation performance or prove remote replication.

Integration

Copy the new ERR_NativeEnvironmentRestartProbe.c, this document, and tests/test_environment_restart_runner.py. Apply environment-restart-integration.patch to ERR_GameMode.c, ERR_NativeBaseSmoke.c, tools/headless_workbench.py, and tools/check.py. The patch is based on current central sources containing casualty-bench and environment; other outcomes remain unchanged.

The smoke uses steps 1200/1202. Its probe is created before settings loading by the WORKBENCH path override, then polled by the ordinary Core smoke loop after the real prisoner exists. Both rounds use existing explicit defeat/reset behavior. OnStop stops the probe without deleting failure evidence. No normal player health or lifecycle is changed by this fixture.

Run python3 tools/check.py for repository policy checks and runner refusal tests. Native compile, two-round execution, and archive provenance are still required before claiming this fixture passed.

Native evidence native-2026-09-19-065351 passes both real rounds, 107 combined assertions, with zero engine or script errors. The private fixture files were removed by successful round two. This proves the described local persistence path and retains the limits above.