Skip to content

Preserve uncertainty for custom GitHub roles in review-thread metadata #8173

Closed

Description

@csoceanu

Problem

PR #7848 added effective-permission handling for GitHub custom repository roles. Custom Write/Maintain roles with usable permission data are now normalized correctly.

The remaining issue is provenance: baseRole() can return "none" for a successful response when the permission data is missing, incomplete, or cannot be normalized. The review-thread fetcher currently treats every successful lookup as verified=true, so the output cannot distinguish an authoritative non-member from an unnormalizable response.

Context: #7907 (comment)

Expected behavior

Preserve whether the normalized role is authoritative:

  • Successfully normalized built-in or effective role: the corresponding role with verified=true.
  • Forge-authoritative non-member result, such as a confirmed 404: RoleNone with verified=true.
  • Successful response with insufficient, contradictory, or unnormalizable permission data: RoleNone with verified=false.
  • Transient lookup failure, bot, or unknown actor: RoleNone with verified=false.

Authorization must remain fail-closed.

Acceptance criteria

  • Existing effective-permission handling from fix(#7834): honor effective GitHub permissions #7848 remains unchanged.
  • Custom Write/Maintain roles with effective permission data remain correctly normalized.
  • A successful response that cannot establish an effective role is not marked verified.
  • Tests cover built-in roles, custom roles with effective permissions, an authoritative non-member, incomplete permission data, and lookup failure.
  • Documentation defines the verification semantics clearly.

Relationship to #7907

This is non-blocking follow-up work from #7907. It refines the provenance of verified review-thread role metadata for downstream consumers.

Activity

  1. csoceanu commented on Oct 19, 2026

    @csoceanu
    ContributorAuthor

    /fs-triage

    This still appears relevant after PR #7907. PR #8158 adds useful provenance and authorization semantics that this issue should align with: verified=true should mean the role was authoritatively established, not merely that the API request succeeded.

    PR #8415, #8329, and #8413 are adjacent bot-role work, but appear focused on registered bot identity rather than human review-thread authors with incomplete or unnormalizable repository permissions.

    Please confirm the intended implementation location and whether author_role_verified should follow the ADR 0133 semantics directly.

  2. fullsend-ai-triage commented on Oct 19, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 3:47 PM UTC · Completed 3:49 PM UTC

    Commit: af8cd47 · View workflow run →

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

  3. added
    ready-to-code
    on Oct 19, 2026
  4. fullsend-ai-triage commented on Oct 19, 2026

    @fullsend-ai-triage

    Triage found this actionable and ready to implement; no open PR currently addresses it, and the related bot-identity work (#8415, #8329, #8413) does not overlap with human review-thread authors.

    Answers to the open questions in your comment

    • Implementation location: the verified flag is set in the resolveRole closure inside ListPullRequestReviewThreads (internal/forge/github/github.go), fed by GetCollaboratorPermission → collaboratorPermission.baseRole(). The suggested approach is an internal helper that returns the role plus an authoritative flag, with GetCollaboratorPermission wrapping it so the forge.Client interface and its other callers are unchanged.
    • ADR 0133 semantics: yes — verified=true should mean the role was authoritatively established, not that the API call succeeded. The matrix in the issue is consistent with that, and the existing verification paragraph in docs/guides/dev/cli-internals.md should be updated to match.

    Edge case for the implementer: decide how a successful response that explicitly states none is treated. It is probably authoritative only when the data is explicit and consistent, and it should be documented either way.

    Proposed test cases

    built-in role_name (admin/maintain/write/triage/read) -> role, verified=true
    custom role + effective permission flags              -> write/maintain, verified=true
    404                                                   -> none, verified=true
    200, unknown custom role, no usable flags/legacy perm -> none, verified=false
    empty/contradictory flags                             -> none, verified=false
    5xx / transport error                                 -> none, verified=false
    bot or empty login                                    -> none, verified=false
    

    Assert both author_role_verified and resolved_by_role_verified, and that GetCollaboratorPermission output is unchanged for existing callers.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. fullsend-ai-coder commented on Oct 19, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 3:52 PM UTC · Completed 3:59 PM UTC

    Commit: af8cd47 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $1.12

  6. added 2 commits that reference this issue on Oct 30, 2026
  7. self-assigned this
    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

bugready-to-code

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions