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

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

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 #330

shipped merged opened this has it
opened this

Replaces #316 (piece of #242). Both earlier pulls (#321, #323) wrote the module but died at the preview deploy, which runs the whole suite; neither builder had run the whole suite. Keep the module as #321 described it; done now means the deploy's own test step passes too.

Done:

  • [ ] Only two new files: Software/so101/src/reports.ts and Software/so101/src/reports.test.ts. No change to lobby.ts, fake-serve.ts, the page, forge.json or any budget test.
  • [ ] new Reports(file); add({id, text, author, reporter, at}) returns false for a repeat of the same reporter and line id; list() is newest first; capped at 200 overall and 20 per reporter, oldest dropped first.
  • [ ] Writes are synchronous (write a temp file, then rename), so no promise or timer outlives a test. A missing file starts empty; an unreadable or malformed one starts empty with one console.error line.
  • [ ] The test makes its own directory with mkdtempSync(join(tmpdir(), ...)), removes it in afterAll, and never touches FORGE_APP_DATA or the repo. It covers a duplicate, both caps, a restart restoring the list, and a corrupt file.
  • [ ] After bun install --cwd Software/so101, bun --cwd Software/so101 test passes in full and bun x tsc --noEmit is clean. The pull says the pass/fail counts of the full run and whether the same run on main has the same failures.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs