feat(slop): AI-assisted advisory slop layer (advisory-only, never blocks) - #724
Merged
Conversation
…cks) 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.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | d4effd8 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 03:09 PM |
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This was referenced Jun 14, 2026
JSONbored
added a commit
that referenced
this pull request
Jun 14, 2026
Extends the AI slop advisory (#724) to optionally use the maintainer's own frontier model (Anthropic/OpenAI) instead of free Workers AI, reusing the existing per-repo encrypted key + aiReviewByok flag — one BYOK key serves both AI features. Advisory-only either way; BYOK never changes whether the slop pass can block (it can't). - ai-review.ts: extract callAiProvider (shared BYOK HTTP/timeout/error handling) — runProviderReview now wraps it; export ProviderFailure + DEFAULT_BYOK_DAILY_REPO_LIMIT. - repositories.ts: generalize countByokAiReviewEventsForRepoSince -> countByokAiEventsForRepoSince — one shared per-repo/day BYOK cap across ALL AI features (review + slop), so enabling more capabilities cannot multiply frontier spend. - ai-slop.ts: providerKey path skips the free neuron budget, checks the shared BYOK cap, calls callAiProvider + parseSlopOpinion, records byok:<provider> usage. Workers-AI fallback unchanged. Fail-safe. - processors runAiSlopForAdvisory: decrypt the repo key (a declared provider override must match) and pass it through. Tests: BYOK provider path (provider used, Workers AI not) + shared BYOK cap quota; existing Workers-AI gating/fail-safe still green. 97% coverage held.
Closed
12 tasks
This was referenced Jun 14, 2026
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
Completes the slop feature (#716) with the AI-assisted advisory layer — 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 ever block. The AI layer is structurally advisory:
ai_slop_advisoryfinding code is not recognised byisConfiguredGateBlocker, so it can never be a blocker;warning, nevercritical;slopRiskor the gate policy;How
src/services/ai-slop.ts—runGittensoryAiSlopAdvisory: one free Cloudflare Workers-AI call (reuses theai-reviewdaily-neuron budget window + public-safe sanitizer), returns at most one advisorySignalFinding.slopAiAdvisorysetting wired throughtypes,schema(migration0034),repositories,focus-manifest(.gittensory.ymlgate.slop.aiAdvisory) and theRepositorySettingsOpenAPI schema. Runs only whenslopGateMode != offandslopAiAdvisory.processors—runAiSlopForAdvisoryappends the advisory finding, reusing the already-fetched changed files; deliberately does not touchslopRisk.Drive-by fix
slop_gate_mode/slop_gate_min_scorewere absent from the settings upsert'sonConflictDoUpdateSET clause, so slop settings silently did not persist on update of an existing row. Restored alongside the new field.Tests
New
ai-slopsuite (parse / finding mapping / gating / fail-safe / can-never-block), processor wiring, focus-manifestaiAdvisoryround-trip + resolve, and the DB persist-on-update round-trip. Typecheck clean; 97% coverage gate held; OpenAPI spec regenerated.