in reviewhumanPR #323Other

Synapse: verify a consent-scoped record handoff

Synapse gives agents scoped access to a shared record with source citations. This PR adds a NANDA Town workflow that passes a cited synthetic mobility claim between two participants and verifies what arrived against the record.

Author

zach-yaninek avatar

@zach-yaninek

github profile →
Status
In review
Opened on
Nov 9
Branch
codex/synapse-hw8

Description

The pitch.

## Summary

Synapse gives agents scoped access to a shared record with source citations. This PR adds a NANDA Town workflow that passes a cited synthetic mobility claim between two participants and verifies what arrived against the record.

## Integration

A sender uses its scoped bearer to call the separate Synapse record over MCP and obtains a brief. It sends a claim through Town's HTTP mailbox. A verifier uses a second scoped bearer to check the received claim and sends the verdict back through Town. The record runs separately. The evidence records accepted, claimed, and acknowledged messages and correlates the verdict to the received payload by fingerprint.

## Reproduce

Town base `6f9a7c064486c4a0ae9242f1ff341b8a4aad0244`. Record build `c68c7366cc89e96417bfff00419d00eafb4b29c4`. Python 3.13.

```sh
python3.13 -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'
python -m pytest -q tests/test_example_synapse_handoff.py
python examples/integrations/synapse-handoff/run_check.py \
  --verify examples/integrations/synapse-handoff/evidence/local.json
```

For a live rerun, set the authorized synthetic endpoint and the two separate scoped bearers using the environment variables in the [example README](https://github.com/zach-yaninek/nandatown/blob/codex/synapse-hw8/examples/integrations/synapse-handoff/README.md). Then run:

```sh
python examples/integrations/synapse-handoff/run_check.py \
  --project-version c68c7366cc89e96417bfff00419d00eafb4b29c4 \
  --out /tmp/synapse-handoff-evidence.json
```

## Results and limitations

| Case | Expected | Observed on the disposable synthetic record |
| --- | --- | --- |
| Faithful handoff | `matches_record` and a correlated Town receipt | Passed |
| Value changed, citation preserved | `differs_from_record` with `value_mismatch` and a correlated Town receipt | Passed |

The evidence verifier passed for both cases, all three focused tests passed, and the full Town suite passed with 1,868 tests and eight upstream warnings. The distribution check passed. The run covers prepared read grants, one synthetic item kind, actual Town mailbox delivery, and the record's verification of the received claim. It leaves hosted credential provisioning, grant revocation, writes, and model behavior untested. Offline evidence verification is available without a service connection. A live replay requires operator-approved access to the synthetic record.

## Course context

MIT AI Studio Fall 2026, HW8.

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/323/head:pr-323
git checkout pr-323