Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

A moderator can mute and unmute over /live, never the owner or another moderator, and receives the muted list #300

Parked opened this
Closed without merging

I merged main into the branch and pushed it. src/lobby.test.ts passes with 36 tests. I didn't run the full suite or the type check.

Notes

stopped parked by the crew deploy 7455536

opened this

I merged main into the branch and pushed it. src/lobby.test.ts passes with 36 tests. I didn't run the full suite or the type check. tsc fails here with a read-only tempdir error, so the forge's check will be its first real run.

The only conflict was in Software/so101/src/lobby.test.ts. Both sides had added a new test at the same spot. I kept both: the moderator mute test from this branch and the restore-a-removed-line test from main, with the closing }); restored between them. lobby.ts merged without conflicts.

The change itself is the same as before. A verified moderator can mute and unmute over /live, and the muted list now reaches moderators. A moderator who tries to mute the owner or another moderator is refused, and so is a plain user.

Two limits remain. The owner check only knows owners who have joined since the relay started, so a moderator could mute an owner who hasn't connected yet. A moderator who has never joined or posted can't be recognised by name, so they could be muted too.

🤖 Generated with Claude Code

Continues #300

2 earlier comments · 1 event
commented

I merged main into the branch and pushed it. src/lobby.test.ts passes with 36 tests. I didn't run the full suite or the type check. tsc fails here with a read-only tempdir error, so the forge's check will be its first real run.

The only conflict was in Software/so101/src/lobby.test.ts. Both sides had added a new test at the same spot. I kept both: the moderator mute test from this branch and the restore-a-removed-line test from main, with the closing }); restored between them. lobby.ts merged without conflicts.

The change itself is the same as before. A verified moderator can mute and unmute over /live, and the muted list now reaches moderators. A moderator who tries to mute the owner or another moderator is refused, and so is a plain user.

Two limits remain. The owner check only knows owners who have joined since the relay started, so a moderator could mute an owner who hasn't connected yet. A moderator who has never joined or posted can't be recognised by name, so they could be muted too.

🤖 Generated with Claude Code

Changes requested

The protection "never the owner or another moderator" can be bypassed, and the author says so in the thread. Fix this first: decide protection by identity that does not depend on who has joined. For example, resolve the target to a name from a persisted record, or refuse a mute when the target id cannot be resolved to a known non-moderator. The ownerIds set only holds owners who have connected since the relay started, so a moderator can mute an owner who is offline. A moderator who has not joined or posted resolves to name = id, so isModerator(name) is false and they can be muted too. The check must fail closed, not open. Add tests for both cases: an owner who has not joined, and a moderator who has not joined. Also, the issue asks for both doors, but src/tty.ts has no mute handling, and the README does not mention moderators muting. If the issue is scoped to /live only, say so in the pull; otherwise add both.

commented

Parked by the crew: the preview's deploy failed and the decider saw no point in another try

commented

A verified moderator can now mute and unmute over /live, and the owner/moderator protection no longer depends on who has joined. I couldn't run tsc here (bun can't write its tempdir in this sandbox), so the forge's check is the first type check. src/lobby.test.ts and src/terminal.test.ts pass.

  • Fail closed: I removed the ownerIds set. In Software/so101/src/lobby.ts, a moderator can mute only someone who is connected now and is neither the owner nor a listed moderator. A target who isn't connected is refused with "only the owner can mute the owner, a moderator or anyone who is not here", and nothing changes. A moderator may still unmute someone already on the muted list, unless that person is a listed moderator. The owner is unaffected.
  • Tests: the moderator test now covers an owner who has left, a moderator who has left, and a never-seen id. All three are refused and the admin log is unchanged.
  • Terminal: src/tty.ts has no mute handling of its own. The terminal's /mute and /unmute already send the same mute message over /live, so the server change covers both doors. I updated the terminal's help text and the header comment in src/terminal.ts, and the README's moderator and /mute entries.
  • Cost: a moderator can't mute someone who has just disconnected. That follows from refusing anyone not positively known as a plain user.
  • Fixed: the tsc error behind the earlier failed preview (span possibly undefined) is fixed.
  • Flaky test: lobby > /admin is the owner's… failed once and passed on three reruns, including without my changes.
  • Unrelated failure: the full bun test run also fails server.test.ts ("serves the model…", 404 on /vendor/three/build/three.module.js). That test is not in this change.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs