Skip to content

feat(signals): deterministic slop-assessment core #530

Description

@JSONbored

Parent roadmap: #525
Parent phase: #526

Background

A contributor's AI harness can write code but cannot judge it against Gittensor's contribution rules. We need a single deterministic scorer for "AI slop vs real contribution" that both the miner MCP tool (#526) and the maintainer CI consume, so the verdict is consistent on both sides.

Goal

Add buildSlopAssessment(input) -> { slopRisk: 0..100, band: clean|low|elevated|high, findings: SignalFinding[] } plus a SLOP_RUBRIC_MARKDOWN constant, in a new src/signals/slop.ts.

Current Behavior

No slop logic exists (grep slop src is empty). Readiness/preflight signals exist but there is no slop score.

Desired Behavior

A pure, deterministic, metadata-only scorer. Signals, each mapped to an existing builder:

  • missing test evidence → reuse src/signals/test-evidence.ts
  • trivial / whitespace-only churn → reuse buildLocalScoreInput token split
  • generated/vendored edits (dist/, *.min.*, *.lock, vendor/, *.generated.*) → new path matcher
  • dependency-bump-only; docs-only padding → new path matchers
  • no linked issue without rationale → reuse preflight missing_linked_issue / hasClearNoIssueRationale
  • duplicate-cluster membership → reuse buildCollisionReport (src/signals/engine.ts)
  • low-quality commit messages → reuse STOPWORDS

Reuse the existing SignalFinding shape so output flows through current renderers/redactors unchanged.

Implementation Requirements

  • New src/signals/slop.ts; weights in one tunable SLOP_WEIGHTS constant; no clock/random in the scoring math.
  • Reuse isTestFile/isCodeFile from src/signals/local-branch.ts; do not re-implement file classification.

Public/Private Output Boundaries

Acceptance Criteria

  • Identical metadata input → identical slopRisk (deterministic). Bands behave at documented thresholds.
  • Findings render through existing public surfaces without new private-term leakage.

Testing Requirements

  • npm run test:ci, 97%+ coverage. Golden-fixture + property tests mirroring buildPublicReadinessScore / buildScorePreview. Forbidden-term assertions on all reason strings.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions