Skip to content

docs(#9389): ADR 0172, let bot-added labels start agents on Jira - #9390

Open
fullsend-ai-coder[bot] wants to merge 4 commits into
mainfrom
agent/9389-adr-jira-bot-label-handoff
Open

fullsend-ai-coder[bot] wants to merge 4 commits into
mainfrom
agent/9389-adr-jira-bot-label-handoff

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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 jira entry 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:
    • Scope: only label-added events.
    • Which accounts count: only the poller's own account ID, or an account ID listed in the write or triage list of the jira entry. Any other author classified as a bot, by app account 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 no jira entry: the account needs a project role.
    • Loop safety: harness authors are responsible, as on GitHub, and a Jira-only per-issue limit on dispatches from admitted label additions, kept beside 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.
    • Upgrade behaviour: the change turns on at upgrade for jira_editors, project_roles, and no-entry repositories. The follow-up must be marked breaking (!), ship with a release note, and document the opt-out event.actor.kind == "human" on the label arm of a harness override.
    • Untrusted content: same as GitHub.
    • Forge scope: the jira-poll driver under GitHub Actions and GitLab CI.
  • Edits to accepted ADRs (cross-reference notes only):
    • ADR 0107: a one-sentence note in Status saying ADR 0172 makes Jira the second implementation of the label grant.
    • ADR 0153: a short note in Status pointing out that ADR 0172 changes its "the poller still drops its own account's events" sentence for label-added events.
  • 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: calls p.filterBotEvents(events) right after deduplicate and before resolveEventRoles, toNormalizedEvent, and p.matcher.Match. So bot events never reach authorization or trigger matching.
  • internal/jirapoll/poller.go, filterBotEvents: drops every event where p.actorKind(event) == "bot", whatever its type.
  • internal/jirapoll/convert.go, actorKind: returns "bot" when the actor ID equals p.selfAccountID, when the account type is app, or when automationDisplayNamePattern matches the display name.
  • internal/harnessdispatch/auth.go, eventAuthorization: lets a Jira label-added event through without a role threshold only when AuthOptions.JiraLabelsByEditPermission is set, which happens only under labels: jira_editors.
  • The self-account check came from 3b70889 (fix(#6835), PR fix(#6835): filter self-authored Jira poller events as bot #7688).
  • docs/normative/normalized-event/v1/jira-poll-adapter.md already says, for the target contract, that a display-name pattern alone does not make actor.kind bot.

Which accountType Jira Automation reports

Not 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 app type 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)

  • Change filterBotEvents so that it keeps label-added events from the poller's own account and from listed account IDs only.
  • Add the Jira-only per-issue limit on dispatches from admitted label additions.
  • Mark the change breaking, add the release note and opt-out.
  • Update docs/normative/authorization/v1/README.md (the "poller's own account's events are ... dropped" sentence), jira-poll-adapter.md, and docs/guides/user/jira-integration.md once the behavior ships.

Notes for reviewers

Testing

  • make lint passes. lint-adr-status, lint-adr-numbers, lint-adr-frontmatter, lint-docs-links and a staged-content secret scan passed after the merge and edits. pre-commit itself could not fetch its remote hook repositories in the sandbox.
  • Tests: not applicable (docs only).

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO): not applicable, autonomous agent commit
  • Changes can be explained in full (see the evidence above)

Closes #9389

Post-script verification

  • Branch is not main/master (agent/9389-adr-jira-bot-label-handoff)
  • Secret scan passed (gitleaks — 7338abefc1c8f618b8149053ee80a7a75e45fb99..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

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>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:43 PM UTC · Completed 8:52 PM UTC

Commit: 392ca50 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.96

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://770a693b-site.fullsend-ai.workers.dev

Commit: 9b9162716b5e478e62201f8b502646e1b43f40cb

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 12, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Documentation-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

Risk Assessment: moderate (2/5)

Details

Documentation-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)

Details

Documentation-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)

Details

Documentation-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.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Looks good to me

