# PreyLab foundation audit and portable-record ledger (2026-10-20) Source status is local code inspection plus focused tests. The attached foundations review was a proposal; its observations were independently checked here. No F01–F12 biology redesign is claimed in this phase. | ID | Status and source evidence | Current rule, follow-up, migration and falsifiable check | | --- | --- | --- | | F01 | **Repaired in this pass.** `model.js:debrisMetabolism`, `usesDebrisMetabolism`; `population.js:stepPopulation`. | The former Noctiluca appearance branch now reads a 0–1 inherited alga locus (active at ≥0.5). Version 2 genomes missing that locus receive the old appearance-derived value once on migration. Subsequent function never reads appearance. Historical raw genotypes remain in `record.legacyGenome`. Existing detritus conversion and light forfeiture remain; whole-lifecycle accounting awaits F08. | | F02 | **Repaired in this pass.** `population.js:supportPopulationLimit`, `supportLifespanMs`, `refusals`; `experiment-protocol.js`. | The 25% support birth quota and eight-minute forced support death are labeled experiment interventions. New-dish protocol v1 exposes 100% quota-off and 0 ms age-off; the separate 1–512 living numerical ceiling remains. Existing dishes keep their rules. Forced age has its own death cause and bounded quota/space/cap refusal counters. | | F03 | **Local implementation, numerical audit open.** `compounds.js`, `chemistry.js:sampleCompoundReceptor`, `population.js:senseChemicals`. | Six stable compounds replace semantic receiver messages. Local affinity mixtures, saturation and bounded background drive signed responses. Observer channel/provenance stays separate. Three-dimensional field normalization, boundary and merge errors remain F11 work. See `COMPOUNDS-RECEPTORS.md`. | | F04 | **Repaired in this pass.** `chemistry.js:sampleChemical`, `stepChemicalMedium`, `receptor`. | Local sampling no longer filters the receiver's own source ID; same-channel cap merging permits mixed provenance. Source remains observer-only diagnostics. The gathering channel uses locomotion family, so this is family-associated, not ancestry recognition. Self-background adaptation was deferred; self-sensing is real and may mask weak outside cues. Toxin dose remains independent. | | F05 | **Local implementation.** `model.js` genome v3; `compounds.js:COMPOUND_LOCI`; `signals.js`; `dna.js`. | Three compound production, reception and signed response triplets now vary and inherit independently; true zero is retained. Six apparatus loci have mass/upkeep cost and released material is finite. Old v2 alleles upgrade once. Controlled opposite/neutral tests pass; broader evolutionary reachability remains F07. | | F06 | **Implemented for light and ordinary organic/alarm/social output.** `regulation.js`, `signals.js`, `population.js`; genome/DNA v4, population v16. | Nine bounded inherited loci choose local/internal input, threshold, gain, duration, recovery and protected reserve independently of apparatus. Toxin and passive odor paths remain separate. Legacy programs derive once, with raw historical genotypes retained; focused capacity invariance and paid output tests pass. | | F07 | **Bounded operator reachability measured.** `population.js:mutateGenome` now separates per-locus chance (default .12) and continuous maximum step (default 6% of locus range), counts attempts/effective changes/numeric phenotype changes, and retains categorical and circular rules. | The v4 `photoGlowThreshold` omission on new algae was repaired; v3 raw history remains. Five fixed-seed mutation lineages and ordinary population trials are in `EVOLVABILITY-TRADEOFFS.md` and `../evidence/f07-f09-trials.json`. A generated allele is not proof of establishment. | | F08 | **Repaired locally after the original audit.** `accounting.js`, `grazer.js`, `population.js` schema 14/15; `RESOURCE-ACCOUNTING.md`. | The unfunded prey-energy multiplier was removed and corpse/detritus fuel made finite. One-time unknown legacy fuel is initialized to zero with retained source snapshot. The signed ledger and focused/local archive checks pass; broad closed-dark event-chain verification remains open. | | F09 | **Finite-horizon tradeoffs evaluated.** `scripts/run-preylab-evolution-trials.mjs` runs mutation-off three-level trait comparisons in mixed dishes and a separate reserve comparison. | Results and censoring are in `EVOLVABILITY-TRADEOFFS.md` and `../evidence/f07-f09-trials.json`. Existing costs and resource effects remain; no ecological winner is coded in. | | F10 | **Locally implemented and verified.** `dose-decisions.js`, `grazer.js`, `population.js`, `foundation-trials.js`; see `DOSE-AWARE-DECISIONS.md`. | Signed local receptor readings, hunger, sensed food and actual toxin burden combine as bounded vectors; toxicology stays separate. Foundation Trials disclose finite setups. Coefficients remain qualitative, and longer replicated ecological outcomes remain open. | | F11 | **Numerical field repaired and checked locally.** `chemistry.js`, `test/preylab-chemistry-reliability.test.mjs`, `scripts/verify-preylab-chemistry-numerics.mjs`. | Finite-support XYZ kernel integrates to packet quantity/volume within the measured quadrature error; bounded boundary reflection improves edge samples. Tight same-compound local merging conserves packet quantity and refusal does not charge. Medium kernel marker migrates without changing packet resources. Physical calibration and mobile hardware timing remain open. | | F12 | **Partly implemented.** `population.js:recordPopulationHistory`, metabolic/events, `preylab.js` observer/perception views and experiment JSON export. | Telemetry is bounded, but a repeated-trial protocol and causal ledger are absent. Add seeded replication and refusal counts without passing observer positions into cell perception. Check observer toggle leaves equal-time biology invariant. | ## Setting ownership | Owner | Current fields or source | Rule | | --- | --- | --- | | DNA | `model.js` family and genes; `dna.js` v2 | Functional inherited alleles only. Schema 1 files with a historical missing debris locus are migrated once. | | Environment v1 | `environment.volume/light/temperature/drift/lamp/cycle/nutrientField/automatic` | Initial abiotic field and timed forcing. Validated new empty dishes only. Full 192-bin nutrient field and patches keep quantities exact. | | Experiment protocol v2 | `experiment-protocol.js`, `manual/experiment-protocol-v2.schema.json`; population maxCells/supportLimitFraction/supportLifespanMs/mutationRate/mutationStep | Export, validate, preview and apply only to the next dish. Environment v1 owns abiotic automatic feeding/current; preferences cannot change biology. Existing saved-dish settings remain authoritative. Other chemical/evolution toggles and solver settings are still outside this small portable record. | | App preferences v1 | Local music, top bars, chemical-map visibility/opacity; local named rack groups | Visual/workspace choices. No authority to fetch archived dishes. | | Saved dish | `population.js:migratePopulationState`, `api/dishes.cfm`, live environment, cells, time, RNG, resources, commitments, camera | Continuation state. Initial environment provenance is copied only as provenance, never reapplied on load. | ## Phase-one limits and next checks The environment record uses model version 2, schema version 1 and a fully resolved nutrient field; it does not encode cells, chemicals, detritus, custom substrate geometry or automatic insertion. An exported current field is explicitly a new starting field, not a claim that it was the dish's original condition. The included examples turn automatic nutrient replenishment off. Protocol v1 records a numerical living-cell cap, support birth quota, forced support lifespan and per-locus mutation chance; its identity is separate from the physical environment signature. The new-dish defaults remain 128 cells, 25% support share, eight simulated minutes and .12 mutation chance. Chemical/evolution toggles and numerical solver settings are outside portable protocol v1 and retain their existing defaults and saved-dish ownership. App preference v1 includes chemical map visibility/opacity, music and top-bar layout. Rack export includes names/order only; local dish IDs and write tokens remain device bound and are never accepted from an import. Imported rack names merge without deleting existing groups. Theme, contrast, reduced motion, UI scale, units, notification choices and camera/input defaults have no independent persisted preference registry in this app and remain outside the v1 contract. Camera stays in the saved dish. `performanceMode` and `adaptiveDetail` are not imported because equal-time biology under their scheduling behavior needs an invariant check. Next work priority: F08 closed energy budget; F03/F05 physical compound and receptor model; F06/F07/F09 capacity and reachability; F10/F11 dose and numerical convergence; F12 repeated trials. Each requires a versioned migration preview, focused source/sink or perception test, near-cap timing and real archive continuation. ## Integrity pass evidence (2026-10-20) The pre-edit full TAP report is `../../preylab-baseline-test.log`: 315 tests, 286 passed, 28 failed, one skipped. The final full TAP report is `../../preylab-final-test.log`: 321 tests, 295 passed, 25 failed, one skipped. Name-based comparison found no newly failing test after the corrections. Two interim regressions led to a regenerated gene source index and an alga-only migration guard; both were fixed before the final run. The extra protocol zero-value test was added after the full run began and passed separately in `test/preylab-integrity.test.mjs` (5/5). Twenty-five failures also occurred by name in the baseline. Three baseline failures passed in the final run; several simulation outcomes vary between runs and remain unresolved, not presumed unrelated. The current final full report is not green. `scripts/verify-preylab-integrity-local.mjs` created local test archive `1e668ce2-2594-445d-ae8c-fce52d3ee016` through `api/dishes.cfm`, fetched it from MySQL, migrated a legacy Noctiluca-like alga, updated the same row using its revision write token (the client autosave route), fetched again, and advanced one ordinary 20 ms step. It preserved the organism ID, active inherited allele, exact old `legacyGenome`, 1.501261984432 material within 1e-9 serialization tolerance, one real aversive packet, and 6.8e-6 local receptor concentration. It retained support quota 100% and forced lifespan 0. The one-step continuation changed usable energy by ordinary metabolism; no offline catch-up was applied. Local catalog import accepted both a current schema-2 gamete producer and a historical schema-1 alga lacking the new allele. No production deployment was performed. At 390×667 and 1280×800 browser viewports, the Presets controls and versioned protocol preview were visible, zero-valued settings validated, document width matched viewport width, and the browser reported no console errors. Screenshots: `../screenshots/integrity-protocol-mobile.png`, `../screenshots/integrity-protocol-desktop.png`. A physical phone, CRISPR touch editing and a full New/Load UI pass were not verified in this pass. A Win32 x64 Node 20.11.1 128-cell/200× synthetic near-packet-cap benchmark (`scripts/bench-preylab-integrity.mjs`) sampled 512 receptor calls and one model step over 15 rounds: median 2.59 ms sample batch, 13.15 ms step, 663,945-byte JSON state with 256 packets. The `dist` copy was missing a required module before this pass, so it could not provide a trustworthy baseline median. These host figures are diagnostic, not mobile hardware performance claims. ## F08 follow-up: finite organic fuel (2026-10-20) The previous mass-only corpse/detritus representation let scavenging regenerate energy from recycled mineral. Population schema 14 adds corpse `energy`, `detritusEnergy[192]` and bounded observer counters; `foodEnergy` is a recoverable fraction of actual prey fuel. Older remains receive zero unknown historical fuel with an explicit `legacy-estimate` origin and retained `legacyEnergySnapshot`. The archived snapshot is not reinitialized on later loads. See [RESOURCE-ACCOUNTING.md](RESOURCE-ACCOUNTING.md) for equations, source table, tests, local MySQL continuation and remaining limits. ## F07/F09 update (2026-10-21) Protocol v2 adds an independently bounded continuous mutation step; v1 still imports with its historical 6% step. Population schema 17 migrates schema 16 once without changing living resources, identities, lineages or mutation events. Mutation policy belongs to the saved dish and exported next-dish protocol. The one repaired allele-default omission affects newly normalized v4 algae; old raw genomes remain preserved. See [evolvability and tradeoffs](EVOLVABILITY-TRADEOFFS.md) for the search-space audit, seeded trial rules, results and limits. The locally served source path is the active app; these edits affect newly loaded PreyLab pages.