
> peter-eater-cloud@0.7.0 test
> node --test tests/*.test.mjs

✔ enrollment approval retry returns the same machine and expires (11.7406ms)
✔ online status follows validated polling and rejects a forged cadence (1.9745ms)
✔ public downloads cannot retrieve tenant history or arbitrary R2 keys (42.8116ms)
✔ hex range includes odd lengths and rejects insecure sizes (5.1437ms)
✔ routes reject reserved paths, encoding, traversal and injected hosts (0.6169ms)
✔ public projection excludes hostile nested values and private data (0.4967ms)
✔ enrollment activation defaults off at Worker and DO boundary (25.3312ms)
✔ signed enrollment consumes challenge and does not expose device key in status (18.255ms)
✔ forged proof cannot enroll; expired challenge cannot enroll (2.6795ms)
✔ duplicate device key enrollment is rejected (4.1651ms)
✔ signed telemetry is accepted, replay and modified payload rejected (6.0676ms)
✔ cross-tenant device, group and alias access fail (7.5119ms)
✔ public route serializes no private names, IDs, groups, URLs or raw snapshots (5.2121ms)
✔ visibility cannot opt secrets into public output (4.036ms)
✔ groups require members, preserve overlap and reject last-member removal (10.9583ms)
✔ online machine cannot be deleted; offline reconnect restores memberships (11.4702ms)
✔ custom domains require configured verification and aliases are unique (4.6937ms)
✔ migration requires confirmation and rejects stale review (4.9813ms)
✔ reassignment retires all old aliases and restores removed automatic aliases (8.4068ms)
✔ migration collision rolls back all changes atomically (5.3237ms)
✔ concurrent replay has exactly one acceptance (8.7113ms)
✔ alternate hosts, viewer mutation, cross-origin and command routes denied (0.9696ms)
✔ public routes default disabled (0.2617ms)
✔ real JWT verification rejects wrong issuer/audience, expiry, tamper and membership (73.4394ms)
✔ Chrome report is minimal and distinguishes group activity from connector truth (0.6862ms)
✔ directory storage chunks large Unicode state and cleans old chunks atomically (6.5816ms)
✔ management assets and session always require authenticated Access identity (2.8988ms)
✔ management routes cannot be claimed by a public alias (0.2687ms)
✔ management script parses as a browser script (1.1843ms)
✔ retention preview uses trusted tenant exemptions and keeps raw input unchanged (2.5776ms)
✔ signed telemetry queues history atomically; private reads enforce tenant membership (14.9464ms)
✔ full history queue rolls back signed ingestion so the same nonce can retry (6.0343ms)
✔ public HTML route uses the same filtered projection as JSON (6.0515ms)
✔ device revocation blocks telemetry and owner-approved rotation preserves machine identity (12.0052ms)
✔ telemetry does not invalidate a reviewed configuration migration (5.6591ms)
✔ R2 documented Standard example and account free allowance (1.549ms)
✔ fractional billable units round up and IA never receives Standard free tier (3.6408ms)
✔ raw projection uses sixty-second default and adjustable measured sample size (0.4625ms)
✔ cost assumptions reject negatives, invalid cadence and missing prices (0.8069ms)
✔ history outbox survives crash after R2 put and acknowledges once on retry (17.7933ms)
✔ history queue backpressure rolls back rather than dropping an archive (0.7839ms)
✔ R2 checksum conflicts preserve the queued record (2.316ms)
✔ history reads verify tenant, machine, path and checksum (2.2136ms)
✔ history requires an enabled flag and bound bucket (0.5195ms)
✔ local dashboard renders native metric shapes and full export controls with matching HTML IDs (68.8995ms)
✔ removing all watched processes clears stale resource details (5.6418ms)
✔ read-only folder mode disables settings and reconciliation controls (5.0718ms)
✔ management refresh remains wired and viewer controls are disabled (36.4662ms)
✔ management retention upload parses JSONL and sends no exemption claim (4.6742ms)
✔ public HTML escapes hostile names and never renders unknown private fields (1.9394ms)
✔ public HTML handles filtered fields and unavailable values (0.37ms)
✔ parallel free reservations admit exactly thirty dispatches (28.176ms)
✔ idempotent retry, failure and unknown outcome do not create another billable admission (1.1254ms)
✔ changing tenant does not reset a stable account allowance (6.8924ms)
✔ rolling window expires at exactly thirty days without calendar resets (1.2332ms)
✔ quota principal hashes do not expose raw account IDs (0.6469ms)
✔ six calendar months clamps month end and leap years (2.505ms)
✔ six-hour rollup preserves averages, count, counter totals and coverage (0.981ms)
✔ missing intervals, reset counters and reboot do not become zero traffic (0.5045ms)
✔ bucket-boundary interval apportions totals without duplication (1.008ms)
✔ server owner/BYO exemptions preserve raw data and ignore client flags (0.3131ms)
✔ cutoff is strict, duplicate samples deduplicate, conflicting timestamps reject (0.3997ms)
✔ reduced event history retains connection, IP and user changes (0.2567ms)
ℹ tests 63
ℹ suites 0
ℹ pass 63
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 547.2346
