Skip to content

fix(doctor): name MSR unverifiable causes and cut the log scan (#367) - #387

Merged
VijitSingh97 merged 1 commit into
developfrom
fix/367-doctor-msr-unverifiable
Aug 21, 2026
Merged

fix(doctor): name MSR unverifiable causes and cut the log scan (#367)#387
VijitSingh97 merged 1 commit into
developfrom
fix/367-doctor-msr-unverifiable

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

Closes #367.

Three parts, following the issue's own suggested direction:

  • doctor: when the MSR block's guard fails, it now says so instead of silently skipping — two distinct advisory lines (_ck_info, not counted issues): no config.json so the worker root couldn't resolve, vs a resolved root with no xmrig.log at the named path. Absence and failure are now different signals with different wording.
  • e2e-real verify: asserts the guard's inputs first — resolves the worker's xmrig.log the same way doctor does — so a run where doctor skipped the block fails as "could not resolve xmrig.log" (naming the path and HOME_DIR) instead of "MSR mod not applied". Both original MSR mod: verify it actually applied, and allow tuning presets/custom values #66 assertions kept for the resolved case. This turns the flake from a gate-lying failure into one that names its real cause.
  • _msr_log_status: grep | tail -1 | awk replaces the whole-file awk scan (the 122MB case from the issue), keeping last-match semantics; the comment warns off the naive tail-first "optimization" (the MSR line is written at miner start, not near EOF). The no-line-found wording stays honest about copytruncate rotation: not-found is not proof of not-applied.

What was run (implementation + independent adversarial re-verification in a fresh context):

🤖 Generated with Claude Code

doctor's MSR block goes silent whenever the guard in front of it fails —
no config.json, or a resolved worker root with no xmrig.log yet — and a
silently skipped block reads identically to a failed check. That flake
broke both #66 MSR assertions in e2e-real.sh verify on a healthy miner-3:
re-running the same commit immediately passed clean.

- doctor now names which guard input failed: "MSR unverifiable — no
  config.json, so the worker root couldn't be resolved" when CONFIG_JSON
  is missing, vs. "MSR unverifiable — no xmrig.log at <path>" once the
  root resolves but nothing is logged there yet (fresh install, or a
  copytruncate rotation window on an otherwise healthy rig). Both are
  advisory (_ck_info), never a counted issue — absence is not failure.
- e2e-real.sh verify resolves the same worker root + log path doctor's
  guard needs, before the #66 assertions run, so a skipped block now
  fails there as "could not resolve xmrig.log" (with the path) instead
  of being misread as "MSR not applied".
- _msr_log_status awk-scanned the whole log on every doctor call (122MB
  seen on miner-3). The confirmation line is written at miner START, so
  on a long-lived worker it sits near the file's beginning — a naive
  tail would miss it. grep (C-speed) finds every match and tail -1 keeps
  the same last-match semantics at a fraction of the cost.

Tests: three new doctor cases (unresolved config, resolved root with a
missing log, line present) plus the surrounding #66/#140 MSR sections —
1704 passed, 0 failed. e2e-real.sh isn't runnable outside a real rig;
the new assertion mirrors the file's existing resolver pattern and is
shellcheck/shfmt clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 merged commit db37468 into develop Aug 21, 2026
9 checks passed
@VijitSingh97
VijitSingh97 deleted the fix/367-doctor-msr-unverifiable branch August 21, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e-real verify: doctor's MSR block intermittently doesn't render, failing both #66 assertions on a healthy rig

1 participant