Skip to content

Refuse any revision that would rewrite the live world - #72

Merged
OpenSource-For-Freedom merged 1 commit into
mainfrom
fix/world-tracking-guard
Oct 11, 2026
Merged

OpenSource-For-Freedom merged 1 commit into
mainfrom
fix/world-tracking-guard

Conversation

@OpenSource-For-Freedom

Copy link
Copy Markdown
Owner

Why

data/world/ was tracked on main in #64 and #67 so the locally built hub could be
shipped to the droplet once. That worked, and the mechanism stayed armed. The
droplet pulled it on 2026-10-11 and its live world was replaced by the local
snapshot. The deployment statuses record it: seed 1691256543523180978 became
2945200692062874765, and spawn 587,98,87 became 16,74,-16.

#68 untracked the world and added the .gitignore rule, but nothing stops that
being undone, and every branch cut before 2026-10-11 still tracks all 146 files.
Merging any one of them re-arms it.

Tracking the save is unsafe in both directions:

  • Region files are binary. Git cannot merge them, so whichever side deploys next
    silently destroys what the other side built.
  • Untracking is equally destructive. Dropping a path from the index deletes it
    from the working tree on the next checkout, so the cleanup commit itself can
    erase a live save.
  • playerdata/, stats/ and advancements/ are the players' own inventories,
    positions and hub homes.

What

  • tests/test_world_not_tracked.py, wired into CI: fails if anything under
    data/world/ is tracked, if the .gitignore rule is missing, or if the droplet
    guard is absent or sits after the pull.
  • gitops/deploy.sh refuses a revision whose diff touches data/world/, before
    it pulls. CI gates the repo; only the droplet gates the live world, and that
    box holds the only real copy. Loud exit on every tick, not a quiet skip.
  • tests/test_world_no_player_data.py opened by stating data/world/ is tracked,
    which inverted in Hub guard, slower hunger, and track the board configs #68. Corrected to describe what it now is: the second line
    of defence if the world is ever tracked again.

Validation

All checks mutation-tested rather than trusted green:

mutation result
git add -f a region file FAIL as intended
delete the .gitignore rule FAIL as intended
remove the deploy guard FAIL as intended
guard present but moved after the pull FAIL as intended
clean tree PASS

The guard's detection is proved against a throwaway repo in both directions
(adding world files, and untracking them), because the untracking direction is
the one that deletes a save and the easy one to leave untested.

Local run: test_world_not_tracked, test_world_no_player_data,
test_client_server_mods, test_custom_mods_reviewed, test_kubejs_script_hazards,
test_security_alerts, test_design_role.js all pass; bash -n clean on all nine
shell scripts; ci.yml parses.

Note

This changes no world content and no mod list, so it is safe to deploy: the diff
touches no data/world/ path, which the new guard itself confirms.

data/world/ was tracked on main in #64 and #67 so the hub built on the local
test server could be shipped to the droplet once. That worked, and then the
mechanism stayed armed. The droplet pulled it on 2026-10-11 and its live world
was replaced by the local snapshot: the deployment statuses record the seed
changing from 1691256543523180978 to 2945200692062874765 and the spawn moving
from 587,98,87 to 16,74,-16. #68 untracked it again and added the .gitignore
rule, but nothing stops that from being undone, and every branch cut before
that date still tracks all 146 files.

Tracking the save is unsafe in both directions. Region files are binary so git
cannot merge them, and whichever side deploys next destroys what the other
built. Untracking is equally destructive: dropping a path from the index
deletes it from the working tree on the next checkout, so the cleanup commit
is itself capable of erasing a live save. playerdata/, stats/ and
advancements/ are the players' own inventories, positions and hub homes.

tests/test_world_not_tracked.py is the tripwire, with four checks that each
stop a different mistake: the .gitignore rule (an accidental add -A), the
tracked-file list (an add -f, or a merge of an older branch), and two on the
droplet guard below. Both failure directions are proved against a throwaway
repo rather than asserted against a string, because the untracking direction
is the easy one to leave untested.

gitops/deploy.sh now refuses a revision whose diff touches data/world/, before
it pulls. CI gates the repo, but only the droplet gates the live world, and
that box holds the only real copy. It exits loudly on every tick rather than
skipping quietly, because a main that would eat the save needs a person.

tests/test_world_no_player_data.py opened by stating data/world/ is tracked,
which inverted in #68. Left alone it reads as a guarantee about a directory it
no longer sees any files in, so it now says what it actually is: the second
line of defence if the world ever becomes tracked again.
@OpenSource-For-Freedom
OpenSource-For-Freedom merged commit 42e75d9 into main Oct 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant