Skip to content

feat(worker-search): thread per-graph phase_settings into DecompositionPipeline (Phase 2 #32)#277

Merged
charlie83Gs merged 1 commit intomainfrom
feat/worker-phase-settings-threading-v2
Apr 20, 2026
Merged

feat(worker-search): thread per-graph phase_settings into DecompositionPipeline (Phase 2 #32)#277
charlie83Gs merged 1 commit intomainfrom
feat/worker-phase-settings-threading-v2

Conversation

@charlie83Gs
Copy link
Copy Markdown
Contributor

Summary

Adds `kt_hatchet.composition.resolve_phase_settings(state, graph_id, phase)` — shared helper that translates a running graph's `GraphConfig` into the `phase_settings` dict `DecompositionPipeline` now accepts (#276). Fail-fast on resolver error (tenancy invariant — a narrower graph-type composition MUST NOT silently widen to `Settings` defaults on a resolver hiccup).

Wired into the two Hatchet tasks that construct `DecompositionPipeline` directly:

  • `decompose_chunk_task` (worker-search.workflows.search)
  • `decompose_source_task` (worker-search.workflows.decompose)

Why

Closes Phase 2 #32 for worker-search. Worker-nodes `AgentContext`-wrapped call sites land in the follow-up #33 PR once `AgentContext` grows `graph_id`.

Based on #276 (adds `phase_settings` kwarg to `DecompositionPipeline`). Will rebase onto main after #276 merges.

Test plan

  • `uv run --project libs/kt-hatchet pytest libs/kt-hatchet/tests/test_composition.py -x -v` — 5/5 green (composition present / graph_id None / services None / resolver raises / unknown-phase)
  • `uv run --project services/worker-search pytest services/worker-search/tests/ -x -q` — 8/8 green
  • CI: full workspace tests after rebase

🤖 Generated with Claude Code

…onPipeline (Phase 2 #32)

Adds ``kt_hatchet.composition.resolve_phase_settings(state, graph_id,
phase)`` — the shared helper that translates a running graph's
``GraphConfig`` into the ``phase_settings`` dict
``DecompositionPipeline`` now accepts (#31 / #276). Fails fast on
resolver error: a graph opting into a narrower composition MUST NOT
silently widen to Settings defaults on a transient DB hiccup —
matches the tenancy-invariant posture of
``_resolve_composition_selectors`` in ``web_search``.

Wired into the two Hatchet tasks that construct
``DecompositionPipeline`` directly:

- ``decompose_chunk_task`` (worker-search.workflows.search)
- ``decompose_source_task`` (worker-search.workflows.decompose)

Worker-nodes call sites (``GatherFactsPipeline``, ``BuildingPipeline``,
``NodePipeline``) go through ``AgentContext`` which doesn't expose
``graph_id`` — threading there lands in the companion #33 PR once
``AgentContext`` grows the knob.

5 new unit tests on the helper cover: composition present, graph_id
None fallback, services None fallback, resolver-raises-propagates
(authorization guard), unknown-phase-empty-dict.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@charlie83Gs charlie83Gs force-pushed the feat/worker-phase-settings-threading-v2 branch from 6418616 to 1dd76c6 Compare April 20, 2026 23:14
@charlie83Gs charlie83Gs merged commit aec3b82 into main Apr 20, 2026
14 checks passed
@charlie83Gs charlie83Gs deleted the feat/worker-phase-settings-threading-v2 branch April 20, 2026 23:15
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant