Skip to content

fix(review): fall back to the generic slop detail when the rationale neutralizes to empty - #1381

Closed
minion1227 wants to merge 3 commits into
JSONbored:mainfrom
minion1227:minion_slop-fallback
Closed

fix(review): fall back to the generic slop detail when the rationale neutralizes to empty#1381
minion1227 wants to merge 3 commits into
JSONbored:mainfrom
minion1227:minion_slop-fallback

Conversation

@minion1227

Copy link
Copy Markdown

Summary

No issue linked — this is a small, self-evident correctness fix to an existing sanitizer path, kept to one operator plus a regression test. The repo's linkedIssuePolicy is preferred (not required) and issueDiscoveryPolicy is discouraged, so a direct PR with this rationale is the intended path rather than filing a discovery issue.

  • slopFindingFromOpinion (src/services/ai-slop.ts) built the public advisory detail with const detailBody = safeRationale ?? "An AI maintainer-assist pass flagged…".
  • toPublicSafe (src/services/ai-review.ts) is typed string | null, and it returns the empty string "" (not only null) when a non-empty rationale neutralizes away: a control-character-only rationale survives parseSlopOpinion's .trim() (JS trim() does not strip C0/C1 control chars) but neutralizePublicMarkdown collapses it to "". Since "" ?? fallback evaluates to "", the generic fallback sentence was skipped and the public advisory detail began with a malformed " Observations: …" — a leading space and no explanatory body.
  • The drop-guard immediately above (if (!safeRationale && safeSignals.length === 0) return null;) already treats "" and null alike via !safeRationale; only the detailBody line used ??, so it was the inconsistent one.
  • Fix: use || so an empty body also takes the fallback. Purely additive — safeRationale is string | null, whose only falsy values ("", null) should both fall back; any real rationale is truthy and still used verbatim.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • None skipped. The changed line is 100% statement- and branch-covered (both || arms), and the full suite passes with adequate per-test time.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics. (This PR keeps the public advisory well-formed — it restores the explanatory fallback sentence instead of emitting a malformed " Observations: …" fragment.)
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/session/CORS surface; this is the AI-advisory public-text path, covered by the added regression test.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP shape change.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI change.)
  • Visible UI changes include a UI Evidence section below. (N/A — backend-only, no visible change.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — backend-only change to the AI-slop advisory builder; no visible UI, frontend, docs, or extension change.

Notes

  • Regression test (test/unit/ai-slop.test.ts): drives slopFindingFromOpinion with a control-character rationale (String.fromCharCode(1)) that neutralizes to "", plus one surviving signal, and asserts the detail contains the generic fallback sentence, has no leading space, and still includes the signal. Verified it fails on the pre-fix ?? (detail is " Observations: mostly reformatting.") and passes after the || fix. The pre-existing rationale: "" test continues to pass via the null path, confirming no regression.

…neutralizes to empty

slopFindingFromOpinion built the advisory detail with `safeRationale ?? fallback`, but
toPublicSafe returns "" (not only null) when a non-empty rationale neutralizes away — a
control-character-only rationale survives parseSlopOpinion's trim() yet collapses to ""
in neutralizePublicMarkdown. Since `"" ?? x` keeps "", the fallback sentence was skipped
and the public advisory detail began with a malformed " Observations: …".

Use `||` so an empty body also takes the fallback, matching the `!safeRationale` drop-guard
directly above, which already treats "" and null alike. Add a regression test covering the
control-char rationale path (fails before, passes after).
@minion1227
minion1227 requested a review from JSONbored as a code owner June 25, 2026 17:25
@dosubot dosubot Bot added the size:XS label Jun 25, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb

loopover-orb Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Important

Gittensory found maintainer review notes

Public GitHub metadata was checked for review readiness. Gittensor-specific context appears only when confirmed.

Readiness score: 66/100

Signal Result Evidence Action
Linked issue ⚠️ Missing No linked issue or no-issue rationale found. Explain no-issue PR.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found. No action.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels; size label size:XS. No action.
Validation evidence ❌ 5/25 Cached preflight status is hold. Fix blocker.
Open PR queue ❌ 3/10 39 open PR(s), 12 likely reviewable, 27 unlinked. Expect slower review.
Contributor context ✅ Confirmed Gittensor contributor minion1227; Gittensor profile; 24 PR(s), 0 issue(s). No action.
Gate result ⚠️ Advisory only Advisory only. No action.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review context
  • Author: minion1227
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 24 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Maintainer notes
  • Repo lane is not ready for a confident recommendation: Repository registration is not available in the local Gittensory cache.
  • No linked issue detected: The planned PR does not reference a closing issue or explicit linked issue number.
Contributor next steps
  • Explain no-issue PR.
  • Fix blocker.
  • Expect slower review.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Re-run Gittensory review

💰 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.

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 25, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.37%. Comparing base (314ad9d) to head (3665ed1).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1381   +/-   ##
=======================================
  Coverage   95.37%   95.37%           
=======================================
  Files         192      192           
  Lines       20852    20852           
  Branches     7540     7540           
=======================================
  Hits        19887    19887           
  Misses        383      383           
  Partials      582      582           
Files with missing lines Coverage Δ
src/services/ai-slop.ts 90.54% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored added banned Banned due to plagiarism or other repeat violations. slop AI slop and/or attempts to game additional points via manipulation or alt profiles. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 26, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing this under the same enforcement, and I'll be straight with you about why.

This account is permanently blocked from contributing to our repositories — for plagiarism. You submitted two verbatim copies of another contributor's open PRs as your own work:

  • #1377 copied kiannidev's #1376 (identical source change; tests reworded to obscure the copy), filed ~90 minutes later on the same issue.
  • #1378 copied kiannidev's #1373 byte-for-byte, filed ~2 hours later on the same issue.

Copying someone else's diff to claim the credit is a hard violation for us — two strikes, you're out. Our Code of Conduct now spells this out: plagiarism and reward-farming earn a permanent block from contributing, enforced across JSONbored/gittensory, JSONbored/metagraphed, and JSONbored/awesome-claude.

To be fair to the work: this one — the empty-rationale slop fallback — was a sharp, original catch, and I traced it as correct. That doesn't change the outcome. The ban is on the account, so there's no merit pass for an individual PR. Closed and labeled slop. Final.

@JSONbored JSONbored closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

banned Banned due to plagiarism or other repeat violations. slop AI slop and/or attempts to game additional points via manipulation or alt profiles.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants