This guide is the contributor runbook for a source checkout.
- Python 3.11 or newer
- uv
- PostgreSQL for local execution
- Docker for the full Testcontainers test suite
- Node.js 22.19 or newer only when developing or running
runtime.type: pi
Install Python dependencies:
uv sync --extra devFor Pi work, install the exact locked Node dependencies:
npm ci --ignore-scripts --prefix framework/runtime/pi/node
node framework/runtime/pi/node/runner.mjs --checkCreate a local profile and database once:
createdb agent_task_platform_dev
cp config/.env.dev.example config/.env.devReplace the placeholder database password, API key, and callback secret in config/.env.dev, then initialize and validate:
ENV_MODE=dev uv run alembic upgrade head
ENV_MODE=dev psql agent_task_platform_dev -f sql/seed.dml.sql
ENV_MODE=dev uv run agent-task-platform check-config --config-dir configStart the server with source reload as configured by the development profile:
ENV_MODE=dev uv run agent-task-platform serve --config-dir configSubmit the offline example from another terminal:
KEY=<your-local-key> bash scripts/request_example_run.shUse a new REQUEST_ID when you want a new Run. Reusing the same (caller, route_tag, request_id) intentionally returns the idempotent existing Run.
| Change | Primary location | Tests to inspect first |
|---|---|---|
| Domain model or lifecycle | domain/ |
model, lifecycle, and store tests |
| Submission, retry, recovery, callback flow | orchestration/ |
manager, executor, worker, and callback tests |
| Agent runtime | framework/runtime/ |
runtime adapter and integration tests |
| Tool policy or transport | framework/tool/ |
Tool Gateway, policy, and hardening tests |
| Skill loading or activation | framework/skill/ |
Skill loader, registry, and prompt tests |
| Persistence | infra/store/ |
repository and migration tests |
| HTTP or CLI | interfaces/ |
API, settings, auth, and CLI tests |
| Example extension | agent_hub/, plugins/, config/ |
example and registry tests |
Follow imports inward. If an inner layer needs behavior from an outer layer, pass a protocol or dependency from the composition root instead of reversing the dependency direction.
These do not require Docker:
uv run ruff check .
uv run ruff format --check .
uv run python -m compileall -q domain framework infra interfaces orchestration agent_hub plugins teststests/conftest.py starts PostgreSQL automatically for the normal suite. For a test module that has no database fixtures, --noconftest provides a fast local loop. For example:
uv run pytest --noconftest -q \
tests/test_layering.py \
tests/test_runtime_config.py \
tests/test_settings_loader.pyDo not use --noconftest to claim the full suite passed; tests that require pg_url, make_store, or the automatic table cleanup need the normal harness.
The default test configuration uses Testcontainers. Start Docker, then run:
uv run pytest -qThe session fixture starts postgres:16-alpine and truncates all platform tables between tests. If Docker is unavailable, report the PostgreSQL suite as not run rather than silently replacing it with a different backend.
For an explicit local PostgreSQL alternative, set ATP_TEST_DATABASE_URL to a loopback PostgreSQL URL whose database name begins with atp_test_, for example postgresql+psycopg2://user:password@127.0.0.1:5432/atp_test_local. The test harness refuses non-loopback hosts and names outside that prefix. This database is destructive test-only state: the suite creates its schema and truncates every platform table before each test, with identity sequences restarted. Use a disposable database, never a development, shared, staging, or production database. With the variable unset, Testcontainers remains the default.
The packaging tests verify that packaged configuration, migration history, and Skill resources match their source copies:
uv run pytest --noconftest -q tests/test_packaging.py tests/test_doc_links.pyPi tests include synthetic protocol and failure-boundary coverage. A real model endpoint is not required for the normal suite. Before changing the Node bridge, also run:
node --check framework/runtime/pi/node/runner.mjs
node --check framework/runtime/pi/node/http.mjs
npm audit --omit=dev --ignore-scripts --prefix framework/runtime/pi/nodePersistent models live under infra/store/model/. For a schema change:
-
Update the ORM model and repository behavior.
-
Generate a migration:
ENV_MODE=dev uv run alembic revision --autogenerate -m "describe the change" -
Review the generated upgrade and downgrade operations; do not accept autogeneration blindly.
-
Apply the migration to a disposable database and run migration tests.
-
Regenerate the empty-database SQL reference:
uv run python scripts/gen_sql.py
Alembic is the upgrade mechanism. sql/ddl.sql is a generated reference for an empty database, not a replacement for migration history.
config/agents.yaml, config/tools.yaml, and config/skills.yaml seed missing versions into PostgreSQL. They do not continuously overwrite database records.
- Add a new version when a public Agent, Tool, or Skill contract changes.
- Regenerate
sql/seed.dml.sqlafter Agent or Tool seed changes. - Skill artifacts are loaded from
plugins/skills/and persisted with a content hash. - Restart with a fresh development database when you specifically need to test first-seed behavior.
- Link new pages from the docs index.
- Prefer repository-relative links and commands that work from the project root.
- Name the current limitation when a behavior is intentionally unsupported.
- Keep the OpenAPI document as the field-level API authority; avoid duplicating every generated schema in prose.
- Run
uv run python scripts/check_doc_links.pybefore submitting the change.
git diff --check
uv run ruff check .
uv run ruff format --check .
uv run pytest -q
uv run python scripts/check_doc_links.py
uv run python scripts/gen_sql.py
git diff --exit-code -- sql/ddl.sql sql/seed.dml.sqlThen inspect git status for logs, credentials, local environment files, build output, or unrelated changes. See Contributing for the review checklist.