diff --git a/_migration_overlaps.json b/_migration_overlaps.json deleted file mode 100644 index fde80b1051e..00000000000 --- a/_migration_overlaps.json +++ /dev/null @@ -1,382 +0,0 @@ -{ - "overlaps": [ - { - "id": "48e397e9-b2f6-4f8c-844d-b408cccbc372", - "title": "Athletics team name alias fix", - "tags": [ - "paper-dynasty", - "python", - "fix", - "discord-bot" - ], - "copied_to": "major-domo" - }, - { - "id": "5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01", - "title": "Fix for play lock never released on exception", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "sqlalchemy", - "fix", - "play-lock", - "concurrency", - "critical" - ], - "copied_to": "major-domo" - }, - { - "id": "1c795804-d2bd-4ace-8de8-aea4819424f0", - "title": "Circular import fix: move shared utilities to standalone module", - "tags": [ - "python", - "circular-import", - "architecture", - "fix", - "paper-dynasty", - "discord-bot" - ], - "copied_to": "major-domo" - }, - { - "id": "40da57ca-02da-48b1-9672-73a0e53c6b6e", - "title": "Position validation missing in lineup sheet loading", - "tags": [ - "paper-dynasty", - "python", - "fix", - "discord-bot", - "position-validation" - ], - "copied_to": "major-domo" - }, - { - "id": "b9f0edd4-8752-42a4-a4d9-5a984ae741d0", - "title": "Fix pack type grouping in packs display", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "fix" - ], - "copied_to": "major-domo" - }, - { - "id": "638ac861-2c7b-462c-9d82-672e4536688e", - "title": "Production deployment checklist for Paper Dynasty bot", - "tags": [ - "paper-dynasty", - "discord-bot", - "deployment", - "production", - "checklist", - "devops" - ], - "copied_to": "major-domo" - }, - { - "id": "18d507ca-6e14-46b5-99aa-28b24ef569eb", - "title": "CalVer versioning for all Major Domo and Paper Dynasty services", - "tags": [ - "major-domo", - "paper-dynasty", - "ci-cd", - "gitea", - "docker", - "calver" - ], - "copied_to": "major-domo" - }, - { - "id": "711ea568-414d-4a00-90cc-45abc6673a14", - "title": "Paper Dynasty bot freeze from duplicate X-Check interaction submissions", - "tags": [ - "paper-dynasty", - "discord-bot", - "sqlalchemy", - "race-condition", - "x-check", - "concurrency", - "database", - "deadlock" - ], - "copied_to": "major-domo" - }, - { - "id": "9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d", - "title": "Play lock never released on exception - causes permanent user lockout", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "sqlalchemy", - "concurrency", - "critical-bug", - "play-lock", - "database" - ], - "copied_to": "major-domo" - }, - { - "id": "c253c9de-bb42-44a7-856b-e9981131169f", - "title": "CRITICAL: Git commit requires explicit user approval", - "tags": [ - "paper-dynasty", - "major-domo", - "git", - "commit", - "workflow", - "approval-required", - "critical" - ], - "copied_to": "major-domo" - }, - { - "id": "88bbf5f1-2d76-4e68-9c62-ca72e464f5c0", - "title": "Optional locking parameter pattern for read vs write commands", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "architecture", - "locking", - "concurrency", - "pattern" - ], - "copied_to": "major-domo" - }, - { - "id": "d3f80a8b-24e9-407e-8b83-7b8886e16b08", - "title": "Bulk codebase audit and Gitea issue creation across multiple repos with parallel agents", - "tags": [ - "gitea", - "tea-cli", - "code-review", - "automation", - "major-domo", - "paper-dynasty", - "claude-code", - "agents" - ], - "copied_to": "major-domo" - }, - { - "id": "803b3f29-f38f-4739-aa09-1d1db5e42eb3", - "title": "Cross-cutting code quality anti-patterns in Major Domo and Paper Dynasty repos", - "tags": [ - "major-domo", - "paper-dynasty", - "code-quality", - "security", - "patterns", - "homelab" - ], - "copied_to": "major-domo" - }, - { - "id": "dfa75d94-cfcc-459c-999b-41123d4f700a", - "title": "Scope guards added to major-domo, paper-dynasty, proxmox skills", - "tags": [ - "claude-code", - "skills", - "scope-guards", - "configuration", - "claude-code-config", - "major-domo", - "paper-dynasty", - "proxmox" - ], - "copied_to": "major-domo" - }, - { - "id": "48e397e9-b2f6-4f8c-844d-b408cccbc372", - "title": "Athletics team name alias fix", - "tags": [ - "paper-dynasty", - "python", - "fix", - "discord-bot" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01", - "title": "Fix for play lock never released on exception", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "sqlalchemy", - "fix", - "play-lock", - "concurrency", - "critical" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "1c795804-d2bd-4ace-8de8-aea4819424f0", - "title": "Circular import fix: move shared utilities to standalone module", - "tags": [ - "python", - "circular-import", - "architecture", - "fix", - "paper-dynasty", - "discord-bot" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "40da57ca-02da-48b1-9672-73a0e53c6b6e", - "title": "Position validation missing in lineup sheet loading", - "tags": [ - "paper-dynasty", - "python", - "fix", - "discord-bot", - "position-validation" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "b9f0edd4-8752-42a4-a4d9-5a984ae741d0", - "title": "Fix pack type grouping in packs display", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "fix" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "638ac861-2c7b-462c-9d82-672e4536688e", - "title": "Production deployment checklist for Paper Dynasty bot", - "tags": [ - "paper-dynasty", - "discord-bot", - "deployment", - "production", - "checklist", - "devops" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "18d507ca-6e14-46b5-99aa-28b24ef569eb", - "title": "CalVer versioning for all Major Domo and Paper Dynasty services", - "tags": [ - "major-domo", - "paper-dynasty", - "ci-cd", - "gitea", - "docker", - "calver" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "711ea568-414d-4a00-90cc-45abc6673a14", - "title": "Paper Dynasty bot freeze from duplicate X-Check interaction submissions", - "tags": [ - "paper-dynasty", - "discord-bot", - "sqlalchemy", - "race-condition", - "x-check", - "concurrency", - "database", - "deadlock" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d", - "title": "Play lock never released on exception - causes permanent user lockout", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "sqlalchemy", - "concurrency", - "critical-bug", - "play-lock", - "database" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "c253c9de-bb42-44a7-856b-e9981131169f", - "title": "CRITICAL: Git commit requires explicit user approval", - "tags": [ - "paper-dynasty", - "major-domo", - "git", - "commit", - "workflow", - "approval-required", - "critical" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "88bbf5f1-2d76-4e68-9c62-ca72e464f5c0", - "title": "Optional locking parameter pattern for read vs write commands", - "tags": [ - "paper-dynasty", - "python", - "discord-bot", - "architecture", - "locking", - "concurrency", - "pattern" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "d3f80a8b-24e9-407e-8b83-7b8886e16b08", - "title": "Bulk codebase audit and Gitea issue creation across multiple repos with parallel agents", - "tags": [ - "gitea", - "tea-cli", - "code-review", - "automation", - "major-domo", - "paper-dynasty", - "claude-code", - "agents" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "803b3f29-f38f-4739-aa09-1d1db5e42eb3", - "title": "Cross-cutting code quality anti-patterns in Major Domo and Paper Dynasty repos", - "tags": [ - "major-domo", - "paper-dynasty", - "code-quality", - "security", - "patterns", - "homelab" - ], - "copied_to": "paper-dynasty" - }, - { - "id": "dfa75d94-cfcc-459c-999b-41123d4f700a", - "title": "Scope guards added to major-domo, paper-dynasty, proxmox skills", - "tags": [ - "claude-code", - "skills", - "scope-guards", - "configuration", - "claude-code-config", - "major-domo", - "paper-dynasty", - "proxmox" - ], - "copied_to": "paper-dynasty" - } - ] -} diff --git a/graph/code-patterns/optional-locking-parameter-pattern-for-read-vs-write-command-88bbf5.md b/graph/code-patterns/optional-locking-parameter-pattern-for-read-vs-write-command-88bbf5.md deleted file mode 100644 index 055b8e96e48..00000000000 --- a/graph/code-patterns/optional-locking-parameter-pattern-for-read-vs-write-command-88bbf5.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: 88bbf5f1-2d76-4e68-9c62-ca72e464f5c0 -type: code_pattern -title: "Optional locking parameter pattern for read vs write commands" -tags: [paper-dynasty, python, discord-bot, architecture, locking, concurrency, pattern] -importance: 0.75 -confidence: 0.8 -created: "2026-02-04T15:53:57.725265+00:00" -updated: "2026-02-04T15:53:57.725265+00:00" -relations: - - target: 5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01 - type: BUILDS_ON - direction: incoming - strength: 0.5 ---- - -In Paper Dynasty, added lock_play parameter (default=True) to checks_log_interaction() to distinguish read-only commands from write commands. Read-only commands like /show-card and /settings-ingame use lock_play=False to avoid unnecessary locking. Write commands that modify play state use default lock_play=True. This reduces lock contention and prevents blocking users during non-critical operations. Pattern: Create single validation function with optional locking, rather than duplicating validation logic for read vs write. Also moved actual state modifications to callbacks (dropdown selections) where lock is acquired at last possible moment, keeping commands themselves lock-free. Structure: Command shows UI -> User interaction triggers callback -> Callback acquires lock -> Modifies state -> Releases lock. This minimizes lock hold time. diff --git a/graph/configurations/scope-guards-added-to-major-domo-paper-dynasty-proxmox-skill-dfa75d.md b/graph/configurations/scope-guards-added-to-major-domo-paper-dynasty-proxmox-skill-dfa75d.md deleted file mode 100644 index 4518db26828..00000000000 --- a/graph/configurations/scope-guards-added-to-major-domo-paper-dynasty-proxmox-skill-dfa75d.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -id: dfa75d94-cfcc-459c-999b-41123d4f700a -type: configuration -title: "Scope guards added to major-domo, paper-dynasty, proxmox skills" -tags: [claude-code, skills, scope-guards, configuration, claude-code-config, major-domo, paper-dynasty, proxmox] -importance: 0.6 -confidence: 0.8 -created: "2026-03-01T05:48:14.559362+00:00" -updated: "2026-03-01T22:02:48.108978+00:00" ---- - -# Scope Guards Added to Project-Specific Skills - -## What Changed -Added `SCOPE: Only use in X repos. Do not activate in unrelated projects.` to the `description` field in SKILL.md frontmatter for three skills: - -## Skills Updated -- **major-domo**: scoped to `major-domo-v2`, `major-domo-bot`, `major-domo-database` repos -- **paper-dynasty**: scoped to `paper-dynasty`, `paper-dynasty-database` repos -- **proxmox**: scoped to `claude-home`, `vm-management` repos - -## Deploy Skill -The `deploy` skill was soft-deleted (moved to `_archive/`) because Gitea Actions workflows now handle deployments. The skill was redundant. - -## Storage Location -All skills remain in `~/.claude/skills/` as user-level skills (not project-level). - -## Purpose -Prevents Claude from offering irrelevant skills when working in unrelated repos. - - diff --git a/graph/decisions/calver-versioning-for-all-major-domo-and-paper-dynasty-servi-18d507.md b/graph/decisions/calver-versioning-for-all-major-domo-and-paper-dynasty-servi-18d507.md deleted file mode 100644 index fd282c824cb..00000000000 --- a/graph/decisions/calver-versioning-for-all-major-domo-and-paper-dynasty-servi-18d507.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: 18d507ca-6e14-46b5-99aa-28b24ef569eb -type: decision -title: "CalVer versioning for all Major Domo and Paper Dynasty services" -tags: [major-domo, paper-dynasty, ci-cd, gitea, docker, calver] -importance: 0.8 -confidence: 0.8 -created: "2026-02-17T22:40:12.230917+00:00" -updated: "2026-02-17T22:40:12.230917+00:00" ---- - -Switched all 4 services (MD bot, MD database, PD bot, PD database) from manual semver with PR validation to auto-generated CalVer (YYYY.MM.BUILD). Build number increments by counting git tags matching current month pattern. PR/feature branches push to Docker Hub with dev and dev-SHA tags for testing. Main branch pushes latest + CalVer + CalVer-SHA tags. Shared buildcache means PR builds warm the cache for fast main builds. CI auto-commits VERSION file update and creates git tag on merge. PRs: https://git.manticorum.com/cal/major-domo-v2/pulls/10, /major-domo-database/pulls/14, /paper-dynasty-discord/pulls/15, /paper-dynasty-database/pulls/3 diff --git a/graph/decisions/production-deployment-checklist-for-paper-dynasty-bot-638ac8.md b/graph/decisions/production-deployment-checklist-for-paper-dynasty-bot-638ac8.md deleted file mode 100644 index a0a27fc7644..00000000000 --- a/graph/decisions/production-deployment-checklist-for-paper-dynasty-bot-638ac8.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: 638ac861-2c7b-462c-9d82-672e4536688e -type: decision -title: "Production deployment checklist for Paper Dynasty bot" -tags: [paper-dynasty, discord-bot, deployment, production, checklist, devops] -importance: 0.8 -confidence: 0.8 -created: "2026-02-04T15:53:47.786896+00:00" -updated: "2026-02-04T15:53:47.786896+00:00" -relations: - - target: 9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d - type: REQUIRES - direction: incoming - strength: 0.5 ---- - -CRITICAL: Always verify bot startup in production logs after deployment. Check: 1) All cogs loaded successfully (grep 'Loaded cog' in logs), 2) No 'Failed to load' errors, 3) 'Logged in as' confirmation appears, 4) Test basic commands in Discord. Common failure patterns: circular imports (only caught at runtime, not by linters), missing dependencies, database connection issues. Use 'docker logs CONTAINER --tail 100 | grep -E "Logged in|Failed|ERROR"' for quick health check. Production container: paper-dynasty_discord-app_1 on ssh sba-bots. Log file: logs/discord.log inside container. Health endpoint: port 8080. Always manually unlock stuck plays before deploying fixes: 'UPDATE play SET locked = false WHERE locked = true AND complete = false;' diff --git a/graph/fixes/fix-pack-type-grouping-in-packs-display-b9f0ed.md b/graph/fixes/fix-pack-type-grouping-in-packs-display-b9f0ed.md deleted file mode 100644 index fe27c65af55..00000000000 --- a/graph/fixes/fix-pack-type-grouping-in-packs-display-b9f0ed.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: b9f0edd4-8752-42a4-a4d9-5a984ae741d0 -type: fix -title: "Fix pack type grouping in packs display" -tags: [paper-dynasty, python, discord-bot, fix] -importance: 0.5 -confidence: 0.8 -created: "2026-01-08T20:22:13.376080+00:00" -updated: "2026-01-08T20:22:13.376080+00:00" ---- - -In cogs/economy_new/packs.py, p_group was only set if pack type already existed in p_data dict, causing new pack types to be silently skipped. Fixed by unconditionally setting p_group and initializing the list if pack type doesn't exist. diff --git a/graph/insights/cross-cutting-code-quality-anti-patterns-in-major-domo-and-p-803b3f.md b/graph/insights/cross-cutting-code-quality-anti-patterns-in-major-domo-and-p-803b3f.md deleted file mode 100644 index f84bb43febb..00000000000 --- a/graph/insights/cross-cutting-code-quality-anti-patterns-in-major-domo-and-p-803b3f.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: 803b3f29-f38f-4739-aa09-1d1db5e42eb3 -type: insight -title: "Cross-cutting code quality anti-patterns in Major Domo and Paper Dynasty repos" -tags: [major-domo, paper-dynasty, code-quality, security, patterns, homelab] -importance: 0.6 -confidence: 0.8 -created: "2026-02-20T06:57:40.762074+00:00" -updated: "2026-02-20T06:57:40.762074+00:00" ---- - -# Recurring Code Quality Issues Across MD + PD Projects - -## Context -Discovered during a full audit of all 5 active repos (major-domo-v2, major-domo-database, paper-dynasty-discord, paper-dynasty-database, paper-dynasty-card-creation). - -## Anti-Patterns Found in Multiple Repos - -### Security (Critical) -- **Hardcoded secrets** — API tokens, webhook URLs, Supabase JWTs committed to git in: MD database, PD card-creation, PD bot -- **Bearer tokens logged in plaintext** on auth failures in both database projects - -### Error Handling -- **Bare `except:` or broad `except Exception:`** blocks swallowing errors — present in all 5 repos - -### Debug Artifacts -- **`print()` statements** left in production code — MD database, PD database, PD bot - -### Database / Performance -- **Manual `db.close()`** connection management instead of middleware/context managers — both database projects -- **N+1 query patterns** — both database APIs - -### Testing -- **PD database has zero tests** -- **PD card-creation tests always pass** without actually running (broken test setup) - -## Priority Guidance -When working on any of these repos, treat hardcoded secrets and bare excepts as first-priority items. These are cross-cutting concerns that apply to all projects in this ecosystem. diff --git a/graph/problems/paper-dynasty-bot-freeze-from-duplicate-x-check-interaction-711ea5.md b/graph/problems/paper-dynasty-bot-freeze-from-duplicate-x-check-interaction-711ea5.md deleted file mode 100644 index 2d25f9d9167..00000000000 --- a/graph/problems/paper-dynasty-bot-freeze-from-duplicate-x-check-interaction-711ea5.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: 711ea568-414d-4a00-90cc-45abc6673a14 -type: problem -title: "Paper Dynasty bot freeze from duplicate X-Check interaction submissions" -tags: [paper-dynasty, discord-bot, sqlalchemy, race-condition, x-check, concurrency, database, deadlock] -importance: 0.9 -confidence: 0.8 -created: "2026-02-02T20:04:09.989914+00:00" -updated: "2026-02-02T20:04:09.989914+00:00" ---- - -Bot event loop freezes when user double-submits X-Check corrections (clicking twice due to phone lag). Creates race condition where two concurrent SQLAlchemy transactions try to update same game Play record, causing deadlock. Always occurs 'in middle of SQLAlchemy interaction'. User Kalin reported double-clicking X-Check result correction due to phone lag on 2026-02-02 at ~12:26 PM CST, bot crashed immediately after second click. Last log: 'kyounggun says the result was wrong' followed by 'Asking if there was a hit'. Bot remained frozen for 1.5 hours until manual restart. Container showed healthy but event loop blocked, health server timeout after 120s. diff --git a/graph/problems/play-lock-never-released-on-exception-causes-permanent-user-9b70e3.md b/graph/problems/play-lock-never-released-on-exception-causes-permanent-user-9b70e3.md deleted file mode 100644 index f6eacb4b501..00000000000 --- a/graph/problems/play-lock-never-released-on-exception-causes-permanent-user-9b70e3.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: 9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d -type: problem -title: "Play lock never released on exception - causes permanent user lockout" -tags: [paper-dynasty, python, discord-bot, sqlalchemy, concurrency, critical-bug, play-lock, database] -importance: 0.95 -confidence: 0.8 -created: "2026-02-04T15:02:48.444623+00:00" -updated: "2026-02-04T15:02:48.444623+00:00" -relations: - - target: 5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01 - type: SOLVES - direction: outgoing - strength: 0.5 - - target: 638ac861-2c7b-462c-9d82-672e4536688e - type: REQUIRES - direction: outgoing - strength: 0.5 ---- - -The play locking system in checks_log_interaction() sets play.locked=True and commits it (logic_gameplay.py:1262-1264), but if an exception occurs during command processing, the lock is NEVER released. The only unlock is in complete_play() (line 1015) which only runs on successful completion. This caused 13 plays to be permanently locked across multiple games, completely blocking users. Production incident on 2026-02-04: play 103546 in game 1346 was stuck locked, blocking active user. Error message claims 'auto-unlock will trigger' but that functionality doesn't exist. Root cause: no try/finally block or exception handling to release lock on failure. Manual fix: UPDATE play SET locked=false WHERE locked=true AND complete=false. diff --git a/graph/procedures/bulk-codebase-audit-and-gitea-issue-creation-across-multiple-d3f80a.md b/graph/procedures/bulk-codebase-audit-and-gitea-issue-creation-across-multiple-d3f80a.md deleted file mode 100644 index 34b437cee13..00000000000 --- a/graph/procedures/bulk-codebase-audit-and-gitea-issue-creation-across-multiple-d3f80a.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: d3f80a8b-24e9-407e-8b83-7b8886e16b08 -type: procedure -title: "Bulk codebase audit and Gitea issue creation across multiple repos with parallel agents" -tags: [gitea, tea-cli, code-review, automation, major-domo, paper-dynasty, claude-code, agents] -importance: 0.7 -confidence: 0.8 -created: "2026-02-20T06:57:34.926191+00:00" -updated: "2026-02-20T06:57:34.926191+00:00" ---- - -# Bulk Codebase Audit + Gitea Issue Creation Pattern - -## What Was Done -Conducted a full codebase audit across 5 repos (major-domo-v2, major-domo-database, paper-dynasty-discord, paper-dynasty-database, paper-dynasty-card-creation) using parallel Claude agents. - -## Procedure - -### Phase 1: Parallel Scan Agents -Launch 5 parallel Sonnet agents, one per repo. Each agent: -- `grep` for `TODO`, `FIXME`, `HACK`, `XXX` -- Reviews source files for: security issues, performance problems, error handling gaps, dead code, incomplete implementations -- Returns structured list of issues per repo - -### Phase 2: Parallel Issue Creation Agents -Feed scan results to 5 parallel Bash agents that create Gitea issues: - -```bash -tea issues create --repo cal/REPO --title "TITLE" --description "BODY" -``` - -## Key Learnings - -1. `tea` CLI uses `--description` not `--body` for issue body text -2. `tea` labels require **numeric IDs**, not string names — embed label/category info inside the description instead -3. This scan-agents -> issue-creation-agents pattern parallelizes well across repos - -## Results -- 112 total issues created: 21 + 20 + 25 + 26 + 20 across the 5 repos -- Pattern worked cleanly with no cross-agent interference diff --git a/graph/solutions/athletics-team-name-alias-fix-48e397.md b/graph/solutions/athletics-team-name-alias-fix-48e397.md deleted file mode 100644 index 342afebad3c..00000000000 --- a/graph/solutions/athletics-team-name-alias-fix-48e397.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: 48e397e9-b2f6-4f8c-844d-b408cccbc372 -type: solution -title: "Athletics team name alias fix" -tags: [paper-dynasty, python, fix, discord-bot] -importance: 0.5 -confidence: 0.8 -created: "2026-01-04T22:20:14.909433+00:00" -updated: "2026-01-04T22:20:14.909433+00:00" ---- - -Added 'Athletics' alias to ALL_MLB_TEAMS, IMAGES['mvp'], and AL_TEAM_IDS dictionaries in Paper Dynasty discord-app. The Oakland Athletics relocated and the database now uses 'Athletics' as the team lname/mlbclub, but code only had 'Oakland Athletics' keys causing KeyError when opening Team Choice packs. diff --git a/graph/solutions/circular-import-fix-move-shared-utilities-to-standalone-modu-1c7958.md b/graph/solutions/circular-import-fix-move-shared-utilities-to-standalone-modu-1c7958.md deleted file mode 100644 index ce3380138bc..00000000000 --- a/graph/solutions/circular-import-fix-move-shared-utilities-to-standalone-modu-1c7958.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: 1c795804-d2bd-4ace-8de8-aea4819424f0 -type: solution -title: "Circular import fix: move shared utilities to standalone module" -tags: [python, circular-import, architecture, fix, paper-dynasty, discord-bot] -importance: 0.85 -confidence: 0.8 -created: "2026-02-04T15:53:22.670768+00:00" -updated: "2026-02-04T15:53:22.670768+00:00" -relations: - - target: 5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01 - type: CAUSES - direction: incoming - strength: 0.5 ---- - -When two modules import from each other, create a standalone module for shared utilities. In Paper Dynasty, utilities/dropdown.py and command_logic/logic_gameplay.py had circular imports after adding play lock functions. Solution: Created play_lock.py as standalone module containing release_play_lock() and safe_play_lock(). Both modules now import from play_lock.py. This pattern works for any circular dependency - extract the shared code into a third module that neither original module imports from. Error manifests at runtime as 'cannot import name X from partially initialized module Y (most likely due to a circular import)'. Ruff/linters won't catch this - only runtime execution or tools like pylint with cyclic-import check will detect it. diff --git a/graph/solutions/fix-for-play-lock-never-released-on-exception-5d8e1f.md b/graph/solutions/fix-for-play-lock-never-released-on-exception-5d8e1f.md deleted file mode 100644 index 85ef3f8cec6..00000000000 --- a/graph/solutions/fix-for-play-lock-never-released-on-exception-5d8e1f.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: 5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01 -type: solution -title: "Fix for play lock never released on exception" -tags: [paper-dynasty, python, discord-bot, sqlalchemy, fix, play-lock, concurrency, critical] -importance: 0.95 -confidence: 0.8 -created: "2026-02-04T15:09:38.128767+00:00" -updated: "2026-02-04T15:09:38.128767+00:00" -relations: - - target: 9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d - type: SOLVES - direction: incoming - strength: 0.5 - - target: 1c795804-d2bd-4ace-8de8-aea4819424f0 - type: CAUSES - direction: outgoing - strength: 0.5 - - target: 88bbf5f1-2d76-4e68-9c62-ca72e464f5c0 - type: BUILDS_ON - direction: outgoing - strength: 0.5 ---- - -Implemented 3-layer defense against stuck play locks: (1) Added release_play_lock() helper function in logic_gameplay.py for manual lock release. (2) Created safe_play_lock() context manager that automatically releases locks on exception via try/except/finally. (3) Added automatic lock release to global error handler in paperdynasty.py @bot.tree.error - on ANY app command exception, checks if there's a locked play in the channel and releases it. This prevents all 13+ stuck locks we found in production. Updated error message from 'auto-unlock will trigger' (which didn't exist) to 'go call dad'. Added comprehensive tests in test_play_locking.py for lock release scenarios. Key files modified: command_logic/logic_gameplay.py (added release_play_lock, safe_play_lock context manager), paperdynasty.py (updated on_app_command_error), cogs/gameplay.py (imported new functions, example usage in end_game_command). diff --git a/graph/solutions/position-validation-missing-in-lineup-sheet-loading-40da57.md b/graph/solutions/position-validation-missing-in-lineup-sheet-loading-40da57.md deleted file mode 100644 index a1878a54c9e..00000000000 --- a/graph/solutions/position-validation-missing-in-lineup-sheet-loading-40da57.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: 40da57ca-02da-48b1-9672-73a0e53c6b6e -type: solution -title: "Position validation missing in lineup sheet loading" -tags: [paper-dynasty, python, fix, discord-bot, position-validation] -importance: 0.7 -confidence: 0.8 -created: "2026-02-08T01:32:51.886765+00:00" -updated: "2026-02-08T01:32:51.886765+00:00" ---- - -Paper Dynasty discord bot: get_lineups_from_sheets reads position+card_id from Google Sheets but never validated if the player can actually play that position. Added check against player.pos_1-pos_8 fields. Also added PositionNotFoundException handling at all read_lineup call sites in cogs/gameplay.py. Error manifested as 'C ratings not found for 2024 Aaron Judge' when an outfielder was listed at Catcher. diff --git a/graph/workflows/critical-git-commit-requires-explicit-user-approval-c253c9.md b/graph/workflows/critical-git-commit-requires-explicit-user-approval-c253c9.md deleted file mode 100644 index 16bdc2bfce8..00000000000 --- a/graph/workflows/critical-git-commit-requires-explicit-user-approval-c253c9.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: c253c9de-bb42-44a7-856b-e9981131169f -type: workflow -title: "CRITICAL: Git commit requires explicit user approval" -tags: [paper-dynasty, major-domo, git, commit, workflow, approval-required, critical] -importance: 0.9 -confidence: 0.8 -created: "2026-02-04T14:59:50.100768+00:00" -updated: "2026-02-04T14:59:50.100768+00:00" -relations: - - target: a621475c-4d0b-4301-a255-0e72ba3682a2 - type: SOLVES - direction: outgoing - strength: 0.5 ---- - -Before ANY git commit/add/push/deploy command, STOP and verify: - -1. Did user EXPLICITLY approve? (commit this/deploy it/go ahead) -2. If NO → ASK: 'Should I commit and deploy this fix?' -3. NOT approval: '--yes flag', silence, technical comments - -Failure pattern: Auto-pilot 'fix mode' - find bug → fix → commit (WRONG) -Correct: find bug → fix → ASK → approval → commit - -Added to ~/.claude/CLAUDE.md as checkpoint. Importance: 0.9 (critical workflow)