(** Request handlers: the seam between Git data and rendered pages. Each handler opens exactly one repository context, reads what its page needs, renders it, and closes the context — so the Git store, resolved metadata and default-branch policy are shared by every operation in a request instead of being reopened per query. Errors keep the category {!module:Resolvers} gave them until they reach {!error_response}, which is the single place a category becomes an HTTP status: malformed input is [400], a missing repository or object is [404], and storage failures are [500]. Handlers therefore never choose a status themselves. This is also the only layer allowed to touch both configuration and the filesystem; views receive plain values. *) val error_response : Resolvers.error -> Dream.response Dream.promise (** Map a resolver failure to the status and wording shown to the reader. *) (** Repository-scoped request handlers. *) module Repo : sig val with_repository : Config.t -> string -> (Resolvers.repository -> Repo_view.context -> Dream.response Dream.promise) -> Dream.response Dream.promise (** Open a repository by name, build a view context, run the continuation, then close the repository. Renders an error page on failure. *) end val routes : Config.t -> Dream.route list (** The complete set of Dream routes for the application. Requires a loaded configuration to bind repository discovery and rendering. *)