Skip to main content

Module split

Module split 

Source
Expand description

Breaking one issue or one pull request into smaller ones.

The unit of work was fixed: one issue became one branch and one pull request whatever its size, and the only thing that changed it was somebody filing the smaller issues by hand. The review loop is the product and its quality falls off with diff size, so the size of the unit is the biggest lever there is on how well spar works, and it was the one a person could not pull.

split decomposes and stops. It never triages, never implements a child, and never merges: it produces smaller units and hands them to the commands that already exist. That keeps one invocation cheap and comprehensible, and it keeps the blast radius of a wrong split to some issues and some branches rather than to hours of implementation.

Two agents, asymmetrically. One proposes the parts with the code open, the other rules on the proposal: accept, reject, or accept with named parts struck. Not two independent proposals, because two decompositions of one thing cannot be reconciled mechanically and reconciling them is a third judgement nobody asked for. Disagreement resolves toward not splitting, on the same asymmetry checkin runs on: getting a decline wrong costs one person one read of something that stays as it was, and getting the write wrong costs them a queue to clean up.

spar never rewrites the branch behind somebody’s pull request. Splitting a pull request is purely additive: new branches, new pull requests, one comment. No existing branch is moved, nothing is closed, and nothing is rebased under anybody. Removing half of a pull request in place is destroying work in place, and two models agreeing does not make that reversible for the person who wrote it. additive is that invariant as code.

Structs§

Candidate
One open item the bare spar split is considering.
Decision
What survived the proposal, the check, and the cap.
Mode
Where a run of spar split stops.

Constants§

SPLIT_MARKER
Written into a split parent’s body and into the comment left on a split pull request. An HTML comment, so GitHub renders it as nothing.

Functions§

additive
Refuse any branch a split did not itself create.
already_split
Whether this text already carries a checklist or a comment spar wrote.
apply_slice
Put one slice of the parent’s change on this branch.
decide
Rule on a proposal, given the check and the cap.
leftover
The files a change touches that none of carried holds.
screen
One agent’s verdict on the whole queue in one call.
split_issue
split_pr
tracker_body
A split parent’s body: what it said, then the checklist of its parts.
uncommitted
Whether anything in this tree is missing from the commit, untracked files included.