feat(settings): add a read-only DB/config settings-drift diagnostic - #3369
Conversation
Adds computeSettingsDrift, a pure diff between a repo's DB-stored repository_settings row and the live effective settings resolveEffectiveSettings would actually apply for it, so a self-host operator can see which DB-stored fields a .gittensory.yml override is silently shadowing. Compares against a "no manifest" baseline rather than the raw DB row, so manifest-independent normalization (the shared contributor-blacklist merge) never misreports as drift. computeSettingsDriftForRepo wires this to the same DB + manifest reads resolveRepositorySettings already makes, so it is immediately callable with a real Env. Never touches the live resolve/review path itself -- purely diagnostic. A human-facing entry point (an MCP tool or CLI script) needs its own auth/data-access wiring and is left as a focused follow-up rather than bolted onto this PR.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-05 05:22:00 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3369 +/- ##
=======================================
Coverage 93.88% 93.89%
=======================================
Files 282 283 +1
Lines 30570 30586 +16
Branches 11136 11139 +3
=======================================
+ Hits 28702 28718 +16
Misses 1211 1211
Partials 657 657
🚀 New features to boost your workflow:
|
Summary
computeSettingsDrift(src/settings/settings-drift.ts): a pure diff between a repo's DB-storedrepository_settingsrow and the LIVE effective settingsresolveEffectiveSettingswould actually apply for it. Every entry names a DB-stored field whose value is silently shadowed by a.gittensory.ymlconfig-as-code override — useful for a self-host operator who changed something via the dashboard and can't tell why it isn't taking effect. Confirmed via direct investigation that no such drift-detection exists anywhere in the codebase today (nodrift/shadow/precedencecomparison logic beyond the one-way{ ...dbSettings, ...manifest.settings }overlay itself).resolveEffectiveSettingsalso applies manifest-independent normalization (the shared/global contributor-blacklist merge, in particular) that would otherwise misreport as "shadowed by private config" for every repo with any global blacklist entry, even one with no manifest at all — verified this with a dedicated test.computeSettingsDriftForRepowires the pure function to the same DB + manifest readssettings/repository-settings.ts'sresolveRepositorySettingsalready makes, so it's immediately callable with a realEnv— no new data-fetch path introduced.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typecheck(clean)npx vitest run test/unit/settings-drift.test.ts(12/12 passing)npx vitest run test/unit/focus-manifest.test.ts test/unit/selftune-readback.test.ts(regression check on the sharedresolveEffectiveSettings/manifest-loader/DB-repositories dependencies — 263/263 passing, no changes needed)vitest --coverage --coverage.include=src/settings/settings-drift.ts): 100% statements/branches/functions/lines on the new file.npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check/npm run ui:build— not run individually this PR; no worker/MCP/OpenAPI/UI surface touched (no new route, no new MCP tool, no schema change). Ran the fullnpm run test:cigate once already this session (PR fix(settings): authorize circuit-breaker hold labels via merge/close autonomy #3363, same branch point) with no relevant failures.gate:-sourced vssettings:-sourced override both detected, a field the manifest never touches staying unreported, the global-blacklist-merge false-positive specifically guarded against, and the live DB+manifest fetch path including itscatch(() => [])fallback.Safety
UI Evidencesection below. — N/A, no visible UI change.Notes