Earlier findings

  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:101, logic-error: resolved by change. The display-name paragraph in decision item 3 was rewritten to state that the display-name test only drops events and is not an enforced boundary.
  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:104, auth-bypass: resolved by change. Decision item 3 now says that an unlisted automation account not of type app and with an ordinary name is treated as human, and that allowlist or project_roles is needed for a firm boundary.
  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:122, auth-bypass: resolved by change. Decision item 5 no longer lets a human-authored event reset the backstop count; only the rolling window restores the budget.
Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJkb2NzL0FEUnMvMDE3Mi1sZXQtYm90LWFkZGVkLWxhYmVscy1zdGFydC1hZ2VudHMtb24tamlyYS5tZCIsImlkIjoiZl81ZmY0MzVmM2ExMjFhYzc0IiwibGluZSI6MTE2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImRvY3MvQURScy8wMTcyLWxldC1ib3QtYWRkZWQtbGFiZWxzLXN0YXJ0LWFnZW50cy1vbi1qaXJhLm1kIiwiaWQiOiJmX2E3MWY2YWQyMzE3MThlODkiLCJsaW5lIjoxMDEsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiYXV0aC1ieXBhc3MiLCJmaWxlIjoiZG9jcy9BRFJzLzAxNzItbGV0LWJvdC1hZGRlZC1sYWJlbHMtc3RhcnQtYWdlbnRzLW9uLWppcmEubWQiLCJpZCI6ImZfMDU3MDA4NTQwMTQ2MDhiYSIsImxpbmUiOjEyMiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoic2VjdXJpdHkifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJhdXRoLWJ5cGFzcyIsImZpbGUiOiJkb2NzL0FEUnMvMDE3Mi1sZXQtYm90LWFkZGVkLWxhYmVscy1zdGFydC1hZ2VudHMtb24tamlyYS5tZCIsImlkIjoiZl82ZTM1N2ViYzI1NTBlOWEwIiwibGluZSI6MTA0LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzZWN1cml0eSJ9XSwiZGlzcG9zaXRpb25zIjpbeyJpZCI6ImZfYTcxZjZhZDIzMTcxOGU4OSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzA1NzAwODU0MDE0NjA4YmEiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl82ZTM1N2ViYzI1NTBlOWEwIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfNWZmNDM1ZjNhMTIxYWM3NCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= -->

Looks good to me

Earlier findings

  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:101, logic-error: resolved by change. The display-name paragraph in decision item 3 was rewritten to state that the display-name test only drops events and is not an enforced boundary.
  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:104, auth-bypass: resolved by change. Decision item 3 now says that an unlisted automation account not of type app and with an ordinary name is treated as human, and that allowlist or project_roles is needed for a firm boundary.
  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:122, auth-bypass: resolved by change. Decision item 5 no longer lets a human-authored event reset the backstop count; only the rolling window restores the budget.
Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImRvY3MvQURScy8wMTcyLWxldC1ib3QtYWRkZWQtbGFiZWxzLXN0YXJ0LWFnZW50cy1vbi1qaXJhLm1kIiwiaWQiOiJmX2E3MWY2YWQyMzE3MThlODkiLCJsaW5lIjoxMDEsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiYXV0aC1ieXBhc3MiLCJmaWxlIjoiZG9jcy9BRFJzLzAxNzItbGV0LWJvdC1hZGRlZC1sYWJlbHMtc3RhcnQtYWdlbnRzLW9uLWppcmEubWQiLCJpZCI6ImZfMDU3MDA4NTQwMTQ2MDhiYSIsImxpbmUiOjEyMiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoic2VjdXJpdHkifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJhdXRoLWJ5cGFzcyIsImZpbGUiOiJkb2NzL0FEUnMvMDE3Mi1sZXQtYm90LWFkZGVkLWxhYmVscy1zdGFydC1hZ2VudHMtb24tamlyYS5tZCIsImlkIjoiZl82ZTM1N2ViYzI1NTBlOWEwIiwibGluZSI6MTA0LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzZWN1cml0eSJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImRvY3MvQURScy8wMTcyLWxldC1ib3QtYWRkZWQtbGFiZWxzLXN0YXJ0LWFnZW50cy1vbi1qaXJhLm1kIiwiaWQiOiJmXzVmZjQzNWYzYTEyMWFjNzQiLCJsaW5lIjoxMTYsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dLCJkaXNwb3NpdGlvbnMiOlt7ImlkIjoiZl81ZmY0MzVmM2ExMjFhYzc0Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Medium

  • [logic-error] docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:101 — Decision 3 says the display-name test "stays on the dropped path only" and that "a rename cannot admit an event" (the last Consequences bullet repeats this), yet the same item says an author no test classifies as a bot "is a human and takes the human rules." The display-name match is still one of the bot tests, so an unlisted, non-self, non-app account named "Release Bot" is dropped, while renaming it to "Release Agent" moves it to the human path, where jira_editors can admit its label addition. The ADR contradicts itself.
    Remediation: Qualify the invariant in Decision 3 and the final Consequences bullet, or specify a classification that does not depend on display names.

  • [auth-bypass] docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:122 — Decision 5 drops admitted label additions past the limit "until the window passes or a human-authored event arrives", but does not require that human to be authorized to dispatch. An outsider who can only comment could clear the backstop and let a cyclic hand-off continue, and an unrelated comment would resume a stopped loop by accident.
    Remediation: Say that ordinary human activity does not reset the counter. Keep the rolling-window count regardless of intervening events, or require an explicit recovery action by a verified, dispatch-authorized actor.

