Skip to content

environments.json does not record which Viron server an environment was created on #63

Open

Description

@dmccoystephenson

Observation

environments.json is keyed by grid count and grid size alone (getEnvironmentKey in main.py, for example 1x50). Each entry records an environment_id but not the server it was created on.

While the Viron address was fixed, one server was the only possibility. Once PR #62 lets the address be set through PATCHWORK_VIRON_URL and PATCHWORK_VIRON_PORT, a cache written against one Viron is read against another:

  • If the new server does not know the ID, Error loading environment, please check logs. is shown and the program exits with status 0.
  • If the new server has an unrelated environment with that ID, it is rendered with no warning. Its locations are scaled by the requested grid size, not the environment's own, so the picture could also be wrong.

PR #62 documents this in the README's Starting Viron section and says to delete the file or use another working directory. The file format is not changed there.

Possible directions

  1. Include the address in the key, or in a per-server section of the file. Existing files would need a migration or would be ignored.
  2. Record the address in each entry, and treat a mismatch as a cache miss or an error.
  3. Keep the file as it is and rely on the README.

Acceptance criteria

  • A decision is recorded on which direction is intended.
  • If the file changes, a unit test under tests/ shows that an entry written for one address is not loaded for another, and existing environments.json files keep working or fail with a clear message.

This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions