13. Sharing code

Because a hash identifies code completely, sharing a codebase means sending only the hashes the other side lacks, and running code remotely means sending its missing closure.

13.1 Remotes

ucm remote add <name> <url|dir> [--token t] [--fingerprint sha256] adds a ucm serve URL or another codebase directory. ucm remote lists them; ucm remote rm <name> removes one.

13.2 Push and pull

13.3 Serving a codebase

ucm serve [--port 7737] [--host 127.0.0.1] [--token t] [--no-run] [--tls [--tls-cert f --tls-key f]] [--insecure] serves the codebase over HTTP(S).

13.4 Running remotely

ucm run <name> [args] --on <remote|url|dir> sends the definition's missing closure, runs it there, and streams stdout/stderr back.

13.5 Sync never trusts the sender

Received definitions are checked before anything is stored:

Dependencies and signatures are recomputed locally. Nothing received is executed during checking, and npm installs use --ignore-scripts. Tampered source sent under an existing hash is rejected; sync.test.ts checks this.

built from 5890e54f