mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-25 20:47:18 +09:00
The venv check probed four imports (dotenv, flask, flask_socketio, sqlalchemy). Those catch a missing or broken venv, but they are blind to the common case: a dependency is added to requirements.txt, all four imports still succeed, dev.sh reports nothing, and the backend dies on the fifth import at startup. That has derailed several sessions. Stamp a sha256 of requirements.txt into the venv after a successful install and compare on each start, so drift triggers a sync. The import probe stays as the broken-venv check; the hash covers what it cannot see. Guards: the hash is computed with the venv's own python (no dependency on sha256sum being installed), an unreadable requirements.txt yields an empty hash and leaves a working venv alone rather than reinstalling every start, and the marker is written only after a successful install so a failed one retries. Verified by driving the decision logic with pip stubbed: no marker → install, marker current → skip, requirement appended → install, settled → skip. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>