fix: split read-only data volume to allow state file writes (#85) #86
No reviewers
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#86
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-v2-85"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #85
Summary
The
data/volume was mounted:roto protect Google Sheets credentials, but this also prevented all state trackers from persisting their JSON files.save_data()calls were silently failing (logged as errors), so scorecard removals, voice channel state, trade channel state, and soak data were never written to disk.Changes
docker-compose.yml— split the single:rovolume into two:${SHEETS_CREDENTIALS_HOST_PATH:-./data/major-domo-service-creds.json}:/app/data/major-domo-service-creds.json:ro${STATE_HOST_PATH:-./storage}:/app/storage:rw5 tracker files — default
data_filepath changed fromdata/→storage/:commands/gameplay/scorecard_tracker.py—storage/scorecards.jsoncommands/voice/tracker.py+cleanup_service.py—storage/voice_channels.jsoncommands/transactions/trade_channel_tracker.py—storage/trade_channels.jsoncommands/soak/tracker.py—storage/soak_data.json.gitignore— addedstorage/to ignore runtime state filesDeployment notes
On
akamai, updatecontainer-data/major-domo/.env:Also migrate existing state files if any were written locally:
Test results
953 passed, 2 skipped — no regressions.
Other observations
commands/gameplay/CLAUDE.mdandcommands/voice/CLAUDE.mdstill referencedata/paths for state files — these should be updated separately..env.examplealso has the updatedSHEETS_CREDENTIALS_HOST_PATHand newSTATE_HOST_PATHdocs, but it is gitignored so it was not included in this commit. The file was updated locally.tracker.py,cleanup_service.py,trade_channel_tracker.py, andsoak/tracker.py(single→double quotes, trailing commas) when those files were edited. The reformatting is cosmetic and all tests pass.AI Code Review
Files Reviewed
docker-compose.yml(modified)commands/gameplay/scorecard_tracker.py(modified)commands/voice/tracker.py(modified)commands/voice/cleanup_service.py(modified)commands/transactions/trade_channel_tracker.py(modified)commands/soak/tracker.py(modified).gitignore(modified)Findings
Correctness
data/→storage/in defaultdata_fileparam.self.data_file.parent.mkdir(exist_ok=True)in__init__(unchanged from before). This meansstorage/is created automatically on first write even without a volume mount, which is correct.WORKDIR /appin the Dockerfile confirms relative pathstorage/scorecards.jsonresolves to/app/storage/scorecards.json— matching the volume mount target./app/data/major-domo-service-creds.json:ro) is correct. Docker will create/app/data/automatically if it doesn't exist in the container image.mergeable: true— no conflicts with currentmain.Security
:roat the file level — no regression on the credentials protection goal.:rwvolume, correctly isolating writable data from secrets.Style & Conventions
Suggestions
SHEETS_CREDENTIALS_HOST_PATHnow expects a full file path, not a directory. If production.envstill hasSHEETS_CREDENTIALS_HOST_PATH=./data, Docker will bind-mount the./datadirectory as a file at/app/data/major-domo-service-creds.json, making it a directory inside the container and breaking Google Sheets auth silently. The PR body documents the migration, but this is worth calling out as a high-impact step during deploy.commands/gameplay/CLAUDE.mdandcommands/voice/CLAUDE.mdstill referencedata/paths — noted in PR body for a follow-up. Fine to defer.Verdict: COMMENT
Clean, correct fix. Root cause (single
:rovolume blocking all state writes) is accurately diagnosed and properly resolved by splitting at the file level. All trackers updated consistently, directory auto-creation works, and the deployment migration is documented. Posting as COMMENT — Gitea does not allow self-approval.Automated review by Claude PR Reviewer