<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=MindAttic.Relay%2FBIBLE</id>
	<title>MindAttic.Relay/BIBLE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=MindAttic.Relay%2FBIBLE"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=MindAttic.Relay/BIBLE&amp;action=history"/>
	<updated>2026-12-06T23:20:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=MindAttic.Relay/BIBLE&amp;diff=615&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=MindAttic.Relay/BIBLE&amp;diff=615&amp;oldid=prev"/>
		<updated>2026-11-29T20:27:18Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= MindAttic.Relay — Project Bible =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Single source of truth for what Relay IS, is NOT, and the rules that keep it coherent. README says how to build and run it; this says how to think about it. The finish line lives in &amp;lt;code&amp;gt;docs/RELEASE.md&amp;lt;/code&amp;gt;. The full architecture is &amp;lt;code&amp;gt;docs/design/relay.md&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 1. The one sentence &amp;lt;span id=&amp;quot;RLY-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Relay is the one way MindAttic apps send each other messages: a local NATS + JetStream server, one contracts package and one client library.&lt;br /&gt;
&lt;br /&gt;
== 2. The product promise &amp;lt;span id=&amp;quot;RLY-2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
* An app publishes an event or calls a command through &amp;lt;code&amp;gt;MindAttic.Relay.Client&amp;lt;/code&amp;gt; and never touches NATS directly.&lt;br /&gt;
* Every message is a versioned Protocol Buffers contract with the same envelope headers, so routing, de-duplication and tracing never need to open the payload.&lt;br /&gt;
* Relay is secure on one machine too: loopback only, TLS, credentials required from the first connection.&lt;br /&gt;
* Nothing depends on Relay to keep working: an app whose Relay link is down keeps doing its own job.&lt;br /&gt;
&lt;br /&gt;
== 3. What it is NOT &amp;lt;span id=&amp;quot;RLY-3&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
* Not a database. The database is the record; a message is the news.&lt;br /&gt;
* Not exactly-once delivery. Delivery is at least once; handlers are idempotent.&lt;br /&gt;
* Not (yet) a multi-machine network. Hub, leaf nodes, device enrollment and the hub-and-spoke plan are out of scope until the single-machine milestone ships (&amp;lt;code&amp;gt;docs/RELEASE.md&amp;lt;/code&amp;gt; §5).&lt;br /&gt;
* Not a code runner: Relay carries messages; apps decide what to do with them.&lt;br /&gt;
&lt;br /&gt;
== 4. Architecture canon &amp;lt;span id=&amp;quot;RLY-4&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt; Orchestrator.Desktop        Tickets.Desktop&lt;br /&gt;
        &amp;amp;#124;  MindAttic.Relay.Client  &amp;amp;#124;&lt;br /&gt;
        +-----------+--------------+&lt;br /&gt;
                    &amp;amp;#124; localhost, TLS, per-app credential (from MindAttic.Vault)&lt;br /&gt;
           +--------v---------+&lt;br /&gt;
           &amp;amp;#124; Relay server     &amp;amp;#124;  nats-server + JetStream, Windows service,&lt;br /&gt;
           &amp;amp;#124; (one per machine)&amp;amp;#124;  store under %ProgramData%\MindAttic\Relay&lt;br /&gt;
           +------------------+&lt;br /&gt;
                    ^&lt;br /&gt;
              relay CLI (install, status, creds, tail, streams, dead-letters)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4.1 Projects (planned; nothing built yet) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Project&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;relay&amp;lt;/code&amp;gt; CLI&lt;br /&gt;
