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

Migrated from github.com/Trevato/SO-ARM100

/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

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

/live now accepts {"type":"report","id":N} from a signed-in, unbanned user. It stores the report through src/reports.ts and sends owners and moderators the reports list. The suite passes except one test that also fails on main: "serves the model, its meshes and the vendored libraries…".

Notes

shipped merged

opened this

/live now accepts {"type":"report","id":N} from a signed-in, unbanned user. It stores the report through src/reports.ts and sends owners and moderators the reports list. The suite passes except one test that also fails on main: "serves the model, its meshes and the vendored libraries…". I didn't investigate it; I think this sandbox lacks the model files, but I haven't confirmed that. I didn't see the tsc --noEmit result: the run printed "bun is unable to write files to tempdir" and nothing else, so the type check is unconfirmed, and I only checked the pushed branch for the push, not for the forge's check.

  • Report vs. timings: a report frame with an id key is a chat report, and one without is the page's timings. Timings behave as before; a test confirms a bad timings frame is still refused.
  • Refusals: a guest gets "join to take part", a banned user gets the ban error, and a missing line gets "no such line to report". A system line also counts as missing, as does a non-integer or string id.
  • Ack and repeats: only the reporter gets {"type":"reported","id"}, including for a repeat. A repeat doesn't re-send the list.
  • Reports list: a reports message goes to the verified owner and moderators on join, whenever a new report is filed, and when moderators change. Nobody else gets it. It reuses the same check as the muted list.
  • Storage: bench/fake-serve.ts passes reportsFile (reports.json under FORGE_APP_DATA) to the lobby. I made the Reports file argument optional so a lobby without reportsFile keeps reports in memory, as the other lobby stores do.
  • Tests and docs: two new tests in src/lobby.test.ts cover each case above. The /live protocol header in lobby.ts documents report, reported and reports. They check the stored reports through lobby.lineReports, not the file on disk, which src/reports.ts already covers.

🤖 Generated with Claude Code

Closes #318

commented

/live now accepts {"type":"report","id":N} from a signed-in, unbanned user. It stores the report through src/reports.ts and sends owners and moderators the reports list. The suite passes except one test that also fails on main: "serves the model, its meshes and the vendored libraries…". I didn't investigate it; I think this sandbox lacks the model files, but I haven't confirmed that. I didn't see the tsc --noEmit result: the run printed "bun is unable to write files to tempdir" and nothing else, so the type check is unconfirmed, and I only checked the pushed branch for the push, not for the forge's check.

  • Report vs. timings: a report frame with an id key is a chat report, and one without is the page's timings. Timings behave as before; a test confirms a bad timings frame is still refused.
  • Refusals: a guest gets "join to take part", a banned user gets the ban error, and a missing line gets "no such line to report". A system line also counts as missing, as does a non-integer or string id.
  • Ack and repeats: only the reporter gets {"type":"reported","id"}, including for a repeat. A repeat doesn't re-send the list.
  • Reports list: a reports message goes to the verified owner and moderators on join, whenever a new report is filed, and when moderators change. Nobody else gets it. It reuses the same check as the muted list.
  • Storage: bench/fake-serve.ts passes reportsFile (reports.json under FORGE_APP_DATA) to the lobby. I made the Reports file argument optional so a lobby without reportsFile keeps reports in memory, as the other lobby stores do.
  • Tests and docs: two new tests in src/lobby.test.ts cover each case above. The /live protocol header in lobby.ts documents report, reported and reports. They check the stored reports through lobby.lineReports, not the file on disk, which src/reports.ts already covers.

🤖 Generated with Claude Code

Approved

Does what the issue asks: a report with an id is validated (safe integer, line exists, not a system line), needs a signed-in unbanned seat, acks only the reporter (repeats too), and pushes the list only to the owner and verified moderators, reusing the muted-list gate. Timings frames without an id are untouched. Reports.ts caps are per reporter and overall, so spam is bounded. Tests would fail without the change. Next: (1) say in the pull that the tsc result and the model-files test were unconfirmed so the forge check is the verdict; (2) wire reportsFile into whatever production entry builds the Lobby once one exists, as only bench/fake-serve.ts passes it now, and give the page a Report button with a plain-worded error for the refusals.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs