Skip to content

feat(identity): cache official miner detection with outage-safe behavior #37

Description

@JSONbored

Parent: #32

Goal

Make confirmed-miner gating reliable and cheaper without ever guessing publicly.

Requirements

  • Cache official Gittensor miner detection with a short TTL.
  • Store status as confirmed, not_found, or unavailable.
  • On official API outage, fail closed for public GitHub output.
  • Add audit events for cache hits, misses, unavailable source, and public-surface skips.
  • Do not use GitHub history alone to publicly classify someone as a miner.

Acceptance Criteria

  • Confirmed miner PRs can use cached status within TTL.
  • Non-miners stay quiet.
  • API unavailable produces no public comment, label, or check.
  • Maintainer diagnostics explain detection unavailable without exposing private data.

Testing Requirements

This issue must preserve the repo's CI gate:

  • npm run test:ci must pass.
  • Global coverage must remain at or above 95% for lines, statements, functions, and branches.
  • Add or update tests for every new branch, fallback path, sanitizer rule, and regression.
  • Add invariant/property-style tests when behavior depends on sorting, gating, public/private boundaries, scoring, queue pressure, or source-upload safety.
  • Public GitHub output must be tested against forbidden language: wallet, hotkey, raw trust score, payout, reward estimate, farming, private reviewability, and public score estimate.

Required Test Scenarios

  • Cache hit confirmed.
  • Cache hit not_found.
  • Cache expiry.
  • API unavailable fail-closed.
  • GitHub history does not override official source.
  • Public sanitizer regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions