Commit graph Huginn/crates/mind-body/tests
Author SHA1 Message Date
Meta Vens
ed5fc195d2 mind-body control: Released carries a Grant only read_effective makes
The run cap and cadence leave the control reader only inside a Grant with
private fields, so a cap cannot exist without a released brake and an
in-bounds dial. effective() is private; its one caller is read_effective.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 05:32:19 +02:00
Meta Vens
cc66193961 mind-body: drop a stale line from the control test header
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:55:51 +02:00
Meta Vens
a50b25c08e mind-body: mind-control takes --root <dir>; the window probe runs in a tempdir
Soul s3: the window probe wrote a window-probe-<pid> instance under the real
/etc/gamecult/minds. A leading --root argv flag (argv, because sudo -E carries
the environment) replaces the default root; the probe points the real binary at
a tempdir, whose drop removes whatever a failed assert leaves. No test names
/etc/gamecult any more; the path-derivation test uses CONTROL_ROOT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:53:27 +02:00
Meta Vens
eb8aefc0fb mind-body: directories the writer creates are 0755 ancestors included; the probe reports its sweeps
Under the binary's umask 077 a first write would have left /etc/gamecult/minds
0700 and unreadable by the units. The attacker reports how much it swept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:43:59 +02:00
Meta Vens
1c2964b6ad mind-body: the window probe also opens the staged file, the wider window
Under umask 000 with the binary's umask removed the first probe never hit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:43:00 +02:00
Meta Vens
8e6b72c21b mind-body: the world-writable store fixture carries a lock, as opening the writer on a store would create one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:40:18 +02:00
Meta Vens
5cccab6899 mind-body: the binary restricts its umask; the writer refuses unsafe installs
Soul s2: under a permissive umask the store was group/world-writable between
CultCache's rename and the chmod, and an fd opened there survived it. The
mind-control binary now sets umask 077 first (the library never touches the
umask). The writer refuses to write through an existing directory, lock or store
that is not root's or is group/world-writable, with the typed UnsafeStore error
naming path, mode and owner. Tests: a non-root open-for-write probe against the
real binary under umask 000; refusals for 0777/0775 directories, 0666/0664
locks and stores, and a non-root-owned directory; accepted root installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:39:19 +02:00
Meta Vens
2377fa6d40 mind-body: the mode test writes once, so a skipped lock mode is not repaired by the second write
cargo-mutants on the diff missed deleting the negation before the lock check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:28:39 +02:00
Meta Vens
d125b95c8d mind-body: the wrong-dial fixture registers the brake it reads beside
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:25:26 +02:00
Meta Vens
550037e0b3 mind-body: pin the creation modes, the non-root refusal and the dial decode branch
Modes under umask 000/022/077 via a re-executed test child; a non-root user
(setpriv uid 65534, skipped with a message when not root) cannot write the store
but can read it; an undecodable or NaN dial reads Held(Undecodable) whatever the
brake says, which kills the fail-open default-dial mutant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:24:58 +02:00
Meta Vens
9a9165d4f1 mind-body: pin the --instance guard and the binary's refusal exit
Two cargo-mutants survivors from the first run (main -> (), and the
--instance match guard -> true) are killed by a malformed-command table row
and a process-level test of the refused invocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:05:51 +02:00
Meta Vens
4b3e850fef mind-body: the operator's brake and burn-rate dial, the reader and the mind-control CLI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:58:29 +02:00