Skip to content

Conversation

@dmccoystephenson
Copy link
Member

@dmccoystephenson dmccoystephenson commented Jan 14, 2026

(TBD)

Copilot AI and others added 30 commits January 10, 2026 05:12
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ependencies

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…cumentation

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…mpilation

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…-roam-to-client-server-architecture

Implement client-server architecture with Spring Boot backend, REST API, pygame client, and Docker support
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ation

- Add NoneType checks before accessing player_data
- Add status message updates for all error cases
- Remove local state modifications (direction, speed, crouch) to maintain server authority
- Improve inventory sync with detailed TODO comment
- Add URL validation for server URL input
- Add session cleanup on restart
- Return to main menu on session init failure
- Remove unused variables (slots, display_height)

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Move CLIENT_REFACTORING_SUMMARY.md to docs/
- Move REFACTORING_NOTES.md to docs/
- Update README.md references to point to docs/ directory
- Add PR link in README for complete implementation details

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Create test_serverBackedWorldScreen.py with 25+ tests for ServerBackedWorldScreen
- Create test_roam_refactored.py with 15+ tests for refactored Roam class
- Add test configuration files (conftest.py) with pygame mocking
- Update pytest.ini to include screen module path
- Create TESTING_SUMMARY.md documenting all tests and coverage
- Tests validate all acceptance criteria:
  * Client communicates exclusively with server
  * No business logic in client
  * All state mutations through REST APIs
  * Player actions call server endpoints
  * Proper error handling and session lifecycle

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Import logging module and configure logger in roam.py and serverBackedWorldScreen.py
- Add logging for client initialization with server URL and configuration
- Log all API client operations (init_session, get_player, perform_player_action, etc.)
- Log session lifecycle events (start, cleanup, restart)
- Log player state updates (energy, direction, inventory)
- Log all player actions (move, stop, gather, consume, add items)
- Log screen transitions and navigation events
- Log key events (key down/up with action descriptions)
- Log tick updates and synchronization with server
- Add detailed error logging with exc_info for stack traces
- Include session IDs and relevant state in debug messages
- Maintain existing print statements for backward compatibility
- Use appropriate log levels: INFO for important events, DEBUG for detailed traces, ERROR for failures

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copy link

Copilot AI commented Feb 1, 2026

@dmccoystephenson I've opened a new pull request, #302, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 1, 2026 22:22
… remove unused files

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…ng comments

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Address PR review comments: fix CI duplication, improve documentation, enhance error handling
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 167 out of 200 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

server/src/main/java/com/preponderous/roam/model/entity/ChickenMeat.java:1

  • Inconsistent image filename convention. ChickenMeat uses 'chickenMeat.png' while DeerMeat references 'chicken.png'. The filename should be 'chicken_meat.png' or similar to match the entity name pattern.
package com.preponderous.roam.model.entity;

server/src/main/java/com/preponderous/roam/model/entity/ChickenMeat.java:1

  • Inconsistent image filename convention. ChickenMeat uses 'chickenMeat.png' while DeerMeat references 'chicken.png'. The filename should be 'chicken_meat.png' or similar to match the entity name pattern.
package com.preponderous.roam.model.entity;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

private double energyValue;

