Commit ·
98ffb4a
1
Parent(s): 2a907df
chore: add hackathon repo guardrails
Browse files- .gitignore +0 -1
- .pre-commit-config.yaml +16 -0
- AGENTS.md +3 -4
- README.md +4 -3
- baselines/README.md +0 -1
- demo/README.md +0 -1
- docs/FUSION_DESIGN_LAB_PLAN_V2.md +2 -2
- fusion_lab/__init__.py +0 -1
- fusion_lab/client.py +1 -4
- fusion_lab/models.py +0 -1
- openenv.yaml +0 -1
- pyproject.toml +1 -1
- server/__init__.py +0 -1
- server/app.py +0 -1
- server/data/README.md +0 -1
- server/environment.py +0 -1
- server/physics.py +0 -1
- training/README.md +0 -1
.gitignore
CHANGED
|
@@ -14,4 +14,3 @@ reports/
|
|
| 14 |
artifacts/
|
| 15 |
checkpoints/
|
| 16 |
server/data/generated/
|
| 17 |
-
|
|
|
|
| 14 |
artifacts/
|
| 15 |
checkpoints/
|
| 16 |
server/data/generated/
|
|
|
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 3 |
+
rev: v0.11.0
|
| 4 |
+
hooks:
|
| 5 |
+
- id: ruff
|
| 6 |
+
args: [--fix]
|
| 7 |
+
- id: ruff-format
|
| 8 |
+
|
| 9 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 10 |
+
rev: v5.0.0
|
| 11 |
+
hooks:
|
| 12 |
+
- id: trailing-whitespace
|
| 13 |
+
- id: end-of-file-fixer
|
| 14 |
+
- id: check-yaml
|
| 15 |
+
- id: check-toml
|
| 16 |
+
- id: check-added-large-files
|
AGENTS.md
CHANGED
|
@@ -45,6 +45,7 @@ Do not leave silent divergence.
|
|
| 45 |
- Do not broaden the task family beyond the single stellarator environment unless explicitly requested.
|
| 46 |
- Do not add broad “other sciences” claims to docs or demo copy unless there is real supporting evidence.
|
| 47 |
- Do not narrate hypotheses as validated facts.
|
|
|
|
| 48 |
- Do not add complicated reward shaping until the simpler version has been tested against actual trajectories.
|
| 49 |
- Do not optimize notebook/training work ahead of local environment stability, remote environment stability, and baseline comparisons.
|
| 50 |
|
|
@@ -58,7 +59,7 @@ Any change to the environment should preserve or deliberately update:
|
|
| 58 |
- terminal conditions
|
| 59 |
- reward semantics
|
| 60 |
|
| 61 |
-
If you change one of these, update the corresponding documentation
|
| 62 |
|
| 63 |
## Reward Design Rules
|
| 64 |
|
|
@@ -88,7 +89,6 @@ If a human cannot act coherently from the observation, fix the environment contr
|
|
| 88 |
- `baselines/`: random and heuristic baselines
|
| 89 |
- `training/`: evaluation or training notebooks
|
| 90 |
- `demo/`: demo assets and scripts
|
| 91 |
-
- `tests/`: focused tests for environment contract and repo behavior
|
| 92 |
- `docs/`: public-facing planning and submission docs
|
| 93 |
|
| 94 |
## Validation
|
|
@@ -99,10 +99,9 @@ Current useful commands:
|
|
| 99 |
|
| 100 |
```bash
|
| 101 |
python3 -m py_compile fusion_lab/models.py fusion_lab/client.py server/environment.py server/app.py server/physics.py
|
| 102 |
-
python3 -m pytest -q tests/test_repo_scaffold.py
|
| 103 |
```
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
## Git and Change Discipline
|
| 108 |
|
|
|
|
| 45 |
- Do not broaden the task family beyond the single stellarator environment unless explicitly requested.
|
| 46 |
- Do not add broad “other sciences” claims to docs or demo copy unless there is real supporting evidence.
|
| 47 |
- Do not narrate hypotheses as validated facts.
|
| 48 |
+
- Do not add new tests during the hackathon unless the user explicitly requests them.
|
| 49 |
- Do not add complicated reward shaping until the simpler version has been tested against actual trajectories.
|
| 50 |
- Do not optimize notebook/training work ahead of local environment stability, remote environment stability, and baseline comparisons.
|
| 51 |
|
|
|
|
| 59 |
- terminal conditions
|
| 60 |
- reward semantics
|
| 61 |
|
| 62 |
+
If you change one of these, update the corresponding documentation in the same task.
|
| 63 |
|
| 64 |
## Reward Design Rules
|
| 65 |
|
|
|
|
| 89 |
- `baselines/`: random and heuristic baselines
|
| 90 |
- `training/`: evaluation or training notebooks
|
| 91 |
- `demo/`: demo assets and scripts
|
|
|
|
| 92 |
- `docs/`: public-facing planning and submission docs
|
| 93 |
|
| 94 |
## Validation
|
|
|
|
| 99 |
|
| 100 |
```bash
|
| 101 |
python3 -m py_compile fusion_lab/models.py fusion_lab/client.py server/environment.py server/app.py server/physics.py
|
|
|
|
| 102 |
```
|
| 103 |
|
| 104 |
+
For this hackathon repo, prefer smoke validation, manual playtesting, and runnable demos over adding test coverage.
|
| 105 |
|
| 106 |
## Git and Change Discipline
|
| 107 |
|
README.md
CHANGED
|
@@ -32,7 +32,6 @@ fusion-design-lab/
|
|
| 32 |
├── docs/
|
| 33 |
├── fusion_lab/
|
| 34 |
├── server/
|
| 35 |
-
├── tests/
|
| 36 |
├── training/
|
| 37 |
├── openenv.yaml
|
| 38 |
├── pyproject.toml
|
|
@@ -43,6 +42,8 @@ fusion-design-lab/
|
|
| 43 |
|
| 44 |
1. Implement the environment contract in `server/environment.py`.
|
| 45 |
2. Implement the VMEC-backed physics loop in `server/physics.py`.
|
| 46 |
-
3.
|
| 47 |
-
4. Run manual-playtest episodes before heavy training work.
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
├── docs/
|
| 33 |
├── fusion_lab/
|
| 34 |
├── server/
|
|
|
|
| 35 |
├── training/
|
| 36 |
├── openenv.yaml
|
| 37 |
├── pyproject.toml
|
|
|
|
| 42 |
|
| 43 |
1. Implement the environment contract in `server/environment.py`.
|
| 44 |
2. Implement the VMEC-backed physics loop in `server/physics.py`.
|
| 45 |
+
3. Run manual-playtest episodes before heavy training work.
|
|
|
|
| 46 |
|
| 47 |
+
## Hackathon Working Note
|
| 48 |
+
|
| 49 |
+
This repo is intentionally biased toward executable demos, manual playtesting, and clear environment behavior over building out test coverage during the hackathon.
|
baselines/README.md
CHANGED
|
@@ -5,4 +5,3 @@ The first baseline milestone is:
|
|
| 5 |
- one random agent
|
| 6 |
- one simple heuristic agent
|
| 7 |
- one short comparison run on the frozen task
|
| 8 |
-
|
|
|
|
| 5 |
- one random agent
|
| 6 |
- one simple heuristic agent
|
| 7 |
- one short comparison run on the frozen task
|
|
|
demo/README.md
CHANGED
|
@@ -5,4 +5,3 @@ Expected contents:
|
|
| 5 |
- one stable episode capture
|
| 6 |
- short demo script
|
| 7 |
- any exported figures used in the 1-minute video
|
| 8 |
-
|
|
|
|
| 5 |
- one stable episode capture
|
| 6 |
- short demo script
|
| 7 |
- any exported figures used in the 1-minute video
|
|
|
docs/FUSION_DESIGN_LAB_PLAN_V2.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Fusion Design Lab — Plan V2
|
| 2 |
|
| 3 |
-
**Hackathon:** OpenEnv Hackathon, March 7-8, 2026
|
| 4 |
-
**Track:** Statement 3.1 (World Modeling — Professional Tasks)
|
| 5 |
**Status:** Judge-aligned rewrite of the main plan
|
| 6 |
|
| 7 |
## 1. Submission Thesis
|
|
|
|
| 1 |
# Fusion Design Lab — Plan V2
|
| 2 |
|
| 3 |
+
**Hackathon:** OpenEnv Hackathon, March 7-8, 2026
|
| 4 |
+
**Track:** Statement 3.1 (World Modeling — Professional Tasks)
|
| 5 |
**Status:** Judge-aligned rewrite of the main plan
|
| 6 |
|
| 7 |
## 1. Submission Thesis
|
fusion_lab/__init__.py
CHANGED
|
@@ -1,2 +1 @@
|
|
| 1 |
"""Shared client-side package for Fusion Design Lab."""
|
| 2 |
-
|
|
|
|
| 1 |
"""Shared client-side package for Fusion Design Lab."""
|
|
|
fusion_lab/client.py
CHANGED
|
@@ -6,9 +6,7 @@ from openenv.core.env_client import EnvClient
|
|
| 6 |
from fusion_lab.models import StellaratorAction, StellaratorObservation, StellaratorState
|
| 7 |
|
| 8 |
|
| 9 |
-
class FusionLabClient(
|
| 10 |
-
EnvClient[StellaratorAction, StellaratorObservation, StellaratorState]
|
| 11 |
-
):
|
| 12 |
"""Thin typed client wrapper for the remote OpenEnv environment."""
|
| 13 |
|
| 14 |
def _step_payload(self, action: StellaratorAction) -> dict[str, object]:
|
|
@@ -24,4 +22,3 @@ class FusionLabClient(
|
|
| 24 |
|
| 25 |
def _parse_state(self, payload: dict[str, object]) -> StellaratorState:
|
| 26 |
return StellaratorState(**payload)
|
| 27 |
-
|
|
|
|
| 6 |
from fusion_lab.models import StellaratorAction, StellaratorObservation, StellaratorState
|
| 7 |
|
| 8 |
|
| 9 |
+
class FusionLabClient(EnvClient[StellaratorAction, StellaratorObservation, StellaratorState]):
|
|
|
|
|
|
|
| 10 |
"""Thin typed client wrapper for the remote OpenEnv environment."""
|
| 11 |
|
| 12 |
def _step_payload(self, action: StellaratorAction) -> dict[str, object]:
|
|
|
|
| 22 |
|
| 23 |
def _parse_state(self, payload: dict[str, object]) -> StellaratorState:
|
| 24 |
return StellaratorState(**payload)
|
|
|
fusion_lab/models.py
CHANGED
|
@@ -49,4 +49,3 @@ class StellaratorState(BaseModel):
|
|
| 49 |
budget_remaining: int = 6
|
| 50 |
constraints_satisfied: bool = True
|
| 51 |
history: list[str] = Field(default_factory=list)
|
| 52 |
-
|
|
|
|
| 49 |
budget_remaining: int = 6
|
| 50 |
constraints_satisfied: bool = True
|
| 51 |
history: list[str] = Field(default_factory=list)
|
|
|
openenv.yaml
CHANGED
|
@@ -4,4 +4,3 @@ type: space
|
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
port: 8000
|
| 7 |
-
|
|
|
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
port: 8000
|
|
|
pyproject.toml
CHANGED
|
@@ -18,6 +18,7 @@ physics = [
|
|
| 18 |
"vmecpp",
|
| 19 |
]
|
| 20 |
dev = [
|
|
|
|
| 21 |
"pytest>=8.3.0",
|
| 22 |
"ruff>=0.11.0",
|
| 23 |
]
|
|
@@ -35,4 +36,3 @@ target-version = "py311"
|
|
| 35 |
|
| 36 |
[tool.pytest.ini_options]
|
| 37 |
testpaths = ["tests"]
|
| 38 |
-
|
|
|
|
| 18 |
"vmecpp",
|
| 19 |
]
|
| 20 |
dev = [
|
| 21 |
+
"pre-commit>=4.0.0",
|
| 22 |
"pytest>=8.3.0",
|
| 23 |
"ruff>=0.11.0",
|
| 24 |
]
|
|
|
|
| 36 |
|
| 37 |
[tool.pytest.ini_options]
|
| 38 |
testpaths = ["tests"]
|
|
|
server/__init__.py
CHANGED
|
@@ -1,2 +1 @@
|
|
| 1 |
"""Server-side package for Fusion Design Lab."""
|
| 2 |
-
|
|
|
|
| 1 |
"""Server-side package for Fusion Design Lab."""
|
|
|
server/app.py
CHANGED
|
@@ -15,4 +15,3 @@ def healthcheck() -> dict[str, str]:
|
|
| 15 |
@app.get("/task")
|
| 16 |
def task_summary() -> dict[str, object]:
|
| 17 |
return TASK
|
| 18 |
-
|
|
|
|
| 15 |
@app.get("/task")
|
| 16 |
def task_summary() -> dict[str, object]:
|
| 17 |
return TASK
|
|
|
server/data/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
Baseline VMEC inputs and related static assets belong here.
|
| 2 |
|
| 3 |
Do not commit generated solver outputs or large transient artifacts.
|
| 4 |
-
|
|
|
|
| 1 |
Baseline VMEC inputs and related static assets belong here.
|
| 2 |
|
| 3 |
Do not commit generated solver outputs or large transient artifacts.
|
|
|
server/environment.py
CHANGED
|
@@ -17,4 +17,3 @@ TASK: Final[dict[str, object]] = {
|
|
| 17 |
def environment_status() -> str:
|
| 18 |
"""Return a simple status string until the full environment is implemented."""
|
| 19 |
return "scaffolded"
|
| 20 |
-
|
|
|
|
| 17 |
def environment_status() -> str:
|
| 18 |
"""Return a simple status string until the full environment is implemented."""
|
| 19 |
return "scaffolded"
|
|
|
server/physics.py
CHANGED
|
@@ -18,4 +18,3 @@ class PhysicsEngine:
|
|
| 18 |
@property
|
| 19 |
def status(self) -> str:
|
| 20 |
return self._status
|
| 21 |
-
|
|
|
|
| 18 |
@property
|
| 19 |
def status(self) -> str:
|
| 20 |
return self._status
|
|
|
training/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
Training and evaluation notebooks belong here.
|
| 2 |
|
| 3 |
This repository treats notebooks as supporting evidence for the environment, not the primary product.
|
| 4 |
-
|
|
|
|
| 1 |
Training and evaluation notebooks belong here.
|
| 2 |
|
| 3 |
This repository treats notebooks as supporting evidence for the environment, not the primary product.
|
|
|