_store_verify.py grew past the 250-line cap. The report, its checks
and the error now live in _store_check_report.py.
Todo: 85af719b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In vmbox, systemd-resolved answered nothing for about 2 s after an
unblock, so the HTTPS check failed a working unblock. It also answers
no address, not 0.0.0.0, for a sinkholed name. Probes now repeat (3
attempts, 2 s apart) until they agree with the wanted result, and a
name with no answer counts as blocked.
Todo: 85af719b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every store-window action now checks its result instead of trusting
the commands: unblock needs no live store hosts line, no iptables
chain and a reachable store (else "network down" when
steamcommunity.com is down too), with one repair pass. Re-block needs
every domain on a sinkhole and the store unreachable, and is not
retried. A failure fails the job, names the check, and files one todo
task (deduplicated by title) through the local todo MCP; re-block
reports reach the web server via the new store_reports op. Job log
times now show local time like the summary.
Todo: 85af719b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/etc/hosts blocks every store domain as 0.0.0.0 and ::. Unblock and
re-block only matched the 0.0.0.0 line, so the live :: line kept the
store blocked while the job said Success. Lines now match on the exact
sinkhole address and hostname, re-block treats a half block as not
blocked, and a failed hosts write still re-locks the file.
Todo: 85af719b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C12: DUSK (519860) is a native Linux game with no CompatToolMapping entry,
so the old rule kept Proton Experimental, SLR 4.0 and the redistributables
for good. A game now also counts as covered when Valve runs it natively:
no mapping of kuhy's (or an empty one), linux in appinfo's common/oslist,
and no Valve tool pick (its own config/app_mappings or app 891390's). Any
doubt still keeps them: an unreadable or old-format appinfo.vdf, a game
missing from it, no 891390 pick list, or a native game forced onto another
tool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steamworks Common Redistributables, Steam Linux Runtime 4.0 and Proton
Experimental stay in PROTECTED_APP_IDS, so no guard ever calls them an
unauthorized game. uninstall_other_games now ends with a step that
uninstalls them, through uninstall_game, only when all of these hold:
- Steam is not running (pgrep steam.sh, as _ensure_steam_running);
- config.vdf parses and has a CompatToolMapping block;
- every installed non-tool appmanifest maps to proton-cachyos-native;
- that tool's toolmanifest.vdf exists.
Anything else keeps all three and logs "kept Steam tools: <reason>";
a running Steam logs "Steam running, deferring tool removal". No game
installed counts as not needed and says so.
- _tool_need.py decides. Every error keeps the tools.
- _vdf_text.py is a stdlib KeyValues parser. The repo had none, and the
root daemon's system python has no vdf package.
- _steam_client.steam_client_running() returns None when pgrep cannot
tell. _ensure_steam_running behaves as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
steam-game-installer drops the flag (no alias): it always writes the
manifest itself now, so the argv no longer passes it. The progress
tracker drops the "Reconciling with steamcmd" marker, which the
installer no longer prints, and names the phase after the DLC check
"writing manifest".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sync_mcp_venv runs in the main shell, so its RETURN trap outlived the
function and fired again when main returned, with $log unset: set -u
turned a passing deploy into exit 1. Remove the temp log explicitly.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWuLpGVY9MnowhTNcM
The MCP venv went a month without a resync and the server crashed on
import (missing leisure_watch) while setup_mcp.sh still passed, because
it imported only the bare package.
- setup_mcp.sh now imports steam_backlog_enforcer._mcp, the module
.mcp.json runs, and exits 1 with a FAIL line when it cannot.
- deploy.sh resyncs the MCP venv on every deploy and adds check 5:
the server must answer an initialize request over stdio.
- scripts/mcp_probe.py is that probe (stdlib, typed).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWuLpGVY9MnowhTNcM
0.23.0 adds the LeetCode review top-up earner (20 shutdown minutes for a finished review, 0 gaming, in the registry from 2026-11-23); pin-only for this repo. leisure-watch 0.2.9 pins earned-time 0.23.0, so the two move together (the hook pins were stale at 0.2.7).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWXYyzSw5S9UTM5k5M1
game-research's approved game is kept installed, visible and on
disk; it is spared from the kill only while game-research launches
or records it. research_game/research_game_revoke ops are audited.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The leisure watcher is uninstalled; an unlimited day must not read its
now.json or bill failclosed:watcher into a budget nobody has. shadow_step
returns an idle verdict when gaming is not enforced. Before the switch
the fail-closed bill is unchanged (both sides tested).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWViGJJaqBKGr1Hbppr
Share the day tail between the budgeted and unlimited usage lines and
narrow the nullable budget fields without defaults, so the 100% branch
gate holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWViGJJaqBKGr1Hbppr
Kuhy removed the daily gaming/leisure budget; only shutdown time
(screen-locker) stays. One gate, _gaming_gate.gaming_enforced_on(day),
wraps earned_time 0.22.0 gaming_enforced; resolve_budget carries it as
BudgetResolution.enforced and rules_for as PlaytimeRules.gaming_enforced.
Unlimited day: no warning, no cutoff, no kill, no leisure billing or
leisure kill; a block left from an earlier day is lifted. Time is still
billed for history. Backlog game choice and launch scope are untouched.
MCP, CLI and /api/budget report unlimited with null numbers; the web UI
paints the no-cap icon, no meter. Past-day history keeps working.
Failure modes: switch unreadable or day key not a date -> fail OPEN
(unlimited), logged ERROR once per cause, never raises, so the 5 h
fallback is never enforced and the daemon never crashes. Demo runs stay
enforced. The playtime_state.json schema is unchanged.
Pins earned-time-v0.22.0 and leisure-watch-v0.2.8 (freshness gate; only
golive.py changed, procscan untouched). DOCS-web-control-api notes null fields.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWViGJJaqBKGr1Hbppr
done, check, pick, pick-manual and hide can be cancelled only while they
hide games in the Steam library: cancel_window events, a SIGTERM handler
during that phase that skips the hide, and the web UI shows the cancel
button while the window is open. Docs fixed (check is mutating).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYNS1qAMRdgAtbr5Rq
Steam launch: _wait_for_cdp_ready watches the launched Popen and raises
"Steam exited during startup (exit code N)" instead of polling 45 s, and
launching is refused when no X display is up.
Non-root jobs: desktop_user_cmd prefixes DISPLAY/XAUTHORITY/XDG_RUNTIME_DIR
via env, so a web-job Steam launch reaches the display.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYNS1qAMRdgAtbr5Rq
Group the research-tick test's Steam mocks, the last class over 10.
pylint now rates 10.00 with no inline disables and max-attributes back
at the repo's original 10.
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_SearchCtx holds the token, its issue time and renewal lock in an
_AuthSlot, and the polls, extras, failures and dirty flag in
_SearchResults. Lookup behaviour is unchanged.
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WebGame carries its HLTB times and poll counts in a WebHltb group;
dataset_to_payload inlines it, so the browser's row keys and order are
unchanged (new test).
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlaytimeState keeps its shadow_* keys on disk through a ShadowLedger
group (flat, prefix shadow_); PlaytimeRules carries the per-earner split
in a BudgetBreakdown. The golden round-trip test still passes.
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Config moves the earned-time transports into EarnSources and the budget
switches into PlaytimePolicy; State moves the legacy single pick into
LegacyManualPick and the assignment clocks into AssignmentTimes.
_flat_record writes groups inline at their old position, so config.json
and state.json keep their exact bytes (golden round-trip tests).
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every except Exception in the daemon, ctl socket, web server and job
runner now catches FAIL_SAFE_ERRORS (OSError, ValueError, TypeError,
LookupError, RuntimeError, SubprocessError). A bug outside it is loud:
the ctl thread dies with its slot freed, http.server reports it, a job
writes its failed result and re-raises.
Todo: 9b9342ba
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The single ci-mirror manual hook (clean venv + pre-commit --all-files +
serial pytest) ran past the 60 s per-command cap, so the tree could not be
stamped for a push. It is now nine gate steps, each under 55 s at load ~40:
- ci-mirror-venv / -precommit / -pytest: scripts/ci_mirror.sh parts;
pytest runs on 4 xdist workers, pytest-cov still enforces 100 %.
- ci-mirror-pylint-{pkg,tests-1,tests-2,tests-3}: per-file checks over a
partition of the pylint hook's targets; -dup and -cycles: the two
cross-file checks on the whole tree. pylint is now a local hook so all of
them share one env (&pylint_env, pylint==4.0.9).
- scripts/pylint_symilar_cache.py: pylint plugin that hashes each file once
for duplicate-code instead of once per file pair (same R0801 output).
Tests: an autouse guard refuses non-loopback DNS (several tests made live
HLTB requests), two web fixtures poll at 0.01 s, and the rate-limit test
uses a fake clock. CLAUDE.md and AGENTS.md get the push line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWjUkRCFGNMnnXZrSP
kuhy 2026-11-11, multi-day research without re-setup.
W1: once a window was used in a lock, the block's purge spares
~/.local/share/Steam (Librarian's install and local saves) for the
rest of the lock; ~/steam, ~/.steam and the rest still go. The
package stays removed, hosts/iptables are re-applied, and since the
kept install could otherwise be launched without the package, every
Steam game is killed on sight. A record that cannot be read also
keeps the folder (an irreversible delete never rests on unknown
state); the block itself stays fully applied.
W2: the 48 h cap is gone; --until is bounded by the lock's end. An
open window may be extended ONCE, to the lock end at most, never
shortened, never reopened after it ended. The extension is a
separate extended_until field beside until, so a daemon still on
the previous code reads the original window instead of rejecting the
record as corrupt (which would have purged the folder).
Failure modes unchanged: missing/corrupt record = no window, and a
corrupt one refuses a new window or extension.
Checked: 3325 tests at 100% coverage; pylint 10/10 in parts; vmbox:
extension accepted once, refused beyond the lock end, earlier or
equal, second time and non-root; extended end honoured past the
original end; at close the Steam dir and a save survive, ~/steam and
~/.steam go, a game started after close is killed; extension to
exactly the lock end accepted. Not verified on the host.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWzuCEg1m87jpKyRrw
Pulls ~/src/steam-backlog-enforcer, syncs units only on difference,
restarts the web unit every run and the daemon only when it predates
the last package commit, then runs four health checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load pacman -Qi / iptables exceed their 10 s timeouts inside the
research-window pass; the uncaught TimeoutExpired crashed the daemon
(systemd restart loop). The pass now logs and retries next tick.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kuhy 2026-11-11: game-design research needs Librarian (app 4197610)
actually played during the 6-day total block. New root command
total-block-research --until T opens ONE window per lock: <= 48 h,
never past the lock end, a rerun never extends it.
The command only validates and records (/var/lib/steam-backlog-
enforcer, root 0700; lock id + deadline + two latches). The daemon
opens and closes everything: Steam hosts names, the store block, the
total-block chain (IP cache kept) and the steam package, reinstalled
with only guard-lib's package-block hook masked for that one pacman
call (--hookdir, proved in a guest). Lock file, hook and end date are
never touched. Browser-game sites stay null-routed.
Only Librarian may run: loop-local allowed set, strict mode (no
whitelist exceptions, no zero-achievement games), launchers and
counted games killed; state.json is never read or written.
Expiry latches the record, then the ordinary tick re-applies hosts
(now reconciled each tick), chain, uninstall and purge; the normal
store block is restored once, unconditionally.
Failure modes: missing/corrupt/unparseable record = no window and a
corrupt one also refuses a new window (fail closed); a clock set
back cannot reopen a latched window.
Checked: 3290 tests at 100% coverage; whole-tree pylint 10/10 run in
three parts (the hook exceeds the 60 s cap, so SKIP=pylint here); vmbox
guest with real guardctl package-block and the real unit, window
opened, Librarian-only enforced, clock moved past the deadline and the
full block re-applied. Not verified on the host.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWzuCEg1m87jpKyRrw