public DeerMeat() {
super("Deer Meat", "assets/images/chicken.png");
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect image path for DeerMeat. Using 'chicken.png' instead of 'deerMeat.png' which will display the wrong sprite for deer meat items.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 22
// Development default: use specific port instead of invalid wildcard
allowedOrigins = "http://localhost:8080,http://localhost:3000,http://localhost:5000";
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CORS configuration allows localhost ports 8080, 3000, and 5000, but port 8080 is the server's own port. This could enable self-XSS attacks. Remove port 8080 from allowed origins unless there's a specific need for the server to make CORS requests to itself.

Suggested change
// Development default: use specific port instead of invalid wildcard
allowedOrigins = "http://localhost:8080,http://localhost:3000,http://localhost:5000";
// Development default: use specific ports instead of invalid wildcard
allowedOrigins = "http://localhost:3000,http://localhost:5000";

Copilot uses AI. Check for mistakes.
class Stone(DrawableEntity):
def __init__(self):
DrawableEntity.__init__(self, "Stone", "assets/images/stone.png")
DrawableEntity.__init__(self, "Stone", "assets/images/stone_item.png")
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent image filename. The client uses 'stone_item.png' while the server model uses 'stone.png' (server/src/main/java/com/preponderous/roam/model/entity/Stone.java line 15). This inconsistency may cause rendering issues.

Suggested change
DrawableEntity.__init__(self, "Stone", "assets/images/stone_item.png")
DrawableEntity.__init__(self, "Stone", "assets/images/stone.png")

Copilot uses AI. Check for mistakes.
# Roam-specific configuration
roam:
persistence:
auto-save: false # Disabled by default to avoid unexpected background writes; set to true to enable periodic automatic saves and reduce risk of data loss on crashes
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states auto-save is 'disabled by default to avoid unexpected background writes' but doesn't explain the tradeoff. Consider clarifying that users need to manually save or risk losing progress, and provide guidance on when to enable this feature.

Suggested change
auto-save: false # Disabled by default to avoid unexpected background writes; set to true to enable periodic automatic saves and reduce risk of data loss on crashes
auto-save: false # Disabled by default to avoid unexpected background writes; when false, users must save manually and may lose recent progress on crashes. Enable (set to true) in environments where periodic background writes are acceptable to reduce data-loss risk.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 18
# Require an explicit database password to avoid using insecure defaults
if [ -z "${DB_PASSWORD}" ]; then
echo "Error: DATABASE_PASSWORD environment variable is not set." >&2
echo "Refusing to run backup with a default or empty database password." >&2
echo "Please set DATABASE_PASSWORD to the database user's password and rerun this script." >&2
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good security practice enforcing explicit password requirement. However, the script doesn't validate the password is non-trivial (e.g., not 'password' or 'admin'). Consider adding minimum password strength validation for production use.

Suggested change
# Require an explicit database password to avoid using insecure defaults
if [ -z "${DB_PASSWORD}" ]; then
echo "Error: DATABASE_PASSWORD environment variable is not set." >&2
echo "Refusing to run backup with a default or empty database password." >&2
echo "Please set DATABASE_PASSWORD to the database user's password and rerun this script." >&2
# Require an explicit, non-trivial database password to avoid using insecure defaults
WEAK_PASSWORDS=("password" "admin" "123456" "12345678" "qwerty" "letmein" "${DB_USER}" "${DB_NAME}")
is_weak_password=0
for weak in "${WEAK_PASSWORDS[@]}"; do
if [ -n "${weak}" ] && [ "${DB_PASSWORD}" = "${weak}" ]; then
is_weak_password=1
break
fi
done
password_length=${#DB_PASSWORD}
if [ -z "${DB_PASSWORD}" ] || [ "${password_length}" -lt 8 ] || [ "${is_weak_password}" -eq 1 ]; then
echo "Error: DATABASE_PASSWORD environment variable is not set to a sufficiently strong value." >&2
echo "Refusing to run backup with an empty, too-short, or commonly used database password." >&2
echo "Please set DATABASE_PASSWORD to a stronger password (at least 8 characters, not a common or trivial value) and rerun this script." >&2

Copilot uses AI. Check for mistakes.
environment:
POSTGRES_DB: roam
POSTGRES_USER: roam
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-roamdev}
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default password 'roamdev' is weak and should not be used in production. The file comment on lines 4-6 mentions requiring POSTGRES_PASSWORD, but the default undermines this. Consider removing the default or making it intentionally invalid (e.g., 'CHANGE_ME_OR_FAIL') to force explicit configuration.

Suggested change
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-roamdev}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD environment variable must be set}

Copilot uses AI. Check for mistakes.
@dmccoystephenson
Copy link
Member Author

@copilot address comments

Copy link

Copilot AI commented Feb 1, 2026

@dmccoystephenson I've opened a new pull request, #303, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits February 1, 2026 22:47
…e documentation

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
… weak password list

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…k password list

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Address code review comments: fix asset paths, harden security, improve documentation
@dmccoystephenson
Copy link
Member Author

@copilot I am no longer able to move. My player switches directions visibly but there is no movement. I have full energy. Also, the server tick is stuck at 0

Copy link

Copilot AI commented Feb 1, 2026

@dmccoystephenson I've opened a new pull request, #304, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 1, 2026 23:10
…t mode

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Fix player movement and server tick progression in WebSocket mode
@dmccoystephenson
Copy link
Member Author

@copilot After placing bear meat I ran into the following:

2026-02-01 16:12:59,233 - screen.serverBackedWorldScreen - WARNING - Unknown entity type encountered: 'BearMeat' (name: 'Bear Meat'). Using colored square fallback. Consider adding sprite mapping.

Resolve and check for other issues related to entity rendering

Copy link

Copilot AI commented Feb 1, 2026

@dmccoystephenson I've opened a new pull request, #305, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 1, 2026 23:16
…d add class name sprite mappings

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Fix meat entity rendering: correct image paths and add class name sprite mappings
@dmccoystephenson
Copy link
Member Author

@copilot grass should be an entity that the player can pick up, not a tile type

Copy link

Copilot AI commented Feb 2, 2026

@dmccoystephenson I've opened a new pull request, #306, to work on those changes. Once the pull request is ready, I'll request review from you.

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.

2 participants