fix(ci): restore a green build — FastAPI route introspection and two undocumented MCP tools#31
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI has been red on
mainfor every run since #24. Two independent causes, neither related to the code in those pull requests. This restores a green build: 2399 unit tests pass, 0 fail.1.
test_web_app_routes.py— 28 failuresassert '/api/health' in routesfailed withhave: ['/', '/docs', '/favicon.ico', '/openapi.json', '/redoc', '/static'].The application is not broken.
GET /api/healthreturns 200 underTestClient, andapp.openapi()lists every expected path. The test's introspection is what broke.FastAPI 0.139 changed
include_router(): instead of copying an included router's routes onto the app, it appends a single_IncludedRouterwrapper exposing the router asoriginal_router._route_methods_by_pathiteratedapp.routesand saw ten wrappers whose.pathisNone, so it reported no/api/*routes at all.Nothing in the repository pins FastAPI, so this arrived with an upstream release rather than with a commit — which is why the failure appears across unrelated pull requests.
The helper now descends through
original_router. It is written to work on both layouts, so it will not break again when the wrapper is added or removed:2.
test_usage_guide.py— 1 failureAssertionError: undocumented tools: ['ensure_kb', 'ground_paper']fcbfe7edregistered both tools in_TOOL_NAMESwithout adding them tobuild_usage_guide(). The drift guard caught exactly what it exists to catch. Both now havepurpose,when_to_use, andkey_knobsentries, written from their implementations:ensure_kbidempotently creates a per-paper KB from a DOI, andground_paperanswers a question against that KB, withtier="si"preferring supplementary information.Verification
Against the CI environment (
pip install -e ".[dev]", nordflib/pyoxigraph/indicium) and CI's own exclusion flags:2399 passed, 5 skipped, 18 deselected— previously29 failed.75 passed, 65 deselected.usage_guide.pyare unchanged.No production code changes. Issue #29, which breaks
uv syncon fresh clones, is addressed separately in #30.