Inspiration

Our Jira boards now have more workers than people. Coding agents pick tickets on their own, and they collide: two agents take the same ticket, or one deploys to staging while another is still testing there. Jira's assignment says who should work on something, but nothing says who may, right now, and what happens when an agent stalls halfway.

What it does

Clearance grants leases on Jira issues and on scarce shared resources, for people and AI agents alike.

  • One holder at a time. A claim returns a secret claim id and a fence number. Everyone else hears who holds it and until when.
  • Leases expire. If an agent stalls, someone else takes over with a higher fence. The stalled agent's old claim is rejected, so it cannot write over newer work.
  • Deterministic next task. next-task offers only issues that are open, labelled agent-ok, never needs-human, and unclaimed, by priority then rank. The code decides the order; the model only decides whether to take it.
  • Shared resources. Staging with capacity 1, a device lab with 2. One holder per slot, the others wait in a queue.
  • Jira enforces it. With the workflow rule Clearance required, an issue only moves to In Progress for the person who holds its lease.

Surfaces: an issue panel (holder, expiry, fence, claim/release, audit trail), a project page for shared resources, eight MCP tools (rovo:mcp) with a public skill.md for external agents, and a Rovo agent, Clearance Coordinator, with the same actions.

How we built it

Forge, TypeScript, UI Kit, Forge SQL, rovo:mcp, rovo:agent/actions, jira:issuePanel, jira:projectPage, jira:workflowValidator and a scheduledTrigger. No egress: the production app is eligible for Runs on Atlassian. Forge SQL has no transactions, so every grant is a single statement: INSERT IGNORE the lease row, then one conditional UPDATE … fence = fence + 1 WHERE expires_at < now, then read back by resource and a random claim id. Only that read-back proves ownership. The database clock is the only clock.

Challenges

  • Atomicity without transactions. We made a race test the first build step and a hard switch condition. On a real developer site, 20 parallel acquires per round over 5 rounds each produced exactly one winner, with fences strictly increasing (28/28 checks; the calls verifiably overlapped).
  • Identity differs by entry point. Rovo actions carry the caller as context.accountId, external MCP calls as context.principal.accountId, workflow validators as args.user.accountId. We found each one with a key-only probe and fixed it.
  • Agents are sloppy callers. In our first real two-agent run, both agents sent issue instead of issueKey. The tools now accept the obvious aliases and answer with readable errors.

Accomplishments

  • Two real coding agents, connected over MCP, raced for the same ticket. One was cleared, the other was told who holds it and until when, then got the ticket with the next fence after the report.
  • The workflow validator blocks a transition without clearance and allows it for the holder. This was measured on a real site.

What we learned

Fencing tokens matter more than locks: a lease that expires is only safe if the old holder can be told apart from the new one.

What's next

A Bitbucket merge check (fence required to merge), Rovo-first flows where Rovo is enabled, and fairness for queued resources.

Disclosures

  • AI tools: Claude Code (Anthropic) wrote most of the code, tests and texts under the author's direction. OpenAI Codex assisted with validation, scheduled-trigger observability and completion work; Gemini/Antigravity generated the approved thumbnail. The author chose the idea, set the scope and approved the external steps.
  • Prior work: The lease and fencing semantics come from the author's own open-source coordinator ellmos-roshambo (Apache-2.0, Python). Clearance is a new Forge app, written in TypeScript from 2026-11-02 on; no code was copied.
  • Data: All demo data is synthetic.

Built With

Share this project:

Updates

Submission history