diff --git a/TODO-astro-migration.md b/TODO-astro-migration.md deleted file mode 100644 index 4d5ed6c..0000000 --- a/TODO-astro-migration.md +++ /dev/null @@ -1,80 +0,0 @@ -# Migrate steam-backlog-enforcer/web to Astro (no React) - -## what -Rebuild the loopback dashboard (`web/`) as Astro 7 static pages, one per -section. Scripts fetch and render in vanilla TS, and stateful widgets become -custom elements. TanStack Router and React Query go away. -`steam_backlog_enforcer._web_server` keeps serving `web/dist` on -127.0.0.1:8000, with its per-launch token. - -**Order: this repo migrates LAST, after every other repo.** - -## steps -1. Do `~/src/utils/web_ui/TODO-astro-port.md` first. Then add `@kuhyx/web-ui` - at the new tag, for `tokens.css` only. -2. Pages. The router routes become `src/pages/`: - - `index` (dashboard), `backlog`, `picks`, `library`, `store`, `gaming`, - `jobs`, `system`, `setup`, and `404.astro`. - - `/jobs/$jobId` becomes `jobs/?id=`, because static output cannot - prerender unknown ids. - - `shell/AppShell.tsx` becomes `layouts/Shell.astro`, with nav, health and - the job indicator. -3. Server (`_web_server.py`): - - Serve `/index.html` before the SPA fallback. - - Inject the token into EVERY served `.html`, not only the root - `index.html`, and mark each one no-cache. - - Add tests to `tests/test_web_server_static.py`. -4. `_web_build.py` calls `npm run build`. Change it to `pnpm build`, and update - its "npm missing" message. Delete `web/package-lock.json`, so pnpm is the - only lockfile. -5. Rewrite the 45 React files: - - `screens/*` (10, plus `system/*` 3) become `.astro` pages and sections. - - `components/*` (10): `GameTable` and `FilterPanel` become a - `` custom element. The budget cards are `.astro` plus a - poller. `TimelineChart` and `BudgetHistoryChart` become SVG builders in - `src/lib/charts/`. - - `commands/*` (7): `` and `` custom - elements on ``. `RunnerProvider` becomes a module-level store. - - `jobs/*` (4): `` subscribes to the SSE `EventSource`. - `library/*` (3) becomes ``. - - `ui/*` (3) and `shell/*` (3) become `.astro`. Delete `router.tsx` and `App.tsx`. - - Hooks (`useBudgetPoll.ts`, `api/queries.ts` and the other React-only `.ts` - files) become plain fetch, poll and cache helpers in `src/lib/`. -6. Mock mode. `web/mock/plugin.ts` stays a Vite plugin, added through - `vite.plugins` in `astro.config.mjs` when `MODE=mock`. `dev:mock` becomes - `astro dev --mode mock`. -7. Dependencies, from `web/`, exact pins via pnpm: - - Add `astro@7.4.4`, `@astrojs/check@0.9.12`, `eslint-plugin-astro@3.2.1` - and `@testing-library/dom`. - - Remove `react`, `react-dom`, `@tanstack/react-query`, `@tanstack/react-router`, - `@vitejs/plugin-react`, `babel-plugin-react-compiler`, `@babel/core`, - `@rolldown/plugin-babel` and `@testing-library/react`. - - Drop direct `vite`. Replace or delete the Vite template `web/README.md`. -8. Tests. Use vitest 5.0.5 with `getViteConfig()`: - - Elements and helpers are tested in jsdom against the `mock/` world. - - The Container API renders each page. - - Coverage is scoped to `src/**/*.ts`. -9. There is no `[agent_ready]` table. It is a loopback app, so skip AgentReady. - -## done -Run from `web/`: -`pnpm install --frozen-lockfile && pnpm exec astro check && pnpm coverage && pnpm build` -Then: -`! grep -q '"react"' package.json && ! grep -qE '"(react-dom|@vitejs/plugin-react|@tanstack/react-[a-z]+)"' package.json && ! find src -name '*.tsx' | grep -q . && test ! -f package-lock.json` -Both exit 0. Also run the repo root's -`python -m pytest -q steam_backlog_enforcer/tests/test_web_server_static.py`. - -## verify -Start the live server the way the repo does (`_serve_startup.py`) on -127.0.0.1:8000. Use a headless chromium on `/`, `/library/` and -`/jobs/?id=`: -- Every page carries the token and the API calls return 200. -- The command palette runs a dry command. -- There are no console errors. - -## read first -- `~/src/utils/web_ui/TODO-astro-port.md` (do it first) -- `web/src/router.tsx`, `web/src/api/queries.ts`, `web/mock/plugin.ts`, `web/vite.config.ts` -- `steam_backlog_enforcer/_web_server.py`, `_web_auth.py`, `_web_build.py` - -REMOVE ME AFTER FINISH diff --git a/prompts/TODO-pylint-to-ten.md b/prompts/TODO-pylint-to-ten.md deleted file mode 100644 index cf68192..0000000 --- a/prompts/TODO-pylint-to-ten.md +++ /dev/null @@ -1,47 +0,0 @@ -# Take pylint from 9.95 to 10.00 and raise the gate - -## what -Docstrings, booleaness and test duplicates are done (8.65 -> 9.95, measured -2026-11-01). About 45 findings remain in `steam_backlog_enforcer/`, all in -live-enforcer code. Fix them without changing behaviour or adding suppressions -or `[tool.pylint.messages_control] disable` entries, then raise -`--fail-under` in `.pre-commit-config.yaml` from 8.0 to 10.0. - -Remaining, by check (file:line): -- broad-exception-caught: `_ctl_server.py:168,187`, `jobs/_runner.py:208,211`, - `_leisure_kill.py:143`, `_shadow.py:123`, `_web_server.py:103`. These are - fail-safe handlers; narrowing them changes enforcement behaviour. Needs a - decision from kuhy: narrow, or a scoped disable with a reason. -- too-many-locals: `_hltb_confidence.py:110`, `_hltb_detail.py:144`, - `_hltb_search.py:149`, `jobs/_runner.py:136`, `_leisure_kill.py:149`, - `scanning.py:76`, `_stats_gathering.py:44`, `_stats.py:122`. -- too-many-instance-attributes: `config.py:85,154`, `_playtime_record.py:20`, - `_playtime_state.py:78`, `_web_models.py:16`. Persisted state shapes; needs - a decision (raise `max-attributes`, or restructure the stored schema). -- consider-using-with: `_ctl_server.py:154`, `_fast_install.py:152`, - `jobs/_spawn.py:133`. -- redefined-outer-name: `library_hider.py:71,164`. -- chained-comparison: `_hltb_types.py:146`, `_steam_models.py:50`. -- useless-return: `_fast_install_progress.py:106`, `_web_sse.py:91`. -- misc: `_web_routes.py:87` no-member, `_hltb_matching.py:187` - unsubscriptable-object, `_leetcode_ledger.py:47` unexpected-keyword-arg, - `_game_names.py:72` useless/suppressed disable. - -## done -```bash -.ci-mirror-venv/bin/python -m pylint --rcfile=pyproject.toml --jobs=4 \ - steam_backlog_enforcer | tail -2 # rated at 10.00/10 -grep -n 'fail-under=10.0' .pre-commit-config.yaml -``` -`scripts/file_length/` is vendored and excluded from the hook; leave it. - -## verify -The full suite (`.ci-mirror-venv/bin/python -m pytest steam_backlog_enforcer/tests/ -q`, -about 25 min under `capped.sh`, so split it per file group) stays green at -100% coverage. Run `./run.sh ` before and after. Do not -restart the systemd unit or Steam while a game runs. - -## read first -- `CLAUDE.md` (commands, coverage rule) - -REMOVE ME AFTER FINISH