Add PLAN.md rule, garage .gitignore, remove hardcoded server port hint
- AGENTS.md: mark PLAN.md as user-owned (never modify; it stays tracked) - move the .env ignore rule to the garage root so it covers any depth - drop the hardcoded "port 7654" hint from the no-server message; the target is now reported from the resolved SERVER_URL. The 7654 fallback remains only as the upstream TR default.
This commit is contained in:
@@ -18,6 +18,18 @@
|
||||
> is **NOT a layout contract for this folder**. If the root template and this file
|
||||
> disagree about layout, **this file wins.**
|
||||
|
||||
> ## ⚠️ DO NOT TOUCH `PLAN.md`
|
||||
>
|
||||
> **[`PLAN.md`](PLAN.md) is the user's personal working notes file.** The user
|
||||
> maintains it and edits it exclusively.
|
||||
>
|
||||
> - Agents must **NEVER** modify, rewrite, reformat, move, delete or commit
|
||||
> changes to `PLAN.md` — unless the user explicitly asks in that conversation.
|
||||
> - Reading it is **not** assumed or expected; do not open it by default.
|
||||
> - It **IS** tracked in git and is intended to be committed (deliberately added
|
||||
> in commit `59fad00b`). Do **NOT** gitignore it and do **NOT**
|
||||
> `git rm --cached` it.
|
||||
|
||||
## Start here
|
||||
|
||||
This file is the working rules for the bot. The human-facing description lives in
|
||||
@@ -103,7 +115,7 @@ forwards args and signals to `nimble runBot`, and propagates the exit code.
|
||||
directory containing the `.nimble`. From `DevControlBot_garage/` it fails with
|
||||
`Could not find a file with a .nimble extension inside the specified directory`.
|
||||
- `compile`/`build` are reserved Nimble builtin names — hence `runBot`.
|
||||
- Without a Tank Royale server on `ws://localhost:7654` the run fails with
|
||||
- Without a Tank Royale server at `SERVER_URL` the run fails with
|
||||
`[start] Cannot connect ... Connection refused` and exit code 1. That is
|
||||
expected during local verification, not a bug.
|
||||
|
||||
@@ -154,7 +166,7 @@ forwards args and signals to `nimble runBot`, and propagates the exit code.
|
||||
re-exits with the code. Never mask it to 0, never let the shell's code be
|
||||
swallowed.
|
||||
- Exit codes (keep them distinct, they are what BotLauncher branches on):
|
||||
`0` clean, `1` no game server on 7654 (expected), `2` dependency not
|
||||
`0` clean, `1` no game server at `SERVER_URL` (expected), `2` dependency not
|
||||
installed, `3` compile failure, anything else = the bot's own code.
|
||||
Each prints its own short, actionable line; compile failures keep the raw
|
||||
compiler errors.
|
||||
|
||||
@@ -25,7 +25,7 @@ requires "jsony >= 1.1.5"
|
||||
#
|
||||
# `exec` turns ANY non-zero exit into a NimScript exception, which prints a
|
||||
# stack trace plus an escaped copy of the whole script. That is nonsense for the
|
||||
# expected "no game server on 7654" outcome. So the shell always exits 0 and
|
||||
# expected "no game server at SERVER_URL" outcome. So the shell always exits 0 and
|
||||
# hands the real code back through the file named by $DEVCONTROLBOT_STATUS_FILE,
|
||||
# which DevControlBot.sh exports and then re-exits with. Direct `nimble runBot`
|
||||
# (no such variable) keeps the old behaviour: the shell exits with the real code
|
||||
@@ -216,7 +216,7 @@ if [ $bot_rc -ne 0 ]; then
|
||||
# The Tank Royale client answers a refused connection with this exact
|
||||
# exit code, so it means "no server", not "broken bot".
|
||||
echo "[devcontrolbot] No game server on ${SERVER_URL:-ws://localhost:7654} (SERVER_URL)." >&2
|
||||
echo "[devcontrolbot] Start the Tank Royale server, or check it is listening on port 7654." >&2
|
||||
echo "[devcontrolbot] Start the Tank Royale server, or point SERVER_URL at a running one." >&2
|
||||
else
|
||||
echo "[devcontrolbot] The bot ran but failed at runtime (crash or bad metadata)." >&2
|
||||
fi
|
||||
|
||||
@@ -67,7 +67,7 @@ export DEVCONTROLBOT_DEBUG="$BUILD_MODE"
|
||||
# The runBot task's shell always exits 0 (otherwise Nimble raises a NimScript
|
||||
# exception with a stack trace and a dump of the whole script) and writes the
|
||||
# bot's real exit code here instead. We read it back and exit with it, so
|
||||
# BotLauncher still sees the faithful status: 1 = no game server on 7654,
|
||||
# BotLauncher still sees the faithful status: 1 = no game server at SERVER_URL,
|
||||
# 2 = a dependency is missing, 3 = compile failure, anything else = the bot's
|
||||
# own code, 0 = clean run.
|
||||
STATUS_FILE="$(mktemp "${TMPDIR:-/tmp}/devcontrolbot.status.XXXXXX")"
|
||||
|
||||
@@ -154,9 +154,10 @@ a successful release build stays short (10 lines including the no-server report,
|
||||
vs 16 with `--debug`). `--help` / `-h` prints usage and exits 0 **without
|
||||
building**; no arguments does the opposite — it builds and runs.
|
||||
|
||||
The bot needs a running Tank Royale server on `ws://localhost:7654`; without one
|
||||
the run fails with `[start] Cannot connect to ws://localhost:7654` and exits 1
|
||||
(expected during local verification).
|
||||
The bot needs a running Tank Royale server at `SERVER_URL` (the API's documented
|
||||
default is `ws://localhost:7654`); without one the run fails with
|
||||
`[start] Cannot connect to <SERVER_URL>` and exits 1 (expected during local
|
||||
verification).
|
||||
|
||||
## Failure reporting and exit codes
|
||||
|
||||
@@ -170,7 +171,7 @@ not masked.
|
||||
| exit | meaning |
|
||||
|---|---|
|
||||
| `0` | clean run |
|
||||
| `1` | bot could not connect to the game server on `ws://localhost:7654` (expected locally) |
|
||||
| `1` | bot could not connect to the game server at `SERVER_URL` (expected locally) |
|
||||
| `2` | a dependency is not installed — `nimble install <pkg>` |
|
||||
| `3` | compilation failed — the compiler's own errors are printed above |
|
||||
| other | the bot's own exit code (runtime crash, bad metadata) |
|
||||
@@ -178,10 +179,10 @@ not masked.
|
||||
Each mode prints its own short line, e.g.
|
||||
|
||||
```
|
||||
[start] Cannot connect to ws://localhost:7654: Connection refused
|
||||
[start] Cannot connect to ws://localhost:4567: Connection refused
|
||||
[devcontrolbot] bot exited with code 1.
|
||||
[devcontrolbot] No game server on ws://localhost:7654.
|
||||
[devcontrolbot] Start the Tank Royale server, or check it is listening on port 7654.
|
||||
[devcontrolbot] No game server on ws://localhost:4567 (SERVER_URL).
|
||||
[devcontrolbot] Start the Tank Royale server, or point SERVER_URL at a running one.
|
||||
```
|
||||
|
||||
No `Exception raised during nimble script execution`, no stack trace, no source
|
||||
|
||||
Reference in New Issue
Block a user