From 392ca50aeae6bc6a7f8c4e2cca84cbd787ff362c Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:38:14 +0000 Subject: [PATCH 1/3] docs(#9389): ADR 0172, let bot-added labels start agents on Jira Add ADR 0172. The jira-poll driver drops every bot-classified event before authorization, so a label added by the repository's own Fullsend account never starts an agent. Whether another automation account's label does depends on its display name. The ADR makes Jira the second implementation of ADR 0107's label grant: bot-authored label-added events take the repository's jira `labels:` rule like a human's, while bot comments and other non-label events stay dropped to keep the #6835 loop guard. The ADR settles scope, each labels: mode, bot classification (only the poller's own account ID or Jira's app account type; a display-name match alone is treated as a human), loop safety (harness authors keep hand-off chains acyclic), and untrusted-content parity with GitHub. Add cross-reference notes to ADR 0107 and ADR 0153, and target-state entries to docs/architecture.md. Implementation in internal/jirapoll is left to a follow-up issue. Note: pre-commit could not fetch its remote hook repositories (certificate verification failed). The applicable hooks were run directly and passed: pre-commit-hooks 6.0.0 fixers and checks, lint-adr-status, lint-adr-numbers, lint-adr-frontmatter, lint-broken-symlinks, lint-docs-links, lychee, and gitleaks. The semgrep hook skipped itself because it could not download its ruleset. Closes #9389 Co-Authored-By: Claude Opus 5.5 --- ...y-resolution-for-dispatch-authorization.md | 3 + ...l-actors-without-project-administration.md | 4 + ...t-bot-added-labels-start-agents-on-jira.md | 122 ++++++++++++++++++ docs/architecture.md | 10 +- 4 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md diff --git a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md index f011ca35d2..0ede6d9cf3 100644 --- a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md +++ b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md @@ -24,6 +24,9 @@ meet the selected harness's effective `human_min_role` for target CEL dispatch; the accepted label mutation alone no longer bypasses a stronger human minimum. This ADR's provider-classified bot label grant and registered-bot gate remain. +[ADR 0172](0172-let-bot-added-labels-start-agents-on-jira.md) makes the +Jira poll adapter the second implementation of the label grant. + Extends [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) and defines the bot behavior to be added to the existing v1 contracts. This ADR explicitly permits the deferred migration from legacy bot exceptions to diff --git a/docs/ADRs/0153-authorize-jira-poll-actors-without-project-administration.md b/docs/ADRs/0153-authorize-jira-poll-actors-without-project-administration.md index 6b59f9c234..ed70eedfdc 100644 --- a/docs/ADRs/0153-authorize-jira-poll-actors-without-project-administration.md +++ b/docs/ADRs/0153-authorize-jira-poll-actors-without-project-administration.md @@ -18,6 +18,10 @@ Date: 2026-10-28 Accepted +[ADR 0172](0172-let-bot-added-labels-start-agents-on-jira.md) stops the +poller from dropping bot-authored label-added events, including its own +account's. They take the `labels:` rule below; other bot events stay dropped. + ## Context The `jira-poll` input driver diff --git a/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md new file mode 100644 index 0000000000..acda2cceea --- /dev/null +++ b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md @@ -0,0 +1,122 @@ +--- +title: "172. Let bot-added labels start agents on Jira" +status: Accepted +relates_to: + - agent-architecture + - security-threat-model +topics: + - authorization + - jira + - bots + - dispatch +--- + +# 172. Let bot-added labels start agents on Jira + +Date: 2026-11-12 + +## Status + +Accepted + +## Context + +[ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) keeps +label-added events as the supported way for one agent to hand work to another. +It names GitHub as the only implementation and lets another adapter enable the +same grant once it has forge-authoritative evidence of who made the label +change. Jira's changelog records the author of each label change, and +[ADR 0153](0153-authorize-jira-poll-actors-without-project-administration.md) +already treats an accepted Jira label change as authorization for a human +labeler. + +The `jira-poll` driver +([ADR 0063](0063-polling-based-work-discovery.md)) drops every event it +classifies as bot-authored before authorization or harness matching. An actor +counts as a bot when it is the account the poller authenticates as (added for +the dispatch loop in +[#6835](https://github.com/fullsend-ai/fullsend/issues/6835)), when Jira +reports the account type `app`, or when its display name ends in "bot" or +"automation" or starts with "Automation for". So a label added by the +repository's own Fullsend account never starts an agent. Whether a label from +another automation account does depends on its display name. The workaround, +writing labels with a second, ordinarily named account, relies on that name +test and disables the #6835 loop guard, which only works when the poller and +the agents share one Jira account +([#9389](https://github.com/fullsend-ai/fullsend/issues/9389)). + +This ADR aims to let a bot-added Jira label start an agent on the same terms +as on GitHub, without relying on display names and while keeping the #6835 +guard for comments. + +## Options + +- **Keep dropping all bot events.** Hand-off stays impossible with the shared + account and accidental with any other. +- **Admit all bot events.** Bot comments would reopen the #6835 loop, and + non-label bot dispatch needs the registered bot identity ADR 0107 requires, + which Jira does not have. +- **Admit bot label-added events only, through the repository's `labels:` + rule** (chosen). + +## Decision + +We admit bot-authored Jira label-added events to the dispatch gate to make +Jira the second implementation of ADR 0107's label grant. + +1. **Scope.** Only `label_changed` events with `label.action: added` stop + being dropped. Bot-authored comments, slash commands, label removals, and + issue opened, edited, closed, and reopened events stay dropped, which keeps + the #6835 guard. +2. **`labels:` modes.** A bot's label-added event takes the same path as a + human's under the repository's `jira` authorization entry. Under + `jira_editors`, Jira's acceptance of the label change, with the changelog + author as provenance, is the grant, as on GitHub. Under `allowlist`, the + bot account must be in the `write` or `triage` list; listing it is the + opt-in. Under `project_roles`, or with no `jira` entry, the bot account + needs a project role like anyone else. In every mode, matching a harness + trigger is still required. +3. **Bot classification.** Only provider-controlled metadata classifies a + label author as a bot: the poller's own account ID or Jira's `app` account + type. A label author matched only by display name is a human and takes the + human rules, including + [ADR 0151](0151-harness-human-role-minimums.md)'s harness minimum, so a + rename cannot bypass them. On the paths that stay dropped, the display-name + test may remain, because dropping an event grants nothing. +4. **Loop safety** is the harness author's responsibility, as on GitHub. Only + a new label addition dispatches, so re-adding a label that is present + triggers nothing. A loop needs a label to be removed and added again. For + example, an agent removes its trigger label and later adds it back, or + agent A adds B's trigger and B adds back A's trigger after A's was removed. + A harness must not trigger on a label that its own agent, or an agent it + hands off to, adds back; hand-off chains must be acyclic. The + per-issue-per-cycle event cap bounds each poll cycle, not the loop. We + reject telling agents apart by labeler: all of them write through one Jira + account, which the #6835 guard needs. A per-issue dispatch cap would affect + every forge and needs its own ADR. +5. **Untrusted content.** Jira is at parity with GitHub. An agent that reads + issue text and adds a triggering label gives that text's author an indirect + way to trigger the next agent. The label authorizes only its exact + transition, and the content the agent acted on stays untrusted, as ADR 0107 + states. + +## Forge scope + +This decision applies to Jira-sourced events from the shared `jira-poll` +driver, the same under GitHub Actions and GitLab CI. GitHub, GitLab, and +Forgejo event handling are unchanged; ADR 0107 governs their bot events. + +## Consequences + +- A triage agent's label can start the code agent on Jira with the single + shared account, so the second-account workaround and its loss of the #6835 + guard are no longer needed. +- Labels Fullsend itself adds, such as the `fs-code-agent` run marker, become + label-added events that harness triggers can match, so harness authors must + keep triggers off them. +- A cyclic hand-off runs until a human removes the label or the trigger; + no platform cap stops it. +- Under `allowlist` and `project_roles`, bot hand-off needs the bot account + listed or given a project role, so those repositories opt in explicitly. +- The display-name test no longer affects whether a label-added event is + admitted. diff --git a/docs/architecture.md b/docs/architecture.md index 7ac5b87ac4..a368d6b82e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -502,6 +502,12 @@ The existing design principle is that [the repo is the coordinator](problems/age `labels: project_roles` (which, with no lists, resolves every event through the roster, as with no entry) ([ADR 0153](ADRs/0153-authorize-jira-poll-actors-without-project-administration.md)). +- Jira bot label hand-off (target state): the Jira poller stops dropping + bot-authored label-added events, including its own account's. They take the + repository's `labels:` rule like a human's. Only the poller's account or + Jira's `app` account type classifies a label author as a bot, and other bot + events stay dropped. Harness authors keep hand-off chains acyclic + ([ADR 0172](ADRs/0172-let-bot-added-labels-start-agents-on-jira.md)). - The Jira site URL is kept for links and cloud-ID discovery, and API calls go through the Atlassian API gateway for the site, whose host can be overridden. A token with the account's email is sent with Basic auth (bot @@ -576,7 +582,9 @@ The existing design principle is that [the repo is the coordinator](problems/age the labeler's verified effective role. Provider-verified bot label handoffs use a separate grant for the exact transition and its proven projection; label-to-agent mapping remains harness/CEL routing. At the time - of ADR 0107, GitHub is the only production implementation. CEL may + of ADR 0107, GitHub is the only production implementation; Jira is the + second for the label grant (target state, + [ADR 0172](ADRs/0172-let-bot-added-labels-start-agents-on-jira.md)). CEL may further restrict recognized bot roles but cannot authorize an unknown bot on non-label paths ([ADR 0107](ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md); [Authorization Contract v1](normative/authorization/v1/) for current dispatch; From 9cdb583465a180097472fe85650b283a38af2224 Mon Sep 17 00:00:00 2001 From: fullsend-fix <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:56:23 +0000 Subject: [PATCH 2/3] docs(#9389): make trigger removal the cyclic hand-off stop Removing the label is not a reliable stop for a cyclic hand-off: a running agent can add it back, and the poller rebuilds label additions from changelog history without checking the label is still present. Name removing the harness trigger or routing, and cancelling active or queued runs, as the guaranteed stop. Note: pre-commit could not fetch hook repositories (TLS failure), so the applicable whitespace/line-ending checks were done manually and lychee offline link check passed. Addresses #9390 Co-Authored-By: Claude Sonnet 5.5 --- .../0172-let-bot-added-labels-start-agents-on-jira.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md index acda2cceea..03075b96ef 100644 --- a/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md +++ b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md @@ -114,8 +114,12 @@ Forgejo event handling are unchanged; ADR 0107 governs their bot events. - Labels Fullsend itself adds, such as the `fs-code-agent` run marker, become label-added events that harness triggers can match, so harness authors must keep triggers off them. -- A cyclic hand-off runs until a human removes the label or the trigger; - no platform cap stops it. +- A cyclic hand-off runs until a human removes the harness trigger or + routing, and cancels any active or queued runs; no platform cap stops it. + Removing the label is at most best-effort: a running agent can add it back, + and the poller rebuilds label additions from changelog history without + checking that the label is still present, so an addition already recorded + can still dispatch after removal. - Under `allowlist` and `project_roles`, bot hand-off needs the bot account listed or given a project role, so those repositories opt in explicitly. - The display-name test no longer affects whether a label-added event is From 9b9162716b5e478e62201f8b502646e1b43f40cb Mon Sep 17 00:00:00 2001 From: fullsend-fix <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 22:10:26 +0000 Subject: [PATCH 3/3] docs(#9389): qualify display-name limits and backstop reset in ADR 0172 Decision 3 and the last Consequences bullet no longer claim a rename cannot affect classification; they state that non-app, ordinarily named accounts are treated as humans and are not an enforced boundary. Decision 5 no longer lets unrelated human activity reset the per-issue backstop; only the rolling window does. Note: pre-commit could not fetch remote hook repos (certificate error); the repo-local ADR and docs-link hooks were run directly and passed. Addresses #9390 Co-Authored-By: Claude Sonnet 5.5 --- ...t-bot-added-labels-start-agents-on-jira.md | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md index 77c5c229cc..eea19ed104 100644 --- a/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md +++ b/docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md @@ -97,12 +97,18 @@ Jira the second implementation of ADR 0107's label grant. of the repository's `jira` entry. Any other author that the poller classifies as a bot, whether by Jira's `app` account type or by display name, such as Jira Automation's actor or an installed app, stays dropped - until the entry lists its account ID. The display-name test therefore stays - on the dropped path only, where it grants nothing, and a rename cannot - admit an event or bypass - [ADR 0151](0151-harness-human-role-minimums.md)'s harness minimum. An - author that no test classifies as a bot is a human and takes the human - rules. + until the entry lists its account ID. The display-name test therefore only + ever drops events; it never admits one, so it grants nothing. It is not an + enforced boundary, though. An author that no test classifies as a bot is a + human and takes the human rules, so an unlisted automation account that is + not of type `app` and has an ordinary name, or that is renamed to one, + moves from the dropped path to the human path. Under `jira_editors`, its + label addition can then dispatch without its account ID being listed. It + still needs Jira's permission to edit the issue, and this path exists + before this ADR. The guarantee is that the poller's own account and listed + accounts are admitted by account ID, not that every automation account is + kept out. A repository that needs a firm boundary uses `allowlist` or + `project_roles`. 4. **Loop safety** is the harness author's responsibility, as on GitHub. Only a new label addition dispatches, so re-adding a label that is present triggers nothing. A loop needs a label to be removed and added again. For @@ -119,9 +125,11 @@ Jira the second implementation of ADR 0107's label grant. The count is kept per issue beside the checkpoint (`lastCheck`) the poller already holds, so it applies to Jira only and changes nothing on other forges. Past the limit, further admitted label additions on that issue are - dropped with a warning until the window passes or a human-authored event - arrives. The limit, window, and setting are decided in the follow-up - implementation. + dropped with a warning until the window passes. Ordinary human activity, + such as a comment, does not reset the count, because the author of that + activity need not be authorized to dispatch. Only the rolling window + restores the budget. The limit, window, and setting are decided in the + follow-up implementation. 6. **Untrusted content.** Jira is at parity with GitHub. An agent that reads issue text and adds a triggering label gives that text's author an indirect way to trigger the next agent. The label authorizes only its exact @@ -164,5 +172,7 @@ Forgejo event handling are unchanged; ADR 0107 governs their bot events. additions stay dropped, as today, unless the entry lists the actor's account ID, and a repository that lists one accepts that anyone who can fire its rules can start agents. The security threat model notes this. -- The display-name test no longer affects whether a label-added event is - admitted. +- The display-name test never admits a label-added event; it can only drop + one. It is not an enforced boundary: an unlisted, non-`app` account with an + ordinary or renamed display name is classified as human and takes the + human rules.