{"id":51509421,"url":"https://github.com/justinstimatze/leat","last_synced_at":"2026-07-08T04:30:45.100Z","repository":{"id":367204314,"uuid":"1279734578","full_name":"justinstimatze/leat","owner":"justinstimatze","description":"Append-only, per-author-lane message bus built on a git repo — conflict-free by construction (each agent appends only to the lane it owns). Canonical Go implementation of the mcp-dispatch git-transport wire contract.","archived":false,"fork":false,"pushed_at":"2026-06-25T02:10:40.000Z","size":28,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T03:10:37.988Z","etag":null,"topics":["agent-communication","append-only","distributed-systems","git","go","golang","jsonl","lww","mcp","message-bus"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justinstimatze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-25T01:14:29.000Z","updated_at":"2026-06-25T02:10:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/justinstimatze/leat","commit_stats":null,"previous_names":["justinstimatze/leat"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/justinstimatze/leat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinstimatze%2Fleat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinstimatze%2Fleat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinstimatze%2Fleat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinstimatze%2Fleat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinstimatze","download_url":"https://codeload.github.com/justinstimatze/leat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinstimatze%2Fleat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35252324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-communication","append-only","distributed-systems","git","go","golang","jsonl","lww","mcp","message-bus"],"created_at":"2026-07-08T04:30:44.489Z","updated_at":"2026-07-08T04:30:45.082Z","avatar_url":"https://github.com/justinstimatze.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leat\n\n*Of the keeping of records, and the avoidance of blots.*\n\nBrother, attend. This is a scriptorium that wears the habit of a git repository:\nan append-only, per-author message bus — async, durable, borne across machines,\nand faithfully audited behind one shared form of writing. Two scribes on two\ndistant machines, schooled in two different tongues, hold converse by sharing a\nsingle repository and reading one another's chronicles.\n\n`leat` is the canonical Go hand that copies the mcp-dispatch git-transport wire\ncontract. The seam by which strangers interoperate is the on-disk JSONL form,\nnot this Go API — a brother writing in any language joins the order by matching\nthe bytes, not the binding.\n\n## The Rule (the core idea)\n\nConflict-free by the discipline of the order: **each scribe appends only to the\none volume that bears his name, and to no other.**\n\n- private letters: `lanes/\u003cagent_id\u003e.jsonl`\n- public proclamations: `channels/\u003cchan\u003e/\u003cagent_id\u003e.jsonl`\n\nBecause no two hands ever touch one page, every offering to the shared library\nis a fast-forward — no locks are forged, no merge driver is summoned, the\nchronicle never blots nor needs the abbot's hand to reconcile. To **speak** is\nto inscribe one line, seal it (commit), and bear it abroad (push). To **listen**\nis to fetch the others' volumes and read past the ribbon you last left (a\nreader-local cursor), heeding only what is addressed to you.\n\n## The form of a line (wire format)\n\nOne JSON object to a line (JSONL), in honest UTF-8, closed by `\\n`. The heading\nis set down in plain hand for all to read; only the `body` may be enciphered.\nThe order of fields is of no consequence — any scribe reads by name.\n\n| field | type | notes |\n|-------|------|-------|\n| `type` | string | record discriminator: `message`, `atom`, `ack`, … |\n| `from` | string | author id; must equal the lane owner |\n| `to` \\| `chan` | string | DM recipient xor channel name (exactly one) |\n| `key` | string | LWW partition; empty = event-stream record |\n| `id` | string | stable unique id |\n| `ts` | string | UTC, `2006-01-02T15:04:05Z` |\n| `seq` | int | per-lane monotonic, 0-based |\n| `ttl` | int | seconds; 0 = never expire |\n| `version` | int | wire schema version |\n| `sig` | string | signature; reserved/unenforced in v1 |\n| `body` | any | opaque payload (encryptable) |\n\nThe name upon the volume is the true name of its keeper. Should a page within\nprofess a `from` not its keeper's, it is a forgery, and we strike it on reading.\n\n## The labor of the day (usage)\n\n```go\nbus, _ := leat.New(repoDir, \"alice\", leat.WithRemote(\"origin\"))\n\n// Send a DM and a channel post.\nbus.Publish(ctx, leat.Envelope{To: \"bob\", Body: leat.MustBody(map[string]any{\"content\": \"hi\"})})\nbus.Subscribe(\"general\")\nbus.Publish(ctx, leat.Envelope{Chan: \"general\", Body: leat.MustBody(map[string]any{\"content\": \"standup\"})})\n\n// Event-stream view: new records addressed to me since last call.\nmsgs, _ := bus.Receive(ctx)\n\n// State-snapshot view: latest record per (from, key).\nsnap, _ := bus.Collect(ctx, leat.CollectOptions{TypeFilter: \"atom\"})\n```\n\n`Receive` is the tail read once and never again — the ribbon advances, no line\nis delivered twice. `Collect` folds the chronicle to its latest word\n(last-write-wins) and never disturbs the ribbon; set `Key` to a slot identity\nfor per-slot LWW. To read history proper — to trace how a single account changed\nacross its entries — take `bus.RepoDir()` with `bus.LaneRelPath(author, chan)`\nand keep your own `git log`; the snapshot API does not wall the repository away,\nby design.\n\n## On forgery and trust (trust model)\n\nA scribe's identity is the name upon his volume, and only that scribe may write\nbeneath it — that authority is granted by the git host's push ACLs, not by any\nword within the record. A line professing a `from` at odds with the volume it\nlies in is struck as a forgery on reading. Thus the boundary of safety is write\naccess to the repository: any brother who may push may append to *his own*\naccount, and none may counterfeit another's without first defeating the host's\nown gatekeeping. `sig` is set aside for end-to-end signing but is not yet\nenforced in v1; the heading is plain hand, and only the `body` may be enciphered.\n\n## What this order is, and is not (scope)\n\nA durable, audited, cross-boundary bus of measured pace — a chronicle, not a\ncrier in the square. Commit-and-push to the line is heavy by design; the worth\nof it is durability and a permanent audit trail laid over the git host's\ninherited auth and TLS. Encipherment is a seam left ready (the `body` is opaque),\nyet sheathed by default in v1.\n\n## License\n\nMIT — see [LICENSE](LICENSE). *Go in peace.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinstimatze%2Fleat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinstimatze%2Fleat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinstimatze%2Fleat/lists"}