Skip to content

fix(blacklist): add shared/global contributor blacklist#1531

Merged
JSONbored merged 4 commits into
JSONbored:mainfrom
tmimmanuel:fix-1425-shared-contributor-blacklist
Jun 28, 2026
Merged

fix(blacklist): add shared/global contributor blacklist#1531
JSONbored merged 4 commits into
JSONbored:mainfrom
tmimmanuel:fix-1425-shared-contributor-blacklist

Conversation

@tmimmanuel

Copy link
Copy Markdown
Contributor

Summary

  • Added shared/global contributor blacklist persistence via new migration-backed singleton table global_contributor_blacklist and DB read/write APIs.
  • Wired global blacklist into repository settings resolution so effective settings are .gittensory.yml/DB + shared/global list.
  • Added focused unit coverage for DB round-trip, resolution merge behavior, and a self-tune path regression guard.

Validation

  • npm run db:migrations:check
  • npm run typecheck
  • npm test -- test/unit/contributor-blacklist.test.ts test/unit/focus-manifest.test.ts test/unit/selftune-readback.test.ts
  • npm run test:unit

Closes #1425

@tmimmanuel
tmimmanuel requested a review from JSONbored as a code owner June 26, 2026 15:30
@dosubot dosubot Bot added the size:M label Jun 26, 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.54%. Comparing base (8817fbc) to head (1be9293).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1531   +/-   ##
=======================================
  Coverage   95.53%   95.54%           
=======================================
  Files         204      204           
  Lines       22282    22293   +11     
  Branches     8048     8052    +4     
=======================================
+ Hits        21288    21299   +11     
  Misses        415      415           
  Partials      579      579           
Files with missing lines Coverage Δ
src/db/repositories.ts 96.16% <100.00%> (+0.02%) ⬆️
src/settings/repository-settings.ts 100.00% <100.00%> (ø)
src/signals/focus-manifest.ts 99.17% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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 27, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review — held for maintainer review

7 files · 1 AI reviewers · no blockers · readiness 55/100 · CI green · clean

⏸️ Held for maintainer review — This is a first-time contribution to this repo, so the gate stays advisory rather than blocking. The findings remain visible, and the gate will apply normally once this author has merge history here.

Review summary
This adds a migration-backed singleton table plus DB helpers for a shared contributor blacklist, then threads that list through repository settings resolution so the webhook and re-gate enforcement path merges it with per-repo manifest/DB settings before `findBlacklistEntry` is evaluated. The merge order is deliberate and covered: effective per-repo settings win metadata on duplicate logins while the shared list still contributes additional entries. I do not see a reachable correctness blocker in the provided diff; the notable remaining risks are observability around the fail-open read and the lack of an obvious operator write surface in this PR.

Signal Result Evidence
Code review ✅ No blockers 1 reviewers, synthesized
Linked issue ✅ Linked #1425
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Review load ❌ 8/20 Readiness component derived from cached public PR metadata and labels; size label size:M.
Validation evidence ❌ 5/25 Cached preflight status is hold.
Open PR queue ❌ 3/10 17 open PR(s), 10 likely reviewable, 7 unlinked.
Contributor context ✅ Confirmed Gittensor contributor tmimmanuel; Gittensor profile; 33 PR(s), 35 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Nits — 5 non-blocking
  • nit: `src/db/repositories.ts:506` catches every read/parse failure and returns `[]` silently, so an operator cannot distinguish an intentionally empty shared list from a missing table, malformed row, or transient DB outage; add a warning/audit/metric in the catch path.
  • nit: `src/settings/repository-settings.ts:42` wraps `getGlobalContributorBlacklist(env)` in `.catch(() => [])` even though the helper already fail-opens, which duplicates policy and will make future logging or metrics easy to miss in one layer.
  • nit: `migrations/0082_global_contributor_blacklist.sql:6` stores `updated_at` with SQLite `CURRENT_TIMESTAMP` format while most app-written timestamps use ISO strings; this is harmless while metadata is not compared, but document that choice or write ISO timestamps from the repository helper consistently.
  • nit: `test/unit/selftune-readback.test.ts:72` verifies the resolver fallback via a module spy after importing the resolver, which is more brittle than using a real unavailable-table setup or a dependency seam.
  • `src/db/repositories.ts:512`: keep the fail-open behavior if that is intentional, but emit a structured warning that includes `global_contributor_blacklist` so missing migration and malformed JSON do not become invisible no-ops.
Review context
Contributor next steps
  • Review top overlaps.
  • Add scope summary.
  • Fix blocker.
  • Expect slower review.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
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 details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

This adds a migration-backed singleton table plus DB helpers for a shared contributor blacklist, then threads that list through repository settings resolution so the webhook and re-gate enforcement path merges it with per-repo manifest/DB settings before `findBlacklistEntry` is evaluated. The merge order is deliberate and covered: effective per-repo settings win metadata on duplicate logins while the shared list still contributes additional entries. I do not see a reachable correctness blocker in the provided diff; the notable remaining risks are observability around the fail-open read and the lack of an obvious operator write surface in this PR.

Nits (5)

  • nit: `src/db/repositories.ts:506` catches every read/parse failure and returns `[]` silently, so an operator cannot distinguish an intentionally empty shared list from a missing table, malformed row, or transient DB outage; add a warning/audit/metric in the catch path.
  • nit: `src/settings/repository-settings.ts:42` wraps `getGlobalContributorBlacklist(env)` in `.catch(() => [])` even though the helper already fail-opens, which duplicates policy and will make future logging or metrics easy to miss in one layer.
  • nit: `migrations/0082_global_contributor_blacklist.sql:6` stores `updated_at` with SQLite `CURRENT_TIMESTAMP` format while most app-written timestamps use ISO strings; this is harmless while metadata is not compared, but document that choice or write ISO timestamps from the repository helper consistently.
  • nit: `test/unit/selftune-readback.test.ts:72` verifies the resolver fallback via a module spy after importing the resolver, which is more brittle than using a real unavailable-table setup or a dependency seam.
  • `src/db/repositories.ts:512`: keep the fail-open behavior if that is intentional, but emit a structured warning that includes `global_contributor_blacklist` so missing migration and malformed JSON do not become invisible no-ops.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


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

  • Re-run Gittensory review

@tmimmanuel
tmimmanuel force-pushed the fix-1425-shared-contributor-blacklist branch from 727ad5d to c365d05 Compare June 28, 2026 11:16
Main added 0075_ai_review_all_authors.sql (JSONbored#1555) before this PR landed, so
the original 0075_global_contributor_blacklist.sql collides with it. The
db:migrations:check step in the CI lint job fails on the duplicate. Rename
to 0082 (next free number) so both migrations can coexist.
@JSONbored JSONbored changed the title Add shared/global contributor blacklist (#1425) fix(blacklist): Add shared/global contributor blacklist Jun 28, 2026
@JSONbored JSONbored changed the title fix(blacklist): Add shared/global contributor blacklist fix(blacklist): add shared/global contributor blacklist Jun 28, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 28, 2026
@dosubot dosubot Bot added the lgtm label Jun 28, 2026
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 28, 2026
@JSONbored
JSONbored merged commit dcfbaf5 into JSONbored:main Jun 28, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 28, 2026
@github-actions github-actions Bot mentioned this pull request Jun 29, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(anti-abuse): configurable contributor blacklist — auto-label + auto-close banned logins

2 participants