mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
## What this is Follow-up to #1934, as discussed there: the agent-session script moves out of Go and into YAML, so a workload can be read, edited, and selected without touching the driver. - The default script is now `internal/benchmarking/boomer/agentsession/scripts/coding-session.yaml`, embedded in the boomer worker. It was generated from the old Go table and round-trips byte-for-byte on every op. - `--agentsession-script <name>` picks a built-in variant (any `scripts/<name>.yaml`). Resolved on the worker's first iteration (the knob arrives with the first spawn message, after Init); a bad name is logged and retried each iteration, so fixing the knob and re-swarming recovers. - Decoding is strict and runs the same invariants the old tests enforced: unknown op kinds or fields, arguments a kind does not take, reads before writes, walks before fills, duplicate steps, non-positive think times. - Each script declares `min_actor_memory`. The worker reads the glutton template's memory limit at start and refuses to run against a smaller actor, with a message naming `--actor-memory`. That replaces the README's advice with a guard. - README gains a "Writing an agent-session script" section with the format and the op table. ## Not in this PR Loading a script from a file on the worker (ConfigMap mount) is the next PR, on top of this loader. ## Testing `go test -race` on the benchmarking packages, boilerplate, gofmt, and golangci-lint pass. New tests: every embedded script loads; default script shape (20 steps, 1Gi floor, declared bytes under budget); encode/decode round trip; 14 rejection cases; the template memory guard in refuse, exact, and no-limit modes. Co-authored-by: Aditya Shantanu <aditya-shantanu@users.noreply.github.com>