This project generates a State Machine DSL from high-level mission requirements using a 5-step pipeline integrated with Gemma 3.
- Python 3.8+
- A machine with a GPU is recommended for Gemma 3 inference (steps 2 & 3), but it can run on CPU (slowly).
- Hugging Face Access Token (for Gemma 3 models). You may need to log in via
huggingface-cli login.
- Clone/Navigate to this directory.
- Install Dependencies:
pip install -r requirements.txt
Run the pipeline steps sequentially:
Merges your input (input_mission.json) with the security template.
python3 step1_mission_context.pyUses LLM to analyze the context and documents.
python3 step2_canonical_context.pyUses LLM to generate the state machine logic with Pydantic validation.
python3 step3_overlay.pyCompiles and validates the overlay into the final DSL.
python3 step4_compiler.pySimulates the execution of the generated state machine.
python3 step5_runtime.py- Input: Modify
input_mission.jsonto change the mission parameters. - Templates: Modify
templates/generic_template.jsonfor base security settings. - Documents: Update
data/documents.txtto change the knowledge base.