Skip to content

refactor(settings): drop Batch B's 15 config-as-code-only DB columns - #6585

Closed
RealDiligent wants to merge 4 commits into
JSONbored:mainfrom
RealDiligent:refactor/batch-b-phase2-drop-db-columns-6443
Closed

refactor(settings): drop Batch B's 15 config-as-code-only DB columns#6585
RealDiligent wants to merge 4 commits into
JSONbored:mainfrom
RealDiligent:refactor/batch-b-phase2-drop-db-columns-6443

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Drop the 15 Batch B fields from repository_settings (migration 0158): label/moderation/review-evasion/merge-train knobs already parsed from .loopover.yml settings:.
  • getRepositorySettings / upsertRepositorySettings return built-in defaults for these fields (caller writes are silent no-ops); resolveEffectiveSettings still overlays the manifest.
  • Extend CONFIG_AS_CODE_ONLY_FIELDS; remove dashboard/API write paths for gittensorLabel / createMissingLabel / mergeTrainMode / related keys.

Closes #6443

Mirrors Batch A Phase 2 (#6557 / #6442). Maintainer unlocked this as DB-removal-only.

Test plan

  • Unit: contributor-blacklist, moderation-config-db, merge-train-mode, maintainer-settings-editable
  • Unit: review-evasion courtesy-comment false via manifest
  • CI validate + codecov/patch ≥ 99%

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 16, 2026 15:44
@superagent-security

Copy link
Copy Markdown
Contributor

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

Removes label/moderation/review-evasion/merge-train fields from
repository_settings so .loopover.yml is the single source of truth.

Closes JSONbored#6443

Co-authored-by: Cursor <cursoragent@cursor.com>
RealDiligent and others added 2 commits July 16, 2026 23:55
Batch B (JSONbored#6443) removed it from MAINTAINER_SETTINGS_EDITABLE_KEYS.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.62%. Comparing base (88457ce) to head (9328a50).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6585      +/-   ##
==========================================
- Coverage   93.64%   93.62%   -0.02%     
==========================================
  Files         678      678              
  Lines       67964    67952      -12     
  Branches    18678    18666      -12     
==========================================
- Hits        63642    63623      -19     
- Misses       3347     3354       +7     
  Partials      975      975              
Flag Coverage Δ
shard-1 43.84% <ø> (-0.04%) ⬇️
shard-2 36.90% <ø> (-0.03%) ⬇️
shard-3 32.39% <ø> (-0.05%) ⬇️
shard-4 34.80% <ø> (-0.02%) ⬇️
shard-5 31.55% <ø> (-0.02%) ⬇️
shard-6 45.44% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 94.54% <ø> (ø)
src/db/repositories.ts 96.39% <ø> (-0.40%) ⬇️
src/db/schema.ts 72.97% <ø> (ø)

… steps

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-16 16:06:49 UTC

16 files · 1 AI reviewer · 1 blocker · CI green · clean

🛑 Suggested Action - Reject/Close

Review summary
This PR continues Batch A's DB-removal pattern for a second set of 15 config-as-code-only fields (labels, moderation, review-evasion, merge-train), swapping DB reads/writes for hardcoded defaults, extending CONFIG_AS_CODE_ONLY_FIELDS, and updating the dashboard/API/tests to drive these settings through .loopover.yml + resolveEffectiveSettings instead. The code-level mechanics mirror the already-merged Batch A migration and look internally consistent (schema column removal maps 1:1 to the 15 ALTER TABLE DROP COLUMN statements). The critical problem is the migration's own filename: migrations/0158_drop_batch_b_config_as_code_columns.sql reuses migration number 0158, which the provided repo context shows is already taken by the existing migrations/0158_drop_batch_a_config_as_code_columns.sql.

Blockers

  • migrations/0158_drop_batch_b_config_as_code_columns.sql reuses migration number 0158, which is already occupied by the existing migrations/0158_drop_batch_a_config_as_code_columns.sql in this repo — two different migrations both filed as '0158' will run in filename-sort order at deploy and can collide/diverge on which one the D1 ledger records as applied; rename this file to the next free number (0159) before merge.
Nits — 4 non-blocking
  • The migration and several touched files (contributor-blacklist.test.ts, repositories.ts, routes.ts) continue to use 'blacklist' terminology; not introduced by this PR and consistent with existing code, so not blocking, but worth a follow-up rename to 'denylist' repo-wide if the maintainer wants to standardize.
  • test/integration/api.test.ts's registration-readiness assertion duplicates the `settings: { publicSurface: "off", createMissingLabel: false, gittensorLabel: "gittensor-miner" }` object in two places — consider extracting to a shared const to avoid drift if a future field is added.
  • Rename the new migration to 0159_drop_batch_b_config_as_code_columns.sql and re-run db:migrations:check to confirm the ledger is contiguous.
  • Double-check CI's migration-numbering guard actually catches this class of collision going forward, since a duplicate number is silently mergeable via git.

Why this is blocked

  • migrations/0158_drop_batch_b_config_as_code_columns.sql reuses migration number 0158, which is already occupied by the existing migrations/0158_drop_batch_a_config_as_code_columns.sql in this repo — two different migrations both filed as '0158' will run in filename-sort order at deploy and can collide/diverge on which one the D1 ledger records as applied; rename this file to the next free number (0159) before merge.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. migrations/0158\_drop\_batch\_b\_config\_as\_code\_columns.sql reuses migration number 0158, which is already occupied by the existing migrations/0158\_drop\_batch\_a\_config\_as\_code\_columns.sql in this repo — two different migrations both filed as '0158' will run in filename-sort order at deploy and can collide/diverge on which one the D1 ledger records as applied; rename this file to the next free number \(0159\) before merge.

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6443
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 357 registered-repo PR(s), 174 merged, 32 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 357 PR(s), 32 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR migrates all 15 named Batch B fields off the DB (schema, migration 0158, repositories.ts read/write, API/dashboard write paths), extends CONFIG_AS_CODE_ONLY_FIELDS to overlay manifest values, and updates tests to source these settings from the focus manifest rather than DB round-trips, matching the issue's DB-removal-half ask.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 357 PR(s), 32 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
diff /
diff /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy · Diff highlights exactly what changed.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (Linked issue #6443 is assigned to the maintainer (@JSONbored) — that work is reserved for the maintainer, so this PR cannot be auto-accepted.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config-as-code: migrate label/moderation/review-evasion settings off the DB

1 participant