mailhand
mailhand: agents look after a person's email in seeded Omega. Maildir + MIME parsing, JSONL CLI and MCP, rule triage, policy-gated sending, hash-chained audit. Free (Apache-2.0).
Brought by drakestapleton
mailhand / tests / fixtures / mcp / run.sh
| 1 | #!/bin/sh |
| 2 | # Invocation glue only. Fixture construction/expansion is seeded Omega; expected JSON is hand data. |
| 3 | set -eu |
| 4 | cd "$(dirname "$0")/../../.." |
| 5 | OMC=${OMC:-../omc} |
| 6 | export OMC |
| 7 | ./build.sh tests/units/mcp.txt build/mcp |
| 8 | ./build.sh tests/fixtures/mcp/fixture.units build/mcp-fixture |
| 9 | mkdir -p build/mcp-evidence |
| 10 | f=tests/fixtures/mcp |
| 11 | e=build/mcp-evidence |
| 12 | build/mcp-fixture expand < "$f/session.expected.template" > "$e/session-base.expected" |
| 13 | build/mcp-fixture large-in > "$e/large.in" |
| 14 | build/mcp-fixture large-expected > "$e/large.expected" |
| 15 | build/mcp-fixture deep-in > "$e/deep.in" |
| 16 | build/mcp-fixture deep-expected > "$e/deep.expected" |
| 17 | build/mcp-fixture deep-bad-in > "$e/deep-bad.in" |
| 18 | build/mcp-fixture bad-expected > "$e/deep-bad.expected" |
| 19 | cat "$f/session.in" "$e/large.in" > "$e/session.in" |
| 20 | cat "$e/session-base.expected" "$e/large.expected" > "$e/session.expected" |
| 21 | cp "$f/errors.in" "$f/errors.expected" "$f/versions.in" "$f/versions.expected" "$f/grammar.in" "$f/grammar.expected" "$e/" |
| 22 | : > "$e/commands.tsv" |
| 23 | for c in session large deep deep-bad errors versions grammar; do |
| 24 | rc=0 |
| 25 | build/mcp < "$e/$c.in" > "$e/$c.stdout" 2> "$e/$c.stderr" || rc=$? |
| 26 | printf '%s\trun=%s\t' "$c" "$rc" >> "$e/commands.tsv" |
| 27 | sha256sum "$e/$c.stdout" >> "$e/commands.tsv" |
| 28 | test "$rc" -eq 0 |
| 29 | test ! -s "$e/$c.stderr" |
| 30 | cmp "$e/$c.expected" "$e/$c.stdout" |
| 31 | printf 'PASS %s run=0 cmp=0\n' "$c" |
| 32 | done |
| 33 | build/mcp-fixture mutate < "$e/session.expected" > "$e/session-mutant.expected" |
| 34 | rc=0 |
| 35 | cmp -s "$e/session-mutant.expected" "$e/session.stdout" || rc=$? |
| 36 | test "$rc" -eq 1 |
| 37 | printf 'PASS one-byte-expectation-mutant cmp=1\n' |
| 38 | sha256sum "$e/session-mutant.expected" >> "$e/commands.tsv" |
| 39 | cat "$e/commands.tsv" |