Skip to content

chore: add run.lock/PID freshness diagnostic for the sensor watchdog - #579

Open
essentialbit wants to merge 2 commits into
mainfrom
chore/run-lock-freshness-check
Open

chore: add run.lock/PID freshness diagnostic for the sensor watchdog#579
essentialbit wants to merge 2 commits into
mainfrom
chore/run-lock-freshness-check

Conversation

@essentialbit

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/check_run_lock_freshness.py, a read-only diagnostic that formalizes the ad-hoc PID/PPID-matching check repeated by hand across cycles while investigating the confirmed-twice bug (2026-08-16) where run-sensor.sh's own 45-min MAX_RUN_SECS kill loop failed to fire.
  • Reads run.lock + watchdog.log + ps -o etime= — never touches run-sensor.sh itself (protected, user-fix-only per project standing policy).
  • Verdicts: RUNNING, OVERRUN_PENDING, OVERRUN_NOT_KILLED (the bug signature), STALE_LOCK (orphaned lock, dead pid), MALFORMED_LOCK, NO_LOCK.

Test plan

  • python3 -c "import ast; ast.parse(...)" — syntax check passes
  • Ran live against the current in-flight sensor cycle's own run.lock — correctly reported RUNNING, elapsed matched ps
  • Unit-style checks (monkeypatched LOCK path) covering STALE_LOCK, MALFORMED_LOCK, NO_LOCK paths — all verdicts correct
  • from main import * still imports cleanly (no shared code touched)

Self-directed tooling addition (empty eligible backlog + no conflicting PRs this cycle) — no consensus/outcome-recording needed per project policy for this PR class.

🤖 Generated with Claude Code

Saifodius and others added 2 commits August 16, 2026 17:25
Formalizes the ad-hoc PID/PPID-matching check repeated by hand while
investigating the confirmed-twice bug where run-sensor.sh's own 45-min
MAX_RUN_SECS kill loop failed to fire. Read-only, never touches the
protected run-sensor.sh itself -- surfaces RUNNING/OVERRUN_NOT_KILLED/
STALE_LOCK/MALFORMED_LOCK/NO_LOCK verdicts from run.lock + watchdog.log + ps.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant