You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Framework surfaces are not consistently scoped to the selected application, and common lifecycle/error/middleware/background registrations are omitted or modeled with incorrect confidence.
Middleware on an unused FastAPI() instance became an established high-confidence surface for the selected app.
import fastapi; fastapi.FastAPI(lifespan=...), constructor on_startup/on_shutdown, APIRouter lifecycle, and keyword add_event_handler forms were omitted as established-empty.
Explicit lifespan=None created false limitations.
An arbitrary lower decorator replacing a lifespan callback still caused the source function's effects to be reported.
@app.exception_handler, add_exception_handler, project pure-ASGI middleware, indirect BaseHTTPMiddleware subclasses, and singular Response(background=BackgroundTask(fn)) were missed.
Multiple legitimate middleware/startup handlers collide on duplicate surface IDs and make inventory conditional.
Required design
Tie every framework surface receiver to the selected app/mount/composition graph.
Add exact contracts for missing lifecycle forms, exception handlers, pure-ASGI middleware, bounded local MRO middleware lookup, and starlette.background.BackgroundTask.
Classify module-qualified constructors correctly; treat literal None as absent; support positional-or-keyword selectors.
Separate decorator application from the registered callback identity. Require trusted contextlib.asynccontextmanager shape for established lifespan phase splitting.
Add contract-level multiplicity semantics (all execute, last wins, etc.).
Keep exception handlers as exception-keyed framework surfaces; do not blindly fan them to every endpoint.
Priority
P0 — framework/effect inventory completeness.
Problem
Framework surfaces are not consistently scoped to the selected application, and common lifecycle/error/middleware/background registrations are omitted or modeled with incorrect confidence.
Evidence:
src/fastapi_endpoint_detector/parser/custom_surface_extractor.py:218-296,568-741,1050-1135,1243-1279src/fastapi_endpoint_detector/presets/framework_v1.yaml:10-135src/fastapi_endpoint_detector/analyzer/mypy_analyzer.py:381-399Reproduced failures:
FastAPI()instance became an established high-confidence surface for the selected app.import fastapi; fastapi.FastAPI(lifespan=...), constructoron_startup/on_shutdown, APIRouter lifecycle, and keywordadd_event_handlerforms were omitted as established-empty.lifespan=Nonecreated false limitations.@app.exception_handler,add_exception_handler, project pure-ASGI middleware, indirectBaseHTTPMiddlewaresubclasses, and singularResponse(background=BackgroundTask(fn))were missed.Required design
starlette.background.BackgroundTask.Noneas absent; support positional-or-keyword selectors.contextlib.asynccontextmanagershape for established lifespan phase splitting.all execute,last wins, etc.).Acceptance criteria
Related: #104.