Metadata-Version: 2.4
Name: keble-task
Version: 2.22.1
Author-email: zhenhao-ma <bob0103779@gmail.com>
Requires-Python: <3.14,>=3.13
Requires-Dist: keble-db<2.0.0,>=1.8.1
Requires-Dist: keble-helpers<2.0.0,>=1.40.0
Requires-Dist: pydantic-ai-slim<2.0.0,>=1.41.0
Requires-Dist: tenacity<10.0.0,>=9
Provides-Extra: test
Requires-Dist: httpx[socks]<1.0.0,>=0.27; extra == 'test'
Requires-Dist: pydantic-ai-slim[openai]<2.0.0,>=1.41.0; extra == 'test'
Requires-Dist: pytest-asyncio<1.0.0,>=0; extra == 'test'
Requires-Dist: pytest<9.0.0,>=8; extra == 'test'
Description-Content-Type: text/markdown

# keble-task

`keble-task` owns generic Keble task schemas, task relations, task-room graph
context, lifecycle/action events, task cost records, and agent query/mutation
tool contracts.

## Verified State

Checked on 2026-06-30 against `pyproject.toml`, package exports,
`keble_task/`, and tests.

- Package: `keble-task 2.22.1`
- Python: `>=3.13,<3.14`
- Critical deps: `keble-helpers`, `keble-db`, `pydantic-ai-slim`, `tenacity`
- Source roots: `schemas/`, `actions/`, `crud/`, `main/`, `agent/`, `utils/`
- Public exports: `TaskClient`, CRUD classes, task/task-relation schemas,
  task-cost schemas, lifecycle/action events, and agent tool providers.

## Runtime Contract

- Task identity, stage, relations, and cost accounting belong here. Feature
  packages should attach domain metadata instead of redefining task rows.
- First-class long-running features should be real `TaskType` flows in the
  consuming service, not generic subagent workflows plus parallel adapters.
- Lifecycle and action events must stay typed and stable for backend
  websocket fanout and frontend task-list rendering.
- Mongo CRUD changes must expose indexed query shapes directly and keep index
  creation in startup wiring, not request handlers.

## Testing

```bash
uv sync --group test
uv run pytest -m "not live and not slow and not eval and not local_stack and not db_stack and not container"
uv run npx --yes pyright .
```

Package-owned test helpers live under `keble_task.testing`; do not recreate
root-level `tests/config.py`, `tests/utils.py`, root test packages, or legacy
source folders such as `tests/schemas/`.

Mongo/Redis integration settings load explicit process env first, then
`tests/.env`, then the umbrella `keble.backend/.env` through
`keble_db.testing.resolve_test_env`. Live LLM settings load explicit `LIVE_LLM_*`
values first and otherwise map the first backend Azure endpoint/token/deployment
entry. Set `KEBLE_BACKEND_ENV_FILE=/path/to/.env` from unusual worktree or CI
layouts. Keep the package-owned test database and collection names isolated.

## Change Logs

Historical release notes and long AI change history live under `logs/`.

## Side Effect If Changes

- Backend task APIs, owner task lists, task room sockets, cost accounting,
  and frontend task rows depend on these schemas/events.
- Relation or graph-context changes can affect all feature rooms that load
  child tasks or background sessions.
