Skip to content

test(ai): add AI sanitizer and fallback invariants #152

Description

@JSONbored

Background

If optional AI is introduced, public/private safety cannot depend on model behavior. Sanitizer and fallback invariants need strong tests.

Goal

Centralize tests for optional AI output safety.

Current Behavior

Public-safety tests exist for deterministic outputs, but AI-specific fallback behavior needs explicit coverage before enabling AI summaries.

Desired Behavior

AI output is always filtered, unsafe output is blocked, and deterministic fallback works across public/private summary modes.

Implementation Requirements

  • Add fixtures for unsafe AI output.
  • Test public and private summary modes separately.
  • Test quota/unavailable fallback.
  • Ensure private facts are not rendered publicly.
  • Keep deterministic signals untouched by AI failures.

Public/Private Output Boundaries

Public GitHub output must never include wallets, hotkeys, payout/reward estimates, raw trust scores, public score estimates, private reviewability, private scoreability context, or farming language. Private API/MCP/control-panel surfaces may show authenticated scoreability, blockers, projections, and evidence, but must not claim guaranteed payout outcomes.

Acceptance Criteria

  • Unsafe generated output is blocked.
  • Private facts never appear in public output.
  • Quota/unavailable model falls back cleanly.
  • Tests cover public and private summary modes.

Testing Requirements

  • npm run test:ci must pass.
  • Global coverage must remain at or above 97% for lines, statements, functions, and branches.
  • Aim for 98%+ branch coverage locally.
  • Add tests for every new branch, fallback path, sanitizer rule, and regression.
  • Add invariant/property-style tests when behavior depends on sorting, gating, scoring, source-upload safety, public/private boundaries, or telemetry privacy.
  • MCP/local tooling must prove source contents are not uploaded when local metadata is involved.
  • Public GitHub output must be tested against forbidden language: wallet, hotkey, raw trust score, payout, reward estimate, farming, private reviewability, and public score estimate.

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