  The meaning of thermodynamic descriptions is found in large-deviations
scaling of the fluctuations probabilities. The primary large-deviations rate
function is the entropy, which is the basis for both fluctuation theorems and
for characterizing the thermodynamic interactions of systems. Freidlin-Wentzell
theory provides a general formulation of large-deviations scaling for
non-equilibrium stochastic processes, through a representation in terms of a
Hamiltonian dynamical system. A number of related methods now exist to
construct the Freidlin-Wentzell Hamiltonian for many kinds of stochastic
processes; one method due to Doi and Peliti, appropriate to integer counting
statistics, is widely used in reaction-diffusion theory.
  Using these tools together with a path-entropy method due to Jaynes, we show
how to construct entropy functions that both express large-deviations scaling
of fluctuations, and describe system-environment interactions, for discrete
stochastic processes either at or away from equilibrium. A collection of
variational methods familiar within quantum field theory, but less commonly
applied to the Doi-Peliti construction, is used to define a "stochastic
effective action", which is the large-deviations rate function for arbitrary
non-equilibrium paths.
  We show how common principles of entropy maximization, applied to different
ensembles of states or of histories, lead to different entropy functions and
different sets of thermodynamic state variables. Yet the relations of among all
these levels of description may be constructed explicitly and understood in
terms of information conditions. The example systems considered introduce
methods that may be used to systematically construct descriptions with all the
features familiar from equilibrium thermodynamics, for a much wider range of
systems describable by stochastic processes.
