Repository navigation
worker-stops-importing-the-orchestrator/3: The graph and the lane stop importing the events module - #996
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Start here
Already verified by the pipeline
Review tier:
light— the planned estimate is lightWhy
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 workerimports the dispatcher modulecli/pipeline.pyand so reaches 231 modules and 82,000 lines, and the agent graph (graph/nodes.py) imports the orchestrator'spipeline/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 importspipeline.eventsany more.pipeline.holdsmodule 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), theClaimtype and the owed and moved-base state and cause sets.pipeline.eventsimports these helpers fromholdsand re-exports the same objects, so its existing callers and its behaviour are unchanged.holds, which removes their imports of the dispatcher's events module.graph.nodesandpipeline.resolution_lane→pipeline.eventsentries.pipeline.holdsand thatpipeline.eventsexposes 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/3of 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:
eventskeepsheld_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 callevents.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 ineventscalls it.HELD_BY_A_REVIEWERis imported intoeventsonly to be re-exported. Nothing ineventsuses it, and nothing in src/ or tests/ reads it asevents.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
autoand policy allowed; a person merges any other, after checkingthe stack order above.