Skip to content

feat(slop): wire + modernize the deterministic slop score into the gate, context & MCP (#530/#531/#532)#716

Merged
JSONbored merged 2 commits into
mainfrom
feat/slop-score
Jun 14, 2026
Merged

feat(slop): wire + modernize the deterministic slop score into the gate, context & MCP (#530/#531/#532)#716
JSONbored merged 2 commits into
mainfrom
feat/slop-score

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

You asked whether gittensory's CI actually has a "slop score." It didn't, really — src/signals/slop.ts had a slop-score core (#530) but it was dead code wired into nothing (no gate, no context, no .gittensory.yml, no MCP). This makes it the real, opt-in maintainer feature you described.

Detector strengthened (#530)

  • New empty_pr_description signal (code change shipped with an empty/whitespace description).
  • Recalibrated weights — whitespace-churn 30 / missing-test-evidence 30 / empty-description 15 — so the high band (≥60) is now reachable (with only 2 signals maxing at 55, it was mathematically impossible before).
  • Stays deterministic + high-precision — this score is the only thing allowed to block.

Config + gate (#532)

  • slopGateMode (off | advisory | block) + slopGateMinScore on RepositorySettings (migration 0033, default off) and .gittensory.yml gate.slop: { mode, minScore }.
  • The gate computes the slop assessment over the PR's changed files + description only when opted in, surfaces findings as advisory context, and adds a slop_risk_above_threshold hard blocker only under slop: block when slopRisk ≥ threshold (default 60) — confirmed-contributor-gated like every blocker.
  • Advisory by default; blocking is opt-in (exactly the rollout you chose).

Self-check (#531)

  • New MCP tool gittensory_check_slop_risk — a source-free, agent-native quality self-check over local diff metadata (paths + line counts) + description; returns slopRisk / band / findings / rubric. No repo data or auth scope needed.

Accuracy posture

Per our discussion: the deterministic core is the only tier that blocks (false-positive-averse), it's advisory by default, blocking is opt-in at a maintainer-set threshold, and it's confirmed-contributor-gated. The AI-assisted advisory slop layer + a dedicated panel score-row are the planned follow-up (advisory-only, never blocks).

Tests

Detector (new signal, recalibration, reachable high, public-safe); gate (advisory never blocks even at 90; blocks at/above threshold; default-60; confirmed-contributor gate; .gittensory.yml overlay end-to-end); settings round-trip + default off; manifest parse + round-trip + non-mapping warning; MCP tool. 97% coverage gate green; workers + git diff --check + ui:openapi:check pass.

Implements #530 (strengthened) + #531 + #532. (#533 issue-side triage + AI-assist advisory remain.)

…te, context & MCP (#530/#531/#532)

The slop-assessment core (#530) existed but was dead code — wired into nothing. This
makes it a real, opt-in maintainer feature: a deterministic slop score that surfaces
warnings in context and (opt-in) blocks, configurable via .gittensory.yml.

Detector (#530, strengthened): adds an `empty_pr_description` signal and recalibrates
weights (whitespace-churn 30 / missing-test-evidence 30 / empty-description 15) so the
`high` band (>=60) is now reachable (it was mathematically impossible before). Stays
deterministic + high-precision — this score is the ONLY thing allowed to block.

Config + gate (#532): new `slopGateMode` (off | advisory | block) + `slopGateMinScore`
on RepositorySettings (migration 0033, default off) and `.gittensory.yml gate.slop:
{ mode, minScore }`. The gate computes the slop assessment over the PR's changed files
+ description ONLY when opted in, surfaces the findings as advisory context, and adds a
`slop_risk_above_threshold` hard blocker only under `slop: block` when slopRisk >=
threshold (default 60) — confirmed-contributor-gated like every blocker. Advisory by
default; blocking is opt-in.

Self-check (#531): new MCP tool `gittensory_check_slop_risk` — a source-free, agent-
native quality self-check over local diff metadata (paths + line counts) + description;
returns slopRisk / band / findings / rubric. No repo data or auth scope needed.

AI-assisted advisory slop signals + a dedicated panel score-row are a planned follow-up;
this PR is the deterministic core + wiring (the part allowed to block).

Tests: detector (new signal, recalibration, reachable high band, public-safe), gate
(advisory never blocks; block at/above threshold; default-60; confirmed-contributor
gate; .gittensory.yml overlay end-to-end), settings round-trip + default off, manifest
parse + round-trip + warning, MCP tool. 97% coverage gate green; workers pass.
@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #716 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 14, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 6511646 Commit Preview URL

Branch Preview URL
Jun 14 2026, 01:49 PM

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 26 changed file(s) — two independent AI reviewers.

Suggested action: 🛠️ Request changes. (reviewers split: merge / request changes) Address the suggestions below before merging.

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR introduces a deterministic anti‑slop gate, adds a new MCP tool for assessing slop risk, updates schemas, DB migrations, settings handling, and extensive tests. The changes are cohesive, type‑safe, and respect the public/private boundaries.

Suggestions

  • Run the full test suite (including migration scripts) in CI to confirm the new DB columns are applied without errors.
  • Verify that the openapi.json generation step includes the new fields consistently across all spec sections.

Worth double-checking

  • Potential migration ordering issues in environments that have not yet applied the new columns.
  • Any external code that constructs a GateCheckPolicy without the new slop fields must be updated (currently covered in the repo).

Reviewer B · mistral-small-3.1-24b-instruct — recommends 🛠️ request changes
This PR introduces a new deterministic slop score feature to the Gittensory project, integrating it into the gate, context, and MCP. The changes are comprehensive, adding new signals, updating schemas, and modifying various components to support the new feature. The code is well-structured and follows the project's conventions.

Suggestions

  • Consider adding more detailed comments in the buildSlopAssessment function to explain the logic behind the slop risk calculation.
  • Ensure that all new features have corresponding tests, especially edge cases for the slop risk assessment.
  • Review the migration script to ensure it handles existing data correctly and does not introduce any regressions.

Worth double-checking

  • Verify that the new slop score logic does not introduce any false positives or negatives that could affect the gate's decision-making.
  • Ensure that the public/private boundary is maintained and that no forbidden terms are leaked into public output.
  • Check that the new feature is thoroughly tested, especially in edge cases where the slop risk might be borderline.

Before = production · After = this PR's preview deploy.

Route Viewport Before After
/ desktop before desktop after desktop
mobile before mobile after mobile

@ghost ghost added the gittensory-review label Jun 14, 2026
…ew ones

The slop.test.ts fixups for the recalibrated weights + new empty_pr_description
signal were left out of the prior commit; without them the isolated-signal tests
score the extra +15 (empty description). Adds descriptions to the single-signal
cases and the new empty-description / reachable-high-band tests.
@JSONbored
JSONbored merged commit ab97fd2 into main Jun 14, 2026
10 checks passed
@JSONbored
JSONbored deleted the feat/slop-score branch June 14, 2026 13:56
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 14, 2026
JSONbored added a commit that referenced this pull request Jun 14, 2026
…cks) (#724)

Completes the slop feature (#716) with an opt-in AI second opinion that
augments the deterministic detector with the SEMANTIC slop it cannot
quantify: generated boilerplate that does not match intent, comments that
merely restate code, cosmetic churn dressed up as substantive, a
description that does not correspond to the diff.

Hard guarantees (AI assistance never changes who can be blocked — only the
deterministic core can block):
- the new `ai_slop_advisory` finding code is NOT recognised by
  isConfiguredGateBlocker, so it can never be a blocker;
- severity is at most `warning`, never `critical`;
- it never feeds slopRisk or the gate policy;
- fail-safe on every path (AI off / no binding / over budget / unparseable
  / unsafe text -> no finding, never throws).

- src/services/ai-slop.ts: runGittensoryAiSlopAdvisory — one free
  Workers-AI call (reuses the ai-review budget window + public-safe
  sanitizer), returns at most one advisory SignalFinding.
- opt-in `slopAiAdvisory` setting wired through types, schema (migration
  0034), repositories, focus-manifest (.gittensory.yml gate.slop.aiAdvisory)
  and the RepositorySettings OpenAPI schema. Runs only when
  slopGateMode != off AND slopAiAdvisory.
- processors: runAiSlopForAdvisory appends the advisory finding, reusing the
  already-fetched changed files; deliberately does NOT touch slopRisk.

Also fixes a latent bug: slop_gate_mode / slop_gate_min_score were absent
from the settings upsert's onConflictDoUpdate SET clause, so slop settings
silently did not persist on update of an existing row.
@github-actions github-actions Bot mentioned this pull request Jun 14, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant