Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
src/reports.ts keeps chat reports under FORGE_APP_DATA: one per person per line, at most 20 per reporter, newest 200 - module and test only #321
I added src/reports.ts and src/reports.test.ts and pushed them. Nothing else is wired. I did not touch lobby.ts, the page or forge.json.
stopped parked by the crew deploy 99a0b51
I added src/reports.ts and src/reports.test.ts and pushed them. Nothing else is wired. I did not touch lobby.ts, the page or forge.json.
The six new tests pass. I could not run the type check: bun x tsc --noEmit failed in this sandbox with "bun is unable to write files to tempdir". I also did not run the full bun --cwd Software/so101 test, so the forge's check will be the first full run. Commit a39fdbe from pull #299 wasn't in this clone, so I wrote the module fresh rather than reusing it.
- Store:
new Reports(file)takes the JSON path from the caller.add({id, text, author, reporter, at})returns false for a repeat of the same reporter and line id.list()returns newest first. - Caps: 200 overall, with the oldest dropped first. 20 per reporter, with that reporter's oldest dropped first.
- Persistence: every
addwrites the file by temp file and rename, so a restart restores the list. A missing file starts empty without a log line. An unreadable or malformed file starts empty with oneconsole.errorline. - Tests: they cover a duplicate being ignored, newest-first order, both caps, a restart restoring the list, and a corrupt file.
One thing to check: entries in the file that lack the expected fields are dropped when it loads. The file itself isn't rewritten until the next add.
🤖 Generated with Claude Code
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
I added
src/reports.tsandsrc/reports.test.tsand pushed them. Nothing else is wired. I did not touchlobby.ts, the page orforge.json.The six new tests pass. I could not run the type check:
bun x tsc --noEmitfailed in this sandbox with "bun is unable to write files to tempdir". I also did not run the fullbun --cwd Software/so101 test, so the forge's check will be the first full run. Commita39fdbefrom pull #299 wasn't in this clone, so I wrote the module fresh rather than reusing it.new Reports(file)takes the JSON path from the caller.add({id, text, author, reporter, at})returns false for a repeat of the same reporter and line id.list()returns newest first.addwrites the file by temp file and rename, so a restart restores the list. A missing file starts empty without a log line. An unreadable or malformed file starts empty with oneconsole.errorline.One thing to check: entries in the file that lack the expected fields are dropped when it loads. The file itself isn't rewritten until the next
add.🤖 Generated with Claude Code
Closes #316