Skip to content

worker-stops-importing-the-orchestrator/3: The graph and the lane stop importing the events module - #996

Merged
bwmatson merged 2 commits into
mainfrom
spec/worker-stops-importing-the-orchestrator/3
Nov 18, 2026
Merged

bwmatson merged 2 commits into
mainfrom
spec/worker-stops-importing-the-orchestrator/3

Conversation

@bwmatson

Copy link
Copy Markdown
Owner

Start here

Already verified by the pipeline

  • Tests were committed first and seen to fail first.
  • unit-test result: passed
  • Review took 1 review round

Review tier: light — the planned estimate is light

Why

This pull request builds part of change worker-stops-importing-the-orchestrator; this is the change's reason.

The kit's design splits it into a core, an orchestrator and a worker package, with the rule that the worker imports only the core. Today that rule is false. A map of the kit's 342 modules (module-level imports form a clean DAG; the only cycle comes from 88 imports inside functions) shows that abk worker imports the dispatcher module cli/pipeline.py and so reaches 231 modules and 82,000 lines, and the agent graph (graph/nodes.py) imports the orchestrator's pipeline/events.py. With every mo

… The full reason is in openspec/changes/worker-stops-importing-the-orchestrator/proposal.md.

What this pull request does

Moves the hold helpers shared by the agent graph and the resolution lane out of the dispatcher's events module into a new core module, pipeline/holds.py, so neither of them imports pipeline.events any more.

  • A new pipeline.holds module holds the hold-reading and hold-making helpers (held_cause, held_for_its_own_reason, held_for_depth, takeover_note, restore_depth_hold, hold_for_conflict, in_a_lane_run, read_base_tip), the Claim type and the owed and moved-base state and cause sets.
  • pipeline.events imports these helpers from holds and re-exports the same objects, so its existing callers and its behaviour are unchanged.
  • The graph's nodes and the resolution lane now import the helpers from holds, which removes their imports of the dispatcher's events module.
  • The package-boundary baseline drops its two graph.nodes and pipeline.resolution_lane → pipeline.events entries.
  • A new test checks that each helper can be imported from pipeline.holds and that pipeline.events exposes the same object, not a second definition.

Based on main, with nothing unmerged beneath it — ready to merge whenever the checks look right.

Unit worker-stops-importing-the-orchestrator/3 of change worker-stops-importing-the-orchestrator, task group(s) 3.
Spec: openspec/changes/worker-stops-importing-the-orchestrator/ in the planning repo.

Assumptions

This unit assumes nothing unmerged: everything it builds on is already in main.

Verification

This is a unit-test unit: everything it needs is fakes, fixtures or throwaway containers, so GitHub Actions runs the whole of it. No e2e-test run was required.

Left for later

Approved, with these recorded rather than blocking:

  • src/agent_build_kit/pipeline/events.py:180 — events keeps held_for_depth = _holds.held_for_depth, reached through a second import form (from agent_build_kit.pipeline import holds as _holds) and explained by a comment that does not say why it exists. Its only readers are three tests that call events.held_for_depth (tests/graph/test_release_event.py:130, tests/pipeline/test_events_release.py:505, tests/pipeline/test_events_rebase_cap.py:304); nothing in events calls it.
  • src/agent_build_kit/pipeline/events.py:72 — HELD_BY_A_REVIEWER is imported into events only to be re-exported. Nothing in events uses it, and nothing in src/ or tests/ reads it as events.HELD_BY_A_REVIEWER.

How this was built

Tests were committed first and seen to fail before any implementation existed; the commit order is checked mechanically; lint, formatting and types pass at the tip.


Opened by the spec-driven pipeline. The build agent never merges. The pipeline merges only
a unit review classified auto and policy allowed; a person merges any other, after checking
the stack order above.

The tests come first and fail until the implementation.

The kit's design splits it into a core, an orchestrator and a worker package, with the rule that the worker imports only the core.

Unit: worker-stops-importing-the-orchestrator/3
With this in, the tests of the previous commit pass.

The kit's design splits it into a core, an orchestrator and a worker package, with the rule that the worker imports only the core.

Unit: worker-stops-importing-the-orchestrator/3
@bwmatson bwmatson added change-worker-stops-importing-the-orchestrator The change this pull request belongs to checking In review, but its checks are still running review-light Review asks for a light look from a person in-review Built and waiting for human review and removed checking In review, but its checks are still running labels Nov 18, 2026
@bwmatson
bwmatson merged commit 1ca8425 into main Nov 18, 2026
5 checks passed
@bwmatson bwmatson added settling Merged; waiting for its checks to complete and removed in-review Built and waiting for human review settling Merged; waiting for its checks to complete labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-worker-stops-importing-the-orchestrator The change this pull request belongs to review-light Review asks for a light look from a person

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant