work-implement-queue
work-implement-queue
Drain the repo's queue of implementable issues — every ready issue plus every changes-requested issue (re-work after review) — and carry each to a pushed, reviewable state by delegating to work-implement. The loop implements nothing itself: the tracker is the queue, each issue is worked in a fresh worker, and the output is an issue in reviewRequested, handed to the work-review-queue. Run it under /loop work-implement-queue for continuous operation.
Opted out? If the repo config sets work to false, all work-* skills are disabled for the repo — stop immediately and tell the user they are turned off in .tituskirch-skills.json. An absent work block is not disabled. Check .work == false on the resolved config before acquiring the lock or building the queue — step 1 resolves it, right after the required-worker check that has to come first. A missing jq or config exits non-zero too, so a pass is not evidence the config was read.
Workflow
1. Load config & lock
work-implementis required, and checked first. This loop implements nothing itself — every issue is handed to it — so if it is not installed, stop here, before resolving anything and before taking the lock: name the missing skill and report that no issue was touched. Checking up front is the whole point; a required call first noticed mid-drain has already leased issues intoworkingthat the next run must reclaim. It is also what lets this skill name the three contracts its worker's REFERENCE already states — Reading the config, The single-flight lock and The forge and its host — rather than carry a second copy of each: no path reaches any of them with the worker absent, because this check runs before all of them.- Config + tracker as in
work-implement(thework.*section; its REFERENCE's Config, read by the rules its Reading the config states). Resolve it with this skill's owntemplates/resolve-config.sh— the same copy every skill ships — and apply those rules unchanged. Where the tracker is a forge (github,gitlab), the host it talks to is resolved per repo rather than assumed — The forge and its host inwork-implement's REFERENCE. - Acquire the implement single-flight lock —
mkdirthe lock at$(git rev-parse --git-common-dir)/tituskirch-skills/work/implement.lock(atomic create-or-fail); a second implement-drain in the same checkout sees it held and exits. On adopting this path, firstrm -fthe old looseimplement.lock(see the migration in the spec) so the two cannot coexist. The review loop uses a separate lock (…/work/review.lock), so implement and review drains run concurrently. The path, themkdirprimitive, the heartbeat-timestamp stale rule, the migration and the single-checkout boundary are specified in The single-flight lock inwork-implement's REFERENCE.
2. Reconcile — reclaim crashed implementations
Before building the queue, reclaim issues an earlier implement-run crashed on: an issue in working with no pushed artifact (no PR / no pushed commit for it) was leased but abandoned before its push. The lock only proves no live worker in this checkout — this drain holds it, so nothing else here is live — but it says nothing about another clone. So gate the reclaim on the assignee the claim set: an issue assigned to a different runner — or, under one shared bot identity, to this runner (its live work in another clone reads the same) — is presumed live and left alone unless a weaker age fallback clears it; only an unassigned issue, or (with distinct per-runner identities) this runner's own crashed lease, is flipped back to ready (dropping the assignee) to be re-worked — or blocked if it left an unrecoverable state. This guard is what prevents destroying a second clone's in-flight work, not merely duplicating it. Full rules, incl. the same-bot caveat: Reconcile in work-implement's REFERENCE. Idempotent — nothing to reclaim is the normal outcome.
(A working issue with a pushed artifact only failed to flip its label — advance it to reviewRequested instead of re-working.)