Habitat-Genome Compiler is a safe, local-first mission compiler for speculative habitat and environmental bio-design programs. It turns a mission JSON spec into a ranked candidate set, a markdown dossier, and an auditable local run archive. The project now also includes a browser-based mission studio that can generate valid mission specs through a guided builder instead of requiring hand-authored JSON.
- A mission JSON compiler with biosafety-aware validation and refusal handling.
- A GUI mission builder that generates safe mission specs and keeps the JSON view in sync.
- A preset library for industrial, water, climate, and offworld mission scenarios.
- Local run persistence with
manifest.json,mission.json,result.json, andreport.mdfor every saved compile. - A lightweight HTTP API plus CLI commands for compile, serve, list runs, and inspect archived artifacts.
Clone the repository, then install the package in editable mode:
pip install -e .For the GUI builder, make sure fastapi and uvicorn are available in your environment, then start the app:
python gui_app.pyOpen http://127.0.0.1:8000 to use the mission studio.
Compile a bundled example and save the full run archive:
habitat-compiler compile examples/pfas_brine.json --save-runList recent saved runs:
habitat-compiler runsInspect a saved markdown dossier:
habitat-compiler show-run <run_id> --artifact reportRun the lightweight API server:
habitat-compiler serve --host 127.0.0.1 --port 8080The browser UI now includes:
- Preset cards with safe-first ordering and blocked-demo missions pushed to the end.
- A guided builder for name, domain, environment, stressors, objectives, and safety profile.
- Research-note cards that explain why extra control, containment, consortium, or offworld objectives were added.
- A live JSON panel so generated missions can still be reviewed and edited directly.
- Compile results that surface verdicts and the saved run ID for traceability.
Current example missions include:
examples/pfas_brine.jsonexamples/desalination_brine_polishing.jsonexamples/methane_biofilter.jsonexamples/mine_tailings_recovery.jsonexamples/mars_bioreactor.jsonexamples/mars_regolith_biofertility.jsonexamples/blocked_mission.json
The mission builder adds extra objectives and constraints using rules derived from published work on:
- Digital twins for bioprocess control
- Long-term microbial consortium homeostasis
- Layered biological containment
- Offworld resource loops and regolith-linked nutrient recycling
The applied source mapping is documented in docs/research-upgrades.md.
When a compile is saved, the run archive stores:
manifest.jsonwith metadata, timestamps, compiler version, and artifact referencesmission.jsonwith the validated mission inputresult.jsonwith the compiler outputreport.mdwith the rendered dossier
Runs are stored in ./runs by default, or in the directory pointed to by HABITAT_COMPILER_RUNS_DIR.
This project is intentionally simulation-first. Unsafe mission requests are blocked, and the builder refuses pathogen, toxin, immune-evasion, transmissibility, and similar harmful capability framing. Generated missions bias toward containment, telemetry, shutdown logic, and review gates instead of actionable wet-lab instructions.
The current automated test suite passes with:
python -m pytest -qLatest verified result: 75 passed.