Skip to content

Implement ADR 0107 bot identity resolution before dispatch authorization #8329

Open
4 of 5 issues completed

Description

@ifireball

What happens

ADR 0107 is accepted, but its runtime and adapter migration remains deferred. Dispatch paths still rely on compatibility behavior: bot events are identified separately from repository permissions, but bot authorization does not consistently require an exact provider-backed registered identity.

The normalized-event and authorization contracts document actor.bot_role and actor.role_verified, but the active dispatch and adapter paths do not yet enforce the ADR 0107 target behavior consistently across supported forges.

What should happen

Implement the ADR 0107 target contract so that:

  • Non-label bot dispatch requires authoritative bot classification and exact registered bot-role resolution for the target.
  • Bot events retain actor.role: none and record the resolved actor.bot_role and actor.role_verified status.
  • Unknown, unverifiable, or unresolved bot identities are denied before CEL evaluation.
  • The existing forge-authoritative label-added exception remains available without requiring bot-role lookup.
  • Human authorization continues to use verified forge permissions.
  • CEL and harness routing can narrow authorization but cannot authorize an unrecognized bot.
  • GitHub and non-mint adapters provide equivalent behavior.
  • Tests cover recognized bots, no-match results, lookup failures, legacy events, human actors, and the label exception.
  • Normative and user-facing documentation reflects the implemented state.

Context

This is the implementation follow-up to ADR 0107, motivated by #7764.

The authorization contract is documented in docs/normative/authorization/v1/, while the current compatibility gate is in internal/harnessdispatch and the GitHub event adapter.

Related work includes #5463 and #7496, but neither tracks the full ADR 0107 implementation.

Sub-issues

Sub-issues

4 of 5 Issues completed
Loading 5 sub-issues

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. fullsend-ai-triage commented on Oct 11, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 1:22 PM UTC · Completed 1:25 PM UTC

    Commit: 9f954d9 · View workflow run →

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

  3. added
    feature
    triaged
    on Oct 11, 2026
  4. fullsend-ai-triage commented on Oct 11, 2026

    @fullsend-ai-triage

    Triage assessment: the target contract is already fully specified by ADR 0107 and the Authorization v1 decision table, so this is ready for implementation work. A few findings to help whoever picks it up:

    • Current gap confirmed in code: the shared gate in internal/harnessdispatch/auth.go still admits any bot-submitted review and any label-added event without a registered-identity check, and normevent.Actor has no bot_role / role_verified fields yet. Adapters classify bots only by the [bot] suffix or sender type.
    • No resolver exists yet: the ADR requires a provider-backed lookup (mint-backed for GitHub, an equivalent trusted lookup for non-mint paths such as GitLab). The implementer will need to define that resolver interface and its providers. If the shape of that provider boundary is still undecided, that is the open design point behind the needs-design label and a maintainer should confirm it before coding.
    • Related work, not duplicates or blockers: Pin review-bot identity checks to performed_via_github_app.id, not login string #5463 (pin review-bot checks to the GitHub App id) and Implement extensible GitLab role identity model with backward-compatible migration #7496 (GitLab role identity model) overlap with the identity inputs this needs; Define a forge-portable bot identity and authorization contract #7764 (closed) motivated the ADR. No open PR currently addresses this issue.
    • Scope note: the work is one dependency chain (fields, resolver, adapters, gate, docs), so it is kept as a single issue. Landing it in reviewable stages is reasonable as long as enforcement only turns on per adapter once that adapter emits the new fields, matching the ADR's migration rule.
    • Docs: per repo guidance, update the normalized-event projection table and docs/contributing/harness-fields.md together with the code, and remove the 'target field' caveats from the CEL triggers reference.

    Proposed test coverage:

    Gate/adapter table tests:
    - registered bot, non-label event   -> authorized; role=none, bot_role=<role>, role_verified=true
    - bot, resolver no-match            -> denied before CEL; role_verified=true, bot_role absent
    - bot, resolver error               -> denied; role_verified=false
    - bot, label-added                  -> authorized, resolver not called
    - human                             -> permission thresholds unchanged; role_verified=false denied
    - legacy event (no role_verified)   -> v1 compatibility behavior
    - CEL matches unrecognized bot      -> never dispatched
    - human with bot_role / bot with bot_role but role_verified=false -> validation failure
    - GitHub vs non-mint adapters       -> equivalent outcomes
    

    Because this is a feature-category security change, it is not auto-promoted to ready-to-code; a maintainer should confirm the resolver design first.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. added 3 commits that reference this issue on Oct 20, 2026
  6. waynesun09 commented on Oct 22, 2026

    @waynesun09
    Member

    A concrete piece of this that the review CEL port (#2898, via #8726) now depends on: after #8415, botidentity.MintResolver / ApplyBotRoleResult have no production caller. The GitHub gha-event input never runs the lookup, so actor.role_verified stays unset for bots and IsAuthorized falls back to the legacy collaborator-role check. On the CEL path that denies PRs opened or pushed by our own registered bots (e.g. the coder bot), which bash routing reviews today.

    Wiring it needs the mint URL plus an Actions OIDC token in the job that runs fullsend dispatch (the review job already has id-token: write; harness-dispatch and route do not).

    Is the gha-event adapter wiring planned under this issue? If so we'll gate FULLSEND_CEL_ROUTING_REVIEW=on on it and keep shadow independent; if you'd rather split it out, happy to take a scoped child issue.

  7. added 3 commits that reference this issue on Oct 22, 2026
  8. ifireball commented on Oct 26, 2026

    @ifireball
    MemberAuthor

    @waynesun09

    17. A concrete piece of this that the review CEL port (#2898, via #8726) now depends on: after #8415, botidentity.MintResolver / ApplyBotRoleResult have no production caller. The GitHub gha-event input never runs the lookup, so actor.role_verified stays unset for bots and IsAuthorized falls back to the legacy collaborator-role check. On the CEL path that denies PRs opened or pushed by our own registered bots (e.g. the coder bot), which bash routing reviews today.

    The only supported way to route bot actions today until #8414 lands is via labels, which should not invoke a collaborator check that cannot pass for bots anyway.

    Wiring it needs the mint URL plus an Actions OIDC token in the job that runs fullsend dispatch (the review job already has id-token: write; harness-dispatch and route do not).

    So we need workflow changes? I'll check that.

    Is the gha-event adapter wiring planned under this issue? If so we'll gate FULLSEND_CEL_ROUTING_REVIEW=on on it and keep shadow independent; if you'd rather split it out, happy to take a scoped child issue.

    Hopefull the tests intoruduced in #8414 would cause the wiring to get created.

  9. added a commit that references this issue on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureneeds-designtriaged

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions