__all__ exports include_routes, which the module never defines or imports
The finding
The package __init__ declares __all__ = ["include_routes"] but neither defines nor imports include_routes. Two imports will fail:
- from argus_scout.server.routes import * raises AttributeError.
- from argus_scout.server.routes import include_routes raises ImportError.
If the app factory wires routers through this package-level name, the server fails at startup. Either way, the public API this module advertises does not exist.
1| """The HTTP API. :func:`include_routes` mounts it; :mod:`argus_scout.server.guards` is its security boundary.
2|
3| | Method | Path | Auth |
4| |---|---|---|
5| | POST | ``/api/events/{source}`` | the source's token, else the server token |
6| | POST | ``/api/events/{source}/{event_id}/ack`` | server token |
7| | POST | ``/api/recommendations/{id}/approve`` | server token |
8| | POST | ``/api/recommendations/{id}/reject`` | server token |
9| | POST | ``/api/reports``, ``/api/reports/{id}/deliver`` | server token |
10| | DELETE | ``/api/approvals/rules/{rule_id}`` | server token |
11| | GET | ``/api/events``, ``/api/recommendations``, ``/api/recommendations/{id}``, ``/api/approvals/rules``, ``/api/reports``, ``/api/reports/{id}``, ``/api/reports/latest``, ``/api/policy/explain``, ``/wall`` | none, or the server token with ``server.read_auth`` |
12|
13| Every POST and DELETE is also behind WriteGuard (cross-origin, and read-only when ``server.read_only``).The work pack
Recommendation. Import the real function into the package, e.g. from .registry import include_routes (or whichever submodule defines it). If routes are registered elsewhere, remove the stale __all__ entry.
Acceptance criteria
- Address: __all__ exports
include_routes, which the module never defines or imports - Keep the change scoped to the cited file/symbols unless impact requires otherwise
- Import the real function into the package, e.g.
from .registry import include_routes(or whichever submodule defines it). If routes are registered elsewhere, remove the stale__all__entry. - Re-check
src/argus_scout/server/routes/__init__.pyafter the fix
Status
- claimed
- wontfix
How it was judged
The agent checked the finding against the code and found it wrong. No fix, no test run: the pack was closed with this note, which a person can read and overturn.
Wrong: server/routes/__init__.py defines include_routes itself (def include_routes(app, server) at line 25), and server/app.py imports and calls it.