Skip to content

fix(orb): explain/generate-tests denial telemetry drops allowedRoles, and @loopover configuration never emits usage events #8688

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

src/queue/processors.ts:12174 (explain command) and :12987-12993 (generate-tests command)
call recordGithubProductUsage(...) for a denial without including allowedRoles in the metadata,
even though the matching recordAuditEvent calls for both do include it. Every sibling command's
denial telemetry — gate-override (:11774), resolve (:11953), pause (:12064), resume
(:12107) — includes allowedRoles in both the audit event and the product-usage event
consistently.

Separately, maybeProcessConfigurationCommand/recordConfigurationSkip (lines 12452-12512) never
call recordGithubProductUsage at all, unlike every other command handler in this file — so
@loopover configuration usage is entirely invisible in product-usage reporting/dashboards.

Consequence: analytics/dashboards lose allowedRoles context specifically for explain/
generate-tests denials, and the configuration command's usage is completely unmeasured. This is
an instrumentation gap with no functional/authorization impact.

Requirements

  • Add allowedRoles to the recordGithubProductUsage metadata for both explain and
    generate-tests denials, matching the pattern already used by gate-override/resolve/pause/resume.
  • Add a recordGithubProductUsage call to maybeProcessConfigurationCommand/
    recordConfigurationSkip, matching how every other command handler records product usage.

Deliverables

  • explain's denial telemetry includes allowedRoles in its recordGithubProductUsage call.
  • generate-tests's denial telemetry has the same fix.
  • @loopover configuration invocations are recorded via recordGithubProductUsage, matching
    every other command handler.
  • A new test asserts recordGithubProductUsage metadata includes allowedRoles for both
    explain and generate-tests denials.
  • A new test asserts a product-usage row is recorded after invoking @loopover configuration.

All five Deliverables are required in the same PR.

Test Coverage Requirements

src/** is measured by codecov/patch (99%+ target, branch-counted). The new tests must exercise
each previously-uncovered telemetry call directly.

Expected Outcome

Product-usage telemetry for explain/generate-tests denials and for @loopover configuration
invocations matches the consistency already established by every other command in this file.

Links & Resources

  • src/queue/processors.ts:12174,12987-12993 (explain/generate-tests denial telemetry)
  • src/queue/processors.ts:12452-12512 (maybeProcessConfigurationCommand,
    recordConfigurationSkip)
  • Already-correct siblings: :11774,11953,12064,12107 (gate-override/resolve/pause/resume)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions