Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- run: sudo apt-get update -qq && sudo apt-get install -y -qq libcurl4-openssl-dev libsqlite3-dev libarchive-dev zlib1g-dev
- run: make -C accordwimsy test
- run: make -C tracer test
- run: python3 scripts/test-rule-mutants.py
- run: python3 scripts/test-mutants.py
- run: sh scripts/test-install.sh
- run: python3 scripts/test-check-docs.py
- run: python3 scripts/check-docs.py
Expand Down
7 changes: 4 additions & 3 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ searches in time linear in what it reads; nginx limits its requests by client an
- ReiWimsy reads a message's text only for the numbers it names, sends GitHub only the numbers, and keeps no message,
no text and no author: its state holds its replies' and cards' ids ([ReiWimsy](./REIWIMSY.md#what-it-keeps)).
- Tracer keeps the sender's user id and the ids of the messages that lead to a report, for the deletion, the updates
and the hourly limit; the site and its JSON name no one. A log's home folders become `~`, its addresses `[ip]` and
`[email]`, and the crash report's dumps are left out; a picture loses its metadata and a video its place, time and
camera ([Tracer](./TRACER.md#what-a-report-keeps)).
and the hourly limit; the site and its JSON name no one. A log's home folders become `~`, and so do the folders of a
path outside them (a disk's, a drive's, Android's storage), its addresses `[ip]` and `[email]`, and the crash
report's dumps are left out; a picture loses its metadata and a video its place, time and camera
([Tracer](./TRACER.md#what-a-report-keeps)).
- AccordWimsy copies what GitHub shows publicly, each issue and comment opening with its GitHub author, day and link.
- The status page keeps nothing of anyone.
28 changes: 20 additions & 8 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
What CI runs on each pull request and each push to main (`.github/workflows/test.yml`), with no network and no
Discord:

make -C rei test && make -C accordwimsy test && make -C tracer test && python3 scripts/test-rule-mutants.py &&
make -C rei test && make -C accordwimsy test && make -C tracer test && python3 scripts/test-mutants.py &&
sh scripts/test-install.sh && python3 scripts/test-check-docs.py && python3 scripts/check-docs.py &&
sh scripts/test-check-theme.sh && sh scripts/check-theme.sh

Expand Down Expand Up @@ -47,8 +47,12 @@ usage.
temporary folder:

- the events and what a message asks; which files are logs, screenshots and videos; the logs unpacked from a `.gz` and
a `.zip`, and the name each downloads as from the site (a log's, never the archive's); the screenshots' metadata
taken out (PNG, JPEG, WebP, GIF) and broken ones refused; an MP4's place and camera blanked; text made valid UTF-8;
a `.zip` (never one of its pictures, nor a Mac's fork; a name flagged UTF-8 read in the C locale, one that is no
UTF-8 passed by), and the name each downloads as from the site (a log's, never the archive's); a zip's screenshots
walked by name, without their folders, each read within its size; the screenshots' metadata taken out (PNG, JPEG,
WebP, GIF) and broken ones refused; an MP4's place and camera blanked; text made valid UTF-8; the paths outside a home
cut to `~` and a file's name (report 58's two lines, a drive, Android's storage, two paths on a line, a JSON string,
the mounts' own names, and what stays: the system's folders, a home, a folder named `mnt` inside a path);
- the game a log names (and the older builds' titles, a garbled one, a name in another script); the crash report's
dumps left out of a log as the log summary leaves them out; the games' names from the list (an update's and an
add-on's ID, a report named at once, one named at the next start, a log's name first, a GBA game by its code, a
Expand All @@ -60,7 +64,11 @@ temporary folder:
naming the game), deletion by the sender and the guild's administrators and by no one else; a reply alone that makes
a report of the message it replies to (its files, its author, its words, the hourly limit of the one who asked) and
its refusals (another channel or server, a bot's message, one gone or kept from the bot, one without files as the
Message Content intent shows it, one that is a report already);
Message Content intent shows it, one that is a report already); a Share Log zip's screenshots kept beside its log
(by their names, a PPM as a PNG, their metadata out, a broken one and a Mac's fork named or left), twelve of them
past the room of eight, an update with no room left, a picture attached as a log taken as a screenshot, a zip that
brings screenshots to a report full of logs, one too large said with its size, one whose bytes fail the zip's check;
the issue's screenshots as the site's pictures;
- a database of the first schema upgraded, a deleted message, a report's number never reused, the hourly limit, the
JSON with no Discord id, the channels it answers in (a list, `all`, none, and other words refused);
- the issues an approval files, through a fake GitHub: an administrator's reaction files one, a second files none,
Expand All @@ -71,7 +79,8 @@ temporary folder:
one that never answers, one gone before it reads, one that names a host file, one shut in its folder that tries the
site, the database and /etc/passwd, one that answers without having shut itself in, one that reads the bot's
environment before the bot keeps it from its user's debuggers and not after, the bot's descriptors closed in it, no
worker for a message without files;
worker for a message without files, a Share Log zip whose names are flagged UTF-8 and have accents, read once shut
in;
- the MCP server over that site: its handshake and protocol versions, notifications, broken and unknown requests, each
tool's filters, limits and errors, and a query's 16 words at most;
- runs of edenprobe: edenprobe's families and which lose their detail, the drivers by the ban table's names and by
Expand All @@ -96,9 +105,12 @@ temporary folder:
words, suite, failing or not) and `probe_case` (by key, by words, several, none, a key that is none), and gone with
its reports; a case no run names any more losing its page.

`python3 scripts/test-rule-mutants.py` then changes `tracer/src/rules.c` one way at a time in a copy of the tree (a
threshold one off, a comparison that lets one more in, a condition left out: 19 mutants) and expects `test_tracer
--rules` to fail on each; a mutant it passes, or one whose text `rules.c` no longer has, fails it. About 10 s.
`python3 scripts/test-mutants.py` then changes Tracer's code one way at a time in a copy of the tree, and expects its
tests to fail on each: `tracer/src/rules.c` (a threshold one off, a comparison that lets one more in, a condition left
out: 19 mutants, `test_tracer --rules`); what a report keeps of its files, in `files.c`, `report.c` and `issues.c` (a
zip's screenshots, a picture never read as a log, the paths outside a home, the limits said with their values: 30
mutants, `test_tracer --files`); and the worker's locale for a zip's names, made before it shuts itself in (1 mutant,
the whole suite). A mutant they pass, or one whose text its file no longer has once, fails it. About 30 s.

`make -C tracer bench [RUNS=1000] [FOLDER=/tmp/tracer-bench]` (`tracer/tests/bench_probe.c`, built by `make test`,
run by hand) keeps RUNS runs like edenprobe 0.9.0's graphics run (1069 cases) on fifteen machines in a new database in
Expand Down
44 changes: 34 additions & 10 deletions docs/TRACER.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,30 @@ for it). The worker's answer is checked before any of its files moves from the w
IPv4 address but the loopback's written as `[ip]` and each e-mail address as `[email]` (a network game's log names the
player's address and the other players'), and summarized: the game, its title ID and version, the build, the system
and GPU, how the run ended and where, the service commands and what else the runtime missed, the last lines. A file
that is no ScarletNX log, nor a run of edenprobe, is named in the reply and not kept.
- Its screenshots (PNG, JPEG, WebP, GIF or PPM, read from their bytes; 8 at most, 25 MiB each) lose their metadata:
EXIF and its place and camera, XMP, PNG's text and time, JPEG's and GIF's comments, a GIF's applications' data but
its loop, and what follows a JPEG's or a GIF's end (a phone's motion photo video, a maker's trailer). A PPM, the
frames ScarletNX's runtimes save (P6, 8 bits a channel), is kept as a PNG, which a browser shows.
that is no ScarletNX log, nor a run of edenprobe, is named in the reply and not kept. Of a `.zip`, the log is the
entry [a run of edenprobe](#a-run-of-edenprobe) is in, else its first `.log`, `.txt` or `.jsonl`, else its first
file that is no picture or video; never one of its pictures, nor a Mac's `__MACOSX/` fork. A zip's names are read as
UTF-8 whatever the worker's locale (ScarletNX's Share Log flags each name so), in a locale it makes before it shuts
itself in; an entry whose name it cannot read is passed by, and the walk goes on.
- Each absolute path outside a home folder in a log is written as `~` and its file's name, as where a player keeps
games says how they arrange their disks, and a disk's label may be theirs: a path under `/mnt`, `/media`,
`/run/media`, `/Volumes` (macOS), `/storage` or `/sdcard` (Android), or on a drive (`D:\`, `D:/`, WSL's `/mnt/d/`) but
in its `\Users` (a home, written as one), `\Windows` and `\Program Files` (the system's and the programs', which name
no one). `/mnt/Disk/Games/Some Game.nsp (9 MB mapped)` becomes `~/Some Game.nsp (9 MB mapped)`; its folders go, and so
does the mount's own name (a disk's label, an account's under `/media`), as `/media/someone` becomes `~`. The last
name stays when it is a file's (a dot, then a letter or a digit); one that is no file's goes with the words after it
on the line, which nothing tells from it, as an account's name does.
- Its screenshots (PNG, JPEG, WebP, GIF or PPM, read from their bytes; 8 at most, 25 MiB each), attached or in a `.zip`
beside its log (each entry named `.png`, `.jpg`, `.jpeg`, `.webp`, `.gif` or `.ppm`, kept under its file's name
without the zip's folders; a Mac's `__MACOSX/` forks are none), lose their metadata: EXIF and its place and camera,
XMP, PNG's text and time, JPEG's and GIF's comments, a GIF's applications' data but its loop, and what follows a
JPEG's or a GIF's end (a phone's motion photo video, a maker's trailer). A PPM, the frames ScarletNX's runtimes save
(P6, 8 bits a channel; the capture key's `captures/screenshot_<when>.ppm`), is kept as a PNG, which a browser shows.
A file whose bytes are a picture is taken as a screenshot, whatever its name says: it is never read as a log. The
reply names the screenshots past the 8 with that room (`shot_9.png, shot_10.png, shot_11.png and 2 more in
logs.zip: a report keeps 8 screenshots`), and one too large with its size (`huge.png in logs.zip: it is 30.2 MiB, over
the 25 MiB a screenshot may be`), as it does a log or a video; and, on a system with no UTF-8 locale, how many of a
zip's files had names it could not read.
- Its videos (MP4 or WebM, read from their bytes; 2 at most, 100 MiB each) are played on the report's page. An MP4's
place, time and camera (its udta and meta boxes whole, where a phone keeps them under its own keys, XMP's uuid box,
and ©xyz, loci, ©mak and ©mod wherever else they are) are blanked where they are, as free boxes of zeros, so that
Expand Down Expand Up @@ -89,7 +108,8 @@ for it). The worker's answer is checked before any of its files moves from the w

A reply to any of a report's messages (the one that sent it, an update, Tracer's answer, also one it posted before it
kept them, whose link names the report) that mentions Tracer adds its logs, screenshots, videos and words to it, as
`@Tracer add 12` does, within the same limits (3 logs and 8 screenshots a report). Only the person who sent the report,
`@Tracer add 12` does, within the same limits (3 logs and 8 screenshots a report; a `.zip` brings its screenshots while
the report has room for them, though its logs are full). Only the person who sent the report,
the owner and administrators of the server it was sent in and `TRACER_ADMINS` add to it; anyone else is asked for a
report of their own, which goes with the same game. A report its logs did not name takes the name a later log of the
same title ID gives. Words added later are shown under the report's note, each with its date.
Expand Down Expand Up @@ -157,7 +177,8 @@ When the log summary or the list of names changes (`scripts/sync-logscan.sh`, `s
report keeps of its logs (`TR_FACTS`), the next start summarizes each kept log again, draws each report's facts again
from its first log, files a report whose first log now names another game under that game, names one its logs don't
name from the list, makes a report whose first log holds a run of edenprobe the run's, and takes out of each kept log
what a run's lines would say of the player.
what a run's lines would say of the player and the paths outside a home. A report keeps no zip, only its log and
screenshots: a zip's screenshots sent before Tracer read them are not found again, and are added by a reply with them.

## Commands

Expand All @@ -177,8 +198,11 @@ A report becomes a GitHub issue once a server's administrator approves it: with
administrator of the server it was sent in (or one of `TRACER_ADMINS`) reacts to one of its messages (the one that sent
it, an update, Tracer's answer) with the approval's emoji, `TRACER_ISSUES_EMOJI`, the check mark by default. Tracer
opens the issue in that repository with what the site shows of the report: its facts and its first log's summary (home
folders as `~`, addresses as `[ip]` and `[email]`, no dumps), each of a log's or a player's words in a code block,
where GitHub links no `@name` and no `#number`, and the report's page. The issue's number goes into the database, onto
folders and the folders of paths outside them as `~`, addresses as `[ip]` and `[email]`, no dumps), each of a log's or
a player's words in a code block, where GitHub links no `@name` and no `#number`, the report's page, and its
screenshots, each the site's picture 320 pixels wide linked to it and named by its number in the report (a file's
name is a player's words). GitHub's API takes no file for an issue: its image proxy fetches each picture from the site,
so the site must answer it. The issue's number goes into the database, onto
the report's page and its JSON, and into a short reply on Discord. A report is filed once: a second approval opens no
other issue, and one GitHub refused (its status and message in the reply) is tried again by the next approval. Anyone
else's reaction, and another emoji, are left as they are. GitHub is asked from the bot's own process, with a 30 s
Expand Down Expand Up @@ -255,7 +279,7 @@ Static files, drawn again where a report changes them, and all of them at each s
| `index.html` | each game, its latest outcome, its reports' count; a search and a filter by outcome |
| `all.html` | every report, the newest first |
| `g/<key>.html` | a game's reports: `<key>` its title ID, or `n-` and its name's letters for a game known by name |
| `r/<id>/` | a report: its facts, screenshots, and each log with its summary, to read or download (a log sent in a `.zip` or a `.gz` is kept as its text and downloads as one: `logs.zip` as `logs.log`, `game.log.gz` as `game.log`); a run of edenprobe's has its counts and each case that did not pass |
| `r/<id>/` | a report: its facts, its screenshots (each shown small, and opened whole by a click), and each log with its summary, to read or download (a log sent in a `.zip` or a `.gz` is kept as its text and downloads as one: `logs.zip` as `logs.log`, `game.log.gz` as `game.log`); a run of edenprobe's has its counts and each case that did not pass |
| `probe/index.html` | the runs of edenprobe: the machines (an emulator, a driver and its version, a system), each case that fails somewhere with its results on each machine, each suite's, and each run |
| `probe/c/<key>.html` | a case of edenprobe: `<key>` 16 hex digits of its suite and name; its results on each machine, what the rules say of it, and its newest 200 failures and skips with their detail |
| `probe/d/<driver>.html` | a driver, by the ban table's name (`radv`, `nvidia`; `unknown` for the console's reports): its machines, the cases that fail on it, its ban candidates, its runs |
Expand Down
Loading