# 3D research laboratory for the Mendel (1866) re-analysis: phased implementation plan

## Starting point

Checked on 2026-11-11 in this project:

- **One session, one research package.** The project holds 54 files in the research package, 6 saved copies (the `.science` archive, the report, three figure PNGs, one results table) and 3 consulted sources that are not redistributed. All 63 are listed in `lab_artifact_inventory.csv` with checksum, lab object, zone and interaction. The package on disk still matches its `MANIFEST.sha256` in every entry.
- **No Jupyter notebook files exist.** The analysis was run as notebook cells in the session, but what was saved is seven Python scripts (about 1,200 lines) plus `run_all.py`. The lab cannot show notebooks that were never written; see decision 2.
- **Blender is not available.** There is no Blender installation on this machine and no Blender connector in this session. Phases 1 to 4 do not need it; phase 5 does.
- **Three.js is not installed** and nothing may be installed from the shell here. The library files would have to be downloaded into the build folder; see decision 3.
- **Available for building and testing:** Node 25, Google Chrome, an Apple M4 display at 2560 x 1440, `pdftoppm` and ImageMagick.

## What the lab is built around

The project is a statistical re-analysis of counts from pea-crossing experiments, not a wet-lab study. The room is therefore a plant-genetics and biometry laboratory: a counting bench, a growth chamber, seed storage, a reading stand for the 1866 volume and a computing workstation. Pea plants, pods and seeds in the room illustrate the seven characters Mendel scored; they are context and are labelled as illustrations, not as data.

## Artifact-to-object mapping

| Artifacts | Count | Lab object | Interaction |
|---|---|---|---|
| `REPORT.md` | 1 | Stapled printed manuscript, centre of the workbench | Pick up, page through, put down |
| `README.md`, `data/PROVENANCE.md`, `references/references.md` | 3 | Binder cover sheet, accession logbook, reprint folder | Pick up, page through |
| Three transcriptions of the 1866 text (`data/raw/`) | 3 | Bound 1866 volume on a reading stand, archive box beside it | Open the volume; compare transcriptions on the workstation |
| Seven-experiment counts (`mendel_f2_monohybrid.csv`) | 1 | Seven counting trays, one physical marker per counted seed or plant | Inspect a tray; its label shows the counts |
| Other curated tables | 6 | Seedling flats, seed envelopes, sorting tray, test-cross rack, two wall pedigree charts | Walk up and examine; open the table on the data terminal |
| Published benchmark tables | 5 | Tabbed reprint folder | Pick up; open on the data terminal |
| Scripts and `run_all.py` | 8 | Workstation: code editor and terminal pane | Focus the monitor, switch tabs, scroll |
| Result tables and summaries | 12 | Bench-top data terminal; simulation outputs on a compute node with a status display | Activate the display, browse tables |
| Verification records | 4 | QC clipboard with a pass/fail checklist | Pick up and read |
| Figures (PNG and PDF) | 6 | Three printed figure sheets, each over a projection pad | Pick up the sheet; click to project the 3D reconstruction |
| Environment files | 2 | Workstation system-information panel | Focus the monitor |
| `MANIFEST.sha256`, `science.json`, the `.science` archive | 3 | Archive storage box and an index terminal on the storage shelf | Examine the label, browse the checksum ledger |
| Reference metadata (`verified_metadata.json`) | 1 | Index-card box | Open on the workstation |
| Consulted sources not redistributed | 3 | Catalogue cards with citation and URL only | Read the card; the content itself is not embedded |

The saved figure PNGs and the results table are byte-identical to files in the package, and the saved report differs from `REPORT.md` only in its three image paths. Each is placed once.

## Figure reconstructions

The three figures contain seven panels. Each reconstruction is rebuilt from the result tables, not traced from the image, and depth comes only from physical thickness or from counting real units. No panel gains a third data axis.

| Panel | Printed form | 3D reconstruction | Source table |
|---|---|---|---|
| Fig. 1a | Ratio with 95% interval, seven experiments and pooled | Seven trays holding 19,959 markers (15,347 seeds, 4,612 plants) sorted into dominant and recessive piles, with the 3:1 dividing line engraved on each tray and the interval shown as a bracket | `f2_chi_square_tests.csv` |
| Fig. 1b | Deviation from 3:1 in standard errors | Rods on a graduated rail, one per experiment, inside a translucent 95% band | `f2_chi_square_tests.csv` |
| Fig. 2 | P-value against hypothesised ratio | A solid ridge whose height is the P-value, with the non-rejected range as a raised plinth and a rod at 3:1 | Pooled counts 14,949 : 5,010 |
| Fig. 3a | Histogram of 84 deviations | Columns built from 84 stacked blocks, one block per test, inside a wire frame for the chance expectation | `binomial84_tests.csv` |
| Fig. 3b | Cumulative distribution of 84 P-values | A staircase of 84 steps with two reference rails (chance, selective-repeat model) | `binomial84_tests.csv`, `selective_repeat_model_fit.csv` |
| Fig. 3c | Simulated totals under two models | Two extruded ridge profiles from the 200-bin histogram of one million replicates, with a vertical pane at Mendel's 41.3 | `monte_carlo_total_chi_square_histogram.csv` |
| Fig. 3d | Share of plants scored as hybrids | Six flats of 100 seedlings each (600 markers) split into hybrid and constant, with rails at 2:1 and 1.70:1 | `f3_progeny_tests.csv` |

Selecting any marker, block or rod shows the row of the table it came from.

## Phases

Each phase ends with something you can open and a check that either passes or fails. Phases 1 to 4 can start now. Phase 5 is the largest and is the one that depends on Blender.

### Phase 0. Inventory and decisions

- **Done:** the 63-item inventory and the mapping above.
- **Remaining:** your answers to the three decisions at the end.

### Phase 1. Content pipeline

- **Work:** turn each artifact into the form the lab displays, without editing its content.
  - Paginate the Markdown documents into print pages with their tables and figures.
  - Prepare the scripts with line numbers and syntax colouring.
  - Convert result tables to browsable form.
  - Build one data bundle per figure panel directly from the result CSVs.
  - Write a content manifest linking every lab object to its source file and checksum.
- **Deliverable:** a `content/` folder and `content_manifest.json`.
- **Check:** every embedded file's checksum equals the package manifest; every figure bundle reproduces its source table value for value; the page count and text of each document match the source.

### Phase 2. Walkable greybox

- **Work:** a Three.js scene at real dimensions with plain materials.
  - Room, workbench at 0.9 m, side bench, shelves, door, windows.
  - First-person camera at 1.65 m eye height starting in front of the workbench, mouse look, walking, collision with furniture and walls.
  - Proximity highlighting and a single "interact" control.
  - One camera state machine for explore, focus on an object, and return to the previous viewpoint.
- **Deliverable:** a runnable build in which every one of the 14 object groups exists as a labelled placeholder.
- **Check:** a scripted walkthrough reaches and selects every placeholder; the camera always returns to the exact pose it left.

### Phase 3. Workbench interactions

- **Computer.** The camera moves to the monitor and the screen becomes a readable interface with four areas: code (eight tabs), notebook (see decision 2), results browser, system information. Exit returns to the bench view.
- **Documents.** A selected document lifts, comes to reading distance, turns pages, and returns to its place. Text is drawn at full resolution when held, so it stays legible.
- **Data terminal, QC clipboard, archive index.** Table browsing, the 34 published-value checks and 58 source-value checks, and the checksum ledger.
- **Check:** every package file marked "embed" in the inventory can be opened from some object; displayed text is compared with the source file character for character.

### Phase 4. Figure holograms

- **Work:** the seven reconstructions, the lift-off and return transitions between sheet and projection, rotation and zoom, and row-level readout on selection.
- **Check:** an automated test reads back every marker count, block count, rod length and ridge height and compares it with the result table. Fig. 1a must contain exactly 19,959 markers and Fig. 3a exactly 84 blocks.

### Phase 5. Photoreal assets and lighting

- **Work, with Blender connected:**
  - Model the bench, monitor, instruments, glassware, trays, books and the room shell.
  - Assign physically based materials for glass, steel, epoxy resin worktop, paper and plastic, with surface wear.
  - Bake global illumination and ambient occlusion into lightmaps.
  - Export compressed glTF.
- **Work in Three.js:**
  - Image-based lighting from an HDR environment, soft shadows from the key lights, screen-space ambient occlusion, filmic tone mapping.
  - Lighting that adjusts during close-ups.
  - A restrained projection look for the holograms.
- **Check:** side-by-side screenshots from fixed viewpoints for your review; frame time stays within the budget in phase 7.
- **Fallback without Blender:** procedural Three.js geometry with the same materials and real-time lighting only. The room will look clean and plausible but not photoreal.

### Phase 6. Surrounding laboratory

- **Work:** the rest of the room, chosen from the project's content.
  - Growth chamber with pea plants showing tall and dwarf stems, axial and terminal flowers.
  - Seed cabinet with round, wrinkled, yellow and green seed samples.
  - Pod specimens (inflated, constricted, green, yellow).
  - Stereo microscope, balance, seed counter, wall charts for the two- and three-character crosses.
- **Secondary interactions:** look through the microscope, open the seed cabinet, switch on the chamber light, read the wall charts.
- **Check:** each object carries a label saying whether it is project data or illustration.

### Phase 7. Integration, performance and packaging

- **Traceability audit:** every inventory row is either reachable in the lab or listed as deliberately not embedded.
- **Performance budget:** 60 frames per second at 2560 x 1440 on the Apple M4 here, with a reduced-detail mode for slower machines. Other hardware will be untested.
- **Usability:** on-screen control hints, keyboard-only operation, a reduced-motion setting, a plain list view of all artifacts as a fallback.
- **Deliverable:** a self-contained folder with a one-line local launch command, added to the research package.

## Limits to expect

- **Real-time photorealism has a ceiling.** A browser scene with baked lighting can look like a good architectural walkthrough. It will not match an offline path-traced render, and baked light means only a few lamps can change at run time.
- **Scripted Blender modelling suits hard surfaces.** Benches, instruments and glassware come out well; convincing pea plants are the hardest asset and may need a licensed or CC0 model.
- **Visual quality needs your eye.** I can check geometry, data fidelity and frame time automatically, and I can look at screenshots, but whether the room reads as photoreal is your call at the phase 5 gate.
- **Automated browser testing is unconfirmed.** Chrome is installed, but I have not yet tried launching it from this session.
- **Two publications stay outside the lab.** The Pires and Branco PDF and the English translation of Mendel's paper appear as catalogue cards with their URLs, because their redistribution terms were not cleared.

## Decisions needed

1. **Blender.** Start phases 1 to 4 now and connect Blender before phase 5 (recommended), or wait until Blender is connected before starting anything.
2. **Notebooks.** Generate one executed notebook from the existing scripts, so the workstation shows real cells with their real outputs (recommended), or show only the scripts and the recorded run output. The notebook would be labelled as generated from the scripts.
3. **Downloads.** Allow downloading the Three.js library files and CC0 textures and HDR environments into the build folder (needed for phase 2 onward), or supply them yourself.
