Commit f81e378
Put the last 14 files under the type gate, and fix what they were hiding (#418)
A coverage check of [tool.mypy].files against the tree found three
directories with Python in them that nothing was checking: plugins/ (8
files), mutation_tests/ (5) and tests_e2e/ (1). The gate said "339 source
files" and meant it, but "all of them" was never verified - so this checks.
mutation_tests/ and tests_e2e/ were already clean. plugins/ was not.
plugins/system_prompt/plugin.py had six errors, of two kinds:
root = document.get_branch_root(parent_node_id)
... edge.target == root.id
get_branch_root returns SceneNode | None - None for an id it does not
know. It cannot be None here, because the guard fifteen lines up already
returned early for a parent_node_id that is not in document.nodes. Rather
than assert that with an ignore, the None branch now returns
_create_pending() - the answer this plugin already has for "no usable
parent", and the difference between an AttributeError and a sensible
fallback if that guard ever changes.
The other four were the familiar unnarrowed node state, in a generator
that read `document.nodes[edge.source]` three separate times. A checker
cannot tie a kind check on one subscript expression to a field read on
another, and neither can a reader. It is a plain loop over one bound
candidate now, with the same result: first match in edge order, or None.
Two mypy settings come with plugins/: namespace_packages and
explicit_package_bases. plugins/ is eight sibling directories each holding
a plugin.py with no __init__.py anywhere - the layout the loader discovers
by path - and without those two mypy maps all eight onto one module name
and refuses to check any of them. Verified they change nothing for the
existing files: the run is clean before and after.
The gate now covers 353 source files and the coverage check reports no
uncovered directory and no uncovered root module. Verified it still bites
by injecting a deliberate type error into a plugin, a mutation test and
api_provider - caught in all three.
Test plan: full suite 3,285 passed / 20 skipped; the System Prompt plugin's
own 23 tests pass. ruff clean. mypy clean across 353 files.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 81ea12f commit f81e378
2 files changed
Lines changed: 37 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
88 | | - | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
392 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
393 | 407 | | |
394 | 408 | | |
395 | 409 | | |
| |||
0 commit comments