Files
headquarter/apps/api/alembic/.pi-map.md
T
Developer ddd92e3dd4 feat: implement configurable tool container home directory
- Add ToolType.home_directory column with default /home/user
- Add Alembic migration to add column, set existing rows, and rewrite
  /workspace to /home/user/{{WORKSPACE_NAME}} in legacy templates
- Add merge migration fc8f1a20cbf6 to resolve Alembic multiple heads
- Update manifest compiler to honor manifest.home_directory for HOME,
  WORKDIR, /workspace symlink, and default repo mount target
- Update legacy dockerfile/compose instance generation to use
  tool_type.home_directory
- Thread resolved home_dir through config profile and git mount expansion
- Generate entrypoint permission fixer to chown home/mounts at startup
- Update base.dockerfile with sudo/passwordless sudo for permission fixer
- Add unit tests for manifest compiler, instance service, and migrations
- Add placeholder integration test for container lifecycle
- Update openspec/tasks/home-path-expansion.md task checkboxes
- Update project maps for modified files

Quality gates: py_compile, ruff, mypy, pytest tests/unit (205 passed),
pytest tests/integration (110 passed, 35 skipped). Alembic round-trip
and container lifecycle integration tests require Docker/PostgreSQL.
2026-06-14 13:09:41 +00:00

1.8 KiB

apps/api/alembic

dir: apps/api/alembic

index: apps/api/alembic/.pi-map.index.md

role

Database migration infrastructure for the API application, enabling version-controlled schema changes with async SQLAlchemy support.

files

  • env.py | Configures Alembic database migration environment with async SQLAlchemy support for a project. | exp: func:run_migrations_offline() → None, call:context.configure, call:context.begin_transaction, call:context.run_migrations, func:do_run_migrations(connection: Connection) → None, call:context.configure, call:context.begin_transaction, call:context.run_migrations, func:run_async_migrations() → None, call:async_engine_from_config, call:config.get_section, call:connectable.connect, call:connection.run_sync, call:connectable.dispose, func:run_migrations_online() → None, call:asyncio.run, call:run_async_migrations | dep: logging.config, alembic, sqlalchemy, sqlalchemy.engine, sqlalchemy.ext.asyncio, src.config, src.models, asyncio
  • script.py.mako | Alembic database migration script template that generates upgrade/downgrade functions for SQLAlchemy schema migrations | dep: alembic, sqlalchemy

arch

Alembic migration framework with Mako templating for script generation, async SQLAlchemy engine configuration, and environment-based database connection management.

tags

migrations, run, sqlalchemy, async, alembic, call:context.configure, call:context.begin, transaction

symbols

  • run_migrations_offline
  • do_run_migrations
  • run_async_migrations
  • run_migrations_online
  • call:context.configure
  • call:context.begin_transaction
  • call:context.run_migrations
  • call:async_engine_from_config

workflows

  • change alembic behavior read: env.py, script.py.mako
  • explore alembic subdirectories index: apps/api/alembic/versions/.pi-map.index.md

dirty