jig-harness/jig

The follow-up claim and its result

stable · Version 1

When a pull request merges, its follow-up settles what the merge still owes, by running the repository’s follow-up command on it once. The follow-up marker claims that one follow-up, so that one run takes it and the later run stops before it acts, and says how it ended. The claim settles who won once both markers are visible on the forge: two runs whose listings lag can each read themselves as the winner and both act, so a follow-up command’s effect outside the pull request must be safe to repeat. A dispatcher’s tick posts one before it starts the follow-up’s session; a follow-up a person runs posts one through jig dispatch marker claim. The dispatcher reads the markers to know which merges are followed up, how each ended and what to tell a person; a second host dispatching the same repository reads them as its shared records; and a repository’s own follow-up command reads them through jig dispatch marker check before each act outside the pull request.

The marker is a comment on the merged pull request that opens with <!-- jig-dispatch-followup --> on a line of its own, holds its record in the record envelope’s marker form in the second marker, and ends with a line a person reads. The hidden comment markers’ chapter gives the envelope and the form; the record’s own fields are below.

It is a forge claim, and is read by the claims’ rule. A marker counts only from a trusted author: the reader’s own forge login, or an author the forge vouches for as an owner, member or collaborator of the repository. Of two trusted markers, the earlier comment wins, and the later run stops before it acts (jig dispatch marker exits 3). A pull request has one follow-up, so a trusted marker whose record does not read still claims it, and holds against every later one until a person settles it, by marking it done or deleting it. A marker whose outcome is not one listed here for its run, or whose version is newer than the one listed, does not read, and so holds the same way: the reader starts no follow-up over it. Only the host that posted a tick’s marker writes its outcome.

Two earlier forms still read: version 1 of the record, whose key was the pull request’s number, and the line form written before the envelope, whose second line is jig dispatch follow-up · record: <id> for a tick or jig dispatch follow-up · run: manual · outcome: running (or done) for a person’s run. The dispatcher also keeps each tick’s follow-up outcome in its own database (dispatch-followup-outcome in RECORDS.md), with the values a tick’s marker carries, so the outcome outlives the launch record.

How a follow-up command claims, checks and ends its marker with jig dispatch marker: the plugin’s README, under its follow-ups. The runs and their outcomes, for a program in any language: data/followup-claim.json, whose field entries also give each payload field’s type and the runs whose markers carry it; the JSON Schemas below publish the claim and result forms those records use.

The record

KindMediumMarkersVersionKeyMeaning
dispatch-followupforgejig-dispatch-followup, jig-dispatch-followup-data2^(?:followup|[1-9]\d*)$The claim on a merged pull request’s one follow-up: which run took it, a dispatcher’s tick or a person’s, and once it ended, its outcome. A follow-up posts or reads it before it acts, and stops when an earlier trusted marker holds the follow-up.

The runs

RunMeaning
tickA dispatcher’s tick took the follow-up: its marker names the launch record of the session the tick started and the host that started it, and that host writes the follow-up’s outcome onto the marker once the launch record ends.
manualA person ran the follow-up, and its run posted the marker through jig dispatch marker claim: the run writes its own outcome onto it (jig dispatch marker done).

The outcomes

A tick’s marker carries no outcome while its follow-up runs, and until its host writes the end.

OutcomeRunMeaning
donetickThe follow-up’s session recorded its result as done (jig dispatch result): the follow-up is finished, and nothing starts it again.
failedtickThe follow-up’s session ended without recording done, or its launch died and is not retried: a person acts, and the marker keeps holding the follow-up against every later one until a person marks it done or deletes it, or the dispatcher’s recovery releases it once, as for a rate-limit wait or a routine that failed.
runningmanualA person’s run claimed the follow-up and has not finished its last act. It holds the follow-up against every later run; a run that failed leaves it so (jig dispatch marker failed) until a person marks it done or deletes it, or the dispatcher releases a stale one once.
donemanualA person’s run finished its last act (jig dispatch marker done): the follow-up is finished.

The record’s fields

Beside the envelope’s, Jig’s writers write these fields into a marker’s record, and no other. “Always” and “sometimes” say whether a run’s marker carries a field on every marker or on some; “never” that it carries none.

FieldTypeA tick markerA manual markerMeaning
printegeralwaysalwaysThe number of the pull request the marker is on; a marker whose record names another pull request does not read.
runstringalwaysalwaysWhich run took the follow-up: one of the runs listed above.
recordstringalwaysneverThe launch record of the session the tick started, in the dispatcher’s form <yyyymmdd>T<hhmmss>Z-<8 hex>.
hoststringsometimesneverThe host whose tick took the follow-up, as a digest of its dispatcher’s database instance: a public comment names no machine, and that host recognises its own marker. A marker posted before markers named their host carries none until the host that ends it writes its own.
ownerbooleansometimesneverWhether the host that took the follow-up owns the repository’s board, notifications and history rows; absent where that host does not say.
outcomestringsometimesalwaysWhere the follow-up stands: one of the outcomes listed above for the marker’s run. A tick’s marker carries none until its host writes the end.
endedAtstringsometimesneverWhen the follow-up’s launch ended, as an ISO 8601 time, written by its host with the outcome.
releaseTagsarraysometimesneverUp to 100 release tags the follow-up found owed, handed to the repository’s owner dispatcher for tracker filing. The owner takes these only from a trusted non-owner follow-up outcome.
bystringsometimesneverWho wrote the follow-up run’s closing report (agent, driver, wrapper, steward or person), or none when it left none, written by its host with the outcome. The report’s own text stays on that host.
causestringsometimesneverWhy the follow-up run fell short, from the closing report’s closed list of causes, written by its host with the outcome when the report named one.

JSON Schemas

The claim schema describes the enveloped JSON record, including version 1 envelopes. The result schema additionally requires a final outcome. Earlier plain-text markers retain their textual grammar. Version 1 identifies its pull request by its envelope key and ignores any pr field; version 2 requires pr and uses the key followup.

Machine-readable files

Source: plugin/protocol/followup-claim.md