# `orchestrator.sdlc.worker`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/sdlc/worker.py`](../../src/orchestrator/sdlc/worker.py)

0 types · 14 functions · python

## Changing this safely

**Tested by** (1): `tests.integration.test_sdlc_workflow_e2e`

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`sdlc_task_queue`](../../src/orchestrator/sdlc/worker.py#L65) — reaches **9** symbols
- [`_build_ci`](../../src/orchestrator/sdlc/worker.py#L163) — reaches **6** symbols · **no test path visible**
- [`_build_codegen`](../../src/orchestrator/sdlc/worker.py#L87) — reaches **6** symbols · **no test path visible**
- [`_build_review`](../../src/orchestrator/sdlc/worker.py#L148) — reaches **6** symbols · **no test path visible**
- [`_default_database_url`](../../src/orchestrator/sdlc/worker.py#L54) — reaches **6** symbols · **no test path visible**
- [`_default_workspace_root`](../../src/orchestrator/sdlc/worker.py#L61) — reaches **6** symbols · **no test path visible**
- [`build_run_budget`](../../src/orchestrator/sdlc/worker.py#L70) — reaches **6** symbols · **no test path visible**
- [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183) — reaches **5** symbols · **no test path visible**

_11 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Documented in

`USER_GUIDE.md#terminal-1-the-worker-that-executes-the-pipeline-stages`, `docs/specs/archive/LIVE-TESTING.md#2-run-the-sdlc-worker-own-queue-default-sdlc-tasks`

## Functions

### `_build_ci`

[`src/orchestrator/sdlc/worker.py:163`](../../src/orchestrator/sdlc/worker.py#L163)

- **Called by** (1): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183)
- **Calls** (6): [`GHACIAdapter`](../../src/orchestrator/sdlc/ci.py#L55), [`GitHubAppAuth`](../../src/orchestrator/codereview/auth.py#L69), [`GitHubAppConfig`](../../src/orchestrator/codereview/config.py#L25), [`GitHubClient`](../../src/orchestrator/codereview/github_client.py#L110), [`StubCIAdapter`](../../src/orchestrator/sdlc/ci.py#L47), `getenv`

### `_build_codegen`

[`src/orchestrator/sdlc/worker.py:87`](../../src/orchestrator/sdlc/worker.py#L87)

- **Called by** (1): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183)
- **Calls** (6): [`LLMCodegenAdapter`](../../src/orchestrator/sdlc/codegen.py#L826), [`StubCodegenAdapter`](../../src/orchestrator/sdlc/codegen.py#L194), [`compose_factory_with_ontomesh`](../../src/orchestrator/spine/grounder.py#L118), `from_file`, `getenv`, [`resolve_codegen_model`](../../src/orchestrator/sdlc/codegen.py#L44)
- **Documented in**: `docs/specs/bet2c-in-loop-approval.md#as-built-notes`

### `_build_llm`

[`src/orchestrator/sdlc/worker.py:80`](../../src/orchestrator/sdlc/worker.py#L80)

- **Called by** (1): [`llm`](../../src/orchestrator/sdlc/worker.py#L194)
- **Calls** (2): `orchestrator.core.llm.BudgetedLLMClient`, `orchestrator.core.llm.LiteLLMClient`

### `_build_review`

[`src/orchestrator/sdlc/worker.py:148`](../../src/orchestrator/sdlc/worker.py#L148)

- **Called by** (1): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183)
- **Calls** (3): [`SemanticReviewAdapter`](../../src/orchestrator/sdlc/review.py#L178), [`StubReviewAdapter`](../../src/orchestrator/sdlc/review.py#L113), `getenv`

### `_default_database_url`

[`src/orchestrator/sdlc/worker.py:54`](../../src/orchestrator/sdlc/worker.py#L54)

- **Called by** (1): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183)
- **Calls** (1): `getenv`

### `_default_workspace_root`

[`src/orchestrator/sdlc/worker.py:61`](../../src/orchestrator/sdlc/worker.py#L61)

- **Called by** (1): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183)
- **Calls** (2): `getenv`, `pathlib.Path`

### `_install_signal_handlers`

[`src/orchestrator/sdlc/worker.py:298`](../../src/orchestrator/sdlc/worker.py#L298)

- **Called by** (1): [`_main`](../../src/orchestrator/sdlc/worker.py#L305)
- **Calls** (2): `get_running_loop`, `suppress`

### `_main`

[`src/orchestrator/sdlc/worker.py:305`](../../src/orchestrator/sdlc/worker.py#L305)

- **Calls** (4): `Event`, [`_install_signal_handlers`](../../src/orchestrator/sdlc/worker.py#L298), `basicConfig`, [`run_sdlc_worker`](../../src/orchestrator/sdlc/worker.py#L259)

### `_sdlc_config`

[`src/orchestrator/sdlc/worker.py:220`](../../src/orchestrator/sdlc/worker.py#L220)

- **Called by** (1): [`run_sdlc_worker`](../../src/orchestrator/sdlc/worker.py#L259)
- **Calls** (3): [`from_env`](../../src/orchestrator/temporal/config.py#L44), `replace`, [`sdlc_task_queue`](../../src/orchestrator/sdlc/worker.py#L65)

### `build_deps`

[`src/orchestrator/sdlc/worker.py:183`](../../src/orchestrator/sdlc/worker.py#L183)

- **Called by** (3): [`_run_address_review`](../../src/orchestrator/cli.py#L646), [`main`](../../scripts/live_sdlc_worker.py#L44), [`run_sdlc_worker`](../../src/orchestrator/sdlc/worker.py#L259)
- **Calls** (14): [`SDLCDeps`](../../src/orchestrator/sdlc/deps.py#L48), [`SubprocessPreflightRunner`](../../src/orchestrator/sdlc/preflight.py#L185), [`SubprocessTestRunner`](../../src/orchestrator/sdlc/testrunner.py#L95), [`WorkspaceManager`](../../src/orchestrator/sdlc/workspace.py#L59), [`_build_ci`](../../src/orchestrator/sdlc/worker.py#L163), [`_build_codegen`](../../src/orchestrator/sdlc/worker.py#L87), [`_build_review`](../../src/orchestrator/sdlc/worker.py#L148), [`_default_database_url`](../../src/orchestrator/sdlc/worker.py#L54), [`_default_workspace_root`](../../src/orchestrator/sdlc/worker.py#L61), [`build_run_budget`](../../src/orchestrator/sdlc/worker.py#L70), `getenv`, `orchestrator.runtime.artifact_store_from_env`, `sqlalchemy.ext.asyncio.async_sessionmaker`, `sqlalchemy.ext.asyncio.create_async_engine`

### `build_run_budget`

[`src/orchestrator/sdlc/worker.py:70`](../../src/orchestrator/sdlc/worker.py#L70)

- **Called by** (2): [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183), [`main`](../../scripts/live_sdlc_worker.py#L44)
- **Calls** (2): `getenv`, `orchestrator.core.llm.RunBudget`

### `run_sdlc_worker`

[`src/orchestrator/sdlc/worker.py:259`](../../src/orchestrator/sdlc/worker.py#L259)

- **Called by** (2): [`_main`](../../src/orchestrator/sdlc/worker.py#L305), [`main`](../../scripts/live_sdlc_worker.py#L44)
- **Calls** (8): [`SDLCActivities`](../../src/orchestrator/sdlc/activities.py#L44), [`_sdlc_config`](../../src/orchestrator/sdlc/worker.py#L220), [`build_deps`](../../src/orchestrator/sdlc/worker.py#L183), [`connect_client`](../../src/orchestrator/temporal/config.py#L61), `create_task`, [`sdlc_activity_methods`](../../src/orchestrator/sdlc/worker.py#L226), `temporalio.worker.Worker`, `wait`
- **Documented in**: `docs/specs/archive/BLOCK-C-DESIGN.md#3-module-layout`, `docs/specs/archive/BLOCK-C-DESIGN.md#8-worker-registration`

### `sdlc_activity_methods`

[`src/orchestrator/sdlc/worker.py:226`](../../src/orchestrator/sdlc/worker.py#L226)

- **Called by** (1 production · 1 test): [`run_sdlc_worker`](../../src/orchestrator/sdlc/worker.py#L259), [`test_sdlc_e2e_marches_through_both_gates`](../../tests/integration/test_sdlc_workflow_e2e.py#L95)
- **Documented in**: `docs/specs/bet2c-in-loop-approval.md#as-built-notes`

### `sdlc_task_queue`

[`src/orchestrator/sdlc/worker.py:65`](../../src/orchestrator/sdlc/worker.py#L65)

- **Called by** (3): [`_run_sdlc`](../../src/orchestrator/cli.py#L545), [`_sdlc_config`](../../src/orchestrator/sdlc/worker.py#L220), [`start_run`](../../src/orchestrator/sdlc/run_control.py#L49)
- **Calls** (1): `getenv`
- **Documented in**: `docs/specs/archive/BLOCK-C-DESIGN.md#8-worker-registration`, `docs/specs/archive/LIVE-TESTING.md#sdlcworkflow-with-id-task-sdlc-id-the-id-the-approval-api-routes-to`

## Imports

`__future__.annotations`, `asyncio`, `collections.abc.Callable`, `contextlib`, `dataclasses`, `logging`, [`orchestrator.agentic`](../../src/orchestrator/agentic/__init__.py#L1), [`orchestrator.codereview.auth`](../../src/orchestrator/codereview/auth.py#L1), [`orchestrator.codereview.config`](../../src/orchestrator/codereview/config.py#L1), [`orchestrator.codereview.github_client`](../../src/orchestrator/codereview/github_client.py#L1), [`orchestrator.core.llm`](../../src/orchestrator/core/llm/__init__.py#L1), [`orchestrator.personas.software_engineer`](../../src/orchestrator/personas/software_engineer.py#L1), [`orchestrator.runtime`](../../src/orchestrator/runtime/__init__.py#L1), [`orchestrator.sdlc.activities`](../../src/orchestrator/sdlc/activities.py#L1), [`orchestrator.sdlc.ci`](../../src/orchestrator/sdlc/ci.py#L1), [`orchestrator.sdlc.codegen`](orchestrator.sdlc.codegen.md), [`orchestrator.sdlc.deps`](../../src/orchestrator/sdlc/deps.py#L1), [`orchestrator.sdlc.grounding`](../../src/orchestrator/sdlc/grounding.py#L1), [`orchestrator.sdlc.preflight`](../../src/orchestrator/sdlc/preflight.py#L1), [`orchestrator.sdlc.review`](../../src/orchestrator/sdlc/review.py#L1), [`orchestrator.sdlc.testrunner`](orchestrator.sdlc.testrunner.md), [`orchestrator.sdlc.workflows`](../../src/orchestrator/sdlc/workflows.py#L1), [`orchestrator.sdlc.workspace`](../../src/orchestrator/sdlc/workspace.py#L1), [`orchestrator.spine.grounder`](../../src/orchestrator/spine/grounder.py#L1), [`orchestrator.temporal.config`](../../src/orchestrator/temporal/config.py#L1), `os`, `pathlib.Path`, `signal`, `sqlalchemy.ext.asyncio.async_sessionmaker`, `sqlalchemy.ext.asyncio.create_async_engine`, `temporalio.worker.Worker`, `typing.Any`

## Imported by

[`orchestrator.cli`](orchestrator.cli.md), [`orchestrator.sdlc.run_control`](../../src/orchestrator/sdlc/run_control.py#L1), [`scripts.live_sdlc_worker`](../../scripts/live_sdlc_worker.py#L1), [`tests.integration.test_sdlc_workflow_e2e`](../../tests/integration/test_sdlc_workflow_e2e.py#L1)
