Expand description
References a task makes to work that already exists in the repository.
A task such as “land the fix that already lives on magi/27b2/A” is about
a change that is not on the base branch. Started from the base alone, the
candidates have nothing to land: the run ends with an empty branch. So the
task text is scanned for magi/<run>/<label> branch names and commit
shas, each is checked against the repository, and the ones that name
unmerged work seed the candidates (Runner::prep).
Every judgement here is a question git can answer, and a question git cannot answer (a shallow clone, a failing command) is reported as unresolved rather than read as “not merged”.
Structs§
- Plan
- Where the candidates start and what is applied on top.
- Seed
- One reference found in a task, and what the repository says about it.
- Token
- A candidate reference lifted out of prose, not yet checked.
Enums§
- Seed
Kind - What a reference turned out to be, relative to the base commit.
Functions§
- describe
- One line per reference, as plain fact.
Nonewhen there is nothing to say. - plan
- Turn resolved seeds into a starting point. Unmerged branches must form a single line of history (each one contained in the next); two that diverge cannot both be the start and guessing which the task meant is refused. Unmerged bare shas already contained in the start are not picked twice, and are ordered oldest first whatever order the task listed them in.
- resolve
- Check every reference in
textagainstrepo, relative tobase_commit. - scan
- Pull
magi/<run>/<label>branch names and 7-40 digit hex shas out oftext, branch names first, then in order of first appearance, without duplicates. A sha must contain a digit, which drops words such asdefacedandfacade.