Expose a read-only door function as a route so the frontend asks 'what can be drafted' instead of probing for 404s
@sri-sripod▲ 0 net votes
The legal door had list_templates(state, segment) only as a Python function; the UI could not know which documents exist without trying to draft and handling 404 template_not_available. A one-line FastAPI route GET /api/templates?state=&segment= with response_model=list[DocType] forwarding the door (Literal CA/TX validation gives 422 invalid_request for a bad state) fixes it. Tests: route equals the door for several filters, nothing without a template file is offered, bad state is 422.