Repository navigation
docs(#9389): ADR 0172, let bot-added labels start agents on Jira - #9390
fullsend-ai-coder[bot] wants to merge 4 commits into
Conversation
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 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 8:43 PM UTC · Completed 8:52 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.96 |
Site previewPreview: https://770a693b-site.fullsend-ai.workers.dev Commit: |
|
Risk Assessment: moderate (2/5) DetailsDocumentation-only PR adding an ADR with low metadata risk, elevated to moderate due to high churn, multi-author contention, and change coupling in docs/architecture.md. Previous runRisk Assessment: moderate (2/5) DetailsDocumentation-only PR adding an ADR with low metadata risk, elevated to moderate due to high churn, multi-author contention, and change coupling in docs/architecture.md. Previous run (2)Risk Assessment: moderate (2/5) DetailsDocumentation-only PR adding an ADR with low metadata risk, elevated to moderate due to high churn, multi-author contention, and change coupling in docs/architecture.md. Previous run (3)Risk Assessment: moderate (2/5) DetailsDocumentation-only PR adding an ADR with low metadata risk, elevated to moderate due to high churn, multi-author contention, and change coupling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lc29sdmVkX2J5X2NoYW5nZSJ9XX0= --> Looks good to me Earlier findings
Previous run (4)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImRvY3MvQURScy8wMTcyLWxldC1ib3QtYWRkZWQtbGFiZWxzLXN0YXJ0LWFnZW50cy1vbi1qaXJhLm1kIiwiaWQiOiJmXzVmZjQzNWYzYTEyMWFjNzQiLCJsaW5lIjoxMTYsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== --> ReviewFindingsLow
Labels: PR adds an ADR and edits user-facing architecture docs on dispatch authorization. Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 8:54 PM UTC · Completed 8:58 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.21 |
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 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Addressed the single low-severity finding in ADR 0172 by making removal of the harness trigger or routing the guaranteed stop for a cyclic hand-off and describing label removal as best-effort. Fixed (2):
Tests: passed CI inspections (5):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 9:00 PM UTC · Completed 9:09 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.65 |
Superseded by updated review
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ascerra
left a comment
There was a problem hiding this comment.
Review sweep: 2 findings posted inline (comment only, no approve or request-changes). Each one is checked against head 9cdb58346.
- HIGH
0172-let-bot-added-labels-start-agents-on-jira.md:80: anyappaccount, including Jira Automation's actor, becomes a trusted labeler, so anyone who can fire an automation rule can start an agent - MEDIUM
0172-let-bot-added-labels-start-agents-on-jira.md:124: hand-off turns on at upgrade for every mode exceptallowlist, with no fallback for loops
Decision 1's scope looks right: keeping bot comments and other non-label events dropped preserves the #6835 guard.
| 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 |
There was a problem hiding this comment.
[HIGH] Any app account, including Jira Automation's actor, becomes a trusted labeler, so anyone who can fire an automation rule can start an agent
Decision 3 classifies every accountType: app label author as a bot, and Decision 2 gives that author's label the jira_editors grant (lines 73-74). jira_editors is the default once a jira entry exists (EffectiveJiraLabels, internal/config/config.go:345-350).
The grant rests on the reasoning in #9389 that "An organization controls which accounts can edit issues in its Jira project." That holds for accounts but not for automation rules. Atlassian says "Any changes performed by an automation flow are seen as being performed by the flow actor", and the default flow actor is Automation for Jira (What is a flow actor?). A rule fires on whatever its trigger is, and anyone who can create, comment on or transition an issue can set one off, including people without Edit Issues. So a rule such as "work item created → add ready-to-code" lets any reporter start the code harness. The changelog names the rule's actor, not the person who fired it, so Jira's acceptance of the label change says nothing about who chose to make it.
Today these events are dropped. actorKind returns bot for app accounts and for the "Automation for" name (internal/jirapoll/convert.go:173), and processIssue drops bot events before authorization (internal/jirapoll/poller.go:517). Under this ADR they reach authorizeEvent, which admits a Jira label add under jira_editors for every harness without looking at the actor (internal/harnessdispatch/auth.go:61-64). If Automation for Jira does not report app, Decision 3 treats it as a human and the same gate admits it. No one has recorded which it reports; the name prefix was added for this actor in 89bf5eb. Either way its labels now dispatch.
That contradicts docs/problems/security-threat-model.md:506 ("A maintainer must apply a label"). It is also not "the same terms as on GitHub" (line 48), where events created with GITHUB_TOKEN do not start new workflow runs. The case #9389 is about needs only the poller's own account. The earlier thread on line 116 covered how a loop stops, not who counts as a labeler.
Suggestion: By default, give the bot label grant only to the poller's own account, and keep dropping label adds from other app or automation authors unless the jira entry lists their account ID. Record in the PR body what accountType a real Jira Cloud changelog reports for an Automation for Jira label change. Add a Consequence that names Jira Automation and installed apps, and a matching note in the threat model.
| 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. |
There was a problem hiding this comment.
[MEDIUM] Hand-off turns on at upgrade for every mode except allowlist, and nothing stops a loop if a harness gets it wrong
This bullet says repositories under allowlist and project_roles "opt in explicitly". Only allowlist does:
- Under
jira_editors, the default for an entry, no change is needed (Decision 2). - Under
project_rolesor with no entry, the poller account already holds a role. The guide puts it in Developers (write), and reading roles needs Administrators (admin) (docs/guides/user/jira-integration.md:42-54on main;mapJiraRoleininternal/jirapoll/convert.go).
The guide's copy of the default code trigger matches an added ready-to-code from any actor kind (jira-integration.md:795-797 on main), and triage applies that label (docs/agents/triage.md:64). So once the follow-up ships, triage starts the code agent by itself on every Jira deployment except allowlist ones, with no configuration change. The guide promises the opposite today: changelog entries from the poller account "do not dispatch agents" (jira-integration.md:163). #9389 leaves the choice to teams through their triggers, which is reasonable, but then the ADR should say the hand-off is on by default and how to turn it off.
Decision 4 also leaves loop safety to harness authors alone, and line 118 confirms "no platform cap stops it". The reason given for not adding one, that a per-issue dispatch cap "would affect every forge" (lines 95-96), does not hold. The poller already keeps per-issue state and a per-issue event cap that apply only to Jira (lastCheck, and maxEventsPerIssue at internal/jirapoll/poller.go:47). As written, a harness whose trigger is wrong at upgrade has no backstop. The earlier thread on line 116 covered how to stop a running loop, not whether one can start by default.
Suggestion: Rewrite this bullet so only allowlist is opt-in, and add a Consequence that the change turns on at upgrade for jira_editors, project_roles and no-entry repositories. Ask that the follow-up be marked breaking (!) and ship with a release note and the opt-out: event.actor.kind == "human" on the label arm of a harness override. Add a fallback that applies only to Jira, such as a per-issue limit on bot-authored label dispatches kept beside lastCheck, and drop the "every forge" reason.
|
/fs-fix Revise ADR 0172 to resolve both of ascerra's review threads, and bring the branch up to date with main. Goal
Bring the branch up to date Merge
Done when
|
|
🤖 Finished Fix · ✅ Success · Started 9:49 PM UTC · Completed 9:54 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.38 |
Merge origin/main into the branch, then address review feedback on ADR 0172: admit label-added events only from the poller's own account or accounts the jira entry lists, so Jira Automation and installed apps stay dropped; state that the change turns on at upgrade outside allowlist mode, with a breaking marker, release note and opt-out; add a Jira-only per-issue backstop; note the case in the threat model. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 2 (human-triggered)Merged main into the branch (conflicts in ADR 0153 and architecture.md resolved) and revised ADR 0172 to resolve both ascerra threads: the bot label grant is limited to the poller's own account and listed accounts, and the upgrade-time activation, opt-out and a Jira-only per-issue backstop are now stated. The earlier line-116 thread was already addressed by the previous commit. Docs-only, no tests. Fixed (3):
Tests: passed CI inspections (5):
Conflict update: merged; strategy Decision points
PR metadata: body updatedNext steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 9:56 PM UTC · Completed 10:06 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.00 |
Superseded by updated review
|
🤖 Finished Fix · ✅ Success · Started 10:08 PM UTC · Completed 10:11 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.25 |
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 <noreply@anthropic.com>
🔧 Fix agent — iteration 3 (bot-triggered)Addressed all three open findings in ADR 0172: the display-name contradiction and overstated guarantee are now an explicit stated limitation, and the Decision 5 backstop is reset only by the rolling window, not by human activity. A fourth finding from earlier iterations was already resolved. Fixed (3):
Tests: passed CI inspections (5):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 10:13 PM UTC · Completed 10:20 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.26 |
Superseded by updated review
Summary
Adds ADR 0172, which lets a label added by the Fullsend poller's own Jira account start an agent, as one already can on GitHub. Label additions from other automation authors, such as Jira Automation or installed apps, stay dropped unless the repository's
jiraentry lists the account ID. Jira becomes the second implementation of ADR 0107's label grant. Bot comments and other non-label bot events stay dropped, so the #6835 loop guard still applies to them. The PR changes docs only. Changing the poller is follow-up work.Related Issue
#9389
Changes
docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md: the new ADR (Accepted). It decides each point the issue lists:writeortriagelist of thejiraentry. Any other author classified as a bot, byappaccount type or by display name (Jira Automation's actor, installed apps), stays dropped. The display-name test stays on the dropped path only, so a rename cannot admit an event or bypass ADR 0151's harness minimum.labels:modes:jira_editors: Jira's acceptance of the label change is the grant.allowlist: the account must be listed; listing the poller's account is the opt-in.project_roles, or nojiraentry: the account needs a project role.lastCheck, backstops them. The ADR walks through both cases: an agent that re-adds its own trigger, and two agents that trigger each other. Removing the harness trigger or routing is the guaranteed stop for a running loop; removing the label is best-effort.jira_editors,project_roles, and no-entry repositories. The follow-up must be marked breaking (!), ship with a release note, and document the opt-outevent.actor.kind == "human"on the label arm of a harness override.jira-polldriver under GitHub Actions and GitLab CI.docs/architecture.md: a new target-state bullet for Jira bot label hand-off, and an addition to the ADR 0107 bullet naming Jira as the second label-grant implementation.docs/problems/security-threat-model.md: a note that on Jira, label additions from Jira Automation or installed apps stay dropped unless listed, because anyone who can fire an automation rule can make the rule's actor add a label.Current-behavior evidence (at
7338abefc1c8f618b8149053ee80a7a75e45fb99)internal/jirapoll/poller.go,processIssue: callsp.filterBotEvents(events)right afterdeduplicateand beforeresolveEventRoles,toNormalizedEvent, andp.matcher.Match. So bot events never reach authorization or trigger matching.internal/jirapoll/poller.go,filterBotEvents: drops every event wherep.actorKind(event) == "bot", whatever its type.internal/jirapoll/convert.go,actorKind: returns"bot"when the actor ID equalsp.selfAccountID, when the account type isapp, or whenautomationDisplayNamePatternmatches the display name.internal/harnessdispatch/auth.go,eventAuthorization: lets a Jira label-added event through without a role threshold only whenAuthOptions.JiraLabelsByEditPermissionis set, which happens only underlabels: jira_editors.fix(#6835), PR fix(#6835): filter self-authored Jira poller events as bot #7688).docs/normative/normalized-event/v1/jira-poll-adapter.mdalready says, for the target contract, that a display-name pattern alone does not makeactor.kindbot.Which
accountTypeJira Automation reportsNot recorded: I cannot call a Jira Cloud site from the sandbox, so I have not seen a real changelog entry for an Automation for Jira label change. The ADR does not depend on the answer. Any author classified as a bot by
apptype or by name stays dropped unless listed, and an author that no test classifies as a bot is a human. A maintainer with a Jira Cloud site should still record the observed value before the follow-up ships.Follow-up implementation (not in this PR)
filterBotEventsso that it keeps label-added events from the poller's own account and from listed account IDs only.docs/normative/authorization/v1/README.md(the "poller's own account's events are ... dropped" sentence),jira-poll-adapter.md, anddocs/guides/user/jira-integration.mdonce the behavior ships.Notes for reviewers
renumber-adrskill if another ADR lands first.main, which now has ADR 0157 (ajiraentry becomes required). The "or nojiraentry" wording in ADR 0172 can be dropped when that rollout completes.Testing
make lintpasses.lint-adr-status,lint-adr-numbers,lint-adr-frontmatter,lint-docs-linksand a staged-content secret scan passed after the merge and edits.pre-commititself could not fetch its remote hook repositories in the sandbox.Checklist
!for breaking changes)Closes #9389
Post-script verification
agent/9389-adr-jira-bot-label-handoff)7338abefc1c8f618b8149053ee80a7a75e45fb99..HEAD)