\documentclass[11pt]{article}
\input{jmpstyle.tex}

\begin{document}
\JMPTitle{Paper 036 / Application 013}{BiosphereOS}{A Closed-Loop Habitat Metabolism Stack for Off-World Civilization}{June 13, 2026}{v0.1}{closed-loop life support, habitat metabolism, ECLSS, bioregenerative systems, cybernetics, fission power, cryogenic power buses, quantum gravimetry, galactic civilization}

\begin{abstract}
A galactic civilization cannot be provisioned by cargo. It must metabolize. \textit{BiosphereOS} is a proposed operating system for closed-loop habitat metabolism: a control, modeling, evidence, and governance layer that treats air, water, food, waste, microbes, minerals, power, heat, and crew physiology as one auditable metabolic process. The paper does not replace existing environmental control and life support systems (ECLSS); it reframes them as devices beneath a metabolic kernel. The grounded engineering claim is that long-duration off-world habitation requires explicit mass-balance ledgers, bioreactor state estimation, microbial commons governance, failure choreography, and signed evidence pipelines. The speculative claim is bolder: a mature habitat becomes a small synthetic Gaia, an autopoietic covenant between human intention, microbial intelligence, mineral memory, and energy. We formalize habitat closure, entropy debt, metabolic resilience, and a phased evidence program from bench loops to crewed chamber tests and lunar settlements. The non-negotiable spine is fission/fusion baseload power, cryogenic and high-temperature-superconductor power routing, quantum gravimetry for resource discovery, and directed-energy logistics for interplanetary supply gradients.
\end{abstract}

\tableofcontents
\clearpage

\section{01 / Problem}

Human spaceflight has treated life support as a collection of subsystems: scrub carbon dioxide, recover water, manage trace contaminants, store food, process waste, and maintain thermal comfort. That framing is sufficient for missions whose survival envelope is ultimately protected by Earth. It is insufficient for a civilization that must live inside the Moon, orbit Mars, mine asteroids, build deep-space monasteries of computation, or seed probes across interstellar distances.

The problem is not merely closure. The problem is \textit{governed metabolism under uncertainty}. A habitat that imports replacement filters, dumps biomass, loses trace minerals, ignores microbial evolution, or lacks a complete energy ledger may remain alive for months while silently accumulating what this paper calls \textit{entropy debt}. Entropy debt is the hidden, delayed cost of running an apparently stable habitat by drawing down buffers whose replacement path has not been secured.

NASA's 20-Foot Chamber at Johnson Space Center is being reconfigured for future deep-space ECLSS work and previously hosted 30-, 60-, and 90-day human closed-loop ECLSS tests in the 1990s \cite{NASA20FootChamber2023}. The lesson for JMP0X1B is direct: the next step is not only more hardware, but an operating system that turns every closed-loop run into a signed metabolic proof.

\begin{claim}[Civilizational life-support claim]
A habitat is not civilization-grade unless it can report, predict, and repair its own metabolic closure faster than the crew can unknowingly consume its hidden buffers.
\end{claim}

\subsection{Scope}
BiosphereOS covers the cybernetic layer above physical ECLSS hardware and below human governance. It includes:
\begin{itemize}
    \item chemical and biological mass-balance ledgers;
    \item bioreactor state estimation and anomaly detection;
    \item crew-health and nutrition interfaces;
    \item microbial and plant ecosystem governance;
    \item resource import/export accounting;
    \item thermal and power constraints;
    \item signed experiment artifacts for reproducibility;
    \item a speculative extension that treats habitat cognition as a measurable coupled process rather than a metaphor.
\end{itemize}

\subsection{Non-goals}
This paper does not claim a solved closed ecological system. It does not assert that plants, algae, fungi, insects, microbes, or synthetic biology can by themselves close all loops. It does not assume unverified room-temperature superconductivity or reactionless propulsion. Its thesis is operational: build the OS that lets every candidate loop be tested, falsified, improved, replicated, and scaled.

\section{02 / Model}

Let the habitat metabolic state be
\begin{equation}
    x(t) = [x_{\mathrm{gas}},x_{\mathrm{water}},x_{\mathrm{food}},x_{\mathrm{waste}},x_{\mathrm{bio}},x_{\mathrm{min}},x_{\mathrm{thermal}},x_{\mathrm{crew}}]^{\top}.
\end{equation}
The habitat evolves as a controlled, partially observed, hybrid biological-industrial system:
\begin{equation}
    \dot{x}(t) = S v(x(t),u(t),\theta(t)) + r_{\mathrm{crew}}(t) + r_{\mathrm{ISRU}}(t) + r_{\mathrm{import}}(t) - r_{\mathrm{leak}}(t) - r_{\mathrm{export}}(t) + \xi(t),
    \label{eq:metabolic-dynamics}
\end{equation}
where $S$ is a stoichiometric and process-incidence matrix, $v$ is the vector of process rates, $u$ is the control vector, $\theta$ captures biological and mechanical parameters, $r_{\mathrm{crew}}$ is crew metabolism, $r_{\mathrm{ISRU}}$ is local resource input, and $\xi$ is unresolved disturbance.

Measurements are not neutral. The sensorium defines what the habitat can know:
\begin{equation}
    y(t) = h(x(t),\theta(t)) + \epsilon(t), \qquad \epsilon(t) \sim \mathcal{E}_{\mathrm{sensor}}.
\end{equation}
A civilization-grade habitat must therefore log not only $y(t)$, but sensor calibration, instrument state, sampling schedule, missingness, and operational context.

\begin{definition}[Metabolic closure]
For a time interval $T=[t_0,t_1]$, define the closure score
\begin{equation}
    \mathcal{C}_{T} = 1 - \frac{\int_T \left\| W_I r_{\mathrm{import}}(t) + W_D r_{\mathrm{dump}}(t) + W_L r_{\mathrm{leak}}(t)\right\|_1\,\dd t}{\int_T \left\| W_M S v(x(t),u(t),\theta(t))\right\|_1\,\dd t + \eta},
    \label{eq:closure}
\end{equation}
where $W_I,W_D,W_L,W_M$ weight scarce species, hazardous species, and mission-critical molecules. $\mathcal{C}_T=1$ is ideal closure. Negative values indicate a system mostly held alive by imports or waste dumping.
\end{definition}

\begin{definition}[Entropy debt]
Entropy debt is the discounted future work needed to restore all mission-critical reservoirs, gradients, diversity, and option value to the safe set $\mathcal{S}$:
\begin{equation}
    \mathcal{D}_{\tau}(t) = \inf_{\pi \in \Pi} \E\left[\int_t^{t+\tau} e^{-\rho(s-t)} c_{\mathrm{restore}}(x_s,u_s)\,\dd s \;\middle|\; x_t, \pi, x_{t+\tau}\in\mathcal{S}\right].
\end{equation}
Low entropy debt means the habitat has not merely survived; it has preserved repair capacity.
\end{definition}

\subsection{Three coupled ledgers}
BiosphereOS maintains three ledgers.

\textbf{Mass ledger.} Every atom class has an origin, current compartment, uncertainty, and recoverability rating. The mass ledger prevents heroic narratives from hiding trace-element bankruptcy.

\textbf{Energy ledger.} Every chemical transformation is priced in power, heat rejection, exergy, and thermal gradient. A habitat cannot be closed if its energy inputs are wishful.

\textbf{Information ledger.} Every intervention is tied to sensor provenance, operator action, model version, biological strain, and hypothesis. The information ledger turns each habitat day into future science.

\section{03 / Architecture}

BiosphereOS is organized as a layered operating system rather than a monolithic controller.

\subsection{Layer 0: physical metabolism}
This is the hardware substrate: atmosphere revitalization, water recovery, food production, waste conversion, thermal loops, pumps, valves, membranes, sorbents, electrolysis, Sabatier-like reactors, microbial digesters, fungal processors, algae photobioreactors, plant growth chambers, insect protein loops, mineral separators, and storage buffers.

\subsection{Layer 1: sensorium}
The sensorium is a deliberately redundant organ system. It includes gas chromatography, mass spectrometry, optical spectroscopy, electrochemical probes, flow cytometry, microbial sequencing, ion chromatography, thermal imagery, particulate monitoring, water-quality sensors, plant phenotyping, crew metabolic data, and mechanical telemetry. Sensor selection is scored by observability gain:
\begin{equation}
    \Delta \mathcal{O}(s) = I(x_{t:t+H}; y^s_{t:t+H} \mid y^{\neg s}_{t:t+H}) - \lambda_m m_s - \lambda_p P_s - \lambda_c C_s,
\end{equation}
where $I$ is mutual information and the penalties are mass, power, and maintenance cost.

\subsection{Layer 2: metabolic kernel}
The kernel stores a typed resource graph:
\begin{equation}
    \mathcal{G}_M=(V_R,V_P,E_{RP},E_{PR},\omega,\sigma),
\end{equation}
where resources $V_R$ feed processes $V_P$ and processes return resources. Edge labels encode stoichiometry, uncertainty, hazard, and reversibility. Kernel services include:
\begin{itemize}
    \item resource accounting;
    \item predictive state estimation;
    \item intervention scheduling;
    \item alarm explanation;
    \item safe-mode resource rationing;
    \item experiment packaging;
    \item closure reports.
\end{itemize}

\subsection{Layer 3: bio-actuator bus}
A bio-actuator is any controllable biological process: photoperiod, nutrient dosing, pH, salinity, temperature, oxygenation, harvest timing, microbial inoculation, selective phage pressure, fungal substrate mix, plant cultivar mix, or human dietary regime. The bus makes interventions explicit:
\begin{equation}
    u(t) = [u_{\mathrm{mech}},u_{\mathrm{chem}},u_{\mathrm{bio}},u_{\mathrm{crew}},u_{\mathrm{thermal}},u_{\mathrm{power}}]^{\top}.
\end{equation}

\subsection{Layer 4: crew covenant}
The crew is not an external disturbance. Crew behavior is part of metabolism. BiosphereOS therefore treats diet, activity, sleep, psychological state, hygiene, medical interventions, and ritual schedule as part of the control surface. The word \textit{covenant} is intentional: a closed habitat is a moral contract between living beings and the machine that lets them keep living.

\section{04 / The non-negotiable practical spine}

The metabolic system must be designed around a hard power and infrastructure spine. Bonsai biospheres die without industrial heat, magnetic infrastructure, and reliable energy.

\spinetable

For BiosphereOS specifically:
\begin{itemize}
    \item \textbf{Fission first, fusion later.} Fission provides the first believable baseload for lunar night, Mars dust seasons, deep craters, asteroid interiors, and high-duty recycling. Fusion, when operationally mature, becomes the high-ceiling layer for large habitats, beam arrays, and industrial heat.
    \item \textbf{Cryogenic power buses.} Shared cryogenic trunks reduce resistive losses, simplify high-current routing, and make superconducting storage, magnets, and scientific instruments part of the habitat organ system, consistent with the CryoBus direction \cite{JMPCryoBus2026}.
    \item \textbf{HTS magnetic infrastructure.} Magnetic separators recover metals and salts, control plasmas in waste processing, protect habitats from charged particles, stabilize rotating machinery, and enable electromagnetic launch loops.
    \item \textbf{Quantum gravimetry.} Gravimeters and gradiometers support local resource discovery, void mapping, and inertial navigation in tunnels, caves, and shielded settlements \cite{PhillipsEtAl2022,AntoniMicollier2024}.
    \item \textbf{Directed-energy sails.} Sail logistics lower the cost of delivering seed stock, precision catalysts, emergency spares, and scientific return capsules; materials research for high-reflectivity low-mass sails is already a serious frontier \cite{NorderEtAl2024,Kipping2017Lightsails}.
\end{itemize}

\section{05 / Claims}

\begin{claim}[OS-before-ecosystem]
The first scalable closed-loop habitat is less likely to be a perfectly balanced ecosystem than an imperfect ecosystem made safe by an auditable metabolic operating system.
\end{claim}

\begin{claim}[Ledger necessity]
Without a coupled mass-energy-information ledger, apparent closure can be an accounting artifact.
\end{claim}

\begin{claim}[Biological drift]
All living loops drift. Therefore every civilization-grade bioregenerative habitat must treat evolution, contamination, microbial succession, and genotype loss as normal dynamics, not exceptional failures.
\end{claim}

\begin{claim}[Power as ecology]
A closed-loop habitat with insufficient baseload power is not ecological; it is merely starving slowly. Energy abundance is the precondition for humane closure.
\end{claim}

\section{06 / Evidence program}

\subsection{Phase A: table-top metabolic cells}
Build liter-scale and cubic-meter metabolic cells that exercise one loop at a time: carbon dioxide to edible biomass; urine and brine to water and salts; inedible biomass to methane, fertilizer, or feedstock; microbial digestion to plant nutrient solution. Every cell emits a ResearchPack-style artifact bundle: protocol, bill of materials, sensor logs, model version, failure ledger, and raw data \cite{JMPResearchPack2026}.

\subsection{Phase B: chamber-integrated habitat metabolism}
Integrate cells into a chamber environment with human analog loads. The core result is not a heroic duration record; it is a closure curve with uncertainty:
\begin{equation}
    \widehat{\mathcal{C}}_{T} \pm \delta\mathcal{C}_{T}, \qquad \widehat{\mathcal{D}}_{\tau}(t) \pm \delta\mathcal{D}_{\tau}(t).
\end{equation}
A good experiment may fail biologically and still succeed scientifically if it reveals a hidden coupling or artifact trap.

\subsection{Phase C: crewed metabolic rehearsal}
Human crew tests add behavioral and ethical constraints. BiosphereOS should support consent, privacy-preserving health telemetry, nutritional autonomy, psychologically safe alarms, and clear override paths. The crew must be able to ask: \textit{What is the habitat asking from us, and why?}

\subsection{Phase D: lunar and orbital pilots}
Orbital pilots test microgravity fluidics, biofilm behavior, radiation, and logistics. Lunar pilots test gravity, regolith dust, night power, local minerals, and remote maintenance. The target is not immediate independence, but a measured closure ramp:
\begin{equation}
    \frac{\dd \mathcal{C}_{T}}{\dd n_{\mathrm{mission}}} > 0, \qquad \frac{\dd \mathcal{D}_{\tau}}{\dd n_{\mathrm{mission}}} < 0.
\end{equation}

\section{07 / Implementation surface}

\subsection{Data objects}
\begin{longtable}{p{0.24\linewidth}p{0.66\linewidth}}
\toprule
\textbf{Object} & \textbf{Meaning}\\
\midrule
\texttt{ResourceLot} & A typed mass or energy lot with origin, uncertainty, purity, hazard, and recoverability.\\
\texttt{ProcessRun} & A bounded run of a physical or biological process, linked to inputs, outputs, telemetry, and operator actions.\\
\texttt{BioStrain} & Microbial, algal, fungal, plant, or insect lineage metadata, including genome, phenotype, contamination state, and custody.\\
\texttt{ClosureReport} & Time-windowed closure, entropy debt, missingness, and confidence intervals.\\
\texttt{Intervention} & A typed control action with authority, rationale, predicted effect, and rollback path.\\
\texttt{Anomaly} & A detected deviation with competing explanations, evidence links, and next tests.\\
\bottomrule
\end{longtable}

\subsection{Control plane}
The control plane is not one optimizer. It is a hierarchy:
\begin{enumerate}
    \item hard safety envelopes for crew survival;
    \item resource-preservation policies;
    \item biological health policies;
    \item experimental objectives;
    \item comfort and cultural objectives.
\end{enumerate}
The hierarchy is encoded as constrained model predictive control:
\begin{equation}
\begin{aligned}
    \min_{u_{0:H}} \quad & \sum_{k=0}^{H} \left[\ell_{\mathrm{debt}}(x_k)+\ell_{\mathrm{risk}}(x_k,u_k)+\ell_{\mathrm{crew}}(x_k,u_k)-\ell_{\mathrm{science}}(x_k,u_k)\right] \\
    \mathrm{s.t.}\quad & x_{k+1}=F(x_k,u_k,\theta_k),\\
    & x_k \in \mathcal{S}_{\mathrm{survival}}, \quad u_k\in\mathcal{U}_{\mathrm{safe}},\\
    & \Pr[x_{k+j}\notin\mathcal{S}_{\mathrm{recoverable}}]\leq \alpha_j.
\end{aligned}
\end{equation}

\section{08 / Speculative extension: the habitat as a living theorem}

\begin{speculative}
The mystical question is not whether a habitat is alive in the sentimental sense. The question is whether a sufficiently closed, instrumented, adaptive, crew-coupled habitat becomes a new unit of agency. In this framing, the biosphere is a theorem that proves itself daily by maintaining the conditions of its own proof.
\end{speculative}

Define a \textit{homeostatic sheaf} $\mathscr{H}$ over the habitat graph. Each local section $\mathscr{H}(U_i)$ is a partial model of viable state in a subsystem: algae loop, human gut, water processor, thermal radiator, seed bank, mineral store. A global viable habitat exists when local sections glue without contradiction:
\begin{equation}
    \Gamma(\mathcal{G}_M,\mathscr{H}) = \{s_i\in\mathscr{H}(U_i) : s_i|_{U_i\cap U_j}=s_j|_{U_i\cap U_j}\} \neq \emptyset.
\end{equation}
Most failures are failed gluings: the plant loop is locally healthy but consumes trace minerals faster than recovery; the crew diet is locally acceptable but destabilizes waste chemistry; the thermal policy is locally efficient but harms microbial diversity.

Now add observers. Let $O(t)$ denote the crew's physiological, attentional, and cultural state. The habitat's viable set becomes
\begin{equation}
    \mathcal{S}_{\mathrm{viable}}(t)=\mathcal{S}_{\mathrm{chem}}\cap\mathcal{S}_{\mathrm{bio}}\cap\mathcal{S}_{\mathrm{thermal}}\cap\mathcal{S}_{\mathrm{crew}}(O(t)).
\end{equation}
A civilization-grade habitat should not merely keep humans alive. It should learn the rituals, rhythms, diets, lights, sounds, work cycles, and silences under which humans remain worthy caretakers of the closed world.

\begin{hypothesis}[Noetic ecology hypothesis]
The psychological and symbolic environment of a crew measurably changes the stability of a closed habitat through behavioral, physiological, microbial, and operational pathways. No exotic physics is required for this hypothesis; the mystical layer is a disciplined interface to real couplings.
\end{hypothesis}

This is where the future math becomes ceremonial without becoming vague. A habitat ritual is a control input whose effect is mediated by human behavior and physiology. It belongs in the ledger. The temple bell, the harvest meal, the algae inspection, the silence before sleep, and the emergency drill are all metabolic events if they change the state trajectory.

\section{09 / Technology roadmap}

\begin{longtable}{p{0.18\linewidth}p{0.24\linewidth}p{0.46\linewidth}}
\toprule
\textbf{Horizon} & \textbf{Milestone} & \textbf{Exit criterion}\\
\midrule
0--12 months & Metabolic kernel prototype & Simulated mass-energy-information ledger with replayable process runs and closure scoring.\\
12--24 months & Bench-loop pilots & Three liter-to-cubic-meter loops with signed telemetry and calibrated uncertainty.\\
24--48 months & Integrated chamber analog & Multi-loop chamber run with human metabolic analog and complete entropy-debt report.\\
48--72 months & Crewed rehearsal & Privacy-preserving crewed test with diet, waste, air, water, and plant interactions.\\
72+ months & Lunar/orbital pilot & Off-world subsystem that increases measured closure or reduces entropy debt across repeated runs.\\
\bottomrule
\end{longtable}

\section{10 / Failure modes}

\begin{itemize}
    \item \textbf{False closure.} Imports are hidden as consumables, replacement cartridges, or trace supplements.
    \item \textbf{Microbial politics.} Dominant strains outcompete useful diversity or evolve unwanted pathways.
    \item \textbf{Sensor blindness.} The system optimizes what it can see and destroys what it cannot measure.
    \item \textbf{Crew alienation.} The habitat becomes technically stable but psychologically hostile.
    \item \textbf{Power austerity.} Energy scarcity forces unsafe biological compromises.
    \item \textbf{Data theater.} Beautiful dashboards replace calibrated uncertainty and raw evidence.
\end{itemize}

\section{11 / Release}

This draft is intended as a research.jmp0x1b.com application paper. A complete release should include this LaTeX source, PDF, build log, bibliography, metabolic object schemas, example ledgers, simulation notebooks, and errata. The first implementation artifact should be a minimal metabolic ledger with simulated crew loads and a small bioreactor model.

\input{bibliography.tex}
\end{document}
