Skip to content

fix(drift): repair broken weekly Drift Watchdog — 100% false-positive issues since May 25#116

Open
helloiamvu wants to merge 1 commit into
mainfrom
fix/drift-watchdog-false-positive
Open

fix(drift): repair broken weekly Drift Watchdog — 100% false-positive issues since May 25#116
helloiamvu wants to merge 1 commit into
mainfrom
fix/drift-watchdog-false-positive

Conversation

@helloiamvu

Copy link
Copy Markdown
Member

Problem

Every Monday since 2026-05-25 the Drift Watchdog cron has opened a false-positive "Drift detected" issue (#6, #56, #73, #77, #85, #86, #105) without ever running a single real comparison.

Root cause: tests/fixtures/drift/capture_drift.py calls mostlyright.research(...) but never imports mostlyright. Every weekly run NameErrors on all 5 cases, writes zero captures, and soft-exits 0. compare.py then reports every case as "drift capture missing", writes drift-report.md, and the workflow opens a GH issue from it.

Fix

  • capture_drift.py: add the missing import mostlyright.
  • compare.py: split genuine value/dtype/shape drift (opens an issue) from missing captures (capture/network/infra failure → stderr warning, never written to the report, never opens an issue). If every capture is missing, no report is written. main() now takes optional parity_dir/drift_dir for testability; the CLI path (python compare.py) is unchanged.
  • test_drift.py (new): regression tests covering missing-capture (no report), real value drift (report written), matching (no report), and that capture_drift imports mostlyright.

Originally authored 2026-06-04 against v1.5.2; rebased clean onto current main (v1.15.0) — the drift fixture scripts were untouched in between. tests/test_drift.py passes against the v1.15.0 research(); full fast suite + typecheck green via pre-push hook.

The TS twin (drift-rotate-ts.yml / drift_capture.ts) imports research correctly and does not share this bug.

TS Parity

N/A — CI/test-fixture fix only; no public API surface change.

Fixes #73. Fixes #77. Fixes #85. Fixes #86. Fixes #105.

🤖 Generated with Claude Code

capture_drift.py called `mostlyright.research(...)` without importing
`mostlyright`, so every weekly cron NameError'd on all 5 cases, wrote
zero captures, and soft-exited 0. compare.py then reported every case
as "drift capture missing", wrote drift-report.md, and the workflow
opened a GH issue from it — a 100% false-positive "Drift detected"
issue every Monday (#6, #56), never once a real comparison.

- capture_drift.py: add the missing `import mostlyright`.
- compare.py: split genuine value/dtype/shape drift (opens an issue)
  from missing captures (capture/network/infra failure -> stderr
  warning, never written to the report, never opens an issue). If
  every capture is missing, no report is written. main() now takes
  optional parity_dir/drift_dir for testability; the CLI path
  (`python compare.py`) is unchanged.
- test_drift.py: regression tests covering missing-capture (no report),
  real value drift (report written), matching (no report), and that
  capture_drift imports mostlyright.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@helloiamvu helloiamvu requested a review from Tarabcak July 11, 2026 12:08
@github-actions

Copy link
Copy Markdown

Parity ticket gate: PASSED

parity-ticket-check: PR does not touch parity-trigger surface; gate skipped.

See CROSS-SDK-SYNC.md §2 for the workflow.

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

Labels

None yet

Projects

None yet

1 participant