fix(mcp-gateway): honor the first adopted drift check - #6966
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Minimal fix with a named root cause (0.0 sentinel misread as a timestamp), a comment documenting the invariant, and a regression test that pins it. [DESIGN-REVIEWED] 39b20da |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of All evidence gathered. The fix is sound and declared; the notable findings are the repo's existing First-Principles-Verdict: CONCERNS A clean, declared fix — but the repo already spells "never checked" as What this change shipsIntent: make the adopted-daemon drift repair actually run its first check on freshly booted hosts — a FIX.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 39b20da |
dwu96
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: fix — the adopted-daemon drift recheck treated the 0.0 "never checked" sentinel as a real time.monotonic() stamp, so on a host whose uptime is below the recheck interval the very first check was suppressed; the guard now requires a non-zero prior stamp, with the test pinning monotonic to make the first assessment uptime-independent.
chenmingwei23
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: fix with clear root cause, honor the first adopted drift check in mcp_gateway manager.
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: treats the zero _last_drift_check sentinel as "never checked" so the first adoption-drift assessment is not suppressed on hosts with less uptime than the 5-minute interval; single-condition change plus the matching test pin.
Summary
_last_drift_check == 0as the existing "never checked" sentinelRoot cause
Freshly provisioned macOS runners can have less than five minutes of uptime. The code subtracted the zero sentinel from
time.monotonic()and treated that small result as a recent check, so the first drift assessment was skipped. The dependent replacement/watchdog assertions then failed even though no assessment ran.Determinism evidence
the first call assessesTestAdoptedDriftRechecktests pass with RuntimeWarning and PytestUnraisable warnings promoted to errorsValidation
git diff --checkpassedOverlap audit
This is the independent owner fix for the macOS gateway failures first observed on #6962; #6962 remains unchanged.