| Install/uninstall the pinned nats-server service, status, credentials, diagnostics&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic.Relay.Contracts&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;.proto&amp;lt;/code&amp;gt; contracts with generated C# types, envelope header names, subject builders&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic.Relay.Client&amp;lt;/code&amp;gt;&lt;br /&gt;
| Publish/subscribe (durable consumers, ack after handler), request/reply, DI via &amp;lt;code&amp;gt;AddMindAtticRelay()&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Domain model (the nouns) ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Subject&amp;lt;/strong&amp;gt;: &amp;lt;code&amp;gt;&amp;amp;lt;app&amp;gt;.&amp;amp;lt;noun&amp;gt;.&amp;amp;lt;event&amp;gt;[.&amp;amp;lt;key&amp;gt;]&amp;lt;/code&amp;gt; for events, &amp;lt;code&amp;gt;&amp;amp;lt;app&amp;gt;.cmd.&amp;amp;lt;verb&amp;gt;&amp;lt;/code&amp;gt; for commands. Lowercase, dot-separated, no personal data or secrets. App tokens: &amp;lt;code&amp;gt;orch&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tix&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;relay&amp;lt;/code&amp;gt; (more as apps join).&lt;br /&gt;
* &amp;lt;strong&amp;gt;Stream&amp;lt;/strong&amp;gt;: one JetStream stream per app (&amp;lt;code&amp;gt;TIX&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;tix.&amp;gt;&amp;lt;/code&amp;gt;); each subscribing app has its own durable consumer.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Envelope&amp;lt;/strong&amp;gt;: headers &amp;lt;code&amp;gt;Nats-Msg-Id&amp;lt;/code&amp;gt; (UUIDv7), &amp;lt;code&amp;gt;Relay-Type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Relay-Version&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Relay-Source&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Relay-Correlation&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Relay-Sent&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Credential&amp;lt;/strong&amp;gt;: one NATS user per app per machine, with the subjects it may publish and subscribe to.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 Key operations (the verbs) ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Event&amp;lt;/strong&amp;gt;: &amp;quot;this happened&amp;quot;, JetStream, at least once, replayable (&amp;lt;code&amp;gt;tix.ticket.changed.&amp;amp;lt;id&amp;gt;&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;strong&amp;gt;Command&amp;lt;/strong&amp;gt;: &amp;quot;please do this&amp;quot;, core NATS request/reply with a timeout (&amp;lt;code&amp;gt;orch.cmd.show-worker&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tix.cmd.open-ticket&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== 5. The Laws &amp;lt;span id=&amp;quot;RLY-5&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Inherits &amp;lt;code&amp;gt;MindAttic.HouseRules.md&amp;lt;/code&amp;gt; by reference.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;strong&amp;gt;Apps only talk to their own machine&amp;#039;s server, through the client library.&amp;lt;/strong&amp;gt; &amp;lt;span id=&amp;quot;RLY-LAW-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;The database is the record; a message is the news.&amp;lt;/strong&amp;gt; Relay never replaces a table. &amp;lt;span id=&amp;quot;RLY-LAW-2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Handlers are idempotent.&amp;lt;/strong&amp;gt; Ack only after the handler succeeds; skip an already-processed &amp;lt;code&amp;gt;Nats-Msg-Id&amp;lt;/code&amp;gt;. &amp;lt;span id=&amp;quot;RLY-LAW-3&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Commands time out loudly&amp;lt;/strong&amp;gt; in plain words (&amp;quot;Tickets Desktop didn&amp;#039;t answer&amp;quot;) and never silently retry an unsafe command. &amp;lt;span id=&amp;quot;RLY-LAW-4&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Poison messages go to a dead-letter stream&amp;lt;/strong&amp;gt; after a set number of failed deliveries, with the reason. &amp;lt;span id=&amp;quot;RLY-LAW-5&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Contracts change by adding fields.&amp;lt;/strong&amp;gt; A breaking change is a new &amp;lt;code&amp;gt;Relay-Version&amp;lt;/code&amp;gt;; consumers skip types and versions they don&amp;#039;t know, and count them. &amp;lt;span id=&amp;quot;RLY-LAW-6&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Credentials and TLS from day one, loopback included; secrets live in MindAttic.Vault.&amp;lt;/strong&amp;gt; &amp;lt;span id=&amp;quot;RLY-LAW-7&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;Nothing depends on Relay to keep working.&amp;lt;/strong&amp;gt; The named-pipe AppBus stays as a fallback. &amp;lt;span id=&amp;quot;RLY-LAW-8&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
# &amp;lt;strong&amp;gt;The nats-server version is pinned&amp;lt;/strong&amp;gt; in the repo, verified by SHA-256, and upgraded deliberately. &amp;lt;span id=&amp;quot;RLY-LAW-9&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Verified state &amp;lt;span id=&amp;quot;RLY-6&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Nothing built. Design accepted 2026-10-27 (commit ba9744e). The bus it replaces is live today in &amp;lt;code&amp;gt;MindAttic.Orchestrator&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Core/Status/AppBus.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AppBusHub.cs&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;MindAttic.Tickets&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Desktop/Bus/AppBus.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AppBusClient.cs&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== 7. Active frontier &amp;lt;span id=&amp;quot;RLY-7&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;docs/RELEASE.md&amp;lt;/code&amp;gt;: milestone MS-8, &amp;quot;Relay 1.0: Orchestrator and Tickets talk over a local Relay&amp;quot;, epics M.RLY-T80 (server and CLI), M.RLY-T81 (contracts and client), M.RLY-T82 (AppBus on Relay).&lt;br /&gt;
&lt;br /&gt;
== 8. Quality bar &amp;lt;span id=&amp;quot;RLY-8&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
A feature is done when it builds clean, has NUnit tests (integration tests run against a throwaway nats-server, never the installed service), follows the Laws above, and its README/BIBLE lines match the code.&lt;br /&gt;
&lt;br /&gt;
== 9. Glossary &amp;lt;span id=&amp;quot;RLY-9&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;NATS&amp;lt;/strong&amp;gt;: the message server. &amp;lt;strong&amp;gt;JetStream&amp;lt;/strong&amp;gt;: its persistence layer (streams, durable consumers).&lt;br /&gt;
* &amp;lt;strong&amp;gt;Durable consumer&amp;lt;/strong&amp;gt;: a named read position in a stream that survives restarts.&lt;br /&gt;
* &amp;lt;strong&amp;gt;AppBus&amp;lt;/strong&amp;gt;: today&amp;#039;s named-pipe bus between Orchestrator.Desktop and Tickets.Desktop.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Leaf node / hub&amp;lt;/strong&amp;gt;: multi-machine NATS topology; out of scope for 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[MindAttic.Relay]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/MindAttic.Relay/blob/main/docs/BIBLE.md MindAttic.Relay/docs/BIBLE.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:MindAttic.Relay]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>