Skip to content

Conversation

@Nostoi
Copy link
Owner

@Nostoi Nostoi commented Sep 18, 2025

Summary

  • mirror ROM GE reset limits by gating on prototype counts with 1-in-5 rerolls and expand spawning coverage for deterministic reroll outcomes.
  • refactor the ban registry to store ROM flag letters, enforce BAN_NEWBIES/BAN_PERMIT in login flows, drop BAN_ALL connections up front, and add account auth tests for prefix/suffix/newbie/permit scenarios.
  • update the port plan to mark the completed resets and security_auth_bans P0 tasks with evidence and refresh the aggregated P0 list.

Testing

  • ruff check . (fails: repository includes shell scripts and pre-existing lint issues)
  • ruff format --check . (fails: repo-wide formatting drift and shell script parsing errors)
  • mypy --strict . (fails: scripts/agent_loop.py is a shell script and cannot be parsed)
  • pytest -q (fails: test environment cannot import the mud package)

https://chatgpt.com/codex/tasks/task_b_68ca1ddba04c83209889a29835028dfa

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +63 to +70
def _parse_host_pattern(raw: str | None) -> tuple[str, BanFlag]:
text = (raw or "").strip().lower()
flags = BanFlag(0)
if text.startswith("*"):
flags |= BanFlag.PREFIX
text = text[1:]
if text.endswith("*"):
flags |= BanFlag.SUFFIX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Prefix/suffix bans persisted with reversed ROM flags

Leading and trailing wildcards are mapped to BanFlag.PREFIX and BanFlag.SUFFIX respectively, but PREFIX is encoded as the ROM letter "B" and SUFFIX as "A", while the matcher treats PREFIX as an ends-with check and SUFFIX as starts-with. Consequently a suffix ban such as *example.com is written with the "B" prefix flag and a prefix ban like corp.* is written with "A", the opposite of ROM’s format. Any ban file exchanged with a ROM server (or reloaded by ROM tools) would interpret these flags backwards, allowing or blocking the wrong hosts. Swap the flag assignments so leading wildcards produce BanFlag.SUFFIX and trailing wildcards produce BanFlag.PREFIX before persisting.

Useful? React with 👍 / 👎.

Comment on lines +25 to +28
if host_for_ban and bans.is_host_banned(host_for_ban, bans.BanFlag.ALL):
writer.write(b"Your site has been banned from this mud.\r\n")
await writer.drain()
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Close connection when rejecting BAN_ALL hosts

The BAN_ALL check at the top of handle_connection writes a message and returns before entering the try…finally block. Because the socket cleanup and session removal happen in the finally, this early return leaves the TCP stream open and bypasses standard teardown and logging, allowing a banned client to keep a connection alive indefinitely. Close the writer (and await wait_closed) or move the check inside the guarded block so the normal cleanup path runs.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants