-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: rename ai_company package to synthorg across entire codebase #398
Copy link
Copy link
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedscope:large3+ days of work3+ days of worktype:refactorCode restructuring, cleanupCode restructuring, cleanup
Description
Summary
Rename the Python package from ai_company to synthorg and the env var prefix from AI_COMPANY_ to SYNTHORG_ across the entire codebase. The project has been called SynthOrg for a while but the internal Python package name was never updated.
Scope
~4,455 occurrences across ~834 files. Breakdown:
| Location | Count | What changes |
|---|---|---|
src/ai_company/ |
2,133 | Directory rename + all internal imports, logger names, module paths |
tests/ |
2,027 | All from ai_company.x import y imports |
docs/ |
209 | API reference docs, mkdocstrings paths |
.claude/ |
58 | Skills and config referencing the package |
| root config | 12 | pyproject.toml, mkdocs.yml |
docker/ |
10 | AI_COMPANY_* env vars in compose, .env.example, Dockerfiles |
.github/ |
6 | CI workflows |
Patterns to replace
| Pattern | Example | Replace with |
|---|---|---|
ai_company |
from ai_company.engine import ... |
synthorg |
AI_COMPANY |
AI_COMPANY_DB_PATH |
SYNTHORG |
ai-company |
any remaining hyphenated references | synthorg |
| directory | src/ai_company/ |
src/synthorg/ |
What to edit (not just find-and-replace)
- CHANGELOG.md — update historical references to use the new name (not just current entries)
- Release Please branch — if
release-please--branches--main--components--synthorghas references, update those too - pyproject.toml — package name, tool.commitizen paths, coverage config
- mkdocs.yml — mkdocstrings handler paths
- Docker — compose.yml env vars, .env.example, Dockerfiles (env vars + entrypoint)
- CI workflows — any
AI_COMPANY_*env var references - Web dashboard —
web/src/api/TypeScript types if any reference the old name
What NOT to change
- Git history — no rewriting, old commits keep their original references
uv.lock— regenerate viauv sync, don't manually edit
Implementation plan
Script-based approach (not manual find-and-replace):
# 1. Rename the directory (preserves git blame)
git mv src/ai_company src/synthorg
# 2. Bulk replace in all source files
# ai_company → synthorg (imports, module paths, loggers, docstrings)
# AI_COMPANY → SYNTHORG (env vars)
# ai-company → synthorg (hyphenated refs)
# Exclude: uv.lock, .git/, node_modules/
# 3. Update CHANGELOG.md historical references
# 4. Regenerate lock file
uv sync
# 5. Regenerate OpenAPI schema (if export_openapi.py is affected)
uv run python scripts/export_openapi.py
# 6. Verify everything
uv run ruff check src/ tests/
uv run ruff format src/ tests/
uv run mypy src/ tests/
uv run pytest tests/ -n auto --cov=synthorg --cov-fail-under=80
npm --prefix web run lint
npm --prefix web run type-check
npm --prefix web run test
npm --prefix web run buildEdge cases to watch
__name__in loggers will auto-update with the directory renamepyproject.toml[tool.coverage.run] source = ["ai_company"]needs updatingmkdocs.ymlmkdocstrings handlerpaths: ["src"]should be fine butimportpaths change- Docker healthcheck uses
import— needs the new module name - Pre-commit hooks that reference
ai_companyin config scripts/export_openapi.pyimports from the package
Notes
- This is a big-bang change — do it when no worktrees have uncommitted work to avoid conflicts
- All 4 active worktrees will need rebasing after this merges
- Release Please branch may need manual updating
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedscope:large3+ days of work3+ days of worktype:refactorCode restructuring, cleanupCode restructuring, cleanup