bac3efee89
feat(activities): resolve_context stub + evaluate_templates — T15/T16
...
activities.py — resolve_context (T15):
- dispatches on source.type: 'static' returns config["value"]
- 'http_get' / 'db_query' raise ApplicationError(non_retryable=True)
- unknown types raise ApplicationError(non_retryable=True)
template_engine.py — evaluate_templates (T16, pure function):
- evaluates optional condition expressions against context snapshot
(restricted eval, no builtins)
- interpolates {context.<name>.<key>} placeholders via str.format_map
- returns list[{task_type, params}] with falsy-condition rows omitted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 22:06:09 +00:00
5e4dc6c946
feat(activities): implement load_activity_definition — T14
...
activities.py:
- init_session_factory(url): module-level async_sessionmaker init,
called once from worker.py before workers start
- load_activity_definition(activity_id): queries activity_definitions
by UUID, returns JSON-serialisable dict; raises ApplicationError
(non_retryable=True) if row not found
worker.py:
- reads ACTCORE_DB_URL at startup, fails fast if missing
- calls init_session_factory() before connecting to Temporal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 22:02:15 +00:00
21edc313db
feat(worker): scaffold activities, workflows, worker entrypoint — T13
...
src/activity_core/activities.py:
- load_activity_definition, resolve_context, log_run — @activity.defn
stubs (raise NotImplementedError, bodies in T14–T17)
src/activity_core/workflows.py:
- RunActivityWorkflow (orchestrator-tq) — @workflow.defn stub (T18)
- TaskExecutorWorkflow (task-execution-tq) — @workflow.defn stub (T19)
src/activity_core/worker.py:
- Connects to Temporal via TEMPORAL_HOST / TEMPORAL_NAMESPACE env vars
- Spawns two Workers: orchestrator-tq and task-execution-tq
- Runs until cancelled (python -m activity_core.worker)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 21:57:56 +00:00