feat(calibration): config-drift section in the maintainer recap (#8214)#8257
feat(calibration): config-drift section in the maintainer recap (#8214)#8257cleanjunc wants to merge 1 commit into
Conversation
…bored#8214) Drift alerts are point-in-time; the weekly maintainer recap is where a standing drift episode should be impossible to miss. Add the config-drift content slice of the recap digest (epic JSONbored#8211 track A): - src/services/maintainer-recap-config-drift.ts: pure section builder mirroring buildCalibrationRecapSection — a plain source struct in (per-knob KnobDriftReport projections, the shape evaluateKnobDrift already computes), a titled section out. Renders each drifting knob with direction reading (shipped/tighter/looser per the report's own consumer guidance), live vs dominating value, both corpus sizes, and episode standing time from the sentinel's fingerprint timestamp; clean knobs collapse into one summary line. The sentinel-flag-off state renders an explicit 'drift sentinel disabled' line so absence of data is never mistaken for absence of drift. The projection deliberately excludes the report's per-split BacktestComparisons, so corpus content structurally cannot reach the digest. - Recap assembly wiring behind the existing plumbing (no new scheduling): RecapReport carries an optional configDrift section, buildMaintainerRecap builds it only when a drift source is supplied (mirroring the cohorts convention), formatMaintainerRecap renders the section with the explicit disabled fallback when no source was supplied, and runMaintainerRecap threads a source through for the sentinel's plumbing (JSONbored#8213) to use. Tests: every builder arm (disabled / no-knobs / all-clean / mixed / all-drifting, all three direction readings, unknown-age + clock-skew + sub-day + multi-day episode arms), the structural-compatibility invariant that a FULL KnobDriftReport renders aggregates + ids only, sanitizer scrub + line-cap, both formatter arms, and the build/run wiring arms.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-23 15:30:45 UTC
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; No linked issue detected; AI reviewers agree on a likely critical defect: src/services/maintainer-recap-config-drift.ts duplicates the existing, more type-faithful `src/services/maintainer-recap-drift.ts` (`buildDriftRecapSection`/`DriftRecapSource`, built against the real `KnobDriftReport` type) instead of reusing or replacing it — you now have two competing config-drift section builders with different shapes, and it's unclear which one the sentinel (#8213) is meant to feed; this needs a stated reason for the parallel implementation or a consolidation before merge.). 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8257 +/- ##
==========================================
- Coverage 92.14% 89.61% -2.53%
==========================================
Files 784 100 -684
Lines 78694 22798 -55896
Branches 23752 3899 -19853
==========================================
- Hits 72510 20431 -52079
+ Misses 5062 2187 -2875
+ Partials 1122 180 -942
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
Adds the config-drift section to the maintainer recap (epic #8211 track A): drift alerts are point-in-time, but the recap's calibration section is where a STANDING drift episode should be impossible to miss — today it knows nothing about drift.
src/services/maintainer-recap-config-drift.ts— a pure section builder mirroringbuildCalibrationRecapSection(src/services/maintainer-recap-calibration.ts) exactly: a plain source struct in, a titled{ title, counts, note, lines }section out, with the same privatesanitizeRecapTextscrub. Each drifting knob renders its direction reading (shipped→ "drifted override should revert",tighter→ actionable stale-config warning,looser→ informational duplicate of the loosening loop — mirroringKnobDriftReport.direction's own consumer guidance atsrc/services/loosening-knobs.ts:143), live vs dominating value, both corpus sizes, and how long the episode has stood (fingerprint timestamp →generatedAt, with explicit unknown-age and clock-skew-clamp arms). Clean knobs collapse into one summary line. The sentinel-flag-off state renders the mandated explicitdrift sentinel disabledline, so absence of data is never mistaken for absence of drift; enabled-but-no-knobs is its own distinguishable state.BacktestComparisonpayloads andruleIdare structurally excluded, and an invariant test feeds a FULLKnobDriftReport(structurally compatible with the projection) and asserts none of its corpus-side content can surface.RecapReportcarries an optionalconfigDriftsection (mirroring thecohortsoptional-field convention),buildMaintainerRecapbuilds it only when a drift source is supplied,formatMaintainerRecaprenders## Config driftwith the explicit disabled fallback when no source was supplied, andrunMaintainerRecapthreads a source through its options for the sentinel's plumbing (calibration: nightly config-drift sentinel — cron wire + one-shot stale-config alert #8213) to hand in real reports.Closes #8214
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% 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:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test:coverage, I ran every touched suite (maintainer-recap-config-drift,maintainer-recap-format,maintainer-recap,maintainer-recap-calibration,maintainer-recap-wire— 66 tests, all green) with V8 coverage and measured the patch empirically: intersectingcoverage/lcov.infoDA/BRDArecords (max-merged per line/arm) withgit diff -U0's new-side line numbers reports 0 uncovered lines and 0 uncovered branch arms across all 27 instrumented changed lines (src/types.ts's additions are type-only). Every builder arm is exercised: disabled / no-knobs / all-clean / mixed / all-drifting, all three direction readings, unknown-age + clock-skew + sub-day + multi-day episode arms, and both formatter arms (populated section vs disabled fallback).actionlint/ workers / MCP / UI checks: no workflow, worker, MCP, or UI file is touched — this diff is twosrc/servicesfiles, a type addition, and unit tests.RecapReportis not part of the public OpenAPI surface (no route serves it), so noui:openapiregeneration applies. Real CI re-runs the full chain regardless.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
No visible UI, frontend, docs, or extension change — this PR touches
src/services/**,src/types.ts, andtest/unit/**only.Notes
ConfigDriftRecapSource(per-knobKnobDriftReports — the projection is structurally satisfied by the real type landed in feat(review): pure config-drift evaluator over the loosenable-knob registry #8232 — plus its flag state and episode fingerprint timestamps) viarunMaintainerRecap'sconfigDriftoption. Until it does, every recap renders the explicitdrift sentinel disabledline — the issue's mandated empty state, and the correct reading of "no drift data was collected".maintainer-recap-calibration.ts's header documents shipping the section independently of the foundation builder via a projection struct, which is also the required pattern named by calibration: config-drift section in the maintainer recap #8214.