Refine AGENTS.md

This commit is contained in:
Tanner
2026-11-05 17:44:52 +00:00
parent 4c27f5058e
commit 5262cbd411
+4 -2
View File
@@ -15,6 +15,7 @@
- Run tests with `.venv/bin/python -m unittest discover -s tests -v`.
- Run a syntax check with `.venv/bin/python -m compileall -q mosfet tests` and `git diff --check`.
- Add regression tests for packet encodings, world-state behavior, and migrated job state transitions.
- Do not git commit changes until explicitly asked each time.
- If changes span both repositories, commit bot and pyCraft changes separately.
## Theory
@@ -30,7 +31,7 @@
## Live Checks
- For one-off live checks, start `mosfet.py` inside a Python heredoc so the test can inspect `app.g` and shut the bot down cleanly. Run from the repo root, keep `SERVER=127.0.0.1`, and let `GAME_PASSWORD` come from the environment.
- For one-off live checks, start `mosfet.py` inside a Python heredoc so the test can inspect `app.g` and shut the bot down cleanly. Run from the repo root, keep `SERVER=127.0.0.1`.
```sh
SERVER=127.0.0.1 PLAYER_NAME=mosfet1 .venv/bin/python - <<'PY'
@@ -51,7 +52,7 @@ try:
time.sleep(0.1)
else:
raise TimeoutError("bot did not finish joining/loading nearby chunks")
print("mosfet1 position:", tuple(g.pos))
print(time.monotonic(), "mosfet1 position:", tuple(g.pos))
g.commands.handle_chat(("CHAT", "test", "tester: 1ping"))
finally:
if g.get("job") and g.get("connection") and g.connection.connected:
@@ -65,3 +66,4 @@ PY
- Give enough time for the bot and world to load.
- Always include the `finally` cleanup.
- When printing during live checks, include `time.monotonic()` to better understand the timing of events.