tools/scenario/control.py sends a command before it can record it, so an unrecordable command still reaches the game

Open Beginner friendly
#2,878 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Read tools/scenario/control.py, especially the send and record steps around lines 75–79, then add a test with a command-counting fake endpoint and an unwritable work root. Confirm the command is not sent when its record cannot be written, and that a successful record is followed by the reply record. The issue says the Go harness from #2875 may also close this issue if it lands first.

Written by the indexing model from the issue text.

Description

backlog

tools/scenario/control.py sends a command to the game before it can write its record, so a command whose record cannot be written reaches the game and leaves no line in control-log.jsonl, and the caller sees only a traceback.

Evidence at eccd986d622140f317a89cb7122eea12a007960a

  • tools/scenario/control.py:75: reply = call(port, command) sends the command and waits for the reply.
  • tools/scenario/control.py:78-79: only then work_root.ensure_dir(log.parent, ...) and with log.open("a") as f: write the record.
  • The module docstring (tools/scenario/control.py:8) says "Every command and reply is printed and appended".
  • Seen in #2875 M1 on 2026-11-25: run as a user that could not write the run's work root, control.py --port <p> '{"op":"fire","action":"invite_create",...}' ended in PermissionError ... README.md from work_root.ensure_dir, yet the game's log shows [NEVR.INVITE] request sent op=create expires_s=10800 and answer op=create status=200 ... result=ok at that moment, and the invite service made a match. The next create, sent from a run that could write, was answered 503.

Not shown

  • Whether run_scenario.py has the same order (its Control.call writes no record at all; the run's result.json is written at the end).

Falsifier

A run of control.py whose record cannot be written that sends nothing to the endpoint (no matching line in the game's log).

Work

  1. A test first: a fake endpoint that counts the commands it receives, and a work root the tool cannot write; the test fails while the tool sends.
  2. Write the command's record (or check the record can be written) before call, and the reply after; a failure to record ends the run before the command is sent.
  3. The Go harness of #2875 replaces this tool (ADR 0052 decision 3 records before sending); this issue closes with that port or with step 2, whichever lands first.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.