This repository documents an experiment in "Clean Room Design" using Large Language Models (LLMs).
The goal was to test if two separate AI models (acting as Model A and Model B) could write compatible software components (Backend vs. Frontend) without ever seeing each other's code.
We tasked two models to build a Gladiator Battle Simulator in Python.
- Model A (Backend): Wrote the
Gladiatorclass logic. - Model B (Frontend): Wrote the
main.pyexecution script.
The Constraint: Neither model was allowed to see the source code produced by the other. They had to rely entirely on a "Shared Interface Contract" provided in the prompt.
The experiment was conducted in three phases, simulating the evolution of a prompt engineering strategy.
.
├── Test 1/ # The Failure
│ ├── gladiator.py # Generated by Model A
│ └── main.py # Generated by Model B
├── Test 2/ # The Partial Success
│ ├── gladiator.py
│ └── main.py
└── Test 3/ # The Success (Final)
├── gladiator_simulation.py
└── main.py
- Approach: We gave general instructions (e.g., "create a damage function").
- Result: CRASH.
- Model A wrote
take_damage(amount). - Model B called
attack(target). - Lesson: Natural language is too ambiguous for code integration.
- Model A wrote
- Approach: We provided a list of function names.
- Result: CRASH.
- Logic Mismatch: The frontend expected the backend to return an integer (damage value), but the backend returned a string (combat log).
- Lesson: Sharing names is not enough; you must share Behavior and Data Types.
- Approach: We removed all creative freedom. We implemented a Strict Naming Grammar derived from ASD-STE100 (Simplified Technical English).
- Rule: Names must follow
[VERB]_[NOUN]_[SUFFIX]. - Lookup Table: "Health" =
vitality, "Check" =validate, "Math" =metric. - Result:
modify_vitality_metric,validate_survival_condition.
- Rule: Names must follow
- Result: SUCCESS. Both models hallucinated the exact same verbose function names and arguments. The code ran perfectly on the first try.
Navigate to the strict phase folder and run the simulation:
cd "Test 3"
python main.py- Eliminate Synonyms: Don't ask for "verbose names." Force a specific vocabulary (e.g., "Use 'modify', never 'change'").
- Enforce Style: Explicitly state
snake_caseorCamelCaseto avoid syntax errors. - Encapsulation: Clearly define which file owns the math logic to prevent "Integration Hell."
Experiment conducted by affan810.