Summary
Reorganize the OPSIE 0.3.80 XP codebase so the repository root stays focused on the entry point, operator config, assets, and governance, while feature modules live under a dedicated package directory (e.g. modules/ or opsie/). Today ~12 Python modules sit beside OPSIIE_0_3_80_XP.py, which complicates navigation, imports, and future packaging.
Parent epic: #20 (.github work is done; this was listed as out of scope there). Reference snapshot branch: 0_3_80_XP.
Problem
| Current state |
Pain |
Flat root with mail.py, dna.py, markets.py, web3_handler.py, video.py, room.py, agentic_network.py, etc. |
Hard to see what is “core” vs “plugin-like” |
| Main file imports many siblings by bare module name |
Any move breaks imports, docs paths, and operator mental model |
docs/MODULES.md and README layout table describe root files |
Docs drift if structure changes without a deliberate pass |
Proposed layout (starting point — refine in implementation)
Keep at repository root
OPSIIE_0_3_80_XP.py — entry point (rename to opsie.py or similar is optional, separate decision)
kun.py, kun.example.py — operator profiles (or config/ if agreed)
requirements.txt, .env.example, LICENSE, governance (CONTRIBUTING.md, SECURITY.md, etc.)
README.md, docs/, assets/, system_sounds/, .github/
- Shared UX/helpers if they stay “core-adjacent”: e.g.
terminal_colors.py, help.py, utils.py (or move under opsie/core/ — decide in design comment on this issue)
Move under package (example: modules/ or opsie/modules/)
| Module(s) |
Area label |
agentic_network.py |
area:agentic |
markets.py, markets_mappings.py |
area:markets |
web3_handler.py |
area:web3 |
mail.py |
area:mail |
dna.py |
area:dna |
video.py |
area:genai |
room.py |
area:rooms |
Add __init__.py (or PEP 420 namespace layout) as needed so imports stay explicit and testable.
Acceptance criteria
Suggested implementation phases (optional sub-issues)
- Design — comment on this issue with final tree + import style (
from modules.mail import … vs opsie.mail)
- Move + imports — mechanical refactor PR
- Docs — README +
docs/ alignment PR if split for review
Related
Nature of work (informational)
Refactor — same intended behavior, cleaner structure
Primary area
Cross-cutting / multiple modules
Also affects (optional)
Not applicable
Scope and files
Out of scope (unless explicitly added)
Risks or breaking changes
- Windows path assumptions and
system_sounds/ relative paths
- Global state and circular imports when package boundaries change
- External docs or forks that reference old root module paths
Checklist
Summary
Reorganize the OPSIE 0.3.80 XP codebase so the repository root stays focused on the entry point, operator config, assets, and governance, while feature modules live under a dedicated package directory (e.g.
modules/oropsie/). Today ~12 Python modules sit besideOPSIIE_0_3_80_XP.py, which complicates navigation, imports, and future packaging.Parent epic: #20 (
.githubwork is done; this was listed as out of scope there). Reference snapshot branch:0_3_80_XP.Problem
mail.py,dna.py,markets.py,web3_handler.py,video.py,room.py,agentic_network.py, etc.docs/MODULES.mdand README layout table describe root filesProposed layout (starting point — refine in implementation)
Keep at repository root
OPSIIE_0_3_80_XP.py— entry point (rename toopsie.pyor similar is optional, separate decision)kun.py,kun.example.py— operator profiles (orconfig/if agreed)requirements.txt,.env.example,LICENSE, governance (CONTRIBUTING.md,SECURITY.md, etc.)README.md,docs/,assets/,system_sounds/,.github/terminal_colors.py,help.py,utils.py(or move underopsie/core/— decide in design comment on this issue)Move under package (example:
modules/oropsie/modules/)agentic_network.pyarea:agenticmarkets.py,markets_mappings.pyarea:marketsweb3_handler.pyarea:web3mail.pyarea:maildna.pyarea:dnavideo.pyarea:genairoom.pyarea:roomsAdd
__init__.py(or PEP 420 namespace layout) as needed so imports stay explicit and testable.Acceptance criteria
Suggested implementation phases (optional sub-issues)
from modules.mail import …vsopsie.mail)docs/alignment PR if split for reviewRelated
0_3_80_XP— pre-refactor referenceNature of work (informational)
Refactor — same intended behavior, cleaner structure
Primary area
Cross-cutting / multiple modules
Also affects (optional)
Not applicable
Scope and files
modules/vsopsie/package) and what stays at rootOPSIIE_0_3_80_XP.pyand cross-module importsdocs/MODULES.md,docs/ARCHITECTURE.md,docs/COMMANDS.md, README layout table,CONTRIBUTING.mddev paths if needed/markets,/mail,/0x,/room,/dna,/videoon a dev machinekun.pyin the diffOut of scope (unless explicitly added)
OPSIIE_0_3_80_XP.py(can be follow-up)Risks or breaking changes
system_sounds/relative pathsChecklist