Low

  • [auth-bypass] docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:104 — The ADR overstates its account restriction. An unlisted automation account with a non-app type and an ordinary (or renamed) display name is classified as human, so under jira_editors its label change can dispatch without its account ID being listed. The account still needs Jira edit permission, and this path exists before the PR, so the issue is an overstated guarantee rather than a new bypass. Same root cause as the finding at line 101.
    Remediation: State the limitation explicitly (non-app, ordinarily named accounts are treated as humans and are not an enforced boundary), or require authoritative classification where possible.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJkb2NzL0FEUnMvMDE3Mi1sZXQtYm90LWFkZGVkLWxhYmVscy1zdGFydC1hZ2VudHMtb24tamlyYS5tZCIsImlkIjoiZl81ZmY0MzVmM2ExMjFhYzc0IiwibGluZSI6MTE2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9XSwiZGlzcG9zaXRpb25zIjpbeyJpZCI6ImZfNWZmNDM1ZjNhMTIxYWM3NCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= -->

Looks good to me

Earlier findings

  • docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:116, logic-error, resolved: the Consequences bullet now names removal of the harness trigger or routing, plus cancelling active or queued runs, as the stop for a cyclic hand-off. It describes label removal as best-effort because the poller rebuilds label additions from changelog history.
Previous run (4)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImRvY3MvQURScy8wMTcyLWxldC1ib3QtYWRkZWQtbGFiZWxzLXN0YXJ0LWFnZW50cy1vbi1qaXJhLm1kIiwiaWQiOiJmXzVmZjQzNWYzYTEyMWFjNzQiLCJsaW5lIjoxMTYsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== -->

Review

Findings

Low

  • [logic-error] docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md:116 — The consequence says a cyclic hand-off "runs until a human removes the label or the trigger." Removing the label is not a reliable stop: Decision 4 itself describes remove-and-re-add as what sustains a loop, so a running agent can add the label back, and the poller rebuilds label additions from changelog history (internal/jirapoll/discover.go) without checking the label is still present, so an addition already recorded can still dispatch after removal.
    Remediation: Make removing the harness trigger or routing (and cancelling active or queued runs if needed) the guaranteed stop. Describe removing the label as best-effort at most.

Labels: PR adds an ADR and edits user-facing architecture docs on dispatch authorization.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added type/adr component/docs User-facing documentation component/dispatch Workflow dispatch and triggers labels Nov 12, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 8:54 PM UTC · Completed 8:58 PM UTC

Commit: 392ca50 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. ADR 0172 consequence claims a cyclic hand-off runs until a human removes the label, but label removal is not a reliable stop (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Verified against the poller's changelog handling. Reworded the consequence so removing the harness trigger or routing, and cancelling active or queued runs, is the stop. Label removal is described as best-effort, since an agent can re-add the label and recorded additions can still dispatch.
  2. Merge-conflict check: The forge reports the PR as mergeable, so no reconciliation was needed.

Tests: passed

CI inspections (5):

  1. behaviour (passing, success)
  2. playback (passing, success)
  3. commit-lint (passing, success)
  4. semgrep (passing, success)
  5. test (pending, in_progress): The main CI test job was still running at inspection time.

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:00 PM UTC · Completed 9:09 PM UTC

Commit: 9cdb583 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.65

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ascerra ascerra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: any app account, 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 except allowlist, 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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_roles or 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-54 on main; mapJiraRole in internal/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.

@jwm4

jwm4 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

/fs-fix Revise ADR 0172 to resolve both of ascerra's review threads, and bring the branch up to date with main.

Goal

  1. Narrow who gets the bot label grant (thread on Decision 3). By default only the poller's own Jira account gets it. A label added by any other account that the poller classifies as a bot today (app account type or the display-name test) stays dropped, unless that account's ID is listed in the jira authorization entry. Add a Consequence that names Jira Automation and installed apps, and a matching note in the threat model.
  2. Say that hand-off is on by default, and add a loop limit (thread on Consequences).
    • Only allowlist is opt-in. Correct the bullet that says project_roles is too.
    • Add a Consequence that hand-off turns on at upgrade for jira_editors, project_roles and no-entry repositories, with the opt-out (event.actor.kind == "human" on the label arm of a harness override). Ask that the implementation be marked breaking and ship with a release note.
    • Replace "no platform cap" with a limit that applies only to Jira: a per-issue limit on bot-authored label dispatches, kept in the poller's per-issue state. The ADR should say what is counted, what happens at the limit, and how a person clears it. Remove the claim that a cap would affect every forge.

Bring the branch up to date

Merge origin/main into the branch (a merge commit, not a rebase). Two files conflict and both resolve by keeping both sides:

  • docs/ADRs/0153-authorize-jira-poll-actors-without-project-administration.md, Status section: keep main's ADR 0157 paragraph, then the ADR 0172 note.
  • docs/architecture.md: keep main's ADR 0157 sentences at the end of the ADR 0153 bullet, then the ADR 0172 bullet.

Done when

  • The PR merges cleanly with main and make lint passes.
  • The ADR 0172 notes in ADR 0107, ADR 0153 and docs/architecture.md match the revised decision.
  • No text in the PR says that any app account gets the grant by default, that project_roles repositories opt in, or that a cap would affect every forge.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 9:49 PM UTC · Completed 9:54 PM UTC

Commit: 9cdb583 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. Merge conflict with main in ADR 0153 and architecture.md (docs/architecture.md): Merged origin/main (strategy merge); kept both the ADR 0157 notes and the ADR 0172 notes in ADR 0153 Status and the architecture Jira bullets.
  2. ascerra HIGH: any app/Automation account becomes a trusted labeler (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Admit label-added events only from the poller's own account or accounts listed in the jira entry; other bot-classified authors (Jira Automation, installed apps) stay dropped, display-name test stays on the dropped path only. Added Context on rule actors, an Options entry, and a Consequence naming Automation and apps; added a threat-model note and updated the ADR 0153 and architecture.md summaries. The PR body records that the accountType for Automation is unverified and that the design does not depend on it.
  3. ascerra MEDIUM: hand-off turns on at upgrade outside allowlist mode and has no backstop (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Rewrote the consequence so only allowlist is opt-in and the change turns on at upgrade for jira_editors, project_roles and no-entry repositories; required the follow-up to be breaking with a release note and the event.actor.kind == "human" opt-out; added Decision 5, a Jira-only per-issue limit kept beside lastCheck; dropped the 'every forge' reason.

Tests: passed

CI inspections (5):

  1. CI / test (passing, success): Passed on the previous head.
  2. CI / semgrep (passing, success): Passed on the previous head.
  3. CI / commit-lint (passing, success): Passed on the previous head.
  4. PR Title Lint (passing, success): Passed on the previous head.
  5. E2E Tests / behaviour (passing, success): Passed on the previous head.

Conflict update: merged; strategy merge; forge CONFLICTING; target main@4c8159050583a928a261d720f32ce8b53608922e

Decision points
  • How to restrict the bot label grant (alternatives: Admit every app-type author, Admit the poller's own account plus accounts the jira entry lists; rationale: Automation rule actors can be fired by people without Edit Issues, so only the poller's account and explicitly listed accounts are admitted.)

PR metadata: body updated

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:56 PM UTC · Completed 10:06 PM UTC

Commit: 8bce987 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.00

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Nov 16, 2026
fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review November 16, 2026 22:05

Superseded by updated review

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 10:08 PM UTC · Completed 10:11 PM UTC

Commit: 8bce987 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. Decision 3 and the last Consequences bullet claim a rename cannot admit an event, yet an unclassified account is treated as human (display-name logic contradiction) (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Reworded Decision 3 and the final Consequences bullet: the display-name test only ever drops events and never admits one, but it is not an enforced boundary, since an unlisted non-app account with an ordinary or renamed display name is classified as human and takes the human rules.
  2. Decision 5 lets any human-authored event reset the per-issue backstop, even from an actor not authorized to dispatch (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Removed the human-event reset. Ordinary human activity such as a comment does not reset the count; only the rolling window restores the budget.
  3. ADR overstates its account restriction; non-app, ordinarily named automation accounts are classified as human (same root cause as the display-name finding) (docs/ADRs/0172-let-bot-added-labels-start-agents-on-jira.md): Stated the limitation explicitly in Decision 3: such accounts can dispatch under jira_editors without being listed, still need Jira edit permission, and the path predates this ADR. The firm guarantee is by-account-ID admission of the poller's own and listed accounts. Repositories needing a firm boundary should use allowlist or project_roles.

Tests: passed

CI inspections (5):

  1. CI / test (passing, success)
  2. CI / semgrep (passing, success)
  3. CI / commit-lint (passing, success)
  4. E2E Tests / behaviour (passing, success)
  5. codecov/patch (passing, success)

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:13 PM UTC · Completed 10:20 PM UTC

Commit: 9b91627 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.26

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Nov 16, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — 9b916271 Deployed Nov 16, 2026 by github-actions[bot]
dev — 9b916271 Deployed Nov 16, 2026 by fullsend-ai-coder[bot] via playback #20438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/dispatch Workflow dispatch and triggers component/docs User-facing documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate type/adr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR: let a bot-added label start agents on Jira

2 participants