Lingtai
Docs
GitHub

Documentation

refs:

DoesDeletes the agent/<n>-attempt-<k> history refs a landed ticket left on origin.
Write it atend.
Needsrefs: true. branch defaults to false; when is landed, the only value.
Refuseswhen: any, refs: false, any step but end.
Watch outOnly for a ticket that landed: for one that did not, those refs are the only account of what was tried. Leave it out to keep every branch.

Stops the remote from collecting one ref per approach a repository has ever tried. Nothing else deletes a branch, so the count only grows, and every clone and fetch pays for all of them.

What it does#

An effect at end, like close: and labels:, so it cannot refuse. It removes the per-attempt sibling refs pushed when a ticket is claimed. agent/<n> itself stays unless branch: true: after a merge its commits are reachable from main, but it is the ref a person follows from the merge commit, so the default keeps what somebody might read.

Leaving it out keeps every branch. A team that keeps every branch for audit does not declare it.

Where it may be declared#

refsPlugin.at is { end }: an effect, and only end carries out effects.

Parameters#

fieldtyperequiredwhat it means
namestringyesHow the effect is named on the log.
refstrueyesThe key. What is deleted is decided by branch, not by this value.
branchbooleanno, falseAlso delete agent/<n>, on top of its arms.
whenlandedno, landedOnly landed, written out so the file says which ending.

when accepts the one value landed. The per-attempt refs exist so a later attempt can fetch what an earlier one tried, and a cleanup on any other ending destroys that.

Examples#

# the default: clean the arms of what landed, keep the branch
end:
  - name: tidy
    refs: true
# delete the branch too, for a team that reads history from main and nowhere else
end:
  - name: tidy
    refs: true
    branch: true
# beside close: — the ticket is closed and its refs go in the same ending
end:
  - name: close it
    close: true
  - name: tidy
    refs: true

Each resolves under resolveSource. They differ in what is destroyed: the arms, the arms and the branch, and what else happens at the same ending.

What it refuses#

end:
  - name: tidy
    refs: true
    when: any

steps.end.0.when: … its "when" field is not what "refs" accepts: Invalid input: expected "landed".

At any other step: refs: does not implement … — it serves end: it is an effect rather than a verdict. Both when the recipe resolves — before a worktree, before an agent, before any money.

Rendered from doc/plugins/refs.md at build time. The file is the document; this page is a projection of it, and never a copy — which is why the fix for anything wrong on it is a pull request against that file.