Mirrors the CI-green safeguards rolled out repo-wide (see screen-locker):
- scripts/check_requirements_sync.py: pre-commit hook that fails if a
package import isn't declared in requirements.txt. On rollout it caught
a real latent gap — aiohttp is imported by hltb/protondb modules but was
only present transitively (via howlongtobeatpy); now declared explicitly.
- scripts/ci_mirror.sh: pre-push gate = requirements.txt-only venv
(hash-gated) running `pre-commit run --all-files` + `pytest`, replacing
the plain pytest-coverage pre-push hook. The web vitest pre-push hook is
left untouched.
Verified: mirror green (960 passed, 100% cov).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PMRRVVkeRyrSaaqueMZKG
CI on main was already red before this branch. Address the repo-wide
failures that `pre-commit run --all-files` and the test job surface:
- requirements.txt: add `mcp>=1.9` so the CI/dev env can import
steam_backlog_enforcer._mcp and collect test_mcp.py (mcp stays an
optional dep in pyproject for the light systemd/CLI path).
- _stats.py: hoist the SteamAPIError import to module scope (PLC0415)
and wrap an over-length f-string (E501).
- _web_dataset.py, docs/pick_game_manually_design.md: codespell typo
fixes (unparsable, achievements, aggressively, until) + trailing
newline.
- scripts/setup_mcp.sh: split declare/assign for SCRIPT_DIR/REPO_DIR
(shellcheck SC2155).
Tests remain 100% covered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RRCdR4D8SaVrN2xraMQxM
Expose the backlog enforcer's read surface and two gated write actions as
typed MCP tools (steam_backlog_enforcer._mcp) so Claude Code and its
subagents can query and drive the backlog without shelling out.
- _mcp.py: FastMCP stdio server. Read tools get_dataset/get_status/
get_stats/list_backlog; gated writes pick_manual/block_gaming (preview
unless confirm=True). Logs to stderr; never exposes Config/the API key.
- _actions.py: stdout-free, state-only cores shared by CLI and MCP
(apply_manual_pick, status_payload, is_manual_pick_locked). cmd_pick_manual
now delegates its state mutation here.
- .mcp.json + scripts/setup_mcp.sh: project-scoped registration via a
dedicated ~/.venvs/steam-backlog-mcp interpreter; mcp is an optional-dep,
kept out of the systemd/CLI system-python path.
- pyproject: fix setuptools flat-layout discovery and declare the previously
undeclared direct deps aiohttp + websockets, un-breaking the editable install.
- 100% coverage of the new modules; server verified end-to-end over stdio.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQGQj8Ne6TriBExv91nG8v