Skip to content

refactor: rename ai_company package to synthorg across entire codebase #398

@Aureliolo

Description

@Aureliolo

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--synthorg has 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 dashboardweb/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 via uv 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 build

Edge cases to watch

  • __name__ in loggers will auto-update with the directory rename
  • pyproject.toml [tool.coverage.run] source = ["ai_company"] needs updating
  • mkdocs.yml mkdocstrings handler paths: ["src"] should be fine but import paths change
  • Docker healthcheck uses import — needs the new module name
  • Pre-commit hooks that reference ai_company in config
  • scripts/export_openapi.py imports 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:highImportant, should be prioritizedscope:large3+ days of worktype:refactorCode restructuring, cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions