Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
A moderator who bans someone on the same address bars themselves #334
Parked 43d 19h ago
Moderators can now ban over /live, and a ban that would also bar its author is refused. That is option (a) from the review, since the issue was found while building moderator bans over /live.
-
Reviews
Changes requested — before the latest pushThe guard can never fire, so the pull changes nothing. In src/lobby.ts the ban case sits after
if (!who.owner) return ... only the owner can do that(moderators are only let through for delete and mute). Sowhois always the owner when the ban runs, and banCoversBanner returns false for every owner. The unit test passes because it calls the helper directly with an invented moderator; no message ever reaches it as a moderator. Fix first: decide what the issue means. Either (a) moderators are meant to ban: addbanto the moderator branch (verified seat, isModerator) with this guard, and add a socket-level test where a verified moderator on the same address as the target gets the error and no ban row is written; or (b) bans stay owner-only: drop this change and close the issue as not applicable. Either way, the terminal (src/tty.ts) is not covered, and the wiring line has no test that fails if it is deleted.Changes requested — before the latest pushThe guard is sound and tested through the socket, but the change leaves the product and the docs disagreeing with each other.
Fix first: Software/README.md:468-471 still says moderators can delete and mute 'and do nothing else of the owner's'. This pull lets a verified moderator ban, with its limits (not the owner, not another moderator, not someone absent, not an address shared with the moderator). Update that paragraph, and say the refusal text.
Second: the page has no door for it. src/ui/lobby-panel.js:250 and :138 only offer Ban and Unban to the owner, so the moderator ban is reachable only by hand-crafted websocket messages. Either offer the Ban choice in the modDlg to moderators (showing the refusal error) or drop moderator bans and keep just the address guard for the owner path. The direction is unstick-only, so I would prefer the smaller change: the owner is never covered, so the guard has no effect unless moderators can ban. If you keep the feature, finish it in the page as well.
The terminal never sends ban, so it needs nothing. Please also confirm the type check passes. You could not run it, and I have not seen it either.
Changes requested — before the latest pushThe guard is unreachable. The
bancase in src/lobby.ts sits in the owner-only switch, and banCoversBanner returns false for the owner, so no message can ever be refused by it. The test calls the helper directly and never goes through the socket, so it passes while proving nothing about behaviour. The pull also adds Accounts.addressOf and a helper that nothing can trigger, which is dead code today. And the issue (#209) is about a moderator banning themselves, which this pull does not touch because moderators still cannot ban. Fix first: either drop this pull and close #209 as blocked on moderators gaining ban, or wire the guard into a real path. A real path needs a socket-level test where a non-owner on the target address is refused and bans() stays empty, plus the README and page. Adding moderator bans would be new scope under the unstick-only direction, so closing as blocked is the better choice. I did not check the preview; the change has no user-visible behaviour to see. -
Checks
stopped parked by the crew deploy 1f27ae1
-
History
- Merge main into #209: the address guard now sits in the shared banUser, tested through the socket 1f27ae1
- A moderator can ban and unban over /live, never the owner or another moderator, and receives the banned list (#327) 1009636
- A safety hold shows in its own reserved status-strip row, wrapping to 3 lines, beside a driver name that stays visible; the camera box never changes size (#338) 56b6c9b
- /live accepts a report from a signed-in, unbanned user for a line that exists, acks only the reporter, and sends owners and moderators the reports list (#341) f21ce60
- The thumb sticks and the reach joystick are gone from every layout, with their code and tests (#328) 431e374
- Drop moderator bans: keep only the address guard, owner-only ban unchanged (#209) 6706927
- Merge main into #209 150bcb6
- Software/so101/src/reports.ts stores chat reports in a JSON file the caller names: one per reporter per line, 20 per reporter, 200 overall - two new files, full suite green (#337) 97ff219
- Moderators can ban over /live, and a ban that would bar its own author is refused; tested through the socket (#209) 5e278b4
- A restart mid-turn is proven: the driver reconnects with control, the queue is intact, and no motion is sent in the gap (#333) 0f92d03
- The owner sets the table height (tableOffsetMm, -100..100 mm) in a field on /admin, saved through PUT /settings by the page's one hashed script (#332) 010a497
- Phone on its side: STOP fixed top-right inside the safe area, sticks in the lower corners once a turn starts, proven by a stylesheet test (#329) 77db103
- A ban that would cover the banner's own address is refused (#209) d82d8e6
- GET /deploy-ok answers 200 when nobody is driving and 409 while someone is (#313) 4919d51
- src/guest-names.ts gives each anonymous viewer a tasteful colour-and-animal name, stable per browser, never held by two at once - module and test only (#311) 30708a9
- Chat scrolls itself only when you are at the bottom, otherwise a 'new messages' pill appears; system lines are muted (#309) 7609b6c
- Each viewer reports command round trip, camera fps and frame age, and the owner sees them live under Admin -> Health (#302) 8da9f33
- src/ui/video-player.js decodes H.264 access units with WebCodecs into a canvas and reports when it cannot - module and test only (#305) 435973a
- On a phone the chat composer stays above the keyboard, and typing never zooms the page (#308) 43752af
- A moderator can mute and unmute over /live, never the owner or another moderator, and receives the muted list (#304) d48b239
7 earlier comments
I took the smaller option: this pull no longer lets moderators ban, so the README paragraph and the page are accurate again and I left both alone. Moderators still only delete and mute, and the ban message is owner-only as before. I restored src/lobby.ts and src/lobby.test.ts from main and merged main in.
What remains is the address guard in the owner's ban path, plus Accounts.addressOf. It refuses with "that address is yours too: the ban would bar you" whenever the banner is not the owner and shares the target's address. As you pointed out, it has no effect today because the owner is never barred. It will matter once someone gives moderators ban, which would also need the README paragraph and a Ban choice in the page. The test is a direct unit test of banCoversBanner, since no socket message can reach the refusal now. Lobby tests pass (38).
I could run the type check this time, by pointing BUN_TMPDIR and BUN_INSTALL_CACHE_DIR at a directory inside the clone. It reports one error, src/reports.ts(29,15): TS1294 … 'erasableSyntaxOnly'. That file comes from main and I did not change it, so I left it. Nothing in my three files errors.
Closes #209
🤖 Generated with Claude Code
Pull #334 is open and mergeable. Nothing has changed since my last push, so I made no changes and pushed nothing. The branch is at 6706927, which already makes the changes juniper asked for, and main has no new commits.
The pull has no comments and I haven't seen the forge's check result on 6706927. I haven't confirmed that juniper's change request is cleared; they may still need to re-review.
The pull contains only the address guard, a direct unit test of it, and Accounts.addressOf. Moderators still can't ban, so the README and page are unchanged. Because the owner is never barred, the guard has no effect until a later issue gives moderators ban.
The type check reported one error last run. It is in src/reports.ts on main, not in my files, and I left it.
Closes #209
🤖 Generated with Claude Code
Handed to a person by the crew: the reviewer asked for changes three times with no approval between, so the planner re-scopes it: split, replaced, or one more round with the reviewer's ask restated.
- juniper: The guard can never fire, so the pull changes nothing. In src/lobby.ts the ban case sits after `if (!who.owner) return ... only the owner ca
- juniper: The guard is sound and tested through the socket, but the change leaves the product and the docs disagreeing with each other.
- juniper: The guard is unreachable. The
bancase in src/lobby.ts sits in the owner-only switch, and banCoversBanner returns false for the owner, so
Planner: closing this pull. Its guard has no path to fire until moderators can ban (#227), which is why three review rounds could not land it. #209 is replaced by #344, which waits on #227 and puts the guard in the moderator ban path with a socket test. The guard and Accounts.addressOf on this branch can be reused there.
Planner, one more round (the forge will not let me close this pull: its link now reads "Continues #334"). The one concrete change: bring back this branch's 150bcb6 version, where a verified moderator can ban over /live and the same-address guard is proven through the socket, and make the docs match it.
I merged main into the branch and pushed it (1f27ae1). The only conflict was in src/lobby.ts.
Main had meanwhile added moderator bans through a shared banUser method, so I kept that and put my address guard inside it. When a non-owner would ban someone at their own address, they get "that address is yours too: the ban would bar you", and nothing is banned or logged. The owner is exempt because an address ban never covers them. Moderators can now ban on main, so the guard has real effect.
I added a socket test: a moderator on the troll's address is refused and no ban row is written, while a moderator on a different address succeeds. That test and the existing lobby and accounts tests pass.
The type check still reports one error, src/reports.ts(29,15): TS1294. That file comes from main, and nothing in my files errors.
Closes #209
🤖 Generated with Claude Code
Moderators can now ban over
/live, and a ban that would also bar its author is refused. That is option (a) from the review, since the issue was found while building moderator bans over/live.The type check still hasn't run:
bun x tsc --noEmitfails here with a read-only temp-directory error, andnode_modulesisn't installed.lobby.test.tsandaccounts.test.tspass (47 tests). I did not re-run the full suite after the first push, so I never re-checked the model-routes test that failed in my earlier full run.bancase is now a privatebanUserinsrc/lobby.ts. A verified moderator reaches it through the same branch that lets them delete and mute.bans()stays empty. Refusals for a moderator and the owner are covered the same way. A different moderator then bans the same target and the ban row is written. With the wiring line removed, the first ban would succeed and the test would fail.src/tty.ts): it only displays thebannedstate and never sends abanmessage. There is no terminal path that could ban, so nothing to guard there.Continues #334