interplane.Get Omega
Read in your language

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

branch main Branches Tags History

mailhand / tests / fixtures / mcp / run.sh

39 lines · 1678 bytes Raw Blame History
1#!/bin/sh
2# Invocation glue only. Fixture construction/expansion is seeded Omega; expected JSON is hand data.
3set -eu
4cd "$(dirname "$0")/../../.."
5OMC=${OMC:-../omc}
6export OMC
7./build.sh tests/units/mcp.txt build/mcp
8./build.sh tests/fixtures/mcp/fixture.units build/mcp-fixture
9mkdir -p build/mcp-evidence
10f=tests/fixtures/mcp
11e=build/mcp-evidence
12build/mcp-fixture expand < "$f/session.expected.template" > "$e/session-base.expected"
13build/mcp-fixture large-in > "$e/large.in"
14build/mcp-fixture large-expected > "$e/large.expected"
15build/mcp-fixture deep-in > "$e/deep.in"
16build/mcp-fixture deep-expected > "$e/deep.expected"
17build/mcp-fixture deep-bad-in > "$e/deep-bad.in"
18build/mcp-fixture bad-expected > "$e/deep-bad.expected"
19cat "$f/session.in" "$e/large.in" > "$e/session.in"
20cat "$e/session-base.expected" "$e/large.expected" > "$e/session.expected"
21cp "$f/errors.in" "$f/errors.expected" "$f/versions.in" "$f/versions.expected" "$f/grammar.in" "$f/grammar.expected" "$e/"
22: > "$e/commands.tsv"
23for 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"
32done
33build/mcp-fixture mutate < "$e/session.expected" > "$e/session-mutant.expected"
34rc=0
35cmp -s "$e/session-mutant.expected" "$e/session.stdout" || rc=$?
36test "$rc" -eq 1
37printf 'PASS one-byte-expectation-mutant cmp=1\n'
38sha256sum "$e/session-mutant.expected" >> "$e/commands.tsv"
39cat "$e/commands.tsv"