Tighten quality gates and refactor the test_execute_tool fixtures
A repo-review pass turned up a few drift points worth fixing in one
go:
- The 100% coverage claim in CLAUDE.md didn't match pyproject's 95%
gate or the silent cli.py / srd/* omits. Documented the exclusions
honestly and moved the gate into pytest addopts at the current
floor (96%) — bumping the floor as coverage improves is the new
rule.
- No pre-commit was running, so 119 latent ruff issues had piled up.
Cleared them, added PT/RUF, and ignored RUF001-3 since em dashes
are house style.
- Stood up .pre-commit-config.yaml + loq.toml (with a baseline for
the 14 pre-existing oversized files) so future regressions get
caught at commit time.
- Added pyright matching the docket/uncalled-for setup. Strict mode
was 1300+ errors mostly from dict/yaml-heavy code, so settled on
basic + per-file pragmas for the FastMCP DI markers (`world: str
= World()` looks like a type error but FastMCP resolves it at
call time) and the test files where load_character() returns
Optional and tests subscript directly. Real null-narrowing gaps
in display.py / planner.py / cli.py / srd/extract.py are fixed.
- Refactored test_execute_tool.py to lift the asyncio + Client +
combat-flip scaffolding into mcp_call / mcp_call_in_combat
fixtures, deleting four inline async _run blocks with try/finally
cleanup. The for i in range(3) loop became a fixture too.
- Added pytest-xdist (-n 4) and codespell (with the SRD content
skipped — codespell really doesn't like Wight, Sting, or Cant).
- Renamed prompts/cold-draft.md → arc-cold-draft.md so it sorts
next to its sibling arc-architect.md (they're a two-stage pipeline
for the planner's plot_arc pass).
- Deleted plans/architecture-implementation.md (Milestone 0–4 doc
from before any code existed; predates the streaming-CLI pivot
away from Textual).
CLI thinning into src/storied/commands/* and the actual climb from
96% → 100% coverage are deferred — both are their own focused
workstreams.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>