Fixed #170 -- Split generate_reference.py into focused internal modules - #180
Fixed #170 -- Split generate_reference.py into focused internal modules#180utk2103 wants to merge 8 commits into
Conversation
…ation tests for inject values
…ocumentation entry formatting.
…py` into focused internal modules for improved organization while maintaining existing functionality.
…ved readability and maintainability.
…uthConfig` in `render.py` and updated related field documentation in `tables.py` for clarity on authentication surfaces and usage.
|
@utk2103 Thankyou for this PR! Can you please squash all commits into a single commit ? Please make sure you are following the commit message convention given in our contributing guidelines. |
DevilsAutumn
left a comment
There was a problem hiding this comment.
@utk2103 Thanks for this patch, I left few comments.
| ("tool", "bool", "Expose this route as an MCP tool."), | ||
| ("cli", "bool", "Expose this route as a Quater CLI action."), | ||
| ("needs_approval", "bool", "Require approval before MCP or CLI execution."), | ||
| ("auth", "Authenticate | None", "Route-level auth hook. See [Auth](./auth)."), |
There was a problem hiding this comment.
This split preserves the normal docs:reference:check path, but it leaves the generated fallback path broken. Today the command passes because read_manual_reference() finds the existing manual reference pages and returns them before these renderer tables are used.
If the manual reference directory is missing, or if we ever switch a page back to generated output, the CLI reaches render_application() and fails because these tables still describe the old route auth API. Quater.route() and RouteGroup.route() now take public: PublicSurfaces, not auth, and RouteGroup.__init__() no longer takes group-level auth.
Can you update ROUTE_OPTIONS, GROUP_ROUTE_OPTIONS, and ROUTE_GROUP_OPTIONS, and add a test that forces the generated branch? That would make this a true refactor of both supported paths: manual passthrough and generated fallback.
| [ | ||
| "Quater keeps the three access surfaces explicit:", | ||
| "", | ||
| "- normal routes use `auth=...` on the route or route group.", |
There was a problem hiding this comment.
This prose still describes the previous auth model. The current public API uses Quater(auth=[AuthConfig(...)]) for surface-wide auth, and route-level public=... for exceptions. It no longer uses mcp_auth, cli_auth, or route/group-level auth.
Once the table mismatches are fixed, this generated page would still produce stale auth guidance, so this section should be updated as part of the refactor.
| "allow_credentials": "Whether browsers may include credentials.", | ||
| "max_age": "How long browsers may cache a preflight result.", | ||
| }, | ||
| "AuthConfig": { |
There was a problem hiding this comment.
There is a second generated-path mismatch in the auth field docs. field_table() checks that every documented public field matches the actual object members. With the current source, AuthConfig exposes display_name, and AuthContext exposes payload, but this table only documents authenticator/surfaces/name and subject/metadata.
So render_auth() exits before it can generate the auth page. Please either document those fields here, or adjust field_table() if computed properties like display_name are intentionally not part of the reference output.
Summary
scripts/generate_reference.pyintoscripts/_reference/package:paths,pages,manual,signatures,types,tables,render,output.scripts/generate_reference.pyreduced to a thin CLI (66 lines) that re-exportsformat_signature,split_top_level_commas, andclean_signaturefor the existing unit tests.npm run docs:reference, andnpm run docs:reference:checkbehavior unchanged.Linked Issue
Fixes #170
Contributor Checklist
acceptedbefore I started.issue_170.Checks Run