chore: format and cleanup

This commit is contained in:
Ivan 2026-08-14 10:58:21 -05:00
parent 462e47e056
commit 0f62f8107b
No known key found for this signature in database
3 changed files with 14 additions and 18 deletions

View file

@ -18,14 +18,14 @@ Write property, fuzz, and security tests that decide accept or reject with an in
An oracle predicts the correct outcome from the input alone (or from a simpler trusted model), then the test checks the code matches that prediction.
| Oracle type | Example |
| -------------- | ------------------------------------------- |
| Accept/reject | Empty room name must raise ValueError |
| Oracle type | Example |
| -------------- | ------------------------------------------------ |
| Accept/reject | Empty room name must raise ValueError |
| Origin parse | `http://127.0.0.1:9337@example.com` is not local |
| Round-trip | encode(decode(x)) == x when decode succeeds |
| Jail | Successful path stays under storage root |
| Closed reasons | Error message is one of a fixed set |
| Membership | After PART by non-member, no PARTED fanout |
| Round-trip | encode(decode(x)) == x when decode succeeds |
| Jail | Successful path stays under storage root |
| Closed reasons | Error message is one of a fixed set |
| Membership | After PART by non-member, no PARTED fanout |
## Hard refuse (soft fuzz)

Binary file not shown.

View file

@ -161,9 +161,9 @@ describe("networkVisualiserPlanet", () => {
expect(out.pick.some((p) => p.id === "me")).toBe(true);
expect(out.pick.some((p) => p.id === "eth0")).toBe(true);
expect(out.projected[1].kind).toBe(PLANET_KIND_IFACE_ON);
expect(pickPlanetNode(out.pick, out.pick.find((p) => p.id === "me").sx, out.pick.find((p) => p.id === "me").sy, 24)).toBe(
"me"
);
expect(
pickPlanetNode(out.pick, out.pick.find((p) => p.id === "me").sx, out.pick.find((p) => p.id === "me").sy, 24)
).toBe("me");
expect(pickPlanetNode(out.pick, -400, -400, 8)).toBeNull();
});
@ -187,7 +187,9 @@ describe("networkVisualiserPlanet", () => {
expect(out.planets).toHaveLength(2);
expect(out.planets[0].id).toBe("eth0");
expect(out.planets[1].id).toBe("wifi");
expect(Math.hypot(out.planets[0].cx - out.planets[1].cx, out.planets[0].cz - out.planets[1].cz)).toBeGreaterThan(1);
expect(
Math.hypot(out.planets[0].cx - out.planets[1].cx, out.planets[0].cz - out.planets[1].cz)
).toBeGreaterThan(1);
});
it("marks a far-side peer as back-facing on its interface globe", () => {
@ -283,13 +285,7 @@ describe("networkVisualiserPlanet", () => {
packNode(nodes, 3, 230, 10, 22);
packNode(nodes, 4, -230, 10, 22);
const ids = ["me", "eth0", "wifi", "a", "b"];
const kinds = [
PLANET_KIND_ME,
PLANET_KIND_IFACE_ON,
PLANET_KIND_IFACE_ON,
PLANET_KIND_PEER,
PLANET_KIND_PEER,
];
const kinds = [PLANET_KIND_ME, PLANET_KIND_IFACE_ON, PLANET_KIND_IFACE_ON, PLANET_KIND_PEER, PLANET_KIND_PEER];
const base = {
nodes,
width: 800,