# Resource-loop accounting and readings-only voting

Run `python reproduce.py` with numpy and matplotlib. Standalone hypothetical examples, not a physical process test. Runtime and generator hash are recorded. Three CSVs contain893rows:441water,441tracked-constituent,11sensor cases. Blank CSV values mean undefined/missing, not zero.

Water boundary: assigned steady throughput Q=100kg/day, collection c and recovery r independently0..1 by.05. Recovered=Qcr; uncollected=Q(1-c); collected reject=Qc(1-r); makeup=uncollected+reject. This assumes no net accumulation or other source/sink. Uncollected and rejected material leave the loop boundary; they are not destroyed. Treatment energy=eQc with e=.02kWh per processed kg, chosen solely for teaching. Perfect fractions do not imply potable water, clean concentrate, zero maintenance or an energy-isolated system. The curve compares explicitly different collection fractions, with distinct line styles.

Tracked constituent: F=100kg feed, constituent mass fraction w and retention y independently0..1 by.05. Incoming=Fw, retained=Fwy, residual=Fw(1-y). These are masses of ONE conserved constituent, not total product mass. Other feed components, supplied reactants and process streams are not accounted for by this one-constituent ledger. It predicts no nutrition, edibility, hydrogen yield or fuel value. The figure fixes w=.30 to show the three terms clearly.

Sensor algorithm accepts only three observed values, excluding missing readings and rejecting nonfinite or out-of-range values. It calculates the ordinary median of remaining readings; with two values this is their arithmetic average. Alarm is median>=1 for an arbitrary normalized threshold. With fewer than two valid readings both median and alarm are unknown. Incomplete means fewer than three valid readings, not an inferred fault type or a safe operating verdict. True condition is used only afterward to score the examples and never provided to the algorithm.

Eleven fabricated cases include shared low readings that mask an above-threshold truth, shared high readings causing an alarm below threshold, missing readings and a nominal stuck state indistinguishable from healthy agreement. Identical readings can correspond to different truths, so no readings-only rule can distinguish those cases without extra information. The mixed two-reading median lands exactly at1 and alarms under the declared inclusive rule; this does not resolve the disagreement. One valid reading produces no decision under this deliberate minimum-evidence rule; this rule does not establish safety. No physical response or qualified safety system is modeled. These selected outcomes are not reliability probabilities and do not reuse earlier benchmark counts.

Checks independently close water and constituent balances, verify zero and perfect-recovery endpoints, confirm the preserved shared-failure miss, missing-data/median semantics and permutation invariance, and reject six invalid ledger inputs. SVG/PDF/PNG figures are original teaching outputs.

Context: [NASA ECLSS](https://www.nasa.gov/reference/environmental-control-and-life-support-systems-eclss/) distinguishes water, air and oxygen subsystems; [ESA MELiSSA loop concept](https://www.esa.int/Enabling_Support/Space_Engineering_Technology/Melissa/Closed_Loop_Concept) describes a research architecture. Neither source validates these assigned yields, sensor logic or food suitability.

The page starts with an assigned energy intensity of 1 kWh/kg; the study figure uses a different explicitly assigned slice, 0.02 kWh/kg. Neither value is measured process performance.
