<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Philip Shaw</title>
    <description>The latest articles on DEV Community by Philip Shaw (@virorum).</description>
    <link>https://dev.to/virorum</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4013836%2Fe5cca143-b113-4aa0-909c-5ae3ceddc5af.png</url>
      <title>DEV Community: Philip Shaw</title>
      <link>https://dev.to/virorum</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/virorum"/>
    <language>en</language>
    <item>
      <title>Sentinel Dev Diary: Believed, Not Checked</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 23 Nov 2026 16:28:58 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-believed-not-checked-4lde</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-believed-not-checked-4lde</guid>
      <description>&lt;p&gt;Most entries so far have followed a build step. Step one was read against &lt;em&gt;The Semantic Model&lt;/em&gt;, step four against the watchdog, step six against &lt;em&gt;The Rules Engine&lt;/em&gt;. Each step had an owning document and an audit, and the entry was about what the audit found.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-security-model/" rel="noopener noreferrer"&gt;The Security Model&lt;/a&gt;&lt;/em&gt;, published here last Wednesday, has no step of its own. &lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/#build-order" rel="noopener noreferrer"&gt;The Introduction&lt;/a&gt; says so on purpose:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Security is not a step. The subject layout and the publisher check land in step 3, bus credentials with the first driver host, and forward auth with the API when it exists. Deferring it to a step of its own is how it becomes a retrofit.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I still think that was right, but it meant no audit ever read the document whole. Step three's audit checked its six exit criteria, each a test that asserts a refusal, and stopped there. The rest of the document was built in pieces inside other steps, by work that was busy with something else, and its gaps were found whenever one of those pieces first ran for real.&lt;/p&gt;

&lt;p&gt;The document saw this coming. Its exit criteria open with a warning:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Security properties are the ones most likely to be believed rather than checked, because nothing fails when they are absent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In each finding below, a sentence read as complete and nothing failed until someone ran the real thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  A table that times out
&lt;/h2&gt;

&lt;p&gt;The published copy gives the bus permissions as a three-row table: what each principal may publish and what it may subscribe to. The host row grants publish on its own observation, availability, quarantine and command-result subjects, and subscribe on its commands and its assignment. The criterion that checks it is specific about how:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Asserted against a real server with the real permission set, because a permission file that was never exercised is a permission file that is probably wrong.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On 6 September the real credentials were minted from that table and run against a real broker. The table could not run the system.&lt;/p&gt;

&lt;p&gt;The observation path is a JetStream stream, and the table only names plain NATS subjects. JetStream has subjects of its own. The core needs to publish on &lt;code&gt;$JS.API.&amp;gt;&lt;/code&gt; to create the stream, bind its consumer and fetch, and on &lt;code&gt;$JS.ACK.&amp;gt;&lt;/code&gt; to acknowledge what it has processed. Without the second, every message is redelivered forever. And anything doing request and reply needs an inbox for the reply to land in. The core needs one for every JetStream call. So does a host, for the acknowledgement the broker sends back on every observation it publishes. That last one was the part that hid.&lt;/p&gt;

&lt;p&gt;A host holding the table's grants exactly was not refused. Its publishes timed out, silently, because the acknowledgement had nowhere to go. The core did no better without its JetStream grants, and the decision that added them puts it plainly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A credential minted from the table alone connects and can do nothing - which is worse than one that cannot connect, because the failure is a stalled consumer rather than a startup error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The open question it raised, OI-27, describes the result as a table that "reads complete and the fleet does not work".&lt;/p&gt;

&lt;p&gt;The fix kept the document's narrowness where it could. Granting every principal &lt;code&gt;_INBOX.&amp;gt;&lt;/code&gt; would have worked, and it would have let any host read every other host's replies. Instead each principal gets an inbox under its own prefix, and connects using it. A host that connects with another host's prefix gets no replies at all, and a test asserts that. The prefix is a constant in the code, and the permission set is generated from the same function the client connects with. They are not allowed to drift, because a mismatch shows up as a timeout and not a refusal: the request goes out, and the reply lands on a subject the client may not read.&lt;/p&gt;

&lt;p&gt;The amendment landed on 14 September, and it was wrong in one place when first written. It gave hosts &lt;code&gt;$JS.ACK.&amp;gt;&lt;/code&gt; as well, on the reasoning that anything touching a stream acknowledges. The generated permission set gave it only to the core, and the generated set was right. A host publishes into the stream and never consumes from it, so it has nothing to acknowledge. The document was corrected against the artefact, and now states the asymmetry outright, "because the obvious guess is the other one".&lt;/p&gt;

&lt;h2&gt;
  
  
  Four capabilities, mapped to nothing
&lt;/h2&gt;

&lt;p&gt;The published copy, on what a person may do:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Capabilities, not roles.&lt;/strong&gt; There are four, carried as a second header from the identity provider and mapped in the registry:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The four are &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;claim&lt;/code&gt;, &lt;code&gt;suspend&lt;/code&gt; and &lt;code&gt;direct&lt;/code&gt;. On 9 September the capability check was built, and it had nothing to look the header up against. There was no capability file in the registry, no vocabulary that declared the four, and no document saying what was mapped to what.&lt;/p&gt;

&lt;p&gt;Two readings fit the words, and they are different systems. The registry could map the identity provider's groups to capabilities. That would make who may do what a reviewable diff, the way band authorisation already is. Or the registry could just name the four, and the header would be the authority. The code took the second, because it builds the smaller thing. Nothing about it would need undoing if the first reading won: a mapping would sit in front of the check and resolve groups before the core saw them, and the core's side would not change. The decision recording that reading also pointed out it was no weaker than the alternative, because both trust the same header for the same reason:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;so a registry lookup would be a lookup keyed on an unverified header either way. What the mapping would add is not verification but &lt;em&gt;review&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Review was worth having, so the question was whether to build it. On 14 September the clause was struck instead. The argument against it was already in the document, a few lines further down:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A per-point permission matrix is deliberately not built. A few thousand points maintained by one person would rot within a month and then be trusted anyway.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A group mapping is the same shape. It is a second place to maintain, it drifts from the identity provider, and then it is trusted anyway, which is worse than having nothing, because it looks like a control. So the header is now the authority on purpose, and the mapping went onto the document's list of things it deliberately does not do, with the condition that would bring it back. What a mapping would defend against is not a compromised proxy, which could forge either header. It is a misconfigured provider: someone added to the wrong group, and silently gaining &lt;code&gt;direct&lt;/code&gt; over the physical plant with no diff anybody reviews. So the trigger is written against that. The question reopens when more than one person holds &lt;code&gt;direct&lt;/code&gt;, or when the UI is published.&lt;/p&gt;

&lt;p&gt;Building the mapping for &lt;code&gt;direct&lt;/code&gt; alone was considered and not taken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Forward auth with nothing to forward to
&lt;/h2&gt;

&lt;p&gt;The published copy has people sign in through forward auth at the proxy: "The proxy terminates TLS, an identity provider authenticates the person, and the proxy injects the principal as a header that the core trusts." In mid-September, when the read surface was ready to route, the deploy host had no identity provider.&lt;/p&gt;

&lt;p&gt;Waiting for one was tempting, and the decision of 17 September explains why it was worse. It would have left the routing, the network and the header handling all untested until the day someone was also debugging a new identity provider. So the surface was routed straight away, and the proxy strips both identity headers from every incoming request, unconditionally. Every request arrived with no principal and was refused, which is the document's "absent principal is a rejection, never a default" running on every request.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The surface is therefore reachable and answers nothing, which is the honest state of a system whose authentication has not been built.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The same decision named the trap for later. The strip has to come first and the authenticator after it, because the proxy copies the authenticator's answer over whatever the strip left. Any header the authenticator does not name passes straight through from the client. Add forward auth and name only the principal, and you have authenticated the caller and let them choose their own capabilities.&lt;/p&gt;

&lt;p&gt;The identity provider was my call, and I made it the same day. It is a tinyauth, because it joins groups with a comma, which is exactly what the capability check splits on, and because the whole integration is labels on a router the repository already configures. Two things moved with it. The service had to read tinyauth's header names, since tinyauth cannot be told to emit Sentinel's, and the strip had to move to those names too. A strip still blanking the old headers while the service read the new ones would have let the real principal header arrive from the client, guarded only by the authenticator being in the chain.&lt;/p&gt;

&lt;p&gt;Then the order. The proxy's README told whoever wired this up to put the authenticator before the strip. The decision written four lines away in another file said the opposite, and the two disagreed from the day they landed. The wrong one was in the file an operator would actually follow. Put the authenticator first and the strip erases its answer, so every request is refused. It fails closed, and a surface that refuses everyone looks like one that simply isn't wired up yet. Nothing had been deployed from it, because there had been no provider to wire. The order was measured on the running proxy, all four combinations, the README was corrected, and a test now asserts the order instead of a document describing it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The first request that got through
&lt;/h3&gt;

&lt;p&gt;Within the hour, the first authenticated request went through the staging proxy to the route that tells a caller who they are and what they may do. The capabilities it reported were:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"claim"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"direct"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"lldap_admin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"suspend"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;lldap_admin&lt;/code&gt; is a group in my directory, not a capability, and there are four capabilities, not five. The route had reported every group in the provider's header as a capability. Authority was not affected, because &lt;code&gt;lldap_admin&lt;/code&gt; grants nothing. The answer was still wrong, and a UI reading it to decide which controls to offer would have believed it.&lt;/p&gt;

&lt;p&gt;Filtering out unknown names was the obvious fix, and it was turned down, because it would have deleted the only place a misspelled group shows up. The response now has two fields. &lt;code&gt;capabilities&lt;/code&gt; holds only real capabilities and is closed, so a consumer may treat it as the whole list. &lt;code&gt;groups&lt;/code&gt; holds what the provider sent. A misspelling becomes readable off one response: the group is in &lt;code&gt;groups&lt;/code&gt; and not in &lt;code&gt;capabilities&lt;/code&gt;, and that difference says it had no effect. That shape was mine too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one found last week
&lt;/h2&gt;

&lt;p&gt;While &lt;em&gt;The Security Model&lt;/em&gt; was being prepared for publication last week, one paragraph was flagged for a closer look. As published, it is headed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Bands above &lt;code&gt;manual&lt;/code&gt; are unreachable from the API.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It goes on to list &lt;code&gt;schedule&lt;/code&gt;, &lt;code&gt;safety&lt;/code&gt; and &lt;code&gt;interlock&lt;/code&gt; as reached only by a rule. &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt; ranks &lt;code&gt;schedule&lt;/code&gt; below &lt;code&gt;manual&lt;/code&gt;. Each sentence is true on its own. The bands above &lt;code&gt;manual&lt;/code&gt; are &lt;code&gt;safety&lt;/code&gt; and &lt;code&gt;interlock&lt;/code&gt;, and &lt;code&gt;schedule&lt;/code&gt; is reached only by a rule. Read together, they say &lt;code&gt;schedule&lt;/code&gt; outranks &lt;code&gt;manual&lt;/code&gt;. The paragraph also left out &lt;code&gt;automation&lt;/code&gt;, which only a rule reaches too, and &lt;code&gt;default&lt;/code&gt;, which only the registry writes.&lt;/p&gt;

&lt;p&gt;The code was never confused. The API only accepts &lt;code&gt;manual&lt;/code&gt;, and the rule loader accepts the four rule bands, which is what the other two documents already said in full. The wording dated from the import of the specification in August, and an earlier fix to the same paragraph, in October, had edited around it without noticing. It was filed as OI-198 on 17 November and resolved the same day. The canonical document now heads the paragraph "The API reaches &lt;code&gt;manual&lt;/code&gt; and no other band" and names every band and who reaches it.&lt;/p&gt;

&lt;p&gt;The published copy still reads the old way, and will. Parts of the specification go out as the September snapshot, edited for readability and never for meaning, and a heading that implies an order is a meaning question. So the fix lives in the canonical document, and this entry is where the difference is written down.&lt;/p&gt;

&lt;h2&gt;
  
  
  What running it found
&lt;/h2&gt;

&lt;p&gt;Nothing was scheduled to read the security document against the code, so the first three were found the first time the real thing ran: credentials minted and run against a broker, a capability check that had to look something up, a read surface routed before a provider existed and the first real request through it. OI-198 was found by reading, but by a reading done for publication rather than as an audit.&lt;/p&gt;

&lt;p&gt;The document's own exit criteria pushed that way. Every one of them asserts a refusal against something real: a real broker, a database role connecting as itself, a request with no header. The table that timed out was found because its criterion said to use a real server.&lt;/p&gt;

&lt;p&gt;The missing step cost timing. The gaps surfaced inside whichever step happened to be nearby and were handled there. Every amendment here was approved by me, and two are recorded as my choice outright: the identity provider and the two-field answer. The smaller calls inside the work were the agent's, recorded as decisions in the register, in sessions I run and steer and whose every step I approved before it started. Most of these gaps were closed within a week of being found. The heading stood for eleven weeks, from the import in August until someone read it closely enough to publish it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;Observability&lt;/em&gt;.&lt;/strong&gt; The specification's tenth part: what signals every mechanism must expose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next Monday - the Dev Diary.&lt;/strong&gt; The latest on where the specification and the build disagree as the system takes shape, and which of the two had to change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>security</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Sentinel: The Security Model</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 18 Nov 2026 00:01:46 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-the-security-model-58l0</link>
      <guid>https://dev.to/virorum/sentinel-the-security-model-58l0</guid>
      <description>&lt;p&gt;One line of &lt;code&gt;nats pub&lt;/code&gt; on &lt;code&gt;cmd.&amp;gt;&lt;/code&gt; sends a command straight to a device. It skips arbitration, bands, suspension, interlocks and the audit trail, because all of those live in the core and the core is not on that path. Anything allowed to publish on that subject can do it. So in Sentinel the bus is the primary control surface, the HTTP API is the secondary one, and the permissions that say who may publish on which subjects are the real authorisation model.&lt;/p&gt;

&lt;p&gt;Most of this part puts the weight on boundaries that already exist rather than adding new ones. Where the design adds nothing, it says so. There is no mTLS, no role hierarchy, no per-point permission and no defence behind the core, and each absence comes with the condition that would change it.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; the threat model and the order effort goes in; the principal naming scheme shared by claims and credentials, and how each kind of principal is established; why rules hold no credentials; the core as one trusted principal with nothing behind it; the bus permissions that turn the subject layout into an authorisation surface; why subject scoping leaves point spoofing open, and the publisher check that closes it; human identity through forward auth, and the binding that makes it safe; the four capabilities; which bands the API can reach, and why &lt;code&gt;suspend&lt;/code&gt; is separate from &lt;code&gt;claim&lt;/code&gt;; the limits on the escape hatch; acting on behalf of a person; claim expiry against session expiry; secrets by reference, and their rotation; the one requirement that turns the control log into an audit log; the exposure assumption and what changes without it; and the deliberate absences, each with its trigger. It does not own the subject layout itself, which belongs to &lt;em&gt;Driver Contract&lt;/em&gt;; the core epoch that lets a driver refuse a superseded core, which belongs to &lt;em&gt;Core Runtime&lt;/em&gt;; the ingest stage that runs the publisher check, which belongs to &lt;em&gt;Ingest Path &amp;amp; Log Schema&lt;/em&gt;; or bands, suspension and the escape hatch's command path, which belong to &lt;em&gt;Command Plane&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this defends against
&lt;/h2&gt;

&lt;p&gt;In descending order of likelihood, which is also the order effort goes in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A compromised or hostile device on the local network.&lt;/strong&gt; Consumer sensors and relays with firmware nobody audited. The likely case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A compromised driver host.&lt;/strong&gt; A small computer on a segment, reachable, running drivers with credentials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accident.&lt;/strong&gt; A half-written script, a dashboard bug, a rule that should not have been at that band. Not malice, and the most frequent cause of damage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote exposure&lt;/strong&gt;, if the UI ever becomes reachable from outside the network.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Explicitly not in scope: insider threat across a team, regulatory compliance, nation-state adversaries. This is a single-maintainer system, and a model that assumes otherwise generates role machinery that gets routed around at the moment something is broken. The cost of unusable security is that it stops being used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Principals
&lt;/h2&gt;

&lt;p&gt;There is one naming scheme for principals, shared between the claim model and the credential system, so an owner string in the claim log is the same string as the identity that produced it:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;principal&lt;/th&gt;
&lt;th&gt;form&lt;/th&gt;
&lt;th&gt;identity mechanism&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;driver host&lt;/td&gt;
&lt;td&gt;&lt;code&gt;host:rpi-c1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NATS NKey/JWT, one per host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;core&lt;/td&gt;
&lt;td&gt;&lt;code&gt;system:core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NATS NKey/JWT, one credential&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;read/UI/alert service&lt;/td&gt;
&lt;td&gt;&lt;code&gt;service:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NATS credential for state, read-only Postgres role&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;person&lt;/td&gt;
&lt;td&gt;&lt;code&gt;user:alice&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;forward auth at the proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rule&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rule:frost-protect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none — see below&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;registry default&lt;/td&gt;
&lt;td&gt;&lt;code&gt;system:default&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none — materialised by registry load&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;mTLS is not used anywhere.&lt;/strong&gt; It would be stronger and it is not worth the operational learning curve here. Machine identity uses NATS-native credentials, which are a file and a revocation list rather than a certificate authority to run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules are not runtime principals and hold no credentials.&lt;/strong&gt; A rule exists because a YAML file in the repository declared it, and its band was validated at registry load. Nothing on the network authenticates as a rule. This is worth stating plainly, because the instinct when securing a system is to issue every actor a credential, and doing that here would create a new path into the command plane that bypasses the registry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The core is a single principal with broad rights, and its compromise is total.&lt;/strong&gt; It holds the only credential that may publish commands, and it is the single writer described in &lt;em&gt;Core Runtime&lt;/em&gt;. There is no defence in depth behind it and pretending otherwise would be theatre. The trust boundary sits at the core process, and everything else is about limiting what reaches it and what happens if something outside it is taken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bus permissions
&lt;/h2&gt;

&lt;p&gt;Each credential carries NATS subject permissions, and those are the whole machine-authorisation model.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;principal&lt;/th&gt;
&lt;th&gt;may publish&lt;/th&gt;
&lt;th&gt;may subscribe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;host:{h}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;obs.{h}.&amp;gt;&lt;/code&gt;, &lt;code&gt;avail.{h}.&amp;gt;&lt;/code&gt;, &lt;code&gt;quarantine.{h}.&amp;gt;&lt;/code&gt;, &lt;code&gt;cmdres.{h}.&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;cmd.{h}.&amp;gt;&lt;/code&gt;, &lt;code&gt;assign.{h}&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;system:core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;cmd.&amp;gt;&lt;/code&gt;, &lt;code&gt;state.&amp;gt;&lt;/code&gt;, &lt;code&gt;assign.&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;obs.&amp;gt;&lt;/code&gt;, &lt;code&gt;avail.&amp;gt;&lt;/code&gt;, &lt;code&gt;quarantine.&amp;gt;&lt;/code&gt;, &lt;code&gt;cmdres.&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;service:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;nothing&lt;/td&gt;
&lt;td&gt;&lt;code&gt;state.&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two properties of the subject layout exist for this and are specified in &lt;em&gt;Driver Contract&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every driver-plane subject leads with a host segment.&lt;/strong&gt; Subjects keyed on driver instance would mean a host running three instances needs three grants, and adding an instance to a host would require editing that host's credentials as well as its assignment. Two places to keep in step is one too many, and the one that gets forgotten is the credential. Prefixing by host makes one grant per host cover every instance it will ever run, and the permission becomes stable across assignment changes. The cost is one more subject token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;cmdres&lt;/code&gt; carries the driver instance.&lt;/strong&gt; A subject of &lt;code&gt;cmdres.{command_id}&lt;/code&gt; alone contains nothing scopeable, so every driver would need &lt;code&gt;cmdres.&amp;gt;&lt;/code&gt; and any driver could forge a command outcome for any other driver's command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subject scoping does not stop point spoofing, and one ingest check does.&lt;/strong&gt; A driver publishing &lt;code&gt;obs.{its own host}.{its own instance}.boiler.ch1.flow-temp&lt;/code&gt; is inside its permissions even when that point belongs to a different instance entirely, because the core resolves points by &lt;code&gt;point_id&lt;/code&gt; and does not otherwise check who sent them. One compromised host could then feed false readings to every interlock in the system.&lt;/p&gt;

&lt;p&gt;The fix is a stage in the ingest pipeline, immediately after point resolution: the point's registry-assigned driver instance must match the publishing instance, or the observation is quarantined with reason &lt;code&gt;wrong_instance&lt;/code&gt;. It is one comparison against a lookup already being performed, and without it the bus permissions are decorative for anything that matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command authenticity runs the other way.&lt;/strong&gt; A driver cannot verify that a command came from the legitimate core by subject permissions alone, because a driver cannot tell a stolen core credential from the real core. What it can check is that the command is not from a superseded instance, which is the core epoch described in &lt;em&gt;Core Runtime&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Human identity
&lt;/h2&gt;

&lt;p&gt;People sign in through forward auth at the proxy. The proxy terminates TLS, an identity provider authenticates the person, and the proxy injects the principal as a header that the core trusts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The binding is the control, not the header.&lt;/strong&gt; A header-trusting service reachable directly on the local network fails open: anyone who can reach the port asserts any identity they like. So the core's API listens on a unix socket, or on an interface only the proxy can reach, and the proxy is the only route rather than merely the usual one. If that binding is ever relaxed for convenience, the authentication model is gone and nothing will indicate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Absent principal is a rejection, never a default.&lt;/strong&gt; No anonymous fallback, no service account the core assumes when the header is missing. A code path that cannot name its principal cannot write.&lt;/p&gt;

&lt;p&gt;The principal string is used verbatim as the claim owner, so the value in the header is the value in the claim table and in every &lt;code&gt;control_event&lt;/code&gt; it produces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Capabilities, not roles.&lt;/strong&gt; There are four, carried as a second header from the identity provider and mapped in the registry:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;read&lt;/code&gt; — query state and history&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;claim&lt;/code&gt; — set and withdraw claims at band &lt;code&gt;manual&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;suspend&lt;/code&gt; — suspend a named claim owner&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;direct&lt;/code&gt; — use the commissioning escape hatch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A per-point permission matrix is deliberately not built. A few thousand points maintained by one person would rot within a month and then be trusted anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits on each principal
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bands above &lt;code&gt;manual&lt;/code&gt; are unreachable from the API.&lt;/strong&gt; People claim at &lt;code&gt;manual&lt;/code&gt;; so would any external machine client. &lt;code&gt;schedule&lt;/code&gt;, &lt;code&gt;safety&lt;/code&gt; and &lt;code&gt;interlock&lt;/code&gt; are only ever reached by a rule whose band was declared in the registry and validated at load. Authorisation for those is therefore a git question — who can merge, who can deploy — not a runtime one, which is a better place for it: an interlock's band changes in a reviewable diff rather than in a request body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;suspend&lt;/code&gt; is a separate capability from &lt;code&gt;claim&lt;/code&gt;, and this is the distinction worth enforcing.&lt;/strong&gt; The right to turn on a light is not the right to switch frost protection off for thirty minutes. Collapsing them means a session in a phone browser can do both, which is exactly the credential most likely to be left logged in. &lt;code&gt;suspend&lt;/code&gt; is never granted to a machine principal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The escape hatch bypasses everything except interlock.&lt;/strong&gt; &lt;code&gt;direct&lt;/code&gt; permits a command that skips arbitration for commissioning and debugging, but an asserted interlock claim still wins. If the escape hatch could override a thermal cutout, the system would have no interlock at all. Enablement is modelled exactly like suspension — bounded, expiring, both edges in &lt;code&gt;control_event&lt;/code&gt; — rather than as a second mechanism with its own semantics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The read/UI/alert service acts on behalf of the person, not as itself.&lt;/strong&gt; For any mutating call it forwards the end-user principal rather than substituting &lt;code&gt;service:ui&lt;/code&gt;; otherwise every claim in the log reads as having been made by the UI and the audit trail is worthless for the question it exists to answer. &lt;code&gt;service:ui&lt;/code&gt; is used only for its own read-only access: &lt;code&gt;state.&amp;gt;&lt;/code&gt; on the bus and a read-only Postgres role.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alerting needs no write rights at all.&lt;/strong&gt; It reads state and sends notifications outbound. It holds notification channel secrets and nothing else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claim expiry and session expiry are unrelated.&lt;/strong&gt; A manual claim with a two-hour expiry survives the browser tab closing, deliberately. Tying claims to sessions would mean a person's overrides silently vanishing when their laptop sleeps, which is worse than a claim that outlives the session, since that claim still ends at its own expiry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secrets
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The bus never carries a secret, and neither does the on-disk assignment cache.&lt;/strong&gt; An assignment carries a reference — &lt;code&gt;credential: mqtt/fleet&lt;/code&gt; — resolved by the driver host against its own local store, provisioned out of band. Without this, every host holds a plaintext copy of every credential in its assignment, and so does anything that can read the assignment subject.&lt;/p&gt;

&lt;p&gt;Short-lived credentials issued by the core would be better and are a lot of machinery for a fleet this size. The reference indirection is what makes that upgrade possible later without touching the assignment format again.&lt;/p&gt;

&lt;p&gt;Rotation: device credentials rotate in the local store on each host, with no bus involvement. Bus credentials rotate by reissuing a host's JWT and adding the old one to the revocation list. Human access is revoked at the identity provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Audit
&lt;/h2&gt;

&lt;p&gt;Most of this already exists. &lt;code&gt;control_event&lt;/code&gt; records every claim, resolution, suspension and command, &lt;code&gt;registry_version&lt;/code&gt; carries the git SHA that covers rule and band changes, and the core epoch identifies which core instance acted.&lt;/p&gt;

&lt;p&gt;What makes it an audit log rather than an activity log is one requirement: &lt;strong&gt;the principal is mandatory on every mutating control event.&lt;/strong&gt; Combined with the rejection of absent principals above, there is no code path that can change state without naming who asked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exposure
&lt;/h2&gt;

&lt;p&gt;This document assumes the API and UI are reachable only from the local network, with remote access via VPN. That assumption is doing real work: it is why forward auth without MFA is proportionate, and why there is no rate limiting or lockout policy here.&lt;/p&gt;

&lt;p&gt;If the UI is ever published to the internet, three things change and none are optional: MFA at the identity provider, rate limiting and lockout on the proxy, and a re-examination of whether the core's binding is genuinely unreachable by any other route. That is a decision to make deliberately rather than one to arrive at by opening a port.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this deliberately does not do
&lt;/h2&gt;

&lt;p&gt;This is recorded so that the absences read as decisions rather than oversights, and so the trigger for revisiting each is written down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No mTLS.&lt;/strong&gt; Revisit if driver hosts move onto an untrusted network segment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No per-point authorisation.&lt;/strong&gt; Revisit if a second person gets write access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No role hierarchy.&lt;/strong&gt; Four capabilities, flat. Revisit at the same trigger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No secrets management service.&lt;/strong&gt; Local stores per host. Revisit when rotation becomes frequent enough to be forgotten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No defence behind the core.&lt;/strong&gt; Revisit if the core stops being a single trusted process, which is the same condition that would reopen the multi-core non-goal in &lt;em&gt;Core Runtime&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;Security properties are the ones most likely to be believed rather than checked, because nothing fails when they are absent. Each of these is a test that asserts a refusal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bus permissions refuse, at the broker.&lt;/strong&gt; A host credential publishing outside its own prefix is rejected by NATS, not by a check in the driver. Asserted against a real server with the real permission set, because a permission file that was never exercised is a permission file that is probably wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;service:ui&lt;/code&gt; cannot publish anything&lt;/strong&gt;, and its Postgres role cannot write.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Point spoofing is caught core-side.&lt;/strong&gt; A host publishing under its own valid prefix, for a point assigned to another instance, is quarantined with &lt;code&gt;wrong_instance&lt;/code&gt;. This is the same test as in &lt;em&gt;Ingest Path &amp;amp; Log Schema&lt;/em&gt;, and it belongs in both places because subject permissions and the publisher check are only meaningful together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Absent principal is rejected, with no fallback identity.&lt;/strong&gt; A request with no principal header is refused rather than attributed to a service account, and the core is unreachable except through the proxy — assert the binding, not just the header handling, since the binding is the actual control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Capabilities are separable.&lt;/strong&gt; A principal with &lt;code&gt;claim&lt;/code&gt; but not &lt;code&gt;suspend&lt;/code&gt; can set a manual claim and cannot suspend a safety owner. A principal with &lt;code&gt;direct&lt;/code&gt; cannot override an asserted interlock claim.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No secret appears on the bus or in an assignment cache.&lt;/strong&gt; Scan the cached assignment on a driver host and the assignment subject payload for anything credential-shaped. A cheap test that catches the regression where someone inlines a password to get a driver working.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;On Monday - the &lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-believed-not-checked/" rel="noopener noreferrer"&gt;Dev Diary&lt;/a&gt;.&lt;/strong&gt; This document read against the build. It has no build step of its own, so its gaps turned up when the real thing first ran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;Observability&lt;/em&gt;.&lt;/strong&gt; The specification's tenth part: what signals every mechanism must expose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>security</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel Dev Diary: Reading After the Build</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 16 Nov 2026 01:25:18 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-reading-after-the-build-3e86</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-reading-after-the-build-3e86</guid>
      <description>&lt;p&gt;Build step six of &lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/#what-is-sentinel" rel="noopener noreferrer"&gt;Sentinel&lt;/a&gt; is the rules engine: triggers, evaluation, warmup, input loss, loop protection, and the table of fixtures every rule has to pass. The document that owns it, &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;, was published here on 4 November.&lt;/p&gt;

&lt;p&gt;The last entry was about reading before building. Step five's seam review ran the day before its first commit, so every gap it found became a change to the document, decided with no code depending on either answer. Step six went the other way. Its audit came after the code, and its seam review came nearly three weeks after the step was marked done. By then the code had already answered nearly half of what the review asked, because it had needed an answer and picked one. Several of the other questions turned out to be defects in code that was already marked done. The step opened on 10 September, its audit was written and the step marked done on the 13th, and the seam review was written on 2 October.&lt;/p&gt;

&lt;p&gt;First, though, the finding the last entry held back. It is about a document that was published last Wednesday, and it was found before step six had any code at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seven steps and no rules engine
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-core-runtime/" rel="noopener noreferrer"&gt;The Core Runtime&lt;/a&gt;&lt;/em&gt; writes startup as a numbered list. As published:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Connect to Postgres, acquire the advisory lock, or exit&lt;/li&gt;
&lt;li&gt;Increment and read the core epoch (below)&lt;/li&gt;
&lt;li&gt;Load vocabularies and registry&lt;/li&gt;
&lt;li&gt;Load and restore the projection&lt;/li&gt;
&lt;li&gt;Bind the JetStream durable consumer&lt;/li&gt;
&lt;li&gt;Start the watchdog, derived points and verification timers&lt;/li&gt;
&lt;li&gt;Start the command plane and the API&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;The rules engine is not in it, and neither is the claim set, the durable table of who wants each writable point in which state. The seam review for &lt;em&gt;The Command Plane&lt;/em&gt; noticed on 7 September and filed it as OI-42, an open question against the specification.&lt;/p&gt;

&lt;p&gt;It matters because &lt;em&gt;The Rules Engine&lt;/em&gt; ties protection to a moment. A fail-safe interlock "asserts its &lt;code&gt;fail_value&lt;/code&gt; the instant the core starts, before any inputs are live". &lt;em&gt;The Core Runtime&lt;/em&gt;'s own section on what fails while the core is down says what that moment is worth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;No interlock protection.&lt;/strong&gt; A fail-safe interlock is a claim held by a rule inside the core. If the core is not running, the rule is not evaluating and the protection is not being applied.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So protection begins when the rules engine starts, and the list did not say when that is. Read strictly, "the instant the core starts" is step one, before the registry that declares the rule has even loaded.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Command Plane&lt;/em&gt; had the same gap one layer down. Claim expiries are recomputed "when the claim set loads", and nothing said when that happens either. Step four as written restored only the projection, the core's in-memory record of the latest observed state of every point. What each device should be doing comes from the claims: arbitration resolves them into one desired value per point, and that lives in a different table with a different writer.&lt;/p&gt;

&lt;p&gt;The order cannot be chosen freely. An interlock claim asserted before arbitration runs has nowhere to go. Arbitration that runs before the claim set loads resolves against an empty set and marks the point as wanted by nobody (&lt;code&gt;no_intent&lt;/code&gt;) while a live claim wants it. And &lt;em&gt;The Command Plane&lt;/em&gt; promises that at startup every claim is undeliverable and nothing is sent, which only holds if the claims load after the projection knows which drivers are up. In the review's words, "There is a correct order and three plausible wrong ones."&lt;/p&gt;

&lt;p&gt;It was settled the next day without adding a step. Step four was widened to restore the intent, meaning the claims and the desired values resolved from them, as well as the projection. Step six starts the rules engine with the other evaluators, so a fail-safe interlock asserts there, and its claim sits undeliverable until step seven brings up delivery. Step seven lost the phrase "the command plane", which had invited the reading that all of it starts last. Claims, arbitration and suspension are up by step six. Only the part that reaches a device waits. The canonical document now reads:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Connect to Postgres, acquire the advisory lock, or exit&lt;/li&gt;
&lt;li&gt;Increment and read the core epoch (below)&lt;/li&gt;
&lt;li&gt;Load vocabularies and registry&lt;/li&gt;
&lt;li&gt;Load and restore the projection, and the intent&lt;/li&gt;
&lt;li&gt;Bind the JetStream durable consumer&lt;/li&gt;
&lt;li&gt;Start the evaluators: the watchdog, derived points, rules, and the verification and claim-expiry timers&lt;/li&gt;
&lt;li&gt;Start delivery - the reconciler - and the API&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code already enforced an order. &lt;code&gt;run_startup&lt;/code&gt; refuses steps that arrive out of sequence, against a tuple of seven steps in &lt;code&gt;app/runtime/startup.py&lt;/code&gt;. That tuple was a second copy of the list, and nothing compared the two. So the same change added a test that reads the numbered list out of &lt;em&gt;The Core Runtime&lt;/em&gt; itself and asserts it matches the tuple, step for step. Its docstring gives the reason:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;OI-42 was three mechanisms with no place in this list at all - the rules engine, the claim-set load and the first arbitration pass - and it went unnoticed through four build steps because the list looked complete and nothing compared it to anything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The test matches each step on a keyword rather than on its wording, so the prose can be rewritten freely and a step that moves still fails it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A restart and a standing claim
&lt;/h2&gt;

&lt;p&gt;Three passages in the published copy of &lt;em&gt;The Rules Engine&lt;/em&gt; were settled on 11 September, while step six was being built. Two of them, on whether replay gates the step and how many loop limits there are, make no difference to what follows. The third does.&lt;/p&gt;

&lt;p&gt;Claims are rows in a table, so when a core restarts, the rules' claims from before are still there, and every rule starts in warmup, which "does not evaluate". The only sentence about what a warming rule holds is the first of the extra test cases: "assert it holds no claims rather than evaluating on absent data". Read as an instruction for a rule that has claimed something, that withdraws every rule claim at every restart, so each device moves to the next band for the length of warmup and back again once the rule is warm. The engine as built already took that reading. The amendment says the opposite, and the engine changed with it: a standing claim is left alone through warmup, and the case now asserts both halves: no new claims, and an old one left standing.&lt;/p&gt;

&lt;p&gt;That comes back further down, because the fixture table could not tell the difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  One rule
&lt;/h2&gt;

&lt;p&gt;The fixture table runs every rule in the registry, and at the audit the registry had one. It is called &lt;code&gt;aircon-cooling&lt;/code&gt;. It switches relay channel 8, which runs a cooling unit, from a derived point that goes high at 25 °C and low at 24 °C. It has no warmup deadline, no &lt;code&gt;hold_max&lt;/code&gt; and no interlock class, so three of the four extra cases could not be exercised by anything that shipped. They are asserted against rules built inside the test files instead.&lt;/p&gt;

&lt;p&gt;There was no interlock rule in the registry either, and there still is not. One of the findings below is an interlock check that was never built, and part of why it went unnoticed is that the only interlocks were in test fixtures, on a test point that already declared everything the missing check would have asked for.&lt;/p&gt;

&lt;h2&gt;
  
  
  The warning nobody built
&lt;/h2&gt;

&lt;p&gt;Step six's audit was written on 13 September, by reading the code against the document. The document gives the step two criteria. The fixture table passed. The other is load-time validation, and the published copy is firm about it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Load-time validation is the other half, and it is a test rather than a hope: a fixture rule set containing each of the listed violations fails the build with the right message, including the two that are errors rather than warnings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The list printed here has eight bullets. By the audit, amendments had made it nine, and eight were enforced. One had no code at all:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No two rules at the same band claim the same point with different values (warning, not error - sometimes deliberate)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It had no check, no reason code and no log line. A registry containing exactly the configuration the document says to warn about loaded without a word.&lt;/p&gt;

&lt;p&gt;A decision from step five depended on it. Every claim carries one of six bands, from a default at the bottom to an interlock at the top, and the higher band wins. When step five built arbitration, it had to say what happens when two claims tie on band and on timestamp, and the answer it recorded was to break the tie on the owner's name, so the result is at least repeatable. It declined to treat the configuration as an error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The owner tiebreak makes the outcome repeatable so it can be tested and explained; the lint warning is what is supposed to stop it happening. No &lt;code&gt;OI-*&lt;/code&gt;, because the mechanism is not silent here - it says this should not arise.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That reasoning held up. The warning it relied on did not exist, so two disagreeing rules got a deterministic, explainable and entirely unannounced winner.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two guards, both looking the other way
&lt;/h3&gt;

&lt;p&gt;The audit also explains why nothing caught it, when two things should have.&lt;/p&gt;

&lt;p&gt;The first was a test that iterates every rejection reason the loader has and asserts each one has a case that fires it. A bullet that was never given a reason is invisible to it. It checks that the reasons that exist are tested, not that the reasons the document lists exist.&lt;/p&gt;

&lt;p&gt;The second was the component register, which said the loader "refuses every bullet &lt;em&gt;Rules Engine&lt;/em&gt; lists, one named reason per bullet with a fixture asserting each fires" and marked it green. The audit:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nobody counted bullets against reasons; the sentence reads as a check and is a claim.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the shape step five's audit named, a note that argues from what the code should do rather than from what it does, and the audit counts this as the fourth instance in a week.&lt;/p&gt;

&lt;p&gt;It would be natural to fix it the way OI-42 was fixed, with a test that reads the document's list. The audit declined, because a test that counted the specification's bullets would be "a second home for the list", which is what the registers exist to prevent. The startup test gets away with it because the code's tuple has to exist anyway, one entry per step, and the test only compares two copies that are already there. The loader's reasons map to the bullets loosely. Some reasons serve several bullets, and some bullets are enforced by the schema before the loader sees them, so there is nothing to pair. The correction went into the register instead, and the missing bullet was found the way it could have been all along, by someone counting by hand.&lt;/p&gt;

&lt;h3&gt;
  
  
  A warning that is not a rejection
&lt;/h3&gt;

&lt;p&gt;The fix landed the same day. It is a check that logs and returns nothing. In this loader a reason code &lt;em&gt;is&lt;/em&gt; a rejection: every reason is collected into the list that fails the load. Giving the warning a reason of its own would have turned the document's warning into an error. The shape was copied from the one other load-time warning the specification asks for, which also warns inline and rejects nothing.&lt;/p&gt;

&lt;p&gt;Two choices came with it. Interlocks are left out, because two interlocks disagreeing is already refused as an error, and one disagreement reported twice under two severities leaves a reader deciding which applies. And two rules claiming the &lt;em&gt;same&lt;/em&gt; value are not warned about, following the bullet's "with different values", because they arbitrate to the same answer whichever wins. The record of the fix:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;warning there would train a reader to ignore the warning that matters.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step six was marked done later that day, and the step-five decision about tiebreaks became true as written.&lt;/p&gt;

&lt;p&gt;The criterion's last clause was settled the same day. It says every listed violation fails the build, "including the two that are errors rather than warnings". The list marks one violation as an error, one as a warning and the rest not at all, so there is no "two" for the clause to mean, and the one warning is the violation that must not fail the build. The document now says every violation reports its own message and every one except the warning fails the build, and that the warning is asserted on its message. A load that succeeds silently and one that succeeds having said why look the same to a test that only checks the exit code.&lt;/p&gt;

&lt;h3&gt;
  
  
  An empty list that meant two things
&lt;/h3&gt;

&lt;p&gt;The same audit filed another row, and building it proved the row's own diagnosis wrong.&lt;/p&gt;

&lt;p&gt;The first of the four extra cases needs a rule that never leaves warmup to leave a claim it held before the restart standing. That is the September amendment above. The row said the fixture format needed a key for a prior claim. It did not. The engine never sees standing claims. What it returns for a warming rule is "leave what stands alone", which is different from "assert nothing", and the fixture harness accepted &lt;code&gt;expect_claims: []&lt;/code&gt; against either one. So if a warming rule had regressed to withdrawing every claim on every restart, which is exactly the reading the amendment ruled out, the table would have gone on passing.&lt;/p&gt;

&lt;p&gt;The fix was a new key, &lt;code&gt;expect_untouched&lt;/code&gt;, and silence in a row became a failure. That turned the one shipped warmup row and two of the harness's own rows red until they said what they meant.&lt;/p&gt;

&lt;h2&gt;
  
  
  The seam review, after the fact
&lt;/h2&gt;

&lt;p&gt;A seam review reads one document against the others it touches and asks what each assumes of the other, and where neither says. Step six's was owed from the day the step was marked done and was written on 2 October. Its introduction sets the terms:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This step is built, and that decides the routing.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step five's review filed every finding as an open question against the document, because no code existed to have taken a position. Step six's code had already taken plenty. It had recorded eleven readings of its own while being built, as decisions in the register, and the documents had been amended for only a few of them, so much of the review's job was writing down what the code had decided and asking each document to agree or disagree. Two readings had never been written down anywhere, and the review wrote them.&lt;/p&gt;

&lt;p&gt;It filed nine questions and two pieces of owed work, and an addendum the same day filed two more questions. Four of the nine could be closed by ratifying what the build already did, and the rest needed somebody to choose. Here are five of the findings, including one where the document was clear and nothing had been built.&lt;/p&gt;

&lt;h3&gt;
  
  
  A safety net with a hole in it
&lt;/h3&gt;

&lt;p&gt;The published copy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;expires_in&lt;/code&gt; on a claim is a safety net, not a mechanism. It bounds the damage if a rule stops evaluating for a reason nobody anticipated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A rule's unchanged claim only gets its expiry moved forward when the rule evaluates, and a rule only evaluates when something wakes it. So a claim whose &lt;code&gt;expires_in&lt;/code&gt; is shorter than the gap between two wakes is deleted by the expiry sweep while the rule's condition still holds, and nothing puts it back until the trigger next fires.&lt;/p&gt;

&lt;p&gt;The document's own example does this. The rule at the top of &lt;em&gt;The Rules Engine&lt;/em&gt; has &lt;code&gt;expires_in: 20m&lt;/code&gt; on a &lt;code&gt;transition&lt;/code&gt; trigger. If neither input moves for twenty minutes, the claim lapses while the flow is still above 35.&lt;/p&gt;

&lt;p&gt;The one rule that shipped then had already worked this out. Its file declares no expiry, and says why:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An expiry shorter than that would switch the unit off in a hot room between two evaluations&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That fixed one rule and documented the problem for nobody else. This finding changed the code. A rule that is waiting now has its claims kept alive by the core, at half the shortest &lt;code&gt;expires_in&lt;/code&gt; it declares, without evaluating it, logging anything or touching arbitration. A new exit criterion holds it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nobody chose this
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;Watchdog &amp;amp; Derived Points&lt;/a&gt;&lt;/em&gt; damps a point that keeps crossing between &lt;code&gt;live&lt;/code&gt; and &lt;code&gt;stale&lt;/code&gt;. Past a threshold, "further transitions coalesce until it settles", so that a rule watching the point's staleness does not fire endlessly. Three things in the build then met:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a damped transition wakes no rule&lt;/li&gt;
&lt;li&gt;a rule that has evaluated waits to be woken&lt;/li&gt;
&lt;li&gt;when the point settles, the core writes one &lt;code&gt;flapping&lt;/code&gt; event to the control log and publishes nothing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put a rule on a sensor that starts to flap and then dies. Its last evaluation was on a published &lt;code&gt;live&lt;/code&gt; reading. The final drop to &lt;code&gt;stale&lt;/code&gt; happens while the point is damped, so it wakes nothing, and the settle wakes nothing either. The rule goes on holding the decision it made while the sensor was alive, and its input-loss policy is never applied. For a fail-safe interlock, that is a cutout that does not assert on a dead sensor.&lt;/p&gt;

&lt;p&gt;The review's verdict:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No &lt;code&gt;D-*&lt;/code&gt;: nobody chose this. Each of the three is right alone, and the gap is that neither document says what a settle tells the things that were kept quiet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This one also changed the code. When damping ends, the core now publishes one transition carrying the point's state at that moment, and that wakes whatever reads it. The test makes a point flap, lets it die while damped, and asserts exactly one transition and one wake.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two documents on one retry
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;The Rules Engine&lt;/em&gt;, on what a rule can see:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A rule's output ends at the claim. Whether the claim reached the device, whether it converged, and whether the driver was even up are the command plane's concerns, and the rule can see none of them. That is deliberate: a rule that could observe delivery would eventually be written to retry&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;, on divergence, the case where a device never reports the value it was told to take:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;surfaced as a &lt;code&gt;self&lt;/code&gt; point per writable point so that ordinary rules and dashboards can act on it&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;code&gt;self&lt;/code&gt; point is one Sentinel publishes about its own workings, readable like any sensor. A rule's inputs can be any point in the registry, and the convergence of the point it claims is one. So a rule could read whether its own write landed, which is the retry loop the first document forbids, through a point the second document publishes for rules to read. No shipped rule did. Nobody had decided either way.&lt;/p&gt;

&lt;p&gt;The answer keeps both sentences true. A rule may read delivery points in general. It may not read one about a point it claims, and the loader now refuses that.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Not on the first good reading"
&lt;/h3&gt;

&lt;p&gt;The published copy's last extra case says a fail-safe interlock releases "only once inputs are &lt;code&gt;live&lt;/code&gt; and the condition evaluates clear - not on the first good reading".&lt;/p&gt;

&lt;p&gt;Read as a dwell, that needs the rule to count readings, and the document is emphatic that a rule keeps no memory between evaluations. The build released at the first evaluation with live inputs and a clear condition, which can be the first good reading after the fault. The test for it asserted exactly that, under the criterion's own words. The reading is defensible, since the sentence goes on to require a clear condition, but nobody had written it down.&lt;/p&gt;

&lt;p&gt;It was ratified. Data returning is not enough, the condition must also be clear, and a reading that is live and clear does release. A cutout that wants to wait takes a &lt;code&gt;debounce&lt;/code&gt; or &lt;code&gt;hysteresis&lt;/code&gt; derived point as its input, which is where the published copy already sends anything that needs memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  The sentence that belonged to the other document
&lt;/h3&gt;

&lt;p&gt;The one finding where the document was clear and nothing was built. &lt;em&gt;The Command Plane&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Any point marked &lt;code&gt;interlock_protected&lt;/code&gt; gets &lt;code&gt;require_intent&lt;/code&gt; implicitly, and the load fails if it has no default.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The point is that a protective point can never be left with nothing asserting a state. The loader set the interlock flag after every other check had run, and nothing set &lt;code&gt;require_intent&lt;/code&gt; or looked for a default. An interlock on a point with neither loaded cleanly.&lt;/p&gt;

&lt;p&gt;The review's explanation is that the check belonged to neither list a reader would look in. Descriptor validation runs before the rules are read, so it cannot know which points an interlock protects. &lt;em&gt;The Rules Engine&lt;/em&gt;'s load-time list does not carry the sentence, because the sentence is &lt;em&gt;The Command Plane&lt;/em&gt;'s. And the shared test point declares both fields, so every interlock test loaded. It was fixed on the day the review filed it.&lt;/p&gt;

&lt;p&gt;One of the review's findings is still open. It turns on &lt;em&gt;Observability&lt;/em&gt;, which publishes on 25 November, and it waits for that.&lt;/p&gt;

&lt;h2&gt;
  
  
  What reading after cost
&lt;/h2&gt;

&lt;p&gt;Reading after the build found real defects. A rule's claim could lapse in a hot room, an interlock could stay silent on a dead sensor, and a protected point could load with nothing behind it. Each was fixed on the day it was filed. None is known to have done any harm, partly because no interlock rule ships and the one rule that existed then declared no expiry.&lt;/p&gt;

&lt;p&gt;The difference from step five is in who made the decisions, and when. Step five's review read documents that no code depended on, so each answer was argued on the merits with the next document open. Step six's review read documents the code had already answered. Four of its nine questions were closed by writing down what the build did and getting the document to say the same.&lt;/p&gt;

&lt;p&gt;On this project, "the build" means a coding agent. Sentinel's code is written almost entirely by agents, in sessions I run and steer. I approved every step before it started, and the direction at each point was mine. None of step six came out of a long session left running on its own. Approving a step still leaves the small calls inside it to whoever is writing the code. Whether losing an input should wake a rule that was not watching for it, or what becomes of a change held back by a rule's minimum interval, the agent decided as it reached the question, recorded the answer as a decision, and carried on. Eleven calls in step six were recorded that way. Two more, one of them when a fail-safe interlock lets go, were made in the code and written down nowhere until the seam review.&lt;/p&gt;

&lt;p&gt;So reading after is quicker, and it is honest about what happened, because most of those calls were written down. What it gives up is timing. Each call was made against the code in front of it, and the seam review, nearly three weeks later, was the first time any of them was weighed against the rest of the specification.&lt;/p&gt;

&lt;p&gt;OI-42 is the useful contrast. It was found by reading, before the rules engine existed, and by the time step six needed a place in startup there was one.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-security-model/" rel="noopener noreferrer"&gt;The Security Model&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The specification's ninth part: why the bus rather than the API is the primary control surface, which makes subject-scoped bus permissions the real authorisation model, what the design defends against in descending order of likelihood, and why mTLS is deliberately absent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next entry - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-believed-not-checked/" rel="noopener noreferrer"&gt;Believed, Not Checked&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; &lt;em&gt;The Security Model&lt;/em&gt; read against the build: a document with no build step of its own, whose gaps turned up when the real thing first ran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>buildinpublic</category>
      <category>programming</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Sentinel: The Core Runtime</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 11 Nov 2026 00:25:11 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-the-core-runtime-4hkk</link>
      <guid>https://dev.to/virorum/sentinel-the-core-runtime-4hkk</guid>
      <description>&lt;p&gt;Run two Sentinel cores against the same message stream and nothing fails. The durable consumer they both bind to splits the observations between them, so each builds its picture of the estate from half the data, and both report healthy. The timer wheel in &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;Watchdog &amp;amp; Derived Points&lt;/a&gt;&lt;/em&gt;, the single arbitration resolver in &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt; and the interlocks in &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt; all assume this never happens, and none of them says what guarantees it. This part does.&lt;/p&gt;

&lt;p&gt;Most of the rest is what having only one core costs. While it is down the message stream has to hold everything, so the buffers are sized for a four-hour outage, and how long the backlog takes to drain afterwards depends on how busy the core normally is: an hour at 20% utilisation, sixteen hours at 80%. When it falls behind there is no second core to share the load. A core that is down protects nothing, so protection that has to survive it belongs in a local device and not in a rule.&lt;/p&gt;

&lt;p&gt;Nearly every figure here is a design target rather than a measurement, and the document says so. The one the rest of the arithmetic depends on, how many observations a second the core can sustain, is still unmeasured, and the exit criteria end by asking for it, so that the four-hour figure can be checked instead of assumed.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; single writer as a requirement and what breaks when two cores run; the advisory lock and the startup order that takes it first; failing fast when the lock is lost; the core epoch and fencing the bus; the scale targets and the observation rates behind them; the difference between a planned restart and a tolerable unplanned outage; buffer sizing and the drain arithmetic; how the system behaves during a drain, including the pause on warmup deadlines; backpressure, meaning lag read from the consumer's pending count, a full stream that rejects rather than discards, and the poll schedule as the only valve; what stops while the core is down; restart time; the rule against interlocks at a site that can be partitioned from the core; and multiple cores as a recorded non-goal. It does not own the staleness suppression mechanism and its constraints, the startup grace, the recovery rule for late observations, or the strategies for bounding rehydration, which belong to &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;; the driver's epoch tracking and its local disk queues, which belong to &lt;em&gt;Driver Contract&lt;/em&gt;; what the core does with a &lt;code&gt;stale_epoch&lt;/code&gt; rejection, which belongs to &lt;em&gt;Command Plane&lt;/em&gt;; the input-loss policies and warmup themselves, which belong to &lt;em&gt;Rules Engine&lt;/em&gt;; or retention and compression, which belong to &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The core is a single process, and exactly one instance of it runs at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Single writer is a requirement, not an assumption
&lt;/h2&gt;

&lt;p&gt;Five mechanisms already assume it: the in-memory projection is authoritative, the timer wheel holds freshness deadlines, the JetStream consumer is durable and single, verification timers are core-side, and the arbitration resolver is the only writer of &lt;code&gt;point_desired&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two cores would not degrade gracefully. They would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Split the observation stream rather than duplicate it.&lt;/strong&gt; Two consumers bound to the same durable consumer each receive a share of the messages. Each core would build a projection from half the data and believe it complete. This is the worst of the failure modes because nothing errors — both cores look healthy and both are wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double-fire commands.&lt;/strong&gt; Two arbitration resolvers reaching the same conclusion issue two writes; reaching different conclusions issue contradictory ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate timer firing.&lt;/strong&gt; Two watchdogs expiring the same deadline, two verification timers on one command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the first failure is silent, the requirement is enforced mechanically. A convention that only one runs is not enforcement, and the day it is violated is the day someone starts a second instance to test something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enforcement: an advisory lock, not a lease
&lt;/h2&gt;

&lt;p&gt;A Postgres session-level advisory lock, held on a dedicated connection for the process lifetime, taken before anything else happens.&lt;/p&gt;

&lt;p&gt;This is preferred over a lease in NATS KV for one reason: there is no timeout to tune. A lease requires choosing a renewal interval and an expiry, and getting that wrong produces either a slow failover or a window where two cores both believe they hold it. An advisory lock is released by the database when the connection dies, so liveness is delegated to TCP and to Postgres rather than to a chosen number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Acquisition order at startup:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect to Postgres, acquire the advisory lock, or exit&lt;/li&gt;
&lt;li&gt;Increment and read the core epoch (below)&lt;/li&gt;
&lt;li&gt;Load vocabularies and registry&lt;/li&gt;
&lt;li&gt;Load and restore the projection&lt;/li&gt;
&lt;li&gt;Bind the JetStream durable consumer&lt;/li&gt;
&lt;li&gt;Start the watchdog, derived points and verification timers&lt;/li&gt;
&lt;li&gt;Start the command plane and the API&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Nothing may bind the consumer before the lock is held.&lt;/strong&gt; Binding the consumer (step 5) only after taking the lock (step 1) is the whole reason for writing this list down. A core that binds first and locks second has already stolen messages from the running instance before it discovers it should not be there.&lt;/p&gt;

&lt;p&gt;A core that cannot acquire the lock exits non-zero immediately. It does not wait, retry in a loop, or start in a read-only mode. Under a supervisor this produces a restart loop, which is visible; a silently idle second core is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Losing the lock while running
&lt;/h2&gt;

&lt;p&gt;Fail fast. On detecting that the lock is gone — connection death, or a periodic ownership check — the core stops publishing commands, stops consuming, and exits non-zero. No draining, no finishing the batch in flight, no degraded read-only mode.&lt;/p&gt;

&lt;p&gt;A core that has lost the lock has, by definition, possibly been replaced. Anything it does from that moment is a second writer. An uncommitted batch is not a loss: the messages are unacked and will be redelivered, and the dedup key makes redelivery harmless.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fencing the bus
&lt;/h2&gt;

&lt;p&gt;The advisory lock protects Postgres. It does not protect NATS, and the dangerous window is exactly the one it cannot cover: core A is partitioned from Postgres, its lock is released, core B acquires it and starts, and core A has not yet noticed because its TCP socket has not timed out. For that interval, core A can still publish on &lt;code&gt;cmd.&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So commands carry a &lt;strong&gt;core epoch&lt;/strong&gt;: a monotonically increasing integer stored in Postgres and incremented on each successful lock acquisition. Drivers track the highest epoch they have seen and reject any command carrying a lower one, with outcome &lt;code&gt;rejected&lt;/code&gt; and reason &lt;code&gt;stale_epoch&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is one integer in the command envelope and one comparison in the driver, and it is the only thing standing between a partitioned core and a relay pulsing on the instructions of a process that has already been replaced. The epoch is also stamped on every &lt;code&gt;control_event&lt;/code&gt;, which makes "which core did this" answerable after the fact.&lt;/p&gt;

&lt;p&gt;Drivers do not need to know what an epoch means, only that it never goes backwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scale targets
&lt;/h2&gt;

&lt;p&gt;Every number below is a design target rather than a measurement. They exist so that the sizing arithmetic has terms, and so that a future measurement has something to disagree with.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;quantity&lt;/th&gt;
&lt;th&gt;target&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;devices&lt;/td&gt;
&lt;td&gt;200+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;network segments, and therefore driver hosts&lt;/td&gt;
&lt;td&gt;16+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;device timeseries points&lt;/td&gt;
&lt;td&gt;2,000+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;derived points&lt;/td&gt;
&lt;td&gt;1,000+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;self-points&lt;/td&gt;
&lt;td&gt;~700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;total points&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~4,000&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Self-points are the points the system publishes about itself. Their figure is the one most easily forgotten, and it is not small: roughly two per device, seven per driver host, one convergence point per writable point, and the core's own signals. They are points in every respect, so they consume registry entries, timer-wheel slots, storage and ingest capacity like any other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Observation rate.&lt;/strong&gt; Three tiers, and the middle one dominates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a handful of points at 1 Hz — liveness, air quality, heart rate&lt;/li&gt;
&lt;li&gt;the bulk at roughly 10 s&lt;/li&gt;
&lt;li&gt;a few hundred hourly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That works out at &lt;strong&gt;~220 observations/second&lt;/strong&gt; steady state, of which the 1 Hz points are around 5%. The design figure is &lt;strong&gt;500/s&lt;/strong&gt;, leaving room for the fleet growing and for the 10 s tier tightening, which is the parameter the whole figure is sensitive to: at 5 s the rate doubles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storage figures&lt;/strong&gt;, all following from the above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;~19M raw rows/day, ~40 GB rolling under a 90-day retention with compression from day seven&lt;/li&gt;
&lt;li&gt;~5.3M rows/day in the minutely continuous aggregate, which is the long-term storage driver rather than the raw table&lt;/li&gt;
&lt;li&gt;~4,000 timer-wheel entries, well inside a single wheel's design&lt;/li&gt;
&lt;li&gt;~1,000 rehydration queries at cold start, which is the restart time almost in its entirety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sustainable ingest throughput is the one term still unmeasured&lt;/strong&gt;, and it is the term utilisation depends on. Per-observation validation, registry lookup and unit conversion in application code is where the ceiling sits, not in Postgres. It is measured against the 500/s design figure before the stream is sized, rather than assuming the batch insert path is the limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two different outage numbers
&lt;/h2&gt;

&lt;p&gt;These are not the same quantity, and conflating them sizes the buffer against the wrong case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Planned restart&lt;/strong&gt; is lock release plus cold start: minutes, dominated by derived-point rehydration. This is what an upgrade costs, and &lt;em&gt;Restart time&lt;/em&gt; below covers it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tolerable unplanned outage&lt;/strong&gt; is how long the core can be down without losing data — hardware failure with nobody around, or a fault in the middle of the night. The working figure is &lt;strong&gt;four hours&lt;/strong&gt;, with the expectation that the real case is usually far shorter.&lt;/p&gt;

&lt;p&gt;Only the second sizes the buffer. Sizing the stream against restart time would leave the system losing data in exactly the scenario it cannot control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Buffer sizing
&lt;/h2&gt;

&lt;p&gt;While the core is down, drivers publish normally and the observation stream absorbs everything. The stream is the first buffer; the drivers' local disk queues are the second, engaged only once the stream is full and rejecting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The stream is bounded by bytes and messages only, never by age.&lt;/strong&gt; A &lt;code&gt;max_age&lt;/code&gt; limit deletes the oldest messages silently once they pass the age, regardless of whether anything has consumed them, which is precisely the middle-of-the-chain loss that rejecting on full was chosen to avoid (see &lt;em&gt;Where the loss goes&lt;/em&gt; below). The stream size is derived from observation rate, not expressed as a duration limit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recovery is set by headroom, not by outage length.&lt;/strong&gt; After an outage of length &lt;code&gt;O&lt;/code&gt;, the core drains the backlog while new observations keep arriving. With &lt;code&gt;C&lt;/code&gt; the sustainable core throughput, and steady-state utilisation &lt;code&gt;u&lt;/code&gt; the ingest rate divided by &lt;code&gt;C&lt;/code&gt;, the drain takes &lt;code&gt;O × u/(1-u)&lt;/code&gt; and the peak backlog reaches &lt;code&gt;O/(1-u)&lt;/code&gt; of steady-state volume.&lt;/p&gt;

&lt;p&gt;For a four-hour outage:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;utilisation&lt;/th&gt;
&lt;th&gt;drain time&lt;/th&gt;
&lt;th&gt;buffer needed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;td&gt;1 hour&lt;/td&gt;
&lt;td&gt;5 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;50%&lt;/td&gt;
&lt;td&gt;4 hours&lt;/td&gt;
&lt;td&gt;8 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80%&lt;/td&gt;
&lt;td&gt;16 hours&lt;/td&gt;
&lt;td&gt;20 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At 80% the system takes four times the outage to recover and needs five times the outage in buffer, which is how a system that looked fine in steady state turns a short fault into most of a day. Recovery within an hour of a four-hour outage requires running at roughly 20%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At the scale targets above, this is comfortable, and the stream is sized generously rather than carefully.&lt;/strong&gt; Provided sustainable throughput is anywhere above about 1,000/s, utilisation sits under 25%, a four-hour outage drains inside 80 minutes, and the buffer requirement is roughly 5.3 hours of steady state — &lt;strong&gt;8M messages and 4 GB&lt;/strong&gt;, which is cheap enough that rounding up costs nothing and buys margin against the throughput figure being worse than assumed.&lt;/p&gt;

&lt;p&gt;Two refinements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drain throughput is usually better than steady-state throughput&lt;/strong&gt;, because batches fill completely rather than flushing on the 100 ms timer. So treating &lt;code&gt;C&lt;/code&gt; as the steady-state figure is conservative in the right direction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The total buffer is the stream plus the sum of the driver queues&lt;/strong&gt;, so the requirement can be split between them. The stream is the better place for it, though, because a driver queue filling means that host is also at risk of losing data on its own bound.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Draining
&lt;/h2&gt;

&lt;p&gt;The system behaves correctly during a drain, and this is worth stating because it looks alarming.&lt;/p&gt;

&lt;p&gt;Replayed observations carry their original &lt;code&gt;observed_at&lt;/code&gt;, which is older than the current deadline, so under the recovery rule in &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt; they do not clear staleness. Points do not reach &lt;code&gt;live&lt;/code&gt; until the backlog is worked through and genuinely current data arrives. Rules stay in warmup and the system declines to automate until it has caught up, rather than making four hours of retrospective decisions in ninety seconds.&lt;/p&gt;

&lt;p&gt;That is the design working rather than a fault. Two things must hold for it to keep working:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Staleness evaluation is suppressed while lag is high&lt;/strong&gt;, as described below, so the drain does not also produce a fleet-wide staleness cascade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Warmup deadlines pause under the same condition.&lt;/strong&gt; &lt;code&gt;warmup: deadline(60s)&lt;/code&gt; exists to stop a rule waiting forever for an input that is never coming. During a drain the input is coming, just not yet, and letting the deadline expire makes rules evaluate under their input-loss policy while the data they need sits in the queue. Safe, but premature, and for the wrong reason. The pause is the same principle as the suppression: a core-internal condition must not drive device-level decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Backpressure
&lt;/h2&gt;

&lt;p&gt;Single writer determines the shape of this before any policy is chosen: &lt;strong&gt;the usual answer is unavailable.&lt;/strong&gt; When a consumer cannot keep up, the standard response is to add consumers, and there is exactly one core by construction. Backpressure here is solved by shedding load or by going faster, never by scaling out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lag is already measured, for free.&lt;/strong&gt; Because ingest acks after commit, the durable consumer's pending count is the lag, and the age of its oldest unacked message is the second half of the picture. No separate instrumentation is needed and no watermark table exists to disagree with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A backlog survives a restart.&lt;/strong&gt; Resuming from the ack position is what makes restart correct, and it also means a backlog cannot be cleared by bouncing the core. Draining or discarding is a deliberate operation, never a side effect of a restart.&lt;/p&gt;

&lt;h3&gt;
  
  
  A slow core must not look like a dead fleet
&lt;/h3&gt;

&lt;p&gt;This is the failure that makes backpressure a safety concern rather than a throughput concern.&lt;/p&gt;

&lt;p&gt;Freshness is computed from &lt;code&gt;observed_at&lt;/code&gt;. If the core is ten minutes behind, every point in the system passes its deadline and goes &lt;code&gt;stale&lt;/code&gt; while its data sits queued and perfectly healthy on the bus. Rules with &lt;code&gt;on_input_loss: release&lt;/code&gt; drop their claims. Fail-safe interlocks assert. The system takes protective action across the entire estate because ingest is slow, which is close to the worst available response and is entirely self-inflicted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The watchdog therefore suppresses staleness while ingest lag is high&lt;/strong&gt;, in the same shape as the startup grace it already implements. In both cases the absence of data is a fact about the core rather than about the device, and reporting it as device staleness is a lie. The mechanism and its three constraints are in &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where the loss goes when it has to go somewhere
&lt;/h3&gt;

&lt;p&gt;The observation stream rejects new publishes when full, rather than discarding old messages. That choice puts the loss at one end of the chain instead of silently in the middle.&lt;/p&gt;

&lt;p&gt;A full stream means drivers fail to publish, fall back to their local disk queues, and those queues are bounded by size and age with a drop count published as a self-point. So there is exactly one place in the whole path where data is dropped, it is bounded by chosen numbers, and it announces itself. Discarding old messages instead would delete observations that were already accepted, between components that both believe the handoff succeeded.&lt;/p&gt;

&lt;h3&gt;
  
  
  The valve is the poll schedule
&lt;/h3&gt;

&lt;p&gt;There is no load-shedding mechanism inside the core, deliberately. The deadband does not help, because every poll publishes regardless of whether the value changed — the deadband decides what counts as an edge, not what reaches the bus.&lt;/p&gt;

&lt;p&gt;The lever that does exist is the assignment: poll intervals are pushed over the bus and applied without restarting, so raising intervals across a fleet is a config change that takes effect in seconds. That is the response to sustained lag, alongside making ingest faster.&lt;/p&gt;

&lt;p&gt;It stays manual. An automatic feedback loop between ingest lag and collection rate would be a control system nobody specified, tuned by nobody, changing what the data means during the exact period when it is being diagnosed.&lt;/p&gt;

&lt;h2&gt;
  
  
  While the core is down
&lt;/h2&gt;

&lt;p&gt;This is worth stating plainly, because it defines what the availability target has to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collection continues.&lt;/strong&gt; Driver hosts keep polling, the stream absorbs the backlog, and the local queues take over if it fills. Nothing is lost that the bounds above do not lose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Devices hold their last commanded state.&lt;/strong&gt; Nothing reverts, because nothing is driving them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No automation.&lt;/strong&gt; No rules evaluate, no derived points compute, no freshness deadlines fire, no commands are issued or verified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No interlock protection.&lt;/strong&gt; A fail-safe interlock is a claim held by a rule inside the core. If the core is not running, the rule is not evaluating and the protection is not being applied.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point is the honest cost of a single-writer design. Protection that must survive the core being down cannot be implemented in the core.&lt;/p&gt;

&lt;h2&gt;
  
  
  Restart time
&lt;/h2&gt;

&lt;p&gt;Cold start, the larger part of a planned restart, is almost entirely derived-point rehydration: at the scale targets above, roughly a thousand queries against the raw tables, some of them reaching into compressed chunks. The strategies for keeping that bounded are in &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Restart time is to be measured rather than estimated, and it is the number to keep small for two reasons: it is what an upgrade costs, and a long cold start makes the four-hour figure harder to meet, since recovery is cold start plus drain.&lt;/p&gt;

&lt;p&gt;Zero-downtime upgrade is not available under this design and is not pursued. Achieving it means two cores running simultaneously during handover, which is precisely what the epoch and the lock exist to prevent. The realistic improvement is a shorter cold start, not an overlapping one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Geographic split
&lt;/h2&gt;

&lt;p&gt;A second site that occasionally loses contact with the first is a driver-plane concern, not a reason for a second core.&lt;/p&gt;

&lt;p&gt;During a partition the remote site's driver hosts keep collecting and buffering exactly as they would through any other outage, and replay when the link returns. The observations are not lost. What is lost is control: rules and the command plane are at the core, so the remote site has no automation for the duration, and any claim on its points sits &lt;code&gt;undeliverable&lt;/code&gt; until the link returns.&lt;/p&gt;

&lt;p&gt;This is tolerable for most things and unacceptable for one: &lt;strong&gt;interlock-band protection must not be placed on points at a site that can be partitioned from the core.&lt;/strong&gt; An interlock that is unenforced whenever the link drops is not protection, and worse, it reads as protection in the rule set.&lt;/p&gt;

&lt;p&gt;A remote site needing protection that survives partition gets a local device that does not depend on the network — a mechanical thermostat, a hardware cutout, a relay with its own logic — reported into this system as a point so its state is visible, but not driven by it. That is cheaper, more reliable and easier to reason about than a distributed control plane, and it fails in the right direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-goal: multiple cores
&lt;/h2&gt;

&lt;p&gt;This is recorded so the absence reads as a decision, with the conditions that would reopen it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-downtime upgrades.&lt;/strong&gt; Would require overlapping instances. Revisit only if measured cold-start time becomes operationally intolerable, and prefer reducing it first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Geographic redundancy.&lt;/strong&gt; Handled above by buffering plus local protective devices. Revisit if a remote site acquires a control requirement that genuinely cannot be met locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are real, neither is pressing, and a multi-core design would need distributed arbitration, distributed timers and a story for a split-brain claim set. That is a different system, and it should be entered deliberately rather than arrived at by adding a second instance one afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;Single writer is enforced rather than assumed, which means it has to be demonstrated rather than asserted in prose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A second core cannot start, and cannot steal messages before it discovers that.&lt;/strong&gt; Start one core, start another, and assert not only that the second exits non-zero but that it never bound the JetStream consumer. The exit is the visible part; the ordering is the part that matters, and a test that only checks the exit code would pass an implementation that locks after binding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lock loss mid-run exits the process.&lt;/strong&gt; Drop the advisory-lock connection and assert the core stops publishing commands, stops consuming, and exits non-zero, with any uncommitted batch redelivered on the next start rather than half-applied.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The epoch never goes backwards&lt;/strong&gt;, increments only on lock acquisition, and appears on every &lt;code&gt;control_event&lt;/code&gt; written. Together with the driver-side rejection test in &lt;em&gt;Driver Contract&lt;/em&gt;, that closes the fencing path end to end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drain behaves.&lt;/strong&gt; Build a backlog, restart, and assert that points do not reach &lt;code&gt;live&lt;/code&gt; from replayed observations, that rules stay in warmup, and that no commands are issued from data that is hours old. This is the behaviour that looks alarming and is correct, so it needs a test that says so.&lt;/p&gt;

&lt;p&gt;Two figures to measure and record rather than assert:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sustainable ingest throughput&lt;/strong&gt; against the 500/s design rate. Everything in the buffer and recovery arithmetic waits on this number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cold-start duration&lt;/strong&gt;, per startup step, with rehydration broken out since it is the term that grows with the rule set.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once both exist, the stream size and the recovery time stop being estimates and the four-hour figure becomes checkable rather than aspirational.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;On Monday - the &lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-reading-after-the-build/" rel="noopener noreferrer"&gt;Dev Diary&lt;/a&gt;.&lt;/strong&gt; Build step six, read against &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;, and this part's startup order read against what was built.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-security-model/" rel="noopener noreferrer"&gt;The Security Model&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the bus rather than the API is the primary control surface, which makes subject-scoped bus permissions the real authorisation model, what the design defends against in descending order of likelihood, and why mTLS is deliberately absent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel Dev Diary: Read First, Run Second</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 09 Nov 2026 09:13:29 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-read-first-run-second-2id7</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-read-first-run-second-2id7</guid>
      <description>&lt;p&gt;Build step five of &lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/#what-is-sentinel" rel="noopener noreferrer"&gt;Sentinel&lt;/a&gt; is the command plane: the claim set and the arbitration over it, the command record and the path that issues it, verification, fencing, and the API a person uses to ask for a write. It is the step where the system stops only watching devices and starts changing them. The document that owns it, &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;, was published here on 7 October.&lt;/p&gt;

&lt;p&gt;The last two entries said this one would cover where the specification and the build disagree, and which of the two had to change. For step four the answer was usually both. For step five it splits cleanly by when each gap was found. Everything found by reading, before there was any code, changed the document. Everything found by running the code changed the code, and in every case the mechanism had not been run by anybody before.&lt;/p&gt;

&lt;p&gt;Step five is also the first step whose seam review came before the build rather than after it. Entry five held back what that review found until the document it was about had been published. That has happened now, so this entry starts there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Found before any code
&lt;/h2&gt;

&lt;p&gt;A seam review reads each document against the ones it touches and asks what each assumes of the other, and where neither says. The one for &lt;em&gt;The Command Plane&lt;/em&gt; ran on 7 September, the day before step five's first commit. Its method section explains why that timing mattered:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Findings are &lt;code&gt;OI-*&lt;/code&gt; without exception - none gets a &lt;code&gt;D-*&lt;/code&gt;, because no code has been written and so no reading has been taken.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An &lt;code&gt;OI-*&lt;/code&gt; is an open question against the specification; a &lt;code&gt;D-*&lt;/code&gt; is a decision recorded because the code had to pick something. The review found four. One of them is about a document that publishes on Wednesday and waits for it. These are the other three.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two vocabularies for one key
&lt;/h3&gt;

&lt;p&gt;The published copy, on what an interlock does when it cannot evaluate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;heatsink-overtemp&lt;/span&gt;
  &lt;span class="na"&gt;band&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;interlock&lt;/span&gt;
  &lt;span class="na"&gt;interlock_class&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;thermal&lt;/span&gt;
  &lt;span class="na"&gt;on_input_loss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fail_safe&lt;/span&gt;
  &lt;span class="na"&gt;fail_value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;, published last Wednesday, introduces its own input-loss policy as "the same fork as interlocks" and lists &lt;code&gt;release&lt;/code&gt;, &lt;code&gt;hold&lt;/code&gt; and &lt;code&gt;assert(value)&lt;/code&gt;. That is three names against two, and none of them is shared. Both documents put the key on the same object, a rule in the registry, and an interlock is a rule. So one loader would have had to parse one key against two grammars.&lt;/p&gt;

&lt;p&gt;The two vocabularies line up in pairs, &lt;code&gt;fail_safe&lt;/code&gt; with &lt;code&gt;assert&lt;/code&gt; and &lt;code&gt;fail_clear&lt;/code&gt; with &lt;code&gt;release&lt;/code&gt;. The third value has no partner, and the review called it the part with teeth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;hold&lt;/code&gt; exists only in &lt;em&gt;Rules Engine&lt;/em&gt;, and an interlock is a rule ... If it is legal, &lt;code&gt;hold_max: 30m&lt;/code&gt; means a cutout keeps asserting for half an hour on data it knows is stale&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It survived because &lt;em&gt;The Rules Engine&lt;/em&gt; uses both vocabularies itself: the list in one section, and &lt;code&gt;fail_safe&lt;/code&gt; with &lt;code&gt;fail_value&lt;/code&gt; in its warmup prose and its exit criteria. Read alone, each document is consistent.&lt;/p&gt;

&lt;p&gt;The review proposed keeping both spellings as accepted values. That was rejected when the question was settled three days later, because two spellings a loader must both accept are two grammars on one key, which is the problem the question was filed about. There is now one set, &lt;code&gt;release&lt;/code&gt;, &lt;code&gt;hold&lt;/code&gt; and &lt;code&gt;assert&lt;/code&gt;, defined in &lt;em&gt;The Rules Engine&lt;/em&gt;. &lt;em&gt;The Command Plane&lt;/em&gt; keeps fail-safe and fail-clear as the names of the two answers to its own question, which way protective cuts. &lt;code&gt;fail_value&lt;/code&gt; became &lt;code&gt;assert_value&lt;/code&gt;, because &lt;em&gt;fail&lt;/em&gt; is the interlock's word and an ordinary rule taking a defensive position has no failure in it. &lt;code&gt;hold&lt;/code&gt; is refused at load for &lt;code&gt;band: interlock&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;None of this could be tested at the time, and the resolution says so: the rule loader is step six, so nothing in the code parsed either vocabulary yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  A limit read from a field that does not exist
&lt;/h3&gt;

&lt;p&gt;The published copy lists what the core rejects before anything is queued. The last item:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;rate limit per point&lt;/strong&gt;, from the descriptor - a physical relay has a duty cycle, and this is the last defence against a rule loop wearing out hardware&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-semantic-model/" rel="noopener noreferrer"&gt;The Semantic Model&lt;/a&gt;&lt;/em&gt; owns the descriptor and prints its writable fields in full. There are five, and none of them is a rate, a duty cycle, a minimum interval or a cooldown. Every other descriptor field &lt;em&gt;The Command Plane&lt;/em&gt; relies on is there, which made this one an omission rather than a different design. And it could not be the driver's, because a duty-cycle limit is a timer and &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-driver-contract/" rel="noopener noreferrer"&gt;The Driver Contract&lt;/a&gt;&lt;/em&gt; forbids a module to hold timers.&lt;/p&gt;

&lt;p&gt;Adding the field was the easy half. The descriptor gained &lt;code&gt;min_write_interval&lt;/code&gt;, optional, a minimum interval rather than a count per window, "because one number is what a datasheet gives".&lt;/p&gt;

&lt;p&gt;The review had asked a second question as well: what a breach does. Answering it moved the check out of the list it was printed in. The other three checks in that list refuse requests that can never succeed. A sensor does not become writable. A rate limit refuses a request that will succeed a minute later. The paragraph just below the list in the published copy already made that distinction for deliverability, "Deliverability is checked here too, but it is not a rejection", so the rate limit moved beside it. A held-back write is reconsidered on the next pass like any other owed write.&lt;/p&gt;

&lt;p&gt;Two more things came with it. An interlock is exempt, because a duty cycle is about wear across many cycles and a late cutout is the worst failure available. And a point with no &lt;code&gt;min_write_interval&lt;/code&gt; has no limit, which the document now states as a weakness: a fleet-wide default would be a number nobody owns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Command state with nowhere to live
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;The Command Plane&lt;/em&gt; needs state that outlives a single command. It asks for one in-flight command per point with the rest queued, coalescing of the queue, and this on restart:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Anything in &lt;code&gt;sent&lt;/code&gt; or &lt;code&gt;verifying&lt;/code&gt; at shutdown is marked &lt;code&gt;timeout&lt;/code&gt; on recovery&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That requires knowing what was in &lt;code&gt;sent&lt;/code&gt; or &lt;code&gt;verifying&lt;/code&gt;. The specification declared nine tables across two documents and none of them was a command. Command &lt;em&gt;events&lt;/em&gt; had a home in the control log, which is append-only and kept forever, but that log had no &lt;code&gt;command_id&lt;/code&gt; column. Working out "what is in flight now" would have meant folding a lifetime of events through a JSON key to answer a question about the last few seconds.&lt;/p&gt;

&lt;p&gt;The review's first draft got this wrong. It said no document says where commands are stored, and had to be corrected: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-ingest-path-and-log-schema/" rel="noopener noreferrer"&gt;Ingest Path and Log Schema&lt;/a&gt;&lt;/em&gt; says plainly where command events go. What has no home is their current state.&lt;/p&gt;

&lt;p&gt;Both answers needed a migration, so cost did not decide it. The serialiser did. One in-flight command per point, as a partial unique index on a &lt;code&gt;command&lt;/code&gt; table, is a constraint the database keeps across a restart. As a fold over the log, it is something the core rebuilds in memory at the moment it is least able to, coming back with a queue half sent. Step five built the table the day after the review, and &lt;em&gt;Ingest Path and Log Schema&lt;/em&gt; printed it a week later, copied from the migration rather than written for the document.&lt;/p&gt;

&lt;h3&gt;
  
  
  What reading first bought
&lt;/h3&gt;

&lt;p&gt;Each of these became a paragraph or two of specification, written by someone weighing two readings with no code depending on either. The review's last line:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nothing here is code that is owed, and nothing has been routed around - which is the entire value of having looked before step 5 rather than during it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Found by running it
&lt;/h2&gt;

&lt;p&gt;The rest of step five's findings came from the code, and two of them came from probing a criterion rather than reading the line that said it passed.&lt;/p&gt;

&lt;h3&gt;
  
  
  A note that explained the amber away
&lt;/h3&gt;

&lt;p&gt;The published copy on fencing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a stale epoch means two cores existed and one of them was still issuing commands. It escalates rather than retrying.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The exit criterion for it was marked amber, partly met, with a note explaining why that was fine. The core "does not retry it, which is trivially true of a core with no retry".&lt;/p&gt;

&lt;p&gt;Both halves were false. On 10 September the criterion was probed directly. After a driver refused a command as &lt;code&gt;stale_epoch&lt;/code&gt;, the next reconcile pass issued another command, and the pass after that a third, until the retry budget ran out. Then the core reported the point &lt;code&gt;diverged&lt;/code&gt;, which says the device refused. A fenced core went on writing to a bus it was no longer entitled to, and its own record blamed the hardware.&lt;/p&gt;

&lt;p&gt;The fix says what escalating means. The point is fenced and this core never drives it again, because nothing a running core can do raises its own epoch. The core asks the database at once who holds the lock, since a driver refusing its epoch is the strongest evidence available that somebody else does. And a new signal, &lt;code&gt;core.{n}.fenced-points&lt;/code&gt;, is published, because any value above zero means two cores existed and alerting lives outside the core.&lt;/p&gt;

&lt;p&gt;It does not exit from the fence itself, and the reason is written down. The handler runs inside a NATS subscription callback, the client library catches whatever a callback raises, and there was no error callback. An exit raised there would have been swallowed. The exit stays with the periodic lock check, which the process actually watches.&lt;/p&gt;

&lt;p&gt;The step's audit drew the lesson from the note:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The marker was not overstating a gap; it was describing a mechanism nobody had run.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The double-click
&lt;/h3&gt;

&lt;p&gt;The published copy's whole treatment of idempotency is two sentences:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;idempotency_key&lt;/code&gt; on the intent, deduplicated over a short window. A UI double-click or a bus redelivery must not produce two commands.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The double-click was written as a test against the code as it stood, and it produced two commands. So the sentence was false rather than unbuilt. Writing the fix found five things the two sentences did not say: how short the window is, what a repeat returns, what the key is scoped to, what a repeat with a different body does, and whether a withdrawal carries a key.&lt;/p&gt;

&lt;p&gt;All five are answered, and the section is nine paragraphs now. The window is 60 seconds. A repeat returns the original answer, the same &lt;code&gt;command_id&lt;/code&gt; included, because a caller that could tell its retry from its original would be back to guessing whether the first one landed. The key is scoped to the principal. A key reused for a different request is refused, and the comparison includes the point named in the path as well as the body. Without that, one principal reusing a key on a second point would be told the first point's outcome: a write they believe happened, which never did.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code nothing called
&lt;/h2&gt;

&lt;p&gt;Entry one quoted a decision titled &lt;em&gt;A guard with no caller is not a guard&lt;/em&gt;. Entry five found the next one, derived points that were computed and never evaluated. Entry six said three resolutions had been found wrong in that shape before the first deferral audit. The other two were in this step.&lt;/p&gt;

&lt;p&gt;The first was verification. Every confirmation mode was correct and tested, by calling the verification module directly. Nothing in the running core called it. A command a driver accepted stopped at &lt;code&gt;acked&lt;/code&gt;, and because &lt;code&gt;acked&lt;/code&gt; counts as in flight, the database's one-per-point constraint refused every later write to that point for the life of the process. A restart closed the command, which bounded the damage, and is also why nobody noticed. It was found on 17 September by a session writing the developer guide from the code, without the specification open. The register row:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;every mode was proved correct in isolation ... which calls &lt;code&gt;enter&lt;/code&gt; and &lt;code&gt;on_observation&lt;/code&gt; &lt;strong&gt;directly&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second was recovery. The restart behaviour quoted above, close what the last core left, was a function that did exactly that, with tests that called it by hand. Nothing called it at startup. A migration's docstring asserted that "a core starting on this schema runs recovery before anything else". A queued command survived the restart, and could later be sent carrying the previous core's epoch, which a driver refuses as &lt;code&gt;stale_epoch&lt;/code&gt; and the core then treats as a fencing incident. The criterion it undermined had read ✅ for over two weeks.&lt;/p&gt;

&lt;p&gt;There was a third on the same day, of a slightly different kind. A rule changing a positional group, the three channels of a colour, wrote it one member at a time. Moving a light from (A, A, A) to (B, B, B) published (B, A, A) and queued two more commands behind it. The criterion that a write group is written as one command had been proved for the API a person uses, and for nothing else. A rule is a writer like any other, and nothing proved it for a rule. It was latent, since no rule claims a write group yet, and fixed in the commit that filed it.&lt;/p&gt;

&lt;p&gt;The step audit's paragraph on verification has the line I keep coming back to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the lesson did not generalise the first time&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A test of the wiring had been written after derived points, and it covered the issue path. The verification path went on having exactly the tests that finding had been about.&lt;/p&gt;

&lt;h2&gt;
  
  
  What ✅ said
&lt;/h2&gt;

&lt;p&gt;Entry five rested on one audit of the step, written once the step was done. Step five never had one. Its notes were written into the roadmap's &lt;em&gt;Build steps&lt;/em&gt; section, a paragraph at a time, by the changes they describe. On 27 September that prose was moved into the directory where the other steps' audits live, and the file opens by saying so:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Moved, not re-audited.&lt;/strong&gt; ... Nobody re-read the code against &lt;em&gt;Command Plane&lt;/em&gt; to produce it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two passages were audits, on 10 and 14 September. The rest of what this entry describes was found by other readers: the seam review before the build, a probe of one criterion, the developer guide, and the deferral audit from entry six. The file marks three statements that were false by the time it was moved, and leaves their text standing.&lt;/p&gt;

&lt;p&gt;The status marker itself was wrong in both directions. It read not started for four merges after the claim set and resolver had landed, while the component register marked each piece as it arrived. It read amber over a fencing note that explained the gap away, and ✅ over verification and recovery while both were broken. And for a while it read ✅ while seven open questions still stood against the step's own documents; the last of them were settled on 14 September. The audit's note on that says plainly what the tick means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ says the exit criteria pass, and an &lt;code&gt;OI-*&lt;/code&gt; is a gap in the &lt;em&gt;specification&lt;/em&gt; rather than in the build.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A finished step does not mean a settled document. And for this step, ✅ meant the criteria passed when somebody tried them, not that somebody had read the code against the document from start to finish.&lt;/p&gt;

&lt;h2&gt;
  
  
  What each kind cost
&lt;/h2&gt;

&lt;p&gt;The three seam findings cost a reading and an amendment each. Nothing had been built around them, so the decisions were made on the merits, with the next document open.&lt;/p&gt;

&lt;p&gt;The findings from running the code cost a defect each, and a defect has already done something by the time it is found. A fenced core wrote to a bus it no longer owned, a point refused writes until a restart, and a queued command outlived the core that queued it. The last two had tests that passed the whole time the bug stood, because those tests called the mechanism directly and nothing in the running core did.&lt;/p&gt;

&lt;p&gt;Reading could not have found those three. The rate limit could be specified properly before any code existed, but whether anything called verification could only be found by starting a core and watching what it did.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-core-runtime/" rel="noopener noreferrer"&gt;The Core Runtime&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The specification's eighth part: why only one core may run at a time, what enforces it, and what the system does while no core is running. Its startup order is what the seam finding this entry held back is about, and that finding comes the Monday after.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next entry - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-reading-after-the-build/" rel="noopener noreferrer"&gt;Reading After the Build&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Build step six, read against &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;, and the seam finding &lt;em&gt;The Core Runtime&lt;/em&gt; leaves open.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>softwaredevelopment</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel: The Rules Engine</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 04 Nov 2026 00:16:27 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-the-rules-engine-e62</link>
      <guid>https://dev.to/virorum/sentinel-the-rules-engine-e62</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;Watchdog &amp;amp; Derived Points&lt;/a&gt;&lt;/em&gt; turned staleness and derived values into ordinary transitions on ordinary points, and &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt; took commands away from rules altogether. That leaves the rules engine very little to do. A rule watches a few points, evaluates a condition when one of them changes, and holds a claim while the condition is true.&lt;/p&gt;

&lt;p&gt;A rule keeps no state between evaluations. It sees the current value and quality of each input, without timestamps or history, and a rule that needs a fifteen-minute average or a debounce takes a derived point as an input instead. So every rule is a pure function of what it reads. A restart can't leave a latch out of step with the world, and a test is a snapshot of inputs and the claims expected from it.&lt;/p&gt;

&lt;p&gt;A rule has two kinds of output. A claim is idempotent, and the engine diffs it against what the rule already holds, so a rule evaluated every five seconds sends nothing to arbitration until its answer changes. An action, such as a notification, is not idempotent, which is why every action must have a cooldown. Without one it will eventually fire in a loop.&lt;/p&gt;

&lt;p&gt;Restarts are the hard case. Values restored from before an outage look like real readings, so a rule waits in warmup until its inputs are live again instead of reacting to edges that never happened. Interlocks are the exception. A fail-safe interlock asserts its protective value as soon as the core starts, because warmup is when the system knows least. The engine also limits how often a rule can evaluate and how often a point's claims can change. Those limits are the backstop for a pump whose own running switches it off again, a loop that no static check will find.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; the shape of a rule, the four trigger types, level-triggered evaluation and the single pass after derived points settle, the claim diff, assertion and release, actions and their mandatory cooldown, the three input-loss policies and the bound on &lt;code&gt;hold&lt;/code&gt;, the quality a rule requires of its inputs, the warmup policies and why interlocks skip them, the per-rule evaluation limit and the per-point limit on claim changes, load-time validation of a rule set, and fixture and replay testing. It does not own the expression grammar or the derived points a rule takes as input, which belong to &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;; what a band means in arbitration, how a rule's band is checked at registry load, whether a claim reaches a device, the escalation of an interlock claim that can't be enforced, or the command rate limit, which belong to &lt;em&gt;Command Plane&lt;/em&gt;; the ingest lag that pauses a warmup deadline, which belongs to &lt;em&gt;Core Runtime&lt;/em&gt;; or the &lt;code&gt;self&lt;/code&gt; point that flips when a rule is suspended, which belongs to &lt;em&gt;Observability&lt;/em&gt;. The channel an action notifies is not defined anywhere in this specification.&lt;/p&gt;

&lt;p&gt;The engine is small by construction. Almost every trigger type a control system needs is already a derived point or a quality transition, so what remains is a predicate over transitions and a claim as output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule shape
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pump-run-on&lt;/span&gt;
  &lt;span class="na"&gt;band&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;automation&lt;/span&gt;

  &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;flow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="s"&gt;boiler.ch1.flow-temp&lt;/span&gt;
    &lt;span class="na"&gt;demand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boiler.ch1.demand&lt;/span&gt;

  &lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;transition&lt;/span&gt;
    &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;flow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;demand&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

  &lt;span class="na"&gt;when&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;demand.value == false and flow.value &amp;gt; 35&lt;/span&gt;

  &lt;span class="na"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;point&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boiler.ch1.pump&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;expires_in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;20m&lt;/span&gt;

  &lt;span class="na"&gt;on_input_loss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;release&lt;/span&gt;
  &lt;span class="na"&gt;warmup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;all_inputs_live&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Declarative in YAML, in git, loaded into the registry like everything else, versioned the same way. &lt;code&gt;band&lt;/code&gt; is the rule's whole position in arbitration; there is no priority number alongside it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;when&lt;/code&gt; is written in the restricted expression grammar, which is defined in &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt; and owned there. The only thing that differs in this context is the binding: names resolve to the full &lt;code&gt;(value, quality)&lt;/code&gt; pair rather than to a bare value, so &lt;code&gt;flow.value&lt;/code&gt; and &lt;code&gt;flow.quality&lt;/code&gt; are both available and neither is implied. A rule that reads a value without considering its quality is usually a bug, and here it has to say so.&lt;/p&gt;

&lt;p&gt;Beyond value and quality there is nothing. No timestamps, no history, no lookback. A rule needing the average of the last fifteen minutes takes a derived point with a name, not an inline window. This is the constraint that keeps the engine from growing a query language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Triggers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;transition&lt;/span&gt;            &lt;span class="c1"&gt;# any transition of the listed inputs
&lt;/span&gt;  &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;flow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;demand&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;edge&lt;/span&gt;                  &lt;span class="c1"&gt;# value crossing, direction-specific
&lt;/span&gt;  &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demand&lt;/span&gt;
  &lt;span class="na"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rising | falling&lt;/span&gt;

&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;quality&lt;/span&gt;               &lt;span class="c1"&gt;# quality transition
&lt;/span&gt;  &lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;flow&lt;/span&gt;
  &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;stale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;unavailable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;bad&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;interval&lt;/span&gt;              &lt;span class="c1"&gt;# periodic re-evaluation
&lt;/span&gt;  &lt;span class="na"&gt;every&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5m&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;edge&lt;/code&gt; is sugar over &lt;code&gt;transition&lt;/code&gt; plus a &lt;code&gt;prev&lt;/code&gt;/&lt;code&gt;new&lt;/code&gt; comparison, and it exists because rising and falling are the terms people actually think in. It is defined on the &lt;em&gt;changed&lt;/em&gt; flag, so it respects the point's deadband — an edge is a real change, not a resampled one.&lt;/p&gt;

&lt;p&gt;Thresholds are not a trigger type. A rule that wants "above 35 °C" either compares in &lt;code&gt;when&lt;/code&gt;, or, where it needs hysteresis, takes a &lt;code&gt;hysteresis&lt;/code&gt; derived point as input. The second is correct for anything driving a relay.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;interval&lt;/code&gt; exists for rules whose condition is time-dependent rather than data-dependent, and it should be rare. If most rules use it, something is wrong with the derived-point layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation
&lt;/h2&gt;

&lt;p&gt;Level-triggered, not edge-triggered, in the sense that matters: the trigger decides &lt;em&gt;when&lt;/em&gt; to evaluate, &lt;code&gt;when&lt;/code&gt; decides &lt;em&gt;what the world looks like&lt;/em&gt;, and the claim is derived from the current evaluation. The engine does not accumulate state between evaluations.&lt;/p&gt;

&lt;p&gt;That means a rule is a pure function of its inputs' current values and qualities. Restart-safe by construction, testable by feeding it a state snapshot, and free of the class of bug where a rule's internal latch drifts out of sync with reality. Anything that genuinely needs memory — debounce, hysteresis, rate — is a derived point, which is durable and rehydratable from the log.&lt;/p&gt;

&lt;p&gt;Evaluation order: transitions arrive in batches from ingest, derived points settle in topological order, then rules evaluate. One pass. A rule cannot trigger on a claim made by another rule in the same pass, which is deliberate — that path leads to ordering dependence, and the intermediate is better made an explicit derived point.&lt;/p&gt;

&lt;p&gt;Claims are diffed against the rule's existing claims. Unchanged claims are not re-asserted, so a rule evaluating every 5 s does not generate command churn. Only the diff reaches arbitration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Claims and release
&lt;/h2&gt;

&lt;p&gt;A rule holds claims. &lt;code&gt;when&lt;/code&gt; true means assert; &lt;code&gt;when&lt;/code&gt; false means release. Release is the default and should be, because a rule that asserts and never withdraws permanently occupies its band.&lt;/p&gt;

&lt;p&gt;A rule's output ends at the claim. Whether the claim reached the device, whether it converged, and whether the driver was even up are the command plane's concerns, and the rule can see none of them. That is deliberate: a rule that could observe delivery would eventually be written to retry, and retry logic scattered across a rule set is how two things end up pulsing the same relay.&lt;/p&gt;

&lt;p&gt;Some rules genuinely want to fire and forget — send a notification, pulse a door strike. Those are actions, not claims:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;notify&lt;/span&gt;
      &lt;span class="na"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ops&lt;/span&gt;
      &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Flow temp above 80 in {{ zone }}"&lt;/span&gt;
      &lt;span class="na"&gt;cooldown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;15m&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Actions need a cooldown, mandatory. An action without one will eventually fire in a loop, and the difference between a claim and an action is precisely that a claim is idempotent and an action is not.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;expires_in&lt;/code&gt; on a claim is a safety net, not a mechanism. It bounds the damage if a rule stops evaluating for a reason nobody anticipated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Input loss
&lt;/h2&gt;

&lt;p&gt;The same fork as interlocks, required on every rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;release&lt;/code&gt; — withdraw claims, fall through to the next band. The right default for ordinary automation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hold&lt;/code&gt; — keep existing claims, do not re-evaluate. For cases where the last known good decision is better than nothing, and where the point has other protection.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;assert(value)&lt;/code&gt; — take a defensive position.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;hold&lt;/code&gt; needs a bound: &lt;code&gt;hold_max: 30m&lt;/code&gt;, after which it degrades to &lt;code&gt;release&lt;/code&gt;. Holding indefinitely on stale data is the failure mode where the system looks fine and is operating on a picture of the world from three days ago.&lt;/p&gt;

&lt;p&gt;What counts as loss is per rule: &lt;code&gt;required_quality: live&lt;/code&gt; by default, &lt;code&gt;live_or_stale&lt;/code&gt; where the rule tolerates it. A rule reading a 24-hour average should not lose its footing because one input was late.&lt;/p&gt;

&lt;p&gt;Input loss is about the rule's inputs. It says nothing about the point the rule claims, which may be unreachable at the same moment for the same underlying reason without that changing what the rule should decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Warmup
&lt;/h2&gt;

&lt;p&gt;A rule starts in &lt;code&gt;warmup&lt;/code&gt; and does not evaluate. It leaves warmup when its policy is satisfied:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;all_inputs_live&lt;/code&gt; — every input has reached &lt;code&gt;live&lt;/code&gt; since core start&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;all_inputs_known&lt;/code&gt; — inputs are &lt;code&gt;live&lt;/code&gt; or &lt;code&gt;stale&lt;/code&gt;, but not &lt;code&gt;unknown&lt;/code&gt; or &lt;code&gt;restored&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;deadline(60s)&lt;/code&gt; — a hard cap; on expiry, evaluate under the rule's &lt;code&gt;on_input_loss&lt;/code&gt; policy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Warmup exists because &lt;code&gt;restored&lt;/code&gt; values look like real values. Without gating, a restart evaluates every rule against a snapshot of the world as it was before the outage, generates a burst of edges that never happened, and issues commands based on them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warmup deadlines pause while ingest lag is high&lt;/strong&gt;, on the same condition that suppresses staleness in &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;. The deadline exists to stop a rule waiting forever for an input that is never coming; during a drain the input is coming, just not yet. Letting it expire would push rules into their input-loss policy while the data they need sits in the queue — safe, but premature and for the wrong reason. A core-internal condition must not drive device-level decisions.&lt;/p&gt;

&lt;p&gt;The practical effect after a long outage is that the system declines to automate until it has caught up, rather than making hours of retrospective decisions in ninety seconds. That is the intended behaviour, not a stall.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interlocks skip warmup&lt;/strong&gt;, and this is the wrinkle worth being explicit about. A &lt;code&gt;fail_safe&lt;/code&gt; interlock asserts its &lt;code&gt;fail_value&lt;/code&gt; the instant the core starts, before any inputs are live, and releases it only once inputs are genuinely &lt;code&gt;live&lt;/code&gt; and the condition evaluates clear. That is the correct reading of fail-safe: the protective state is the default, and warmup is exactly the window with the least information.&lt;/p&gt;

&lt;p&gt;That assertion is a claim, not a command. At core start no driver instance is up, so the claim does not reach hardware immediately, and it does not need to: the command plane records it as undeliverable and issues it the moment the instance is ready. The rule does not wait, does not retry, and does not get to know. An interlock claim that stays unenforced is escalated by the command plane, which is where the visibility into delivery actually exists.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;fail_clear&lt;/code&gt; interlock does the opposite — it holds no claim during warmup, same as any other rule. The asymmetry is the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loop and flap protection
&lt;/h2&gt;

&lt;p&gt;Three limits, all enforced by the engine rather than left to rule authors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Evaluations per rule per window.&lt;/strong&gt; Past the threshold, the rule is suspended, a control event is written, and a &lt;code&gt;self&lt;/code&gt; point flips. A suspended rule releases its claims under its &lt;code&gt;on_input_loss&lt;/code&gt; policy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claim changes per point per window.&lt;/strong&gt; Independent of which rule caused them. This catches two rules fighting at the same band, which the load-time lint warns about but cannot always predict.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command rate&lt;/strong&gt;, already enforced in the command plane per point descriptor. This is the last line and it protects hardware regardless of what the rule layer does.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A rule whose own claim feeds back into its inputs — pump on, flow temp rises, rule turns pump off, temp falls — is a real physical loop that no static analysis catches. Hysteresis derived points are the primary defence; the evaluation limit is the backstop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Load-time validation
&lt;/h2&gt;

&lt;p&gt;All of this runs in CI, because a rule set is small enough to check exhaustively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every input point exists in the current registry version&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;when&lt;/code&gt; parses under the shared grammar and references only declared inputs&lt;/li&gt;
&lt;li&gt;Claim target points are &lt;code&gt;out&lt;/code&gt; or &lt;code&gt;inout&lt;/code&gt;, and claim values pass type, enum, and range checks&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;on_input_loss&lt;/code&gt; and &lt;code&gt;warmup&lt;/code&gt; are present on every rule&lt;/li&gt;
&lt;li&gt;Interlock rules carry &lt;code&gt;interlock_class&lt;/code&gt; and, if &lt;code&gt;fail_safe&lt;/code&gt;, a &lt;code&gt;fail_value&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;No two rules at the same band claim the same point with different values (warning, not error — sometimes deliberate)&lt;/li&gt;
&lt;li&gt;No two interlock rules claim the same point with different values (error)&lt;/li&gt;
&lt;li&gt;Actions have cooldowns&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;p&gt;The shape that makes the constraints worth it: a rule takes a state snapshot and produces claims, so a test is a fixture and an assertion.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pump-run-on&lt;/span&gt;
  &lt;span class="na"&gt;given&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;boiler.ch1.flow-temp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;value:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;quality:&lt;/span&gt; &lt;span class="s"&gt;live&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;boiler.ch1.demand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;value:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;quality:&lt;/span&gt; &lt;span class="s"&gt;live&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;expect_claims&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;point:&lt;/span&gt; &lt;span class="s"&gt;boiler.ch1.pump&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;value:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No device, no bus, no database. The whole rule set runs against a table of fixtures in CI. The cases covered by convention are: condition true, condition false, each input &lt;code&gt;stale&lt;/code&gt;, each input &lt;code&gt;unavailable&lt;/code&gt;, and warmup.&lt;/p&gt;

&lt;p&gt;A second layer, once the first works: replay. Take a window of real observations from the log, run the rule set against it, and diff the claims against what actually happened. That is how a rule change is validated against real conditions before it touches hardware — and it is only possible because the log kept &lt;code&gt;value_native&lt;/code&gt; and the rules are pure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;The fixture table and the replay layer above are this step's exit criterion. A rule set is done when the whole of it runs against fixtures in CI, covering by convention: condition true, condition false, each input &lt;code&gt;stale&lt;/code&gt;, each input &lt;code&gt;unavailable&lt;/code&gt;, and warmup.&lt;/p&gt;

&lt;p&gt;Four cases worth adding to that convention, because they are the ones where a rule does something plausible and wrong:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A rule that never leaves warmup&lt;/strong&gt; because an input is permanently &lt;code&gt;unknown&lt;/code&gt; — assert it holds no claims rather than evaluating on absent data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Warmup deadline pausing under lag&lt;/strong&gt;, so a long drain does not push rules into their input-loss policy while the data they need is still in the queue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release on input loss actually releases&lt;/strong&gt;, and &lt;code&gt;hold&lt;/code&gt; degrades to &lt;code&gt;release&lt;/code&gt; at &lt;code&gt;hold_max&lt;/code&gt; rather than holding indefinitely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A fail-safe interlock skipping warmup&lt;/strong&gt; asserts its &lt;code&gt;fail_value&lt;/code&gt; immediately, and releases only once inputs are &lt;code&gt;live&lt;/code&gt; and the condition evaluates clear — not on the first good reading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Load-time validation is the other half, and it is a test rather than a hope: a fixture rule set containing each of the listed violations fails the build with the right message, including the two that are errors rather than warnings.&lt;/p&gt;

&lt;p&gt;Replay is the acceptance gate for a rule change rather than for the step: take a window of real observations, run the modified rule set, diff the claims against what actually happened. Nothing touches hardware until that diff is understood.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The latest Dev Diary - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-reading-after-the-build/" rel="noopener noreferrer"&gt;Reading After the Build&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Build step six read against this document: what the audit found after the code was written, and what the seam review found nearly three weeks later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-core-runtime/" rel="noopener noreferrer"&gt;The Core Runtime&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why only one core may run at a time, what enforces it (a Postgres advisory lock, not a lease), what breaks silently if two run at once, and what the system does while no core is running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel Dev Diary: Reading the Resolutions</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 02 Nov 2026 10:53:40 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-reading-the-resolutions-32kk</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-reading-the-resolutions-32kk</guid>
      <description>&lt;p&gt;Entry four of this diary laid out five instruments that keep &lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/#what-is-sentinel" rel="noopener noreferrer"&gt;Sentinel&lt;/a&gt;'s code and documents honest with each other. Every one of them was added because the one before had an edge, and something had just fallen off it. This entry is about the sixth, added the same way, which reads the one thing none of the other five does: the resolutions. It is also about the register checks moving out of the repository into a tool of their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  The column nobody reads
&lt;/h2&gt;

&lt;p&gt;A deferral is a row in the roadmap register, a &lt;code&gt;DW-*&lt;/code&gt;, for work the build owes and has not done. When the work is done the row moves to &lt;em&gt;Resolved deferrals&lt;/em&gt;, and its last column says what was built: which function does it, which test proves it.&lt;/p&gt;

&lt;p&gt;That column is written by whoever made the commit, usually an agent, in the same commit that made it true or not. Then nothing reads it again. The per-step audits map exit criteria onto tests, and the reviews of the development guide read chapters against the code. By the time anybody looked on purpose, 135 rows had been resolved and none had been checked by anyone but its author.&lt;/p&gt;

&lt;p&gt;Three had already been found wrong, each by accident and each in the same shape: a mechanism built, tested by calling it directly, and called by nothing in the running core. One of the three was in the last entry, where derived points were computed and never evaluated or written.&lt;/p&gt;

&lt;p&gt;So about five weeks ago the first deferral audit read all 135 against the code on &lt;code&gt;main&lt;/code&gt;, rather than against the commit that made each claim. For every mechanism a row says was built, it looked for a production caller. Every cited test was read, and for the newest fixes, reasoned against the code before the fix to confirm the test could have failed. Then the open rows were read the other way round, looking for one that was done and still open.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Rows&lt;/th&gt;
&lt;th&gt;Verified&lt;/th&gt;
&lt;th&gt;Wording stale&lt;/th&gt;
&lt;th&gt;Discrepancy&lt;/th&gt;
&lt;th&gt;Unverifiable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Resolved&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;121&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most of it held, but the worst of what did not was live.&lt;/p&gt;

&lt;h2&gt;
  
  
  A reply that beats its own command
&lt;/h2&gt;

&lt;p&gt;The command plane follows every write to a device through a state machine. &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;, published here a few weeks ago, defines the failure state like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;timeout&lt;/code&gt; - no driver response within the deadline&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The row that built the issuing path said the command "moves to &lt;code&gt;sent&lt;/code&gt; after the publish returns". It did not. The publish happened inside the reconcile pass's transaction, which commits only after every point in the pass has been driven.&lt;/p&gt;

&lt;p&gt;The half nobody had recorded was the other direction. A driver's reply is handled in a transaction of its own, which cannot see a command the pass has not committed yet. A reply that arrived quickly enough was looked up, not found, logged as a result that "does not apply", and dropped. The command sat in &lt;code&gt;sent&lt;/code&gt; until its deadline and closed as &lt;code&gt;timeout&lt;/code&gt;. A driver had answered well within the deadline, and the record says it never did.&lt;/p&gt;

&lt;p&gt;The audit's note on which replies lose that race:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The replies most likely to win that race are the instant ones - &lt;code&gt;rejected&lt;/code&gt;, &lt;code&gt;stale_epoch&lt;/code&gt;, a host error - which are exactly the ones whose reason matters.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No test had a driver reply before the commit. The audit filed it and left the fix to a change of its own, because closing the window was a design choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The week a resolution is written
&lt;/h2&gt;

&lt;p&gt;The smaller discrepancies had a family resemblance. A test cited as proof of a database query fed the code a hand-built dictionary. A default that every test materialised by calling the function directly, and never by starting a core.&lt;/p&gt;

&lt;p&gt;The useful finding was where they were. Of the 24 oldest rows, 21 held exactly. The unproven claims clustered in the rows resolved in the two days before the audit; two had been resolved that same morning, and one of those was wrong. The audit's closing note:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A resolution is least reliable in the week it is written, which is also when nobody rereads it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That set how the audit runs. The first one reads everything; each later one starts from the commits the last one read and takes every row resolved since, plus all the open rows. The second ran two days after the first, on twenty rows, and found one wrong. The row said reprocess, the maintenance operation that rewrites stored history, refuses a second run while one is going. The code checked whether a run was in progress, then awaited a dry-run plan, and only then recorded that a run had started. Two requests overlapping by that much both started. The test for the refusal marked a run as in progress by hand, so it never saw the gap.&lt;/p&gt;

&lt;p&gt;The same audit found a second race in the command plane's reads, in a place a decision had explicitly set aside as "not examined". Its note for the next one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A check that precedes an &lt;code&gt;await&lt;/code&gt; is a claim about one request, and a sentence saying something "was not examined" is a row nobody filed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It also began running both repositories' suites against real services and counting every skip, "because a skip is a test that silently does not run". That found 38 tests in the driver host that CI had never run, because the variables that enable them were never set there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The column the code still named
&lt;/h2&gt;

&lt;p&gt;The third audit, four days later, changed how it read. Six readers took the rows in parallel, and every finding they reported was checked against the code a second time before it was written down. What nobody had checked again went under its own heading, &lt;em&gt;Read and not checked again&lt;/em&gt;, and none of it was routed. The next day a different session, one that had not reported them, read those eight again. All eight held.&lt;/p&gt;

&lt;p&gt;The finding that mattered most was about something the code had stopped doing. The published copy of &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-ingest-path-and-log-schema/" rel="noopener noreferrer"&gt;Ingest Path and Log Schema&lt;/a&gt;&lt;/em&gt; declares a column on the per-point state table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;watermark_seq&lt;/span&gt;   &lt;span class="nb"&gt;bigint&lt;/span&gt;                &lt;span class="c1"&gt;-- last control_event applied&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The restart step that read it was later struck, and the column with it. The resolution said "the checkpoint stops naming the column", and the plan for dropping it rested on that: once staging and production both ran a release carrying the change, a migration could remove it.&lt;/p&gt;

&lt;p&gt;The change had taken the key out of the dictionary of values the checkpoint writes. It left the statement those values are bound to, which is built from the table's model, and the model still declared the column. So the SQL on every checkpoint flush still ended &lt;code&gt;watermark_seq = excluded.watermark_seq&lt;/code&gt;. The model's own comment said "Nothing reads or writes it".&lt;/p&gt;

&lt;p&gt;Nothing was broken, because the column was still there. But a migration dropping it on that condition would have run while the outgoing core was still serving, and its next checkpoint would have failed. The test asserted that the key was absent from the dictionary, which was true, and never looked at the statement the dictionary was handed to. The audit's lesson is the most general thing any of the three has said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A claim that code stopped doing something is checked on what reaches the database or the wire, and the audit that reads only the lines a pull request changed will agree with it every time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The audit was not above its own method either. Its test run started throwaway message brokers on the only Docker daemon it could reach, which was the deploy host. It removed them, and said so: "The last audit withheld it on purpose, and this one should have."&lt;/p&gt;

&lt;h2&gt;
  
  
  Six instruments
&lt;/h2&gt;

&lt;p&gt;Entry four's table gains a row:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Instrument&lt;/th&gt;
&lt;th&gt;Tense&lt;/th&gt;
&lt;th&gt;Its normative home&lt;/th&gt;
&lt;th&gt;What keeps it honest&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the specification&lt;/td&gt;
&lt;td&gt;what the system &lt;strong&gt;will be&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;itself&lt;/td&gt;
&lt;td&gt;nothing internal; everything else comes at it from outside&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the four registers&lt;/td&gt;
&lt;td&gt;what is &lt;strong&gt;open now&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the specification&lt;/td&gt;
&lt;td&gt;the register checks, for the registers' shape only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the audits&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;happened&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the build step&lt;/td&gt;
&lt;td&gt;a person, once per step, looking back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the seam reviews&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;nobody said&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the joins between documents&lt;/td&gt;
&lt;td&gt;a rule that every step ends with one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the development guide&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;exists today&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the code&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;test_dev_docs.py&lt;/code&gt;, and a marker on every claim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the deferral audit&lt;/td&gt;
&lt;td&gt;what was &lt;strong&gt;said to be done&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the resolved row&lt;/td&gt;
&lt;td&gt;the last audit's commits, and a second reading of every finding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A resolved row found wrong keeps its text and gains one line pointing at what was found. The wrong sentence is the evidence, and editing it would make the register look as if it had never been wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checks leave home
&lt;/h2&gt;

&lt;p&gt;The register checks started as one test file in the Sentinel repository: ids numbered contiguously from one, every relative link resolving, every link's label naming an id that exists. Entry three was about where that file's reach ends.&lt;/p&gt;

&lt;p&gt;A second project adopted the same registers and copied the test, changing the constants. Within weeks the copies disagreed. One wrote component ids &lt;code&gt;C-12&lt;/code&gt; and the other &lt;code&gt;C12&lt;/code&gt;, they checked different documents, and the copy had two fixes the original lacked. That is the drift the registers exist to prevent, in the tests that check the registers.&lt;/p&gt;

&lt;p&gt;So the checks now live once, in a repository called &lt;code&gt;register-tools&lt;/code&gt;, as a GitHub Action each consumer runs inside its required &lt;code&gt;test&lt;/code&gt; job. A small config file describes that repository's registers, and everything that had differed between the two copies became a field in it. One check improved in the move. The old copy counted a row's cells by splitting on &lt;code&gt;" | "&lt;/code&gt;, so a pipe inside a code span broke a row's rendering on GitHub and the test did not see it. The action counts cells the way GitHub does. Each check's docstring records the incident that caused it, so the rule and the thing it once caught sit side by side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two branches, one number
&lt;/h2&gt;

&lt;p&gt;The tool also carries the renumberer. Register ids are sequential. Two branches written in parallel, which with several agents working at once happens often, both add a decision and both call it &lt;code&gt;D-184&lt;/code&gt;. The first to merge keeps it.&lt;/p&gt;

&lt;p&gt;Detecting that was never the problem. The contiguity check refuses a duplicate, and it is a strict required check, so the second branch cannot merge. The cost was in the repair. Register ids are cited from nearly three hundred files, prose and code and YAML and migrations, and renumbering by hand had gone wrong twice, each time&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;leaving citations that resolved, named a real row, and meant a different one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the worst kind of broken link, because every link check passes it.&lt;/p&gt;

&lt;p&gt;Ids that cannot collide were weighed and turned down. The pull request's number in the id, or a random or date-based one, would each lose contiguity, the check that no row was ever deleted. A merge queue&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Catches the collision earlier and removes none of the renumbering.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the rule is the one now in the tool's README:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An id is fixed when it reaches &lt;code&gt;main&lt;/code&gt;, and not before.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The branch that merges second moves its own rows to the numbers after &lt;code&gt;main&lt;/code&gt;'s highest and rewrites every citation of them. It is one command, with a dry run that prints the plan.&lt;/p&gt;

&lt;p&gt;The hard part is telling the branch's citations of &lt;code&gt;D-184&lt;/code&gt; from &lt;code&gt;main&lt;/code&gt;'s. The first version chose lines by where the diff placed them. With rows in a different order on each side, git can report one of &lt;code&gt;main&lt;/code&gt;'s own lines as removed and re-added, and the tool renumbered &lt;code&gt;main&lt;/code&gt;'s row. Lines are now judged by their content, and the merge base's lines are excluded too, after a smoke run on a real clone caught a branch still holding an older &lt;code&gt;main&lt;/code&gt;'s version of a line.&lt;/p&gt;

&lt;p&gt;The first deferral audit's own rows had to be renumbered. Another branch had taken &lt;code&gt;DW-161&lt;/code&gt; while it was being written.&lt;/p&gt;

&lt;h2&gt;
  
  
  A finding becomes a check
&lt;/h2&gt;

&lt;p&gt;The third audit also corrected component statuses by hand. One component was marked 🟢, complete, with an open deferral against it, written two days after that deferral was filed. Before that, the opposite shape had turned up: a component marked 🟡, partly met, whose citations of what it lacked were all to rows that had since resolved. Three repositories were each checking some version of that locally, each in its own way.&lt;/p&gt;

&lt;p&gt;At the end of last week the second shape became a check in &lt;code&gt;register-tools&lt;/code&gt;: a row marked partly met must cite an open row for what it lacks. Its docstring names the incidents. The first shape, a 🟢 that should not be, still needs someone to read the code and notice.&lt;/p&gt;

&lt;p&gt;That is entry four's pattern, turned once more. A reader, person or agent, finds a shape. Once the shape can be stated, it becomes a check and nobody has to read for it again. The reading moves on to what no check can see yet, starting from the commits the last audit read.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The specification's seventh part: an engine kept small because almost every trigger a control system needs is already a derived point or a quality transition. What is left is a predicate over transitions, with a claim as its output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next entry - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-read-first-run-second/" rel="noopener noreferrer"&gt;Read First, Run Second&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Build step five, read against &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>programming</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Sentinel: The Command Plane</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 07 Oct 2026 09:59:39 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-the-command-plane-1kgo</link>
      <guid>https://dev.to/virorum/sentinel-the-command-plane-1kgo</guid>
      <description>&lt;p&gt;Everything in this series so far has been about reading from devices. This is the part where Sentinel starts writing to them, and a mistake here can leave a heater running or unlock a door twice.&lt;/p&gt;

&lt;p&gt;A writable point has two values. &lt;code&gt;reported&lt;/code&gt; is what the device says and &lt;code&gt;desired&lt;/code&gt; is what the system wants. Nothing writes to a device directly: a rule or a person sets a claim, arbitration resolves the claims on a point into &lt;code&gt;desired&lt;/code&gt;, and a reconciler drives &lt;code&gt;reported&lt;/code&gt; toward it. A device that reboots into the wrong state is corrected on its next report, and nobody has to send the command again.&lt;/p&gt;

&lt;p&gt;Every claim carries an owner and one of six bands, and the band decides who wins. A person's manual claim has to expire, because otherwise one touch of a switch disables the automation on that point until someone notices in November that the heating never came back on. Frost protection can be suspended for half an hour by someone who names it and gives a reason. An interlock can't be suspended at all.&lt;/p&gt;

&lt;p&gt;A write on the bus is fire-and-forget, so each command is followed through a state machine to an outcome. For a relay whose state can't be read, the outcome is &lt;code&gt;unverified&lt;/code&gt; and the point is marked &lt;code&gt;assumed&lt;/code&gt;, which a rule can choose not to trust. A core that restarts in the middle of a write marks the command &lt;code&gt;timeout&lt;/code&gt; and works out what to do next from &lt;code&gt;desired&lt;/code&gt; and &lt;code&gt;reported&lt;/code&gt;. It never sends the same write a second time. And no command is created for a device that can't be reached: the claim stands and waits, so an interlock asserted during cold start is issued the moment its driver is ready, with no deadline it could have missed in the meantime.&lt;/p&gt;

&lt;p&gt;Rules never send commands. They set claims and release them, and that is what lets the rules engine, the next part, be tested without a device in the loop.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; &lt;code&gt;desired&lt;/code&gt; and &lt;code&gt;reported&lt;/code&gt; as separate values on a writable point, the durable claim set and the projection resolved from it, the convergence states and the bounded retry, the command state machine, per-point serialisation and queue coalescing, the four confirmation modes, deliverability and re-drive, the six bands and how arbitration resolves them, manual expiry and withdrawal, suspension of a named owner, how a rule's band is declared and checked at registry load, fail-safe versus fail-clear on input loss, the limit a confirmation mode puts on what an interlock can protect, the intent API and the direct-command escape hatch, validation before the wire, and idempotency of an intent. It does not own &lt;code&gt;core_epoch&lt;/code&gt; and the fencing behind it, which belong to &lt;em&gt;Core Runtime&lt;/em&gt;; how a principal is established, which belongs to &lt;em&gt;Security Model&lt;/em&gt;; the command subject, the driver's acknowledgement, the instance states that deliverability reads and the &lt;code&gt;idempotent&lt;/code&gt; flag on a driver assignment, which belong to &lt;em&gt;Driver Contract&lt;/em&gt;; the timer that claim expiries share with freshness deadlines, which belongs to &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;; or the shape of a rule and when it sets or releases a claim, which belong to &lt;em&gt;Rules Engine&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The command plane is where the system stops being an observer and becomes able to be wrong in ways that matter. Two things carry the weight: the state machine that turns a fire-and-forget write into a verified outcome, and arbitration, which decides whose intent wins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Desired and reported are separate points
&lt;/h2&gt;

&lt;p&gt;A writable point has two values, not one. &lt;code&gt;reported&lt;/code&gt; is what the device says. &lt;code&gt;desired&lt;/code&gt; is what the system wants. They are different fields on the same point, with independent quality.&lt;/p&gt;

&lt;p&gt;Nothing writes to a device directly. Something sets a claim, arbitration resolves the claim set into &lt;code&gt;desired&lt;/code&gt;, and a reconciler drives &lt;code&gt;reported&lt;/code&gt; toward it. This is the difference between "send an off command" and "this light should be off", and it is what makes the system self-healing: a device that reboots into the wrong state gets corrected on its next report without anyone re-issuing anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The claim set is durable; &lt;code&gt;desired&lt;/code&gt; is a projection of it.&lt;/strong&gt; Arbitration has to fall through to the next-highest claim when one is withdrawn, and to restore a suspended claim when its suspension expires. Both require every active claim to be stored, not just the winner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;band&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;ENUM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;        &lt;span class="c1"&gt;-- declaration order is precedence order&lt;/span&gt;
  &lt;span class="s1"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'automation'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'schedule'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'manual'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'safety'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'interlock'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;convergence&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;ENUM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'no_intent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'undeliverable'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'converging'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'converged'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'diverged'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;claim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;    &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;owner&lt;/span&gt;       &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- 'rule:frost-protect', 'user:alice', 'system:default'&lt;/span&gt;
  &lt;span class="n"&gt;band&lt;/span&gt;        &lt;span class="n"&gt;band&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_num&lt;/span&gt;   &lt;span class="nb"&gt;double&lt;/span&gt; &lt;span class="nb"&gt;precision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_bool&lt;/span&gt;  &lt;span class="nb"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_text&lt;/span&gt;  &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;set_at&lt;/span&gt;      &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;expires_at&lt;/span&gt;  &lt;span class="n"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="c1"&gt;-- required for band 'manual'&lt;/span&gt;
  &lt;span class="n"&gt;reason&lt;/span&gt;      &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;point_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;point_desired&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;     &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_num&lt;/span&gt;    &lt;span class="nb"&gt;double&lt;/span&gt; &lt;span class="nb"&gt;precision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_bool&lt;/span&gt;   &lt;span class="nb"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_text&lt;/span&gt;   &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;owner&lt;/span&gt;        &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                  &lt;span class="c1"&gt;-- null when no claim is active&lt;/span&gt;
  &lt;span class="n"&gt;band&lt;/span&gt;         &lt;span class="n"&gt;band&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;resolved_at&lt;/span&gt;  &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;convergence&lt;/span&gt;  &lt;span class="n"&gt;convergence&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;last_command&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Postgres compares enum values in declaration order, so the band &lt;em&gt;is&lt;/em&gt; the comparison. There is no separate priority number to keep in step with it.&lt;/p&gt;

&lt;p&gt;One claim per owner per point. A rule asserting a different value updates its own row rather than accumulating claims.&lt;/p&gt;

&lt;p&gt;Convergence is evaluated on every &lt;code&gt;reported&lt;/code&gt; transition. &lt;code&gt;desired&lt;/code&gt; set with no matching &lt;code&gt;reported&lt;/code&gt; after the confirmation deadline is a divergence, and divergence is a first-class alertable condition, surfaced as a &lt;code&gt;self&lt;/code&gt; point per writable point so that ordinary rules and dashboards can act on it.&lt;/p&gt;

&lt;p&gt;Divergence gets a bounded retry: reconcile, wait, reconcile once more, then stop and mark &lt;code&gt;diverged&lt;/code&gt;. Unbounded reconciliation against a device that physically cannot reach the desired state means a relay clicking every thirty seconds until someone notices.&lt;/p&gt;

&lt;p&gt;What the reconciler does when the device is not reachable at all is a different question, dealt with under deliverability below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command state machine
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  ┌──────────→ rejected
                  │
created → queued → sent → acked → verifying → verified
                    │       │         │
                    │       │         └────→ unverified
                    ├───────┴─────────────→ failed
                    └─────────────────────→ timeout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;created&lt;/code&gt; — intent accepted, arbitration passed, &lt;code&gt;command_id&lt;/code&gt; assigned&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;queued&lt;/code&gt; — waiting on the per-point serialiser&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sent&lt;/code&gt; — published to &lt;code&gt;cmd.{host}.{instance}.{point_id}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;acked&lt;/code&gt; — driver reports transport accepted&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rejected&lt;/code&gt; — driver refused before attempting (unknown point, bad value, instance not ready, stale epoch)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;verifying&lt;/code&gt; — awaiting confirmation per the point's mode&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;verified&lt;/code&gt; — &lt;code&gt;reported&lt;/code&gt; now matches &lt;code&gt;desired&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unverified&lt;/code&gt; — &lt;code&gt;optimistic&lt;/code&gt; mode, or verification window elapsed with no contradiction; point quality becomes &lt;code&gt;assumed&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;failed&lt;/code&gt; — driver reported an error&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;timeout&lt;/code&gt; — no driver response within the deadline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every transition is a &lt;code&gt;control_event&lt;/code&gt;, carrying the principal that caused it and the core epoch that issued it. Terminal states carry the elapsed time, which gives per-device command latency as a &lt;code&gt;self&lt;/code&gt; point without any extra instrumentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every command carries &lt;code&gt;core_epoch&lt;/code&gt;.&lt;/strong&gt; It is the fencing token from &lt;em&gt;Core Runtime&lt;/em&gt;, and a driver rejects any command whose epoch is below the highest it has seen, with reason &lt;code&gt;stale_epoch&lt;/code&gt;. That rejection is treated differently from every other rejection: an unknown point or a bad value is a configuration error, but a stale epoch means two cores existed and one of them was still issuing commands. It escalates rather than retrying.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serialise per point.&lt;/strong&gt; One in-flight command per point, others queued. Concurrent writes to the same relay are never what anyone wanted, and a queue depth of more than one or two is itself a signal worth exposing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coalesce the queue.&lt;/strong&gt; If two commands for the same point are queued and neither has been sent, the older is dropped. A rule flapping should produce one write, not a backlog that plays out after the condition has passed. Coalescing never crosses a &lt;code&gt;sent&lt;/code&gt; boundary — the ordering guarantee has to hold for anything already on the wire.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirmation modes
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;inline&lt;/code&gt; — the driver's &lt;code&gt;device_ack&lt;/code&gt; carries the new value. Compare against desired, go to &lt;code&gt;verified&lt;/code&gt; or &lt;code&gt;failed&lt;/code&gt;. Latency is one round trip.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;async_event&lt;/code&gt; — wait for a subsequent observation on the point. Correlate by value match within the verification window, because most protocols do not echo command IDs. Ambiguity is real here: if something else changed the point to the same value in that window, it will be attributed wrongly. That is accepted, and the window kept tight, typically a couple of seconds.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;poll_verify(delay)&lt;/code&gt; — the core schedules a read after the delay. This is the Modbus path, and it is the core issuing a read, not the driver remembering to. Deliberately a re-read rather than waiting for the next scheduled poll, because a 30 s poll interval is too long to hold a command open.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;optimistic&lt;/code&gt; — no verification exists. The command goes to &lt;code&gt;unverified&lt;/code&gt;, &lt;code&gt;reported&lt;/code&gt; becomes the desired value with quality &lt;code&gt;assumed&lt;/code&gt;, and it stays &lt;code&gt;assumed&lt;/code&gt; until something real contradicts or confirms it. This is honest about the write-only relay whose state cannot be read, and the &lt;code&gt;assumed&lt;/code&gt; quality means a rule can choose not to trust it.&lt;/p&gt;

&lt;p&gt;Verification timers are durable, in &lt;code&gt;control_event&lt;/code&gt;, rehydrated at restart. A core that restarts mid-verification resumes the wait rather than losing the command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On restart, in-flight commands do not resume being sent.&lt;/strong&gt; Anything in &lt;code&gt;sent&lt;/code&gt; or &lt;code&gt;verifying&lt;/code&gt; at shutdown is marked &lt;code&gt;timeout&lt;/code&gt; on recovery, and the reconciler re-derives from &lt;code&gt;desired&lt;/code&gt; versus &lt;code&gt;reported&lt;/code&gt;. Replaying a write whose outcome is unknown is how a door gets unlocked twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliverability and re-drive
&lt;/h2&gt;

&lt;p&gt;Reconciliation only means anything when the device is reachable. Two conditions decide that, and the driver plane already publishes both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A point is deliverable when its driver instance is &lt;code&gt;ready&lt;/code&gt; or &lt;code&gt;degraded&lt;/code&gt;, and the point's own quality is not &lt;code&gt;unavailable&lt;/code&gt;.&lt;/strong&gt; An instance still &lt;code&gt;connecting&lt;/code&gt; and a device the driver has declared off the network are the same thing from here: a command would go into the dark.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Undeliverable is a state of the intent, not the outcome of a command.&lt;/strong&gt; No command is created while the target is undeliverable. The claim stands, &lt;code&gt;desired&lt;/code&gt; holds its value, convergence sits at &lt;code&gt;undeliverable&lt;/code&gt;, and nothing is queued against a wall-clock deadline. A deadline that expires for reasons unconnected to the device says nothing about the device.&lt;/p&gt;

&lt;p&gt;This is why &lt;code&gt;convergence&lt;/code&gt; is an enum rather than the &lt;code&gt;converged boolean&lt;/code&gt; that would otherwise be the obvious choice. A boolean has to mean three different things — no intent, not yet delivered, and genuinely failing — and that is the same null-means-several-things trap the semantic model exists to escape.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The retry budget counts only attempts made while deliverable.&lt;/strong&gt; The bounded retry above exists to stop a relay clicking at a device that cannot reach the desired state. A device that is not there has not refused anything. Burning both attempts against an unreachable instance produces a &lt;code&gt;diverged&lt;/code&gt; that means nothing, and consumes the budget the real divergence would have needed later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Re-drive on the transition to deliverable.&lt;/strong&gt; When an instance reaches &lt;code&gt;ready&lt;/code&gt;, or an observation clears a point's &lt;code&gt;unavailable&lt;/code&gt;, every non-converged claim on the affected points is re-driven and its retry budget resets. It is the same reconciliation a &lt;code&gt;reported&lt;/code&gt; transition triggers, on a different edge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spread the re-drive.&lt;/strong&gt; A driver host with two hundred points reaching &lt;code&gt;ready&lt;/code&gt; would otherwise issue two hundred commands in the same instant, at a device and a transport that have just finished coming up. Modbus in particular does not tolerate that. Concurrency is bounded per instance and the issue jittered. The per-point serialiser and the per-point rate limit do not help here, because the burst is across points rather than within one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cold start is the ordinary case of this, not a special one.&lt;/strong&gt; At core start every instance is &lt;code&gt;connecting&lt;/code&gt;, so every claim is undeliverable and nothing is sent. Claims made during warmup — in practice the fail-safe interlocks, since every other rule is gated — are recorded immediately and issued the moment their instance becomes deliverable. The protective claim is never racing a timer it can lose; it is waiting on a condition it can only win.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Undeliverable is not silent for protective claims.&lt;/strong&gt; An ordinary claim can wait indefinitely and nobody needs to know. An interlock or safety claim sitting &lt;code&gt;undeliverable&lt;/code&gt; is unenforced protection, which is exactly as serious as an interlock that has diverged. Convergence is exposed as a &lt;code&gt;self&lt;/code&gt; point per writable point; for &lt;code&gt;interlock_protected&lt;/code&gt; points, &lt;code&gt;undeliverable&lt;/code&gt; past a short bound escalates rather than waiting quietly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arbitration
&lt;/h2&gt;

&lt;p&gt;The part that is cheap now and expensive later.&lt;/p&gt;

&lt;p&gt;Every claim carries an owner and a band. The band is the whole of the precedence model.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;band&lt;/th&gt;
&lt;th&gt;typical owner&lt;/th&gt;
&lt;th&gt;notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;interlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;protective rules that may not be overridden&lt;/td&gt;
&lt;td&gt;requires &lt;code&gt;interlock_class&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;safety&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;frost protection, over-temperature cutouts&lt;/td&gt;
&lt;td&gt;suspendable, never outrankable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;manual&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a person&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;expires_at&lt;/code&gt; required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;schedule&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;time-based rules&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;automation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ordinary rules&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;system:default&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;optional resting state from the descriptor&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Resolution.&lt;/strong&gt; The active claim set for a point is every claim whose &lt;code&gt;expires_at&lt;/code&gt; is unset or in the future and whose owner is not currently suspended. The winner is the highest band; ties within a band go to the most recent &lt;code&gt;set_at&lt;/code&gt;. The resolver is a pure function from the active set to a winner, and it runs on every claim insert, update, withdrawal, expiry and suspension change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;default&lt;/code&gt; is an ordinary claim, and it is optional.&lt;/strong&gt; A point descriptor may declare &lt;code&gt;default_value&lt;/code&gt;; when it does, the registry materialises a non-expiring claim at band &lt;code&gt;default&lt;/code&gt; owned by &lt;code&gt;system:default&lt;/code&gt;. When it does not, no such claim exists and there is no special case in the resolver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An empty active set means no intent.&lt;/strong&gt; &lt;code&gt;point_desired.owner&lt;/code&gt; is null, convergence is &lt;code&gt;no_intent&lt;/code&gt;, and the reconciler does nothing. Releasing the last claim on a point leaves the device where it is rather than driving it somewhere. Asserting a resting state is something a point opts into by declaring &lt;code&gt;default_value&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is right for a light and wrong for anything protective, so the descriptor carries &lt;code&gt;require_intent&lt;/code&gt;. A point with &lt;code&gt;require_intent: true&lt;/code&gt; must declare &lt;code&gt;default_value&lt;/code&gt;, checked at registry load, which makes an empty active set unreachable and &lt;code&gt;desired&lt;/code&gt; never null. Any point marked &lt;code&gt;interlock_protected&lt;/code&gt; gets &lt;code&gt;require_intent&lt;/code&gt; implicitly, and the load fails if it has no default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manual claims expire.&lt;/strong&gt; Band &lt;code&gt;manual&lt;/code&gt; requires &lt;code&gt;expires_at&lt;/code&gt;, defaulting to an hour or two and configurable per point. On expiry the claim is deleted, arbitration re-resolves, and the point falls through to whatever automation wants. Without expiry, every manual touch permanently disables automation for that point, and the discovery comes in November when the heating never came back on.&lt;/p&gt;

&lt;p&gt;Claim expiries run on the same timer mechanism as freshness deadlines, and like them they are derived rather than stored: recomputed from &lt;code&gt;expires_at&lt;/code&gt; when the claim set loads, so a restart cannot lose one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Withdrawal, not just setting.&lt;/strong&gt; An owner can release its claim, and the point falls through to the next-highest active claim, or to nothing. Rules that have stopped applying must release rather than continue asserting, otherwise arbitration resolves against stale claims forever.&lt;/p&gt;

&lt;p&gt;Every resolution is logged to &lt;code&gt;control_event&lt;/code&gt; with the winner, the full losing set, and the principal responsible. "Why is this light on" is then a query against the claim set, not an exercise in reasoning about rule ordering.&lt;/p&gt;

&lt;p&gt;Two load-time checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two rules claiming the same point at the same band is a lint warning. It is almost always unintentional, and last-writer-wins between them is rarely what anyone meant.&lt;/li&gt;
&lt;li&gt;Two interlock rules claiming the same point with different values is an error, not a warning. Resolving that at runtime is worse than failing the build.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Safety bands
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;interlock&lt;/code&gt; and &lt;code&gt;safety&lt;/code&gt; are separate bands, and the difference between them is not precedence. &lt;code&gt;manual&lt;/code&gt; outranks neither. The difference is that a &lt;code&gt;safety&lt;/code&gt; claim can be suspended and an &lt;code&gt;interlock&lt;/code&gt; claim cannot.&lt;/p&gt;

&lt;p&gt;Suspension is a distinct mechanism from precedence. It is not that manual wins the comparison; it is that the suspended claim is temporarily withdrawn from arbitration on explicit request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suspension is scoped to the owner, not to the point.&lt;/strong&gt; A frost-protection rule holding three pumps is suspended once, for all three. Per-point suspension would let someone servicing the system suspend one pump, believe protection was off, and be wrong about the other two.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;claim_suspension&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;owner&lt;/span&gt;        &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;suspended_by&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;suspended_at&lt;/span&gt; &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;expires_at&lt;/span&gt;   &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- never open-ended&lt;/span&gt;
  &lt;span class="n"&gt;reason&lt;/span&gt;       &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /claims/rule:frost-protect/suspend
  { for: 30m, reason: "servicing the pump" }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request is rejected if the named owner holds any claim at band &lt;code&gt;interlock&lt;/code&gt;. Otherwise the suspension is recorded, every point that owner claims is re-resolved, and the response returns those points with their new winners — so the caller sees the actual blast radius of the decision. The suspension and its expiry are both &lt;code&gt;control_event&lt;/code&gt; entries, and on expiry the claims return automatically.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;expires_at&lt;/code&gt; is not nullable and there is no unsuspend-forever. A suspension that outlives the attention of the person who set it is the failure this mechanism exists to prevent.&lt;/p&gt;

&lt;p&gt;Modelling it as suspension of a named owner rather than as a precedence comparison forces the person to name what they are overriding. "Turn this on" is ambiguous. "Suspend frost protection for thirty minutes" is a decision someone can be held to, and it is legible in the log afterwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which band a claim gets
&lt;/h2&gt;

&lt;p&gt;The band belongs to the rule, declared in the registry, and validated at load rather than trusted at runtime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pump-dry-run-cutout&lt;/span&gt;
  &lt;span class="na"&gt;band&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;interlock&lt;/span&gt;
  &lt;span class="na"&gt;interlock_class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;thermal&lt;/span&gt;
  &lt;span class="s"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;band: interlock&lt;/code&gt; requires &lt;code&gt;interlock_class&lt;/code&gt; (&lt;code&gt;thermal&lt;/code&gt; | &lt;code&gt;electrical&lt;/code&gt;), and the registry rejects it otherwise. That forces the classification to be explicit and reviewable in a diff rather than emerging from whoever wrote the rule.&lt;/p&gt;

&lt;p&gt;Two load-time checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No point may have interlock claims from more than one rule unless they assert the same value. Two interlocks disagreeing is a design error, and resolving it by precedence at runtime is worse than failing the build.&lt;/li&gt;
&lt;li&gt;Any point that a rule targets with &lt;code&gt;band: interlock&lt;/code&gt; gets &lt;code&gt;interlock_protected: true&lt;/code&gt; on its descriptor. That flag is what the API and UI key off, and it means protection is a property of the point that is visible without walking the rule set.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fail-safe versus fail-clear
&lt;/h2&gt;

&lt;p&gt;The harder question, and the one the band split does not answer on its own: what does an interlock do when it cannot evaluate?&lt;/p&gt;

&lt;p&gt;An over-temperature cutout depends on a temperature point. If that point goes &lt;code&gt;stale&lt;/code&gt;, &lt;code&gt;bad&lt;/code&gt;, or &lt;code&gt;unavailable&lt;/code&gt;, the rule has no basis for a decision. Two possible behaviours, and they are opposite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;fail_safe&lt;/strong&gt; — assert the protective value. Cut the heater. Correct for anything where the failure mode is thermal runaway or overcurrent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fail_clear&lt;/strong&gt; — release the claim. Correct where asserting the protective value is itself harmful — a circulation pump forced off during a heat cycle can cause the boiler overheat the interlock was meant to prevent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no sensible default, so it is required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;heatsink-overtemp&lt;/span&gt;
  &lt;span class="na"&gt;band&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;interlock&lt;/span&gt;
  &lt;span class="na"&gt;interlock_class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;thermal&lt;/span&gt;
  &lt;span class="na"&gt;on_input_loss&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fail_safe&lt;/span&gt;
  &lt;span class="na"&gt;fail_value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fail_safe&lt;/code&gt; requires &lt;code&gt;fail_value&lt;/code&gt;. The registry rejects an interlock rule without &lt;code&gt;on_input_loss&lt;/code&gt; — this is the one place where inference is refused outright, because getting it wrong is silent until the day it is not.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;fail_safe&lt;/code&gt; interlocks, the asserted claim persists until inputs return to &lt;code&gt;live&lt;/code&gt; and the rule evaluates cleanly, not merely until data reappears. A single good reading after a fault does not clear a cutout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirmation mode constrains what an interlock can protect
&lt;/h2&gt;

&lt;p&gt;An interlock on a point with &lt;code&gt;confirmation_mode: optimistic&lt;/code&gt; cannot guarantee anything — it asserts a value with no way to verify it, and the point sits at quality &lt;code&gt;assumed&lt;/code&gt;. That is acceptable for a light and not for a thermal cutout.&lt;/p&gt;

&lt;p&gt;This is a load-time rejection: &lt;code&gt;interlock_class: thermal&lt;/code&gt; or &lt;code&gt;electrical&lt;/code&gt; requires the target point to have a verifiable confirmation mode (&lt;code&gt;inline&lt;/code&gt;, &lt;code&gt;async_event&lt;/code&gt;, or &lt;code&gt;poll_verify&lt;/code&gt;). Protecting a write-only relay requires a second point that reads the actual state — a current sensor on the circuit, an auxiliary contact — rather than an interlock that cannot see what it is doing.&lt;/p&gt;

&lt;p&gt;Interlock non-convergence is treated differently from ordinary non-convergence in both directions it can fail. &lt;code&gt;diverged&lt;/code&gt; gets a shorter deadline, no bounded-retry give-up, and escalation rather than a settled state. &lt;code&gt;undeliverable&lt;/code&gt; escalates too, on the bound described under deliverability. An interlock that has failed to take effect is the loudest thing this system can say, and it does not matter whether it failed because the device refused or because the device was not there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The intent API
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST   /points/{id}/claim
  { value, expires_in?, reason?, idempotency_key? }

DELETE /points/{id}/claim        withdraws the caller's own claim
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Owner and band are derived from the authenticated principal, never supplied in the body.&lt;/strong&gt; A rule's band comes from its registry declaration; a person's is &lt;code&gt;manual&lt;/code&gt;. An API that takes &lt;code&gt;owner&lt;/code&gt; and a priority number as parameters lets any caller assert whatever authority it likes, which is not an authorisation model. The mechanism for establishing the principal is in &lt;em&gt;Security Model&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every mutating call names a principal, and there is no default.&lt;/strong&gt; A request that arrives without one is rejected rather than attributed to a service identity, and the principal is written to every &lt;code&gt;control_event&lt;/code&gt; the call produces. That requirement is what makes the claim log an audit trail rather than an activity feed: nothing can change state without saying who asked.&lt;/p&gt;

&lt;p&gt;The response is the resolved arbitration outcome and the resulting convergence state, plus a &lt;code&gt;command_id&lt;/code&gt; if this claim won and a write was issued. A claim that won on an undeliverable point returns &lt;code&gt;undeliverable&lt;/code&gt; and no command ID, which is a normal answer and not an error. A losing claim is still recorded, and the response returns the current winner. That is not an error either, and the caller may well want to know it was overruled.&lt;/p&gt;

&lt;p&gt;Withdrawal removes only the caller's own claim. Removing someone else's is suspension, which is the mechanism above and carries its rules.&lt;/p&gt;

&lt;p&gt;A direct-command escape hatch exists for commissioning and debugging, gated behind its own capability and loudly logged, bypassing arbitration. Two limits on it, both non-negotiable: it does not override an asserted interlock claim, because an escape hatch that can defeat a thermal cutout is the absence of one; and enablement is bounded and expiring exactly like a suspension, with both edges in &lt;code&gt;control_event&lt;/code&gt;, rather than a mode someone leaves on. It is needed when a device is misbehaving late at night, and building it deliberately is better than the alternative of someone reaching for a raw publish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation before the wire
&lt;/h2&gt;

&lt;p&gt;Rejection at the core, before anything is queued:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;point is &lt;code&gt;direction: out&lt;/code&gt; or &lt;code&gt;inout&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;value type and enum membership check&lt;/li&gt;
&lt;li&gt;range check against the descriptor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rate limit per point&lt;/strong&gt;, from the descriptor — a physical relay has a duty cycle, and this is the last defence against a rule loop wearing out hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deliverability is checked here too, but it is not a rejection. An undeliverable target means the claim is accepted and the command deferred until re-drive, never queued against a deadline waiting for an instance to come up.&lt;/p&gt;

&lt;p&gt;Command values are supplied canonical and converted to native on the way out, using the same table as ingest, inverted. Same registry version, same affine handling. An asymmetric conversion path is a bug waiting to happen, so it is one function used in both directions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Idempotency
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;idempotency_key&lt;/code&gt; on the intent, deduplicated over a short window. A UI double-click or a bus redelivery must not produce two commands.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;idempotent&lt;/code&gt; flag on the driver assignment is separate and narrower: it tells the driver whether a single transport-level retry is safe. A coil write is idempotent. A pulse or a momentary is not, and is marked so — the driver never retries it, and a lost command becomes a &lt;code&gt;timeout&lt;/code&gt; that the reconciler handles rather than a double-fire.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this buys the rules engine
&lt;/h2&gt;

&lt;p&gt;Rules never send commands. They set claims with a value and a band, and release them when they stop applying. Everything about delivery, retry, verification, convergence and conflict happens below them.&lt;/p&gt;

&lt;p&gt;That makes rules testable in isolation: a rule's output is a claim, and a claim is data that can be asserted against without a device in the loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Arbitration is a pure function, so it is a fixture table.&lt;/strong&gt; Claim set in, winner out, with no device and no bus. The cases that need covering are the ones the model exists for rather than the obvious ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;withdrawal falls through to the next-highest active claim, and to nothing when there is none&lt;/li&gt;
&lt;li&gt;an expired &lt;code&gt;manual&lt;/code&gt; claim falls through without anyone withdrawing it&lt;/li&gt;
&lt;li&gt;a suspension removes an owner's claims across every point it holds, and they return automatically on expiry&lt;/li&gt;
&lt;li&gt;suspending an owner that holds an &lt;code&gt;interlock&lt;/code&gt; claim is refused&lt;/li&gt;
&lt;li&gt;an empty active set resolves to &lt;code&gt;no_intent&lt;/code&gt; and the reconciler does nothing&lt;/li&gt;
&lt;li&gt;a point with &lt;code&gt;default_value&lt;/code&gt; falls through to the band-&lt;code&gt;default&lt;/code&gt; claim instead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Interlock cold start delivers rather than times out.&lt;/strong&gt; Assert a fail-safe interlock claim before any driver instance is ready; assert that no command is created, that convergence is &lt;code&gt;undeliverable&lt;/code&gt;, and that the command is issued the moment the instance reaches &lt;code&gt;ready&lt;/code&gt;. A timeout here is a failure, not a pass.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The retry budget is not consumed while undeliverable.&lt;/strong&gt; Take a point unavailable, leave a claim standing, bring it back, and assert the bounded retry still has its full allowance. The bug this catches is a &lt;code&gt;diverged&lt;/code&gt; that means nothing, which then hides the real one later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fencing.&lt;/strong&gt; A command carrying a &lt;code&gt;core_epoch&lt;/code&gt; below the driver's highest is rejected with &lt;code&gt;stale_epoch&lt;/code&gt;, and the core treats that outcome as an escalation rather than a retry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restart does not replay writes.&lt;/strong&gt; Commands in &lt;code&gt;sent&lt;/code&gt; or &lt;code&gt;verifying&lt;/code&gt; at shutdown become &lt;code&gt;timeout&lt;/code&gt; on recovery, and the reconciler re-derives from &lt;code&gt;desired&lt;/code&gt; versus &lt;code&gt;reported&lt;/code&gt;. Assert that no command is re-published — this is the door-unlocked-twice case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every mutating path names a principal.&lt;/strong&gt; A request without one is rejected, and every &lt;code&gt;control_event&lt;/code&gt; written during the fixture run has &lt;code&gt;principal&lt;/code&gt; and &lt;code&gt;core_epoch&lt;/code&gt; populated. The &lt;code&gt;NOT NULL&lt;/code&gt; constraints make this hard to get wrong, which is the point of putting them in the schema.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-rules-engine/" rel="noopener noreferrer"&gt;The Rules Engine&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; An engine kept small because almost every trigger a control system needs is already a derived point or a quality transition. What is left is a predicate over transitions, with a claim as its output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The latest Dev Diary - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-read-first-run-second/" rel="noopener noreferrer"&gt;Read First, Run Second&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Build step five read against this document: the gaps found by reading before any code existed, and the ones found by running it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>iot</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel Dev Diary: Auditing the Watchdog</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 05 Oct 2026 09:23:13 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-auditing-the-watchdog-4i55</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-auditing-the-watchdog-4i55</guid>
      <description>&lt;p&gt;Build step four of &lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/#what-is-sentinel" rel="noopener noreferrer"&gt;Sentinel&lt;/a&gt; is the freshness watchdog and derived points. It was audited about four weeks ago against the document that owns it, &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;The Watchdog and Derived Points&lt;/a&gt;&lt;/em&gt;, which went out last Wednesday.&lt;/p&gt;

&lt;p&gt;That post promised this entry would say where the specification and the build disagree, and which of the two had to change. For this step the answer is usually both. In one case the code changed, then the decision that explained the code, then the document, in that order and each because of the one before.&lt;/p&gt;

&lt;h2&gt;
  
  
  Half a sentence
&lt;/h2&gt;

&lt;p&gt;The published copy says this about a stale point recovering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An observation with &lt;code&gt;observed_at&lt;/code&gt; older than the current deadline - a buffered replay landing late - does not clear staleness, though it is still logged.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are two claims in it. A late observation must not push the point's deadline out, and it must not change the point's quality.&lt;/p&gt;

&lt;p&gt;The first was built. Ingest hands the watchdog each observation's &lt;code&gt;observed_at&lt;/code&gt;, so a replay of hours-old data schedules a deadline that is already in the past.&lt;/p&gt;

&lt;p&gt;The second was not, and could not have been where the code stood. The projection applies an observation's quality without ever seeing a deadline; the information is not available to it. A three-hour-old replay carrying &lt;code&gt;live&lt;/code&gt; moved a &lt;code&gt;stale&lt;/code&gt; point to &lt;code&gt;live&lt;/code&gt;, and the watchdog put it back on the next tick. That is two transitions and two control-log rows where the document asks for none.&lt;/p&gt;

&lt;p&gt;It survived because of the test. &lt;code&gt;test_a_late_replay_does_not_push_the_deadline_out&lt;/code&gt; is named for the rule, starts from a &lt;code&gt;live&lt;/code&gt; point, and asserts that it goes &lt;code&gt;stale&lt;/code&gt;. The sentence is about a point that is already &lt;code&gt;stale&lt;/code&gt;, and no test started there. The audit's line on it, at the time:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How it survived: the test that quotes the sentence asserts the half that works.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The fix was wider than the sentence
&lt;/h3&gt;

&lt;p&gt;Holding the quality and applying everything else is what the sentence appears to ask for. The decision row records why that does not work.&lt;/p&gt;

&lt;p&gt;A host reconnecting after an outage replays many rows, oldest first. The projection wrote &lt;code&gt;observed_at&lt;/code&gt; unconditionally, so an old row moved it backwards, and every deadline is derived from &lt;code&gt;observed_at&lt;/code&gt;. Holding only the quality&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;would let the first row lower the bar the second is judged against, and a few rows in a replayed hour would read as current.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The transition published on the bus also carries the observation's own quality. A held row that was still published would tell every subscriber the point read &lt;code&gt;live&lt;/code&gt; while the projection said &lt;code&gt;stale&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So the reading taken was the stronger one: a late replay is written to the log and advances nothing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is a row in the history and no part of the present.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The same row names the trap in the obvious implementation. "Older than the current deadline" is true of every healthy observation; a point reporting every 30 seconds under a 45-second window is always inside its deadline. A rule keyed on lateness alone&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;would freeze the entire projection on the first observation after startup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two more rows came out of building it. One out-of-order observation could mark a healthy point &lt;code&gt;stale&lt;/code&gt;, for the same reason: &lt;code&gt;observed_at&lt;/code&gt; went backwards and took the deadline with it. The other was filed as a cosmetic note about three fields nobody reads. It turned out that a withheld row was still being treated as the predecessor of the row after it, which suppressed a real edge on the next reading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Then the document moved
&lt;/h3&gt;

&lt;p&gt;The decision gated its rule on the point being &lt;code&gt;stale&lt;/code&gt;, because that is the state the sentence is about. Which other states a late replay may promote was left as an open question against the document.&lt;/p&gt;

&lt;p&gt;The document's answer was to stop asking what state the point is in. The current text says a reading that was already past its own deadline when it was ingested "is expired on arrival: it is written to the log and advances nothing". It is judged on its own age, measured from &lt;code&gt;ingested_at&lt;/code&gt;, instead of against whatever deadline the point happens to hold. That closed the question and superseded part of the decision that had prompted it.&lt;/p&gt;

&lt;p&gt;One sentence in the copy published here is now six paragraphs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Criteria that passed without a core
&lt;/h2&gt;

&lt;p&gt;The first exit criterion in the published copy is specific about how to test it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Load a checkpointed projection, start the core, and assert zero &lt;code&gt;restored → stale&lt;/code&gt; transitions inside each point's grace, and the correct ones after it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What existed was six unit tests over a watchdog constructed inside a test. The integration test that does load a checkpoint and start a core asserted nothing about staleness. The second criterion was covered in three pieces, with &lt;code&gt;core.{n}.staleness-suppressed&lt;/code&gt; asserted against a stub that returns what it is given. The audit: "Nothing asserts the chain".&lt;/p&gt;

&lt;p&gt;Both got the tests the document asked for, against a started core swept by its own timer. The register row for that work:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The second test found a live bug on its first run, which is what the deferral was about&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;staleness-suppressed&lt;/code&gt; is the only boolean among the core's signals about itself. The code that turns a sample into a row narrowed the value to a number and excluded booleans without putting them anywhere. So the signal the published document describes as saying "plainly that this is happening" was written on every pass as a row with no value in any column. The stub had asserted one layer above the row.&lt;/p&gt;

&lt;p&gt;The third criterion is the quality propagation table, one fixture per row. It passed. The row that records what was behind it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Derived points were validated, computed, and neither evaluated nor written. Exit criterion 3 passed on pure functions with no loop around them&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Entry one quoted a decision titled &lt;em&gt;A guard with no caller is not a guard&lt;/em&gt;, and I wrote that I had no idea how many more of those there were, presumably not zero. This was the next one, and it covered every derived point in the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wiring it found a collision
&lt;/h3&gt;

&lt;p&gt;A derived point's output goes through the ingest writer into the observation table, because rehydration reads that table and a chain of derived points has to be rebuildable from the log.&lt;/p&gt;

&lt;p&gt;The dedup key is the one from &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-ingest-path-and-log-schema/" rel="noopener noreferrer"&gt;Ingest Path and Log Schema&lt;/a&gt;&lt;/em&gt;: instance, epoch, sequence and &lt;code&gt;ingested_at&lt;/code&gt;. Every row in one derived pass shared three of the four, and the pass wrote one evaluation at a time with the sequence restarting at zero. Every point got the same key. The insert kept the first and dropped the others silently, and the symptom was a chain whose second point stayed &lt;code&gt;unknown&lt;/code&gt; for ever.&lt;/p&gt;

&lt;p&gt;No unit test of a single derived point could have seen that. It needed two points written in the same pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stale point whose checkpoint never moved
&lt;/h2&gt;

&lt;p&gt;This one was found in a running core.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ingest Path and Log Schema&lt;/em&gt; gives the checkpoint's write policy as "immediately on quality change". That write was made by the ingest pipeline, from the observation that caused the change.&lt;/p&gt;

&lt;p&gt;A point going stale is a point that has stopped sending observations. So the path never ran for it. The checkpoint row sat at the last quality the point had reported, while the core's in-memory count of stale points moved. The two disagreed for as long as the point stayed quiet.&lt;/p&gt;

&lt;p&gt;Patch coverage had flagged it. Seventeen changed lines were uncovered on the pull request, and they were the watchdog's entire wiring into the running core. Nothing acted on the flag, because the test job was the only required check. The repository's own note:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A coverage gate that reports and does not block is a gate that tells you afterwards.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The gate now sits inside the test job, and every changed line has to be covered for it to pass. I have written before about &lt;a href="https://glitchedpixel.io/blog/rule-only-as-strong-as-what-enforces-it/" rel="noopener noreferrer"&gt;a rule being only as strong as what enforces it&lt;/a&gt;, and this is the same lesson costing a bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the document changed
&lt;/h2&gt;

&lt;p&gt;Three things in this step ended with the document amended. A fourth did not.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fan-out
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-driver-contract/" rel="noopener noreferrer"&gt;The Driver Contract&lt;/a&gt;&lt;/em&gt; promises that a driver dying silently "is caught by its own heartbeat going stale - the core marks the instance unavailable after a grace period". The published watchdog document gives one route to &lt;code&gt;unavailable&lt;/code&gt;: an availability event from a driver. A dead driver sends no event, and a missed deadline produces &lt;code&gt;stale&lt;/code&gt;. No rule anywhere could perform the promise.&lt;/p&gt;

&lt;p&gt;The watchdog document took it, before the step started. A stale instance heartbeat now marks every point that instance owns &lt;code&gt;unavailable&lt;/code&gt;. The heartbeat itself stays &lt;code&gt;stale&lt;/code&gt;, because "it is the evidence rather than a casualty". And "there is no second grace period": the heartbeat's own interval and grace are the wait. Because the fan-out is triggered by a staleness evaluation, it inherits both suppressions, so "neither a restart nor a slow core can take a fleet &lt;code&gt;unavailable&lt;/code&gt;".&lt;/p&gt;

&lt;h3&gt;
  
  
  The propagation table
&lt;/h3&gt;

&lt;p&gt;The published copy gives six rows as a list. Two of its answers are transitions &lt;em&gt;The Semantic Model&lt;/em&gt; forbids, &lt;code&gt;unavailable → stale&lt;/code&gt; and &lt;code&gt;unknown → stale&lt;/code&gt;, and both are reachable. Row one asks whether an input "has ever been &lt;code&gt;live&lt;/code&gt;", and nothing stores history. &lt;code&gt;restored&lt;/code&gt; appears in no row, though every input is &lt;code&gt;restored&lt;/code&gt; after a restart. And the order decides the answer for an input that is &lt;code&gt;bad&lt;/code&gt; having never been &lt;code&gt;live&lt;/code&gt;, in a list that does not say it is ordered.&lt;/p&gt;

&lt;p&gt;The table is longer now, it is ordered, and it says first match wins. Where a row's answer is an illegal move, the point holds what it has and the control event carries the reason &lt;code&gt;held&lt;/code&gt;. That is the two-exit rule on &lt;code&gt;unavailable&lt;/code&gt; from entry two, applied one level up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flap damping
&lt;/h3&gt;

&lt;p&gt;The published text says transitions "are counted in a rolling window; past a threshold" further ones coalesce "until it settles". It gives no window, no threshold and no definition of settled, and underneath that it does not say whether the window is per point or global. The audit left it unbuilt on purpose:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Building to a guess would put the only absolute duration in the mechanism.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The document now says the window is per point and four times the point's own tolerated silence, the threshold is six, and settled means a whole window with no crossing. That last one is deliberately not "the point is &lt;code&gt;live&lt;/code&gt; for a window", because a dead device settles into &lt;code&gt;stale&lt;/code&gt; and would never clear.&lt;/p&gt;

&lt;p&gt;It has been built since. Building it found that the register row describing the work had named the wrong place to put it. The row said damping was a filter over the watchdog's output, which would have counted entries into &lt;code&gt;stale&lt;/code&gt;. A point can legally go &lt;code&gt;stale → bad → stale&lt;/code&gt;, so that is a different number from the &lt;code&gt;live&lt;/code&gt;/&lt;code&gt;stale&lt;/code&gt; crossings the document counts.&lt;/p&gt;

&lt;h3&gt;
  
  
  The wheel
&lt;/h3&gt;

&lt;p&gt;The published copy asks for a hierarchical timer wheel. The code has a flat one, and the document still says hierarchical. The document names the structure and then says what it is for: one deadline per point, one-second resolution, O(1) reschedule. A flat array of buckets has all three at four thousand points. The difference is recorded as a decision, along with the condition under which hierarchy becomes the answer, and the document has been left as it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  A seam review, pointed back
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Introduction&lt;/em&gt; now requires every step to end with a seam review, and step four was the first to end under that rule. The first run of the procedure pointed forward, at documents that had not been built yet. What it found is still reserved for the Mondays after those documents publish.&lt;/p&gt;

&lt;p&gt;The second run pointed back at this step, reading the watchdog document against its neighbours. Because the step was already built, its findings arrived with a reading already taken in code. Two of them sit between documents that are both public.&lt;/p&gt;

&lt;h3&gt;
  
  
  An escape hatch that exists in one document
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-semantic-model/" rel="noopener noreferrer"&gt;The Semantic Model&lt;/a&gt;&lt;/em&gt;, on logarithmic quantities:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Derived points refuse to compute &lt;code&gt;mean&lt;/code&gt; on a non-agg-safe quantity unless the definition explicitly opts into &lt;code&gt;log_mean&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The watchdog document owns the operator set. Its table lists thirteen operators and &lt;code&gt;log_mean&lt;/code&gt; is not one of them. Its &lt;code&gt;mean&lt;/code&gt; row reads "rejected when the input quantity is not &lt;code&gt;agg_safe&lt;/code&gt;", and its exit criteria ask for exactly that refusal. The name appeared in no vocabulary and nowhere in the code.&lt;/p&gt;

&lt;p&gt;The code refused unconditionally, which is what the owning document says. The review gave it no decision row, and said why:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That is a choice the code should not have had to make silently.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fix went the generous way. The operator set gained &lt;code&gt;log_mean&lt;/code&gt;, computed as &lt;code&gt;10 * log10(mean(10^(x/10)))&lt;/code&gt;, and refused on an &lt;code&gt;agg_safe&lt;/code&gt; quantity as the mirror of &lt;code&gt;mean&lt;/code&gt;'s refusal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two columns the vocabulary never had
&lt;/h3&gt;

&lt;p&gt;The published watchdog document says a derived point declares its output quantity, and that a mismatch with "what the operator produces from the input quantity" is a validation failure at load. Checking that needs something that says what a rate over energy is, or a difference of two temperatures.&lt;/p&gt;

&lt;p&gt;The amended operator table reads two fields off the quantity vocabulary for it, &lt;code&gt;delta_quantity&lt;/code&gt; and &lt;code&gt;rate_quantity&lt;/code&gt;. &lt;em&gt;The Semantic Model&lt;/em&gt; owns that vocabulary and printed it with four columns. Neither field was one of them.&lt;/p&gt;

&lt;p&gt;The registry file declared both, with a rule no document stated: leaving one out means the operator is refused. The decision row has the reason for refusing instead of inheriting:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;20 °C minus 21 °C is −1 degree of interval, not −1 °C of anything&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;The Semantic Model&lt;/em&gt; has the two columns now. The amendment got one sentence wrong on the way in, about when an omission is refused, and it was corrected against the code before it was committed. An amendment written to close a finding about drift had drifted from the code itself, by one sentence, before it landed.&lt;/p&gt;

&lt;p&gt;A third finding from the same review waits for its document.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the step has in common
&lt;/h2&gt;

&lt;p&gt;Entry three's findings were all about placement. These are about joins.&lt;/p&gt;

&lt;p&gt;The late-replay sentence had two halves and its test held one of them. The exit criteria were met by parts that each worked, with no core running them together, and the dedup key was fine for one derived point and collided as soon as there were two. A stale point's checkpoint depended on the one write path a stale point never takes. The promise about a dead driver sat in one document while the machinery to keep it belonged to another.&lt;/p&gt;

&lt;p&gt;Each piece was right when looked at alone, which is why the unit tests passed throughout. What caught these was running the pieces together, and for the first two exit criteria that was the test the document had asked for in the first place.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The specification's sixth part: where Sentinel starts writing to devices, with desired and reported held as separate values and a write followed through to a verified outcome.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next entry - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-reading-the-resolutions/" rel="noopener noreferrer"&gt;Reading the Resolutions&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; A sixth check joins the five from last time: an audit that reads every resolved deferral against the code it says was built. Plus the register checks moving out into a tool of their own, including the one that renumbers rows when two branches claim the same id.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>buildinpublic</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Sentinel: The Watchdog and Derived Points</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 30 Sep 2026 06:24:29 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-the-watchdog-and-derived-points-2088</link>
      <guid>https://dev.to/virorum/sentinel-the-watchdog-and-derived-points-2088</guid>
      <description>&lt;p&gt;A door sensor that only reports when the door opens or closes can go months without sending anything. If nothing has happened, that silence is correct. If the sensor has died, the silence looks identical, and no freshness window can tell the two apart. So the registry won't accept an &lt;code&gt;on_change&lt;/code&gt; point unless it also declares a heartbeat or explicitly sets &lt;code&gt;never&lt;/code&gt;. Whoever adds the point has to say how anyone would know it had died, and the answer is recorded in a commit.&lt;/p&gt;

&lt;p&gt;A derived point can mislead in the same way. Computed naively, a 15-minute mean of a flow temperature keeps producing numbers after its sensor goes quiet, and a mean built from a single reading looks entirely reasonable on a dashboard. So the output carries a quality worked out from its inputs. A window with fewer than &lt;code&gt;min_samples&lt;/code&gt; readings comes out &lt;code&gt;bad&lt;/code&gt;, with the reason &lt;code&gt;insufficient_samples&lt;/code&gt;. A stale input makes the output stale unless the point has opted into &lt;code&gt;live_or_stale&lt;/code&gt;. And a derived point that stops emitting misses its own deadline and is marked stale by the same watchdog that watches the devices.&lt;/p&gt;

&lt;p&gt;Restarts are where silence is easiest to misread. Each point's deadline is recomputed from its last &lt;code&gt;observed_at&lt;/code&gt; when the core starts, so nothing has to be persisted. Without a startup grace, though, a fleet that reports every five minutes would go stale within seconds of the restart. A core running behind on ingest is worse: every point would pass its deadline while its data sat queued on the bus, and fail-safe interlocks would assert across the whole estate. Staleness is paused in both cases, and the lag pause is announced on its own signal so it can't hide a real fault. The slow part of a planned restart is rebuilding derived-point windows, and running those queries on a small pool, with one query shared by every derived point that reads the same input, keeps it bounded.&lt;/p&gt;

&lt;p&gt;Staleness and derived values both reach the rules engine as ordinary transitions on ordinary points, so the engine, two parts from now, only has to understand one kind of input.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; freshness policies and the single timer wheel that enforces them, the heartbeat requirement on &lt;code&gt;on_change&lt;/code&gt; points, liveness as a freshness policy, how staleness fires, how it recovers and how it ranks against &lt;code&gt;unavailable&lt;/code&gt;, startup grace, suppression during ingest lag and the three limits on it, flap damping, the derived point descriptor and its operator set, quality propagation, evaluation order and the cap on chain depth, windows and the retention guard that bounds them, the cold-start rehydration budget, emit policy, and the restricted expression grammar with its two binding contexts. It does not own the lag mechanism, its arithmetic or the scale targets, which belong to &lt;em&gt;Core Runtime&lt;/em&gt;; the retention classes, their policy values and how each rolls up, which belong to &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;; the raw-table query a window rehydrates from, which is defined in &lt;em&gt;Ingest Path &amp;amp; Log Schema&lt;/em&gt;; or how a rule triggers on a transition, claims an output and uses the grammar in its &lt;code&gt;when&lt;/code&gt; clause, which belong to &lt;em&gt;Rules Engine&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;These two land together because the watchdog's output is just another observation, and a derived point with no fresh inputs is exactly the staleness problem again one level up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watchdog
&lt;/h2&gt;

&lt;p&gt;A single timer wheel in the core, not a timer per point. Every point with a freshness policy has one pending deadline; when an observation lands, the deadline is cancelled and rescheduled. A hierarchical wheel at 1 s resolution handles tens of thousands of points on one thread and stays O(1) on reschedule, which is the operation that runs constantly. At the four thousand points targeted in &lt;em&gt;Core Runtime&lt;/em&gt; this is not close to a constraint.&lt;/p&gt;

&lt;p&gt;Deadlines survive restart because they are derived, not stored: &lt;code&gt;observed_at + window + grace&lt;/code&gt;, recomputed for every point during projection load. Nothing to persist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Policies&lt;/strong&gt;, from the descriptor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;periodic(interval, grace)&lt;/code&gt; — deadline at &lt;code&gt;observed_at + interval + grace&lt;/code&gt;. Grace defaults to half the interval, capped at 60 s.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;on_change(max_silence)&lt;/code&gt; — deadline at &lt;code&gt;observed_at + max_silence&lt;/code&gt;. Requires the device to heartbeat.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ttl(duration)&lt;/code&gt; — hard expiry, no grace.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;never&lt;/code&gt; — no deadline. Config values, static setpoints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;on_change&lt;/code&gt; without a heartbeat is the trap. A door sensor that reports only on transition is silent for months when nothing happens, and there is no window that distinguishes "quiet" from "dead". The registry rejects &lt;code&gt;on_change&lt;/code&gt; unless the point also declares &lt;code&gt;heartbeat: &amp;lt;interval&amp;gt;&lt;/code&gt; or explicitly sets &lt;code&gt;never&lt;/code&gt;. Forcing that choice at registration is the whole point: the question "how would I know if this died?" gets answered once, in a commit, rather than never.&lt;/p&gt;

&lt;p&gt;For BLE advertisement points, &lt;code&gt;periodic&lt;/code&gt; against the advertising interval is usually more honest than &lt;code&gt;on_change&lt;/code&gt;, since advertisements repeat regardless of change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Liveness is a freshness policy, not a value.&lt;/strong&gt; A point that reports "still running" every second is not a measurement; the information is in the gap, not in the sample. It is modelled as an ordinary point with a tight &lt;code&gt;periodic&lt;/code&gt; policy, with a rule triggering on &lt;code&gt;quality&lt;/code&gt; rather than on value. The system already treats absence as a first-class signal, so nothing extra is needed — and a rule watching for &lt;code&gt;true&lt;/code&gt; to become &lt;code&gt;false&lt;/code&gt; would be watching the wrong thing, since a dead process does not report &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Firing&lt;/strong&gt; writes a &lt;code&gt;quality_changed&lt;/code&gt; entry to &lt;code&gt;control_event&lt;/code&gt; and publishes a transition on &lt;code&gt;state.{point_id}&lt;/code&gt;. Same envelope shape as a value transition, &lt;code&gt;changed: false&lt;/code&gt;, value untouched. To the rules engine it is indistinguishable in structure from any other transition, which is the design goal.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;stale&lt;/code&gt; and &lt;code&gt;unavailable&lt;/code&gt; interact by precedence: an availability event from a driver sets &lt;code&gt;unavailable&lt;/code&gt; and &lt;strong&gt;cancels&lt;/strong&gt; the point's deadline. When availability returns, the point stays &lt;code&gt;unavailable&lt;/code&gt; until real data arrives — no synthetic promotion. This stops a flapping device from generating alternating &lt;code&gt;stale&lt;/code&gt;/&lt;code&gt;unavailable&lt;/code&gt; noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recovery is not automatic.&lt;/strong&gt; A point goes &lt;code&gt;stale → live&lt;/code&gt; only when an observation arrives that satisfies its policy. An observation with &lt;code&gt;observed_at&lt;/code&gt; older than the current deadline — a buffered replay landing late — does not clear staleness, though it is still logged. This is the second place &lt;code&gt;observed_at&lt;/code&gt; versus &lt;code&gt;ingested_at&lt;/code&gt; earns its keep.&lt;/p&gt;

&lt;h2&gt;
  
  
  When staleness is suppressed
&lt;/h2&gt;

&lt;p&gt;Two conditions pause staleness evaluation entirely. Both exist because the absence of data is sometimes a fact about the core rather than about the device, and reporting it as device staleness is a lie that causes the system to act.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Startup grace.&lt;/strong&gt; For the first N seconds after core start, &lt;code&gt;restored → stale&lt;/code&gt; transitions are suppressed, where N is the point's window plus grace. Otherwise every point in a fleet that reports every 5 minutes goes stale within seconds of a restart and floods the log. The suppression is per point, so a genuinely dead device still surfaces at the right time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ingest lag.&lt;/strong&gt; While the core is behind, all staleness evaluation pauses. Freshness is computed from &lt;code&gt;observed_at&lt;/code&gt;, so a core ten minutes behind would take every point in the system past its deadline while the data sits queued and healthy on the bus — and rules with &lt;code&gt;on_input_loss: release&lt;/code&gt; would drop their claims, and fail-safe interlocks would assert, across the whole estate, because ingest was slow. That is close to the worst available response and it is entirely self-inflicted.&lt;/p&gt;

&lt;p&gt;Three constraints on the lag suppression, because withholding a signal must not become a way to hide problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The threshold is computed, not configured.&lt;/strong&gt; Suppression engages when lag exceeds the smallest &lt;code&gt;window + grace&lt;/code&gt; in the registry. Past that point staleness is unreliable for at least one point, and there is no principled reason to trust it for the others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It is global, not per point.&lt;/strong&gt; Unlike startup grace, the condition is a property of the core, so all staleness evaluation pauses rather than pausing selectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The condition is loud.&lt;/strong&gt; Lag is a first-class signal, sustained lag is alertable, and &lt;code&gt;core.{n}.staleness-suppressed&lt;/code&gt; says plainly that this is happening. The system is not going quiet; it is replacing a false signal with a true one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When lag clears, deadlines are recomputed from each point's &lt;code&gt;observed_at&lt;/code&gt; and genuinely dead devices surface within one window. The lag mechanism and its arithmetic live in &lt;em&gt;Core Runtime&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flap damping.&lt;/strong&gt; A point crossing &lt;code&gt;live&lt;/code&gt;/&lt;code&gt;stale&lt;/code&gt; repeatedly is marked flapping rather than emitting every transition. Transitions are counted in a rolling window; past a threshold, a &lt;code&gt;flapping&lt;/code&gt; control event is emitted and further transitions coalesce until it settles. This is a rules-engine concern as much as a watchdog one — a rule triggering on staleness of a flapping point will fire endlessly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Derived points
&lt;/h2&gt;

&lt;p&gt;A derived point is a point. Same ID scheme, same descriptor fields, same quality states, same freshness, same bus subject. Consumers cannot tell the difference and should not be able to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;id            boiler.ch1.flow-temp-15m&lt;/span&gt;
&lt;span class="s"&gt;kind          measurement&lt;/span&gt;
&lt;span class="s"&gt;quantity      temperature&lt;/span&gt;
&lt;span class="s"&gt;unit_native   Cel&lt;/span&gt;
&lt;span class="s"&gt;subject       water&lt;/span&gt;
&lt;span class="s"&gt;subject_ref   zone:upstairs-ch&lt;/span&gt;
&lt;span class="na"&gt;derivation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;op          mean&lt;/span&gt;
  &lt;span class="s"&gt;inputs      [ boiler.ch1.flow-temp ]&lt;/span&gt;
  &lt;span class="s"&gt;window      15m&lt;/span&gt;
  &lt;span class="s"&gt;emit        on_input | interval(1m)&lt;/span&gt;
  &lt;span class="s"&gt;min_samples &lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;
  &lt;span class="s"&gt;input_quality  live_only | live_or_stale&lt;/span&gt;
  &lt;span class="s"&gt;freshness   periodic(1m, grace=30s)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The descriptor declares &lt;code&gt;quantity&lt;/code&gt; and &lt;code&gt;unit&lt;/code&gt; explicitly rather than inheriting them, because some operators change both. A &lt;code&gt;rate&lt;/code&gt; over energy yields power in W; a &lt;code&gt;delta&lt;/code&gt; over temperature yields &lt;code&gt;temperature_delta&lt;/code&gt;, which is a different quantity precisely because it is not affine-convertible. If the engine cannot verify that the declared output quantity matches what the operator produces from the input quantity, that is a registry validation failure at load time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operator set&lt;/strong&gt;, deliberately small:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;op&lt;/th&gt;
&lt;th&gt;notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mean&lt;/code&gt;, &lt;code&gt;min&lt;/code&gt;, &lt;code&gt;max&lt;/code&gt;, &lt;code&gt;sum&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;mean&lt;/code&gt; rejected when the input quantity is not &lt;code&gt;agg_safe&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;median&lt;/code&gt;, &lt;code&gt;p95&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;for noisy analogue sources&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stddev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a staleness-adjacent signal — a stuck sensor has zero variance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;delta&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;last minus first in window; output quantity differs from input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delta over time; output quantity differs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;debounce(duration)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;boolean stable for a duration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hysteresis(on, off)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;boolean from a numeric input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;restricted arithmetic over named inputs; grammar below&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;hysteresis&lt;/code&gt; as a derived point is the most consequential of these. Thresholds belong here, not in rules. A rule that says "pump on when &lt;code&gt;flow-temp-low&lt;/code&gt; is true" is readable and testable; a rule carrying its own threshold pair is neither, and the same threshold used by three rules is three chances to get it inconsistent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quality propagation&lt;/strong&gt; is where most implementations of this go wrong. The rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No input has ever been &lt;code&gt;live&lt;/code&gt; → output &lt;code&gt;unknown&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Any required input &lt;code&gt;unavailable&lt;/code&gt; → output &lt;code&gt;unavailable&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Any required input &lt;code&gt;bad&lt;/code&gt; → output &lt;code&gt;bad&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Window has fewer than &lt;code&gt;min_samples&lt;/code&gt; live samples → output &lt;code&gt;bad&lt;/code&gt;, reason &lt;code&gt;insufficient_samples&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Any required input &lt;code&gt;stale&lt;/code&gt; and policy is &lt;code&gt;live_only&lt;/code&gt; → output &lt;code&gt;stale&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Otherwise → &lt;code&gt;live&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;min_samples&lt;/code&gt; case matters more than it looks. A 15-minute mean computed from one sample is not a 15-minute mean, and it will look completely reasonable on a dashboard. &lt;code&gt;min_samples&lt;/code&gt; defaults to a figure derived from window and expected input interval — around 50% of expected — rather than to 1.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;input_quality: live_or_stale&lt;/code&gt; exists for windows long enough that a missed poll should not invalidate them. It is opt-in, and the output carries lower confidence, but it stops a 24-hour average collapsing because one reading was late.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evaluation.&lt;/strong&gt; Derived points form a DAG. Acyclicity is validated at registry load and cycles rejected there rather than detected at runtime. Evaluation is in topological order within a single transition batch, so a chain of three derived points settles in one pass rather than three bus round trips.&lt;/p&gt;

&lt;p&gt;Chain depth is capped at three or four levels. Deeper than that is a rules problem wearing a derived-points costume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows are queries, not buffers.&lt;/strong&gt; As established in the ingest design, rehydration is a &lt;code&gt;SELECT&lt;/code&gt; against the raw table for the input's retention class. The in-memory window is a cache of that query, and it can be rebuilt at any time. This is what makes derived points restart-transparent, and it is worth protecting: no derived-point state that cannot be recomputed from the log.&lt;/p&gt;

&lt;p&gt;Windows are bounded by both duration and sample count, so a misconfigured 5 Hz sensor with a 24-hour window does not consume the core.&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows are bounded by the retention of their inputs
&lt;/h3&gt;

&lt;p&gt;A window longer than the retention behind it rehydrates from a truncated range: it produces a value computed over less time than it claims, which &lt;code&gt;min_samples&lt;/code&gt; will usually but not always catch.&lt;/p&gt;

&lt;p&gt;Retention differs by class, so the check is &lt;strong&gt;per input, against that input's class&lt;/strong&gt;, not against a single global figure. A derived point reading a short-retention diagnostic must satisfy the diagnostic horizon even where it would comfortably pass a measurement one. That is a strictly better check than the global version and it catches the case most likely to be wrong.&lt;/p&gt;

&lt;p&gt;Two validations, and the second is the one that will actually bite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;At registry load&lt;/strong&gt;, reject any derived point whose window exceeds its input's class retention less one chunk interval, and warn above half of it. Zero slack is not enough, because a chunk dropping partway through a rehydration truncates the window silently. The check reads the retention policy from the database rather than a constant in the code — retention is a deployment parameter, and hardcoding a figure here means changing it later breaks derived points with no warning at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;At retention change&lt;/strong&gt;, refuse a shortening that would orphan an existing window. Retention gets shortened when a disk fills, which is exactly the moment nobody is thinking about derived points. This is the same class of guard as refusing to remove a vocabulary member that points still reference.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A window that cannot fit takes the rollup as its input instead.&lt;/strong&gt; A thirty-day mean cannot rehydrate from raw samples dropped at fourteen days, but it can read the hourly aggregate, which is kept far longer and is exactly the right granularity for a window that long. The choice is explicit in the descriptor and enforced at load, rather than discovered at the next restart when the window comes back short.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rehydration is the cold-start budget
&lt;/h3&gt;

&lt;p&gt;At the scale targets in &lt;em&gt;Core Runtime&lt;/em&gt; — a thousand or more derived points — this step is essentially all of the planned-restart time, and it is the only part of cold start that grows with configuration rather than with fleet size. Three things keep it bounded:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bounded concurrency, not sequential.&lt;/strong&gt; A thousand round trips executed one at a time is minutes of latency spent waiting rather than working. Run on a small pool, the wall time collapses toward the slowest few queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share queries across derived points reading the same input.&lt;/strong&gt; With a thousand derived points over two thousand inputs, several derived points will read the same source over overlapping windows. Group by input, issue one query covering the widest window in the group, and slice in memory. This is where the largest saving is, and it costs nothing at registry load to compute the grouping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch the compression boundary.&lt;/strong&gt; A window reaching past the compression age decompresses chunks to serve, which is far slower than a hot-chunk read. Windows that cross it are worth knowing about; a long window is not wrong, but it should be a deliberate choice rather than a surprise at the next restart.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rehydration time is measured as a &lt;code&gt;self&lt;/code&gt; point from the first restart. It is the number that degrades quietly as the rule set grows, and the one that makes an outage worse than it needs to be, since recovery is cold start plus drain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Emit policy.&lt;/strong&gt; &lt;code&gt;on_input&lt;/code&gt; recomputes and publishes on every input transition, which is right for &lt;code&gt;debounce&lt;/code&gt; and &lt;code&gt;hysteresis&lt;/code&gt; where latency matters. &lt;code&gt;interval(period)&lt;/code&gt; recomputes on a schedule, which is right for aggregates over slow-moving inputs where per-sample recomputation is wasted work. Aggregates generally use &lt;code&gt;interval&lt;/code&gt;, and the interval becomes the basis for the derived point's own freshness policy.&lt;/p&gt;

&lt;p&gt;Derived points respect their own &lt;code&gt;change_policy&lt;/code&gt; deadband exactly as device points do, so a moving average that moves by 0.001 °C does not emit a transition.&lt;/p&gt;

&lt;h2&gt;
  
  
  The restricted expression grammar
&lt;/h2&gt;

&lt;p&gt;Defined here and referenced by the rules engine. There is one grammar with two binding contexts, not two grammars, and it is written down before either consumer is built because an informal grammar is how &lt;code&gt;eval&lt;/code&gt; gets in.&lt;/p&gt;

&lt;p&gt;Legal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;arithmetic &lt;code&gt;+ - * / %&lt;/code&gt; and unary minus&lt;/li&gt;
&lt;li&gt;comparison &lt;code&gt;== != &amp;lt; &amp;lt;= &amp;gt; &amp;gt;=&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;boolean &lt;code&gt;and or not&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;min&lt;/code&gt;, &lt;code&gt;max&lt;/code&gt;, &lt;code&gt;abs&lt;/code&gt;, &lt;code&gt;clamp&lt;/code&gt;, &lt;code&gt;round&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;numeric, boolean, quality-member and enum-member literals&lt;/li&gt;
&lt;li&gt;names bound by the enclosing declaration, carrying exactly two accessors: &lt;code&gt;.value&lt;/code&gt; and &lt;code&gt;.quality&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rejected at load, not at runtime: function definitions, lambdas, loops, comprehensions, indexing, general attribute access, imports, string formatting, any call not in the list above, and any name not declared in the enclosing &lt;code&gt;inputs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.value&lt;/code&gt; and &lt;code&gt;.quality&lt;/code&gt; are an enumerated accessor pair, not general attribute access. The distinction has to be explicit, because "no attribute access" and &lt;code&gt;flow.quality == live&lt;/code&gt; otherwise contradict each other. The accessor set is closed, it has two members, and adding a third is a grammar change rather than a convenience.&lt;/p&gt;

&lt;p&gt;Quality members are legal only as operands of &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;!=&lt;/code&gt;. Ordering comparison on quality is meaningless — &lt;code&gt;stale &amp;gt; live&lt;/code&gt; is not a question — and the parser rejects it rather than coercing something.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binding contexts.&lt;/strong&gt; In a derived &lt;code&gt;expression&lt;/code&gt; point, names bind to input values and a bare &lt;code&gt;x&lt;/code&gt; means &lt;code&gt;x.value&lt;/code&gt;; &lt;code&gt;.quality&lt;/code&gt; is available but rarely wanted, because quality propagation is handled by the rules above rather than inside the expression. In a rule's &lt;code&gt;when&lt;/code&gt;, names bind to the full &lt;code&gt;(value, quality)&lt;/code&gt; pair and there is no bare-name sugar: a rule that reads a value without considering its quality is usually a bug, and it should have to say so in writing.&lt;/p&gt;

&lt;p&gt;Both contexts parse to an AST at registry load, using one parser. Two parsers is how the contexts diverge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The property that keeps the rules engine small
&lt;/h2&gt;

&lt;p&gt;Derived points feed derived points, and staleness of a derived point is computed by the same watchdog with the same policies. A derived point whose inputs went quiet stops emitting, misses its own deadline, and goes &lt;code&gt;stale&lt;/code&gt; — and a rule can trigger on that without knowing or caring that the point was derived.&lt;/p&gt;

&lt;p&gt;That uniformity is what lets the rules engine stay small. Rising edge, falling edge, moving average, staleness, fresh data and bad data are each either a transition predicate or a derived point, and the engine only needs to understand transitions over points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;No spurious edges at cold start.&lt;/strong&gt; Load a checkpointed projection, start the core, and assert zero &lt;code&gt;restored → stale&lt;/code&gt; transitions inside each point's grace, and the correct ones after it. This is the whole reason startup grace exists, and it is easy to get subtly wrong in a way that only shows up as a burst of log entries nobody reads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staleness suppression engages and clears.&lt;/strong&gt; Simulate lag past the computed threshold and assert that no staleness transitions are emitted, that &lt;code&gt;core.{n}.staleness-suppressed&lt;/code&gt; is true, and that when lag clears the deadlines are recomputed from each point's &lt;code&gt;observed_at&lt;/code&gt; so a genuinely dead device surfaces within one window. The failure mode to catch is suppression that never lifts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quality propagation, one fixture per row of the table.&lt;/strong&gt; Including the two that produce plausible wrong answers rather than errors: a window below &lt;code&gt;min_samples&lt;/code&gt; yields &lt;code&gt;bad&lt;/code&gt; with &lt;code&gt;insufficient_samples&lt;/code&gt; rather than a mean of two readings, and a non-&lt;code&gt;agg_safe&lt;/code&gt; input rejects &lt;code&gt;mean&lt;/code&gt; at load rather than computing one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The window guard fails the build.&lt;/strong&gt; A derived point whose window exceeds its input's class retention is rejected at registry load, and separately, a retention shortening that would orphan an existing window is refused. Both directions, because the second is the one that happens under pressure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rehydration is measured, and the grouping demonstrably works.&lt;/strong&gt; Record the wall time, and assert that the number of queries issued is materially below the number of derived points — if it equals it, the shared-query grouping is not doing anything and cold start will degrade linearly as the rule set grows.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;On Monday - the &lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-auditing-the-watchdog/" rel="noopener noreferrer"&gt;Dev Diary&lt;/a&gt;.&lt;/strong&gt; The latest on where the specification and the build disagree as the system takes shape, and which of the two had to change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-command-plane/" rel="noopener noreferrer"&gt;The Command Plane&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Where Sentinel starts writing to devices: desired and reported held as separate values, a durable claim set with banded arbitration, and a state machine that follows a fire-and-forget write through to a verified outcome.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>monitoring</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Sentinel Dev Diary: Checks &amp; Balances</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Mon, 28 Sep 2026 14:03:16 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-dev-diary-checks-balances-12k4</link>
      <guid>https://dev.to/virorum/sentinel-dev-diary-checks-balances-12k4</guid>
      <description>&lt;p&gt;This entry is about the checks and balances. Nine build steps into Sentinel, five processes have grown up around the specification, and each one catches a different way the code and the documents describing it come apart. Most of the work is done by AI coding agents, but nothing in these processes depends on that. They would work the same way on a team of engineers.&lt;/p&gt;

&lt;p&gt;They all start from one assumption: things will diverge. A specification written before the code will be wrong in places. The code will move after someone has described it. A note that was true on Tuesday will be stale by Thursday. On a project that runs for months you cannot stop that, and trying to is how a team ends up trusting documents that stopped being true a while ago. The realistic goal is to find divergence soon after it happens and to correct it somewhere the next person, or the next agent, will see it.&lt;/p&gt;

&lt;p&gt;The rest of this entry lays out the five: what each one watches, what keeps it honest, and where it stops. First, an example of the kind of divergence they exist to catch, found eleven days ago by the newest of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  A setting nothing read
&lt;/h2&gt;

&lt;p&gt;The part of the specification that went out last Wednesday, &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-ingest-path-and-log-schema/" rel="noopener noreferrer"&gt;Ingest Path and Log Schema&lt;/a&gt;&lt;/em&gt;, says this about writing to the database:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Inserts are batched - multi-row &lt;code&gt;INSERT&lt;/code&gt; flushed on 500 rows or 100 ms, whichever comes first.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code had both numbers. An accumulator took &lt;code&gt;batch_max_rows&lt;/code&gt; and &lt;code&gt;batch_max_delay_ms&lt;/code&gt; from configuration, 500 and 100, and offered a method, &lt;code&gt;due(now)&lt;/code&gt;, that answered exactly the question the sentence asks: is this batch full, or old enough, to flush?&lt;/p&gt;

&lt;p&gt;Nothing in the daemon ever called it.&lt;/p&gt;

&lt;p&gt;The ingest loop passed &lt;code&gt;now=0.0&lt;/code&gt; into every row it added, so the batch could never age, and then took the whole batch unconditionally. Meanwhile the two settings travelled faithfully through the system: from the settings class into the dataclass, into &lt;code&gt;.env.example&lt;/code&gt;, into the deploy workflow, into the GitHub Environment the deploy reads from. Every layer carried them, and none of them did anything. The register row that eventually recorded it put it better than I can:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The two fields travelled from &lt;code&gt;settings.py&lt;/code&gt; into the dataclass and affected nothing, which is worse than absent: a knob that appears to work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The part I did not enjoy: &lt;code&gt;due&lt;/code&gt; did have a caller, just not in the application. The throughput benchmark had built its own loop on top of it.&lt;/p&gt;

&lt;p&gt;Entry one held up a row as the register earning its keep: &lt;strong&gt;CP-1&lt;/strong&gt;, ingest throughput, 4,369 observations a second, with a field reading &lt;em&gt;Do not pre-decide: that the margin holds&lt;/em&gt;. I was quite pleased with that row. The benchmark behind it was measuring a batching strategy this system has never run.&lt;/p&gt;

&lt;p&gt;It was honest by coincidence. The unused knob said 500 rows, and the setting that actually bounds a batch, how many messages one pull from the bus may return, also says 500. When the benchmark was repointed at the real one the figure did not move, so the reading stands. But nobody knew that until somebody looked, and nothing was looking.&lt;/p&gt;

&lt;h2&gt;
  
  
  What found it
&lt;/h2&gt;

&lt;p&gt;The tests missed it. &lt;code&gt;test_batch.py&lt;/code&gt; passed throughout, because it tested the accumulator's flush policy directly; in the words of the row that closed it, it&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;asserted a flush policy nothing consulted, which is how a suite comes to certify behaviour the system does not have.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The audits missed it, because no exit criterion asks whether a configuration field is read. So did the drift check, which reads the code against the specification, and would have found a class implementing the sentence perfectly well.&lt;/p&gt;

&lt;p&gt;It turned up when I sat down to write, from the code, a description of what the ingest path does. There is no way to write "the batch flushes when &lt;code&gt;due&lt;/code&gt; returns true" with a citation next to it and not go and look for the caller.&lt;/p&gt;

&lt;p&gt;That was on the day the fifth process, the development guide, was created. Writing the guide found five things on its first pass, and this was one of the gentler ones.&lt;/p&gt;

&lt;p&gt;I have been describing these processes one at a time for three entries, and from here on I call them instruments. Here are all five together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five instruments, five tenses
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Instrument&lt;/th&gt;
&lt;th&gt;Tense&lt;/th&gt;
&lt;th&gt;Its normative home&lt;/th&gt;
&lt;th&gt;What keeps it honest&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the specification&lt;/td&gt;
&lt;td&gt;what the system &lt;strong&gt;will be&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;itself&lt;/td&gt;
&lt;td&gt;nothing internal; everything else comes at it from outside&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the four registers&lt;/td&gt;
&lt;td&gt;what is &lt;strong&gt;open now&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the specification&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;test_register_integrity.py&lt;/code&gt;, for the registers' shape only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the audits&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;happened&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the build step&lt;/td&gt;
&lt;td&gt;a person, once per step, looking back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the seam reviews&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;nobody said&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the joins between documents&lt;/td&gt;
&lt;td&gt;a rule in &lt;em&gt;Introduction&lt;/em&gt; that every step ends with one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the development guide&lt;/td&gt;
&lt;td&gt;what &lt;strong&gt;exists today&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;the code&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;test_dev_docs.py&lt;/code&gt;, and a marker on every claim&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The specification is where it starts, and it is the only one of the five that defines anything. It is also the only one with nothing inside it checking it. A document cannot audit itself; the best it can do is be written so that the others can.&lt;/p&gt;

&lt;p&gt;The registers number what the specification says, so that it can be cited, and hold what the build keeps producing that the specification has no home for. Entry one was about why they exist. They are under test, and entry three drew the edge of that: a register can be machine-checked for everything that is a statement about itself, and nothing that is a statement about the world outside.&lt;/p&gt;

&lt;p&gt;The audits are the retrospective. One per build step, in two halves: what changed during implementation, and what the step did not deliver. They are kept honest by a person, and only as far as the exit criteria reach. Entry two was the first of them finding silence; entry three was one of them failing to mention a fork in the road, because there was no exit criterion for it to fail.&lt;/p&gt;

&lt;p&gt;The seam reviews are the most recent thing the specification was amended to require, and the oldest complaint. Entry one ended on an open question, &lt;em&gt;Nothing reads the documents against each other&lt;/em&gt;, and three weeks ago it was answered by making it a step's own work: &lt;em&gt;Introduction&lt;/em&gt; now says that "every step ends with a review whose unit is the seam rather than the document". It is the only instrument whose unit is a &lt;em&gt;pair&lt;/em&gt; of documents. The one-owning-document rule optimises for consistency inside a document and provides nothing at the joins, and every cross-document gap found before it existed sat between two documents that were each perfectly consistent on their own.&lt;/p&gt;

&lt;p&gt;It has a joke in its history that I am still enjoying. The paragraph describing the drift check went on calling the seam review "standing, and currently unowned" for two days &lt;em&gt;after&lt;/em&gt; the amendment that gave it an owner. In the document that defines the drift check. The repository's own note on it at the time:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a pointer is only as current as the last person to follow it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What the first run actually found waits for the documents it found things in; that one is coming.&lt;/p&gt;

&lt;p&gt;The development guide is the fifth, and it is the one that runs the other way round.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one that points at the code
&lt;/h2&gt;

&lt;p&gt;Everything else in that table is about the specification. The registers point at it. The audits measure the code against it. The seam reviews read it against itself.&lt;/p&gt;

&lt;p&gt;Nothing said how the thing that exists behaves. Nine build steps in, the daemon was about 36,000 lines across two repositories, and every piece of work, in every session, was paying to reconstruct it. Since nearly all of that work is done by coding agents, "every piece of work" really does mean every one: an agent opening a session has read the repository and none of my recollection, so it rebuilt its understanding of the ingest loop from scratch each time and, presumably, slightly differently each time.&lt;/p&gt;

&lt;p&gt;(It did not help that the project's own &lt;code&gt;CLAUDE.md&lt;/code&gt;, the first file an agent reads, described two application directories as populated. Both hold a &lt;code&gt;.gitkeep&lt;/code&gt;. They always have. They are the layering from a template for a different kind of app, and this process is a daemon. Writing the guide found that too.)&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;docs/dev/&lt;/code&gt; was written as fifteen chapters, around 3,300 lines, and it defines nothing, exactly as the registers define nothing. The difference is only what it points at. A register row points at the specification and is cited by id. A chapter points at the code and cites &lt;code&gt;path.py::symbol&lt;/code&gt;. The constraint that makes that legitimate rather than a second definition was already in the specification:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prose in these notes explains them; it does not define them once the code exists.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And where the code and the specification disagree, the guide describes the code and links the register row recording the disagreement. Where there is no row, the disagreement is a finding and gets routed like any other, instead of being written around.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proved by, or unverified
&lt;/h3&gt;

&lt;p&gt;This is the part I would steal for any project.&lt;/p&gt;

&lt;p&gt;Every mechanism section in the guide ends in one of two ways. Either with &lt;code&gt;Proved by:&lt;/code&gt; and the test that would fail if the claim stopped being true, or with the bare word &lt;strong&gt;unverified&lt;/strong&gt;. There is no third option, and in particular there is no option for explaining why checking was not necessary. The reasoning, from the guide's own introduction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a marker reading "not checked" invites the check; one reading "trivially true" ends it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two days in, sixty-five claims carried a &lt;code&gt;Proved by:&lt;/code&gt;. Three were marked &lt;strong&gt;unverified&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And every chapter names the commit it was derived from,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;because four pull requests means four different truths about &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A chapter is as current as that line says, and no more.&lt;/p&gt;

&lt;p&gt;Then there is a test, &lt;code&gt;test_dev_docs.py&lt;/code&gt;, which asserts that every cited path exists and defines the symbol it names, that a list marked as an enum's members holds exactly that enum's members, and that a table marked as a mapping parses to exactly that mapping.&lt;/p&gt;

&lt;p&gt;That makes it the fifth place in the repository where a document is coupled to the code by a test, and the first that runs this way round. The other four assert that the specification still describes the code. This one asserts that the &lt;em&gt;documentation&lt;/em&gt; still describes the code, which sounds like a small distinction until you notice that nothing checked that before.&lt;/p&gt;

&lt;h2&gt;
  
  
  It rotted in two days
&lt;/h2&gt;

&lt;p&gt;Of course it did.&lt;/p&gt;

&lt;p&gt;Two days after the guide was written, it was audited against the code, the way the audits check a build step. Eleven commits had touched it in the meantime, and not with the same care.&lt;/p&gt;

&lt;p&gt;Eleven chapters claimed a currency they did not have. Every edited chapter still carried its original derived-from commit, in the layer whose own README makes that line the definition of how current a chapter is. Three described code that had changed under them. One citation credited a function with publishing messages when all it does is format a subject string; the claim underneath was true, the citation resolved, so the test passed. A citation hung on a symbol that made the sentence look checked.&lt;/p&gt;

&lt;p&gt;That last one is the docs test's edge, in exactly the way entry three found the register test's. It can prove the symbol exists. It cannot prove the symbol is the one doing the thing.&lt;/p&gt;

&lt;p&gt;My favourite goes straight back to the batching. The ingest chapter had to say what really decides a batch, now that the knob was gone: one pull from the bus is one batch is one transaction. It cited &lt;code&gt;test_ingest_pipeline.py&lt;/code&gt; for that. Nothing in &lt;code&gt;test_ingest_pipeline.py&lt;/code&gt; asserts it. So the audit demoted it, and the section now ends:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For the cadence itself - that &lt;code&gt;run_once&lt;/code&gt; takes &lt;strong&gt;once per fetch&lt;/strong&gt;, unconditionally - &lt;strong&gt;unverified&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;followed by the test that would close it.&lt;/p&gt;

&lt;p&gt;I like that more than any &lt;code&gt;Proved by:&lt;/code&gt; in the guide. It is the marker working in reverse: a claim that had a check pinned to it losing the check, and saying so, where the reader will trip over it. The specification described a batching rule that never ran. The guide describes the one that does, and is honest that nothing yet proves it. That is the right way round for those two documents to be wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Different ways to rot
&lt;/h2&gt;

&lt;p&gt;Every one of the five goes stale in its own way, including the checks themselves. The tenses are the useful way to hold all this, because each one decays differently, and so each needs something different watching it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The specification rots by being overtaken. It is amended as the build discharges its open items, which is why the copies published here are a frozen snapshot, and why the gap between the snapshot and the current text is what this diary is for.&lt;/li&gt;
&lt;li&gt;The registers rot by saying things about the world they cannot see, like entry three's sentence placing a test somewhere it had never been, which stood for three pull requests.&lt;/li&gt;
&lt;li&gt;The audits do not rot so much as squint. They are history, but they only see as far as the exit criteria reach.&lt;/li&gt;
&lt;li&gt;The seam reviews rot like any pointer: the rule was two days old before the paragraph describing it caught up.&lt;/li&gt;
&lt;li&gt;The guide rots by the code moving underneath it, and the derived-from commit is the only reason anyone can tell.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of them can do another's job. The register tests cannot look outside the registers. The audits cannot see a fork that no criterion asks about. The drift check reads the code against the prose, but only from one side. The seam review reads document against document and never touches code. The guide reads code into prose, and the one thing it cannot do is say what the code &lt;em&gt;should&lt;/em&gt; do; that stays with the specification, which is where this started.&lt;/p&gt;

&lt;p&gt;Every one of the five was added because the one before it had an edge, and something had just fallen off it. I had assumed the newest would spend its first week finding small things in the newest code. Instead, on its first day, it found a hole under entry one's proudest number.&lt;/p&gt;

&lt;p&gt;That is the pattern I would take to any long-running project, with or without agents. Assume the documents and the code will drift. Give each kind of drift something that looks for it, and when one of those checks finds its own edge, add the next one.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This Wednesday - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;The Watchdog and Derived Points&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The specification's fifth part: one timer wheel for every freshness deadline, and what a derived point is allowed to say when its inputs go stale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next entry - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-auditing-the-watchdog/" rel="noopener noreferrer"&gt;Auditing the Watchdog&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; What the build sent back to the specification from step four: a sentence with two halves and a test asserting the one that worked, and a stale point whose checkpoint never moved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the diary: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-the-registers/" rel="noopener noreferrer"&gt;Four Registers and a Drift Check&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; Why the registers exist at all, and the one rule about where a sentence is allowed to live.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>documentation</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Sentinel: Ingest Path and Log Schema</title>
      <dc:creator>Philip Shaw</dc:creator>
      <pubDate>Wed, 23 Sep 2026 10:33:04 +0000</pubDate>
      <link>https://dev.to/virorum/sentinel-ingest-path-and-log-schema-2mfj</link>
      <guid>https://dev.to/virorum/sentinel-ingest-path-and-log-schema-2mfj</guid>
      <description>&lt;p&gt;Last week's sensor is still reporting &lt;code&gt;71.6&lt;/code&gt; in Fahrenheit, and its driver has published that number untouched, as the contract requires. The conversion to Celsius happens here instead, at the eighth of thirteen stages between the bus and the database, and the row it writes keeps both numbers: &lt;code&gt;22.0&lt;/code&gt; in the canonical column, and &lt;code&gt;71.6&lt;/code&gt; in the native one beside the unit the device actually used.&lt;/p&gt;

&lt;p&gt;Keeping both is what makes a conversion reversible. Suppose that weeks later the descriptor's scale factor turns out to have been wrong. Nothing collected in the meantime is lost, because the number the device produced was never overwritten; a reprocess recomputes every canonical value from native under a corrected registry version, rebuilds the current state of the affected points, and refreshes the aggregates built over them. It can only reach rows that still exist, and it refuses outright rather than correcting the part of a request it can reach. What it will not do is re-run the rules that fired on the wrong numbers, because those decisions were made on the data as it stood.&lt;/p&gt;

&lt;p&gt;The other load-bearing decision is smaller and much easier to get wrong: where &lt;code&gt;ingested_at&lt;/code&gt; comes from. Timescale requires the partitioning column in every unique index, so the dedup key cannot be just the three columns that identify a message; it has to carry the timestamp as well. Stamp that from the core's clock at processing time, and a message redelivered after a crash arrives with a new timestamp, slips past the index and inserts a duplicate, while the index goes on looking as though it enforces dedup. Take it from the bus instead, where it is fixed once and identical on every redelivery, and the same index turns at-least-once delivery into exactly-once effects without a watermark table of its own.&lt;/p&gt;

&lt;p&gt;Those two decisions are the spine of this document. The two logs, the per-class hypertables, the thirteen stages and their ordering rules, the restart sequence and the reprocess command are what the rest of the schema has to look like once both are held fixed.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;What this document owns:&lt;/strong&gt; the split into an observation log and a control-event log, the observation schema and its physical split into one hypertable per retention class, where &lt;code&gt;ingested_at&lt;/code&gt; comes from and why, the versioned and content-addressed registry, the thirteen-stage ingest pipeline and its three ordering rules, the in-memory projection and its checkpoint, the restart sequence, reprocess and its refusal to apply partially, and the properties of the continuous aggregates that belong with the schema rather than the policy. What it deliberately does not own is how long anything is kept, how each class rolls up and how state-class compaction works, which belong to &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;; keeping cold-start rehydration bounded, which belongs to &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt;; the core epoch, restarting against a backlog and the utilisation arithmetic the ingest ceiling feeds into, which belong to &lt;em&gt;Core Runtime&lt;/em&gt;; and who a &lt;code&gt;principal&lt;/code&gt; is and why a &lt;code&gt;wrong_instance&lt;/code&gt; count is an alert rather than a dashboard figure, which belong to &lt;em&gt;Security Model&lt;/em&gt;. Everything downstream that asks what a point's value is, or was, is reading a projection of the two logs defined here.&lt;/p&gt;

&lt;p&gt;Two things drive the whole design here: the bus message's own identity doubles as the dedup key and the ingest watermark, and &lt;code&gt;value_native&lt;/code&gt; in the log is what makes conversion reversible. Get those right and restart and reprocess both fall out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two logs, not one
&lt;/h2&gt;

&lt;p&gt;The pure event-sourcing instinct is one ordered log. It is the wrong shape here. Observations and control events have different volumes, retention, and query shapes, and Timescale hypertables want homogeneous rows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;observation&lt;/code&gt;&lt;/strong&gt; — high volume, append-only, compressed, aged out. Ordering matters only within a point. Physically several hypertables, one per retention class; see below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;control_event&lt;/code&gt;&lt;/strong&gt; — commands, availability, quality transitions, assignment changes, reprocess operations. Low volume, globally sequenced, kept forever, not classed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The projection is built from both. Quality transitions from the freshness watchdog go in &lt;code&gt;control_event&lt;/code&gt; because they carry no new value; in a healthy system they are rare, and when they are not rare that is the thing most worth a permanent record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Schema
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;quality&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;ENUM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'unknown'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'restored'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'live'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'stale'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'unavailable'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'bad'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'assumed'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- identical definition for each retention class:&lt;/span&gt;
&lt;span class="c1"&gt;--   observation_measurement, observation_state, observation_diagnostic&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;observation_&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;ingested_at&lt;/span&gt;       &lt;span class="n"&gt;timestamptz&lt;/span&gt;  &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- bus-accept time; see below&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;          &lt;span class="nb"&gt;text&lt;/span&gt;         &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;observed_at&lt;/span&gt;       &lt;span class="n"&gt;timestamptz&lt;/span&gt;  &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;device_time&lt;/span&gt;       &lt;span class="n"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="n"&gt;value_num&lt;/span&gt;         &lt;span class="nb"&gt;double&lt;/span&gt; &lt;span class="nb"&gt;precision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- canonical&lt;/span&gt;
  &lt;span class="n"&gt;value_bool&lt;/span&gt;        &lt;span class="nb"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_text&lt;/span&gt;        &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;               &lt;span class="c1"&gt;-- canonical enum member / string&lt;/span&gt;
  &lt;span class="n"&gt;native_num&lt;/span&gt;        &lt;span class="nb"&gt;double&lt;/span&gt; &lt;span class="nb"&gt;precision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;native_text&lt;/span&gt;       &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;               &lt;span class="c1"&gt;-- raw device representation&lt;/span&gt;

  &lt;span class="n"&gt;unit_native&lt;/span&gt;       &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;quality&lt;/span&gt;           &lt;span class="n"&gt;quality&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;reason&lt;/span&gt;            &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;detail&lt;/span&gt;            &lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="n"&gt;changed&lt;/span&gt;           &lt;span class="nb"&gt;boolean&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;registry_version&lt;/span&gt;  &lt;span class="nb"&gt;integer&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;driver_instance&lt;/span&gt;   &lt;span class="nb"&gt;text&lt;/span&gt;         &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;source_epoch&lt;/span&gt;      &lt;span class="nb"&gt;integer&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;source_seq&lt;/span&gt;        &lt;span class="nb"&gt;bigint&lt;/span&gt;       &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;skew_flagged&lt;/span&gt;      &lt;span class="nb"&gt;boolean&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;create_hypertable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'observation_&amp;lt;class&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'ingested_at'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                         &lt;span class="n"&gt;chunk_time_interval&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'1 day'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;observation_&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;driver_instance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source_epoch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source_seq&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ingested_at&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;observation_&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;point_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;observed_at&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typed columns rather than JSONB for values. JSONB costs space on the highest-volume table and blocks index-only scans; five nullable narrow columns cost less, with only one or two populated per row.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One hypertable per retention class.&lt;/strong&gt; Timescale attaches retention, compression and continuous-aggregate policies to a table rather than to a row, so per-class policy means a physical split. The class comes from the resolved descriptor, which ingest already has by the time it writes. The policies themselves are in &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;; what belongs here is that the split exists, that the schema is identical across classes, and that it cannot be deferred — adding the class field later is easy, splitting a populated table is a rewrite of everything ever collected.&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;observation&lt;/code&gt; view over the three, as &lt;code&gt;UNION ALL&lt;/code&gt;, exists for ad-hoc querying. The hot paths do not use it: rehydration and reprocess resolve the class from the descriptor and query the specific table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chunk on &lt;code&gt;ingested_at&lt;/code&gt;, not &lt;code&gt;observed_at&lt;/code&gt;.&lt;/strong&gt; A driver host replaying a buffered partition writes rows with old &lt;code&gt;observed_at&lt;/code&gt; values, which would land in chunks that are already compressed. &lt;code&gt;ingested_at&lt;/code&gt; is monotonic by construction, so chunks close cleanly and never reopen. The cost is that analytical queries filtering on &lt;code&gt;observed_at&lt;/code&gt; lose chunk exclusion, which the secondary index mostly covers at these volumes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every observation writes a row, including one that changed nothing.&lt;/strong&gt; Suppressing unchanged rows at write time is a tempting optimisation and it breaks two mechanisms: derived-point windows rehydrate by querying these tables, so &lt;code&gt;mean&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt; and &lt;code&gt;min_samples&lt;/code&gt; need the samples that were suppressed; and reprocess can only reconvert rows that exist. Volume is managed afterwards, by retention and compaction, where the trade is explicit and bounded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where &lt;code&gt;ingested_at&lt;/code&gt; comes from
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;It is the JetStream message timestamp, not &lt;code&gt;now()&lt;/code&gt; at processing time.&lt;/strong&gt; This is load-bearing and easy to get wrong.&lt;/p&gt;

&lt;p&gt;Timescale requires the partitioning column in every unique index, so the dedup index is necessarily &lt;code&gt;(driver_instance, source_epoch, source_seq, ingested_at)&lt;/code&gt; rather than the three-column key that would otherwise be correct. If &lt;code&gt;ingested_at&lt;/code&gt; were assigned when the core happened to process the message, a redelivery after a crash would carry a different value, land outside the index, and insert a duplicate row. The index would look like it was enforcing dedup and would not be.&lt;/p&gt;

&lt;p&gt;The bus timestamp is fixed when the message enters the stream and is identical on every redelivery, which makes the four-column index behave exactly like the three-column one. It also keeps the monotonicity that chunking depends on, because a single &lt;code&gt;obs&lt;/code&gt; stream assigns timestamps in stream order. If observations ever arrive from more than one stream, that property weakens and this decision needs revisiting.&lt;/p&gt;

&lt;p&gt;The cost is a change of meaning: &lt;code&gt;ingested_at&lt;/code&gt; is when the bus accepted the observation, not when the core recorded it. That is the more useful of the two anyway — it is the moment the observation became durable, it comes from one clock rather than from whichever core process handled it, and it is stable across a core restart. Core processing lag belongs on a &lt;code&gt;self&lt;/code&gt; point, not on a column of the highest-volume table in the system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;control_event&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;seq&lt;/span&gt;          &lt;span class="n"&gt;bigserial&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;occurred_at&lt;/span&gt;  &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;kind&lt;/span&gt;         &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- quality_changed, command_*, availability, assignment, reprocess&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;     &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;subject_key&lt;/span&gt;  &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                   &lt;span class="c1"&gt;-- driver_instance / device / component&lt;/span&gt;
  &lt;span class="n"&gt;principal&lt;/span&gt;    &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- who caused it; see Security Model&lt;/span&gt;
  &lt;span class="n"&gt;core_epoch&lt;/span&gt;   &lt;span class="nb"&gt;integer&lt;/span&gt;     &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- which core instance; see Core Runtime&lt;/span&gt;
  &lt;span class="n"&gt;payload&lt;/span&gt;      &lt;span class="n"&gt;jsonb&lt;/span&gt;       &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;registry_version&lt;/span&gt; &lt;span class="nb"&gt;integer&lt;/span&gt;  &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;principal&lt;/code&gt; and &lt;code&gt;core_epoch&lt;/code&gt; are both &lt;code&gt;NOT NULL&lt;/code&gt; deliberately. A code path that cannot name who asked, or which core acted, cannot write a control event — which means it cannot change state.&lt;/p&gt;

&lt;h2&gt;
  
  
  The registry is versioned data
&lt;/h2&gt;

&lt;p&gt;Vocabularies and point descriptors load from git into Postgres. Every registry load creates a version row, and descriptors are stored per version by content hash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;registry_version&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;version&lt;/span&gt;    &lt;span class="nb"&gt;integer&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;loaded_at&lt;/span&gt;  &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;git_sha&lt;/span&gt;    &lt;span class="nb"&gt;text&lt;/span&gt;        &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;content_hash&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt;      &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;descriptor_blob&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;hash&lt;/span&gt;       &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;-- of the canonicalised descriptor&lt;/span&gt;
  &lt;span class="k"&gt;descriptor&lt;/span&gt; &lt;span class="n"&gt;jsonb&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;point_descriptor&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;version&lt;/span&gt;   &lt;span class="nb"&gt;integer&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;registry_version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;  &lt;span class="nb"&gt;text&lt;/span&gt;    &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;hash&lt;/span&gt;      &lt;span class="nb"&gt;text&lt;/span&gt;    &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;descriptor_blob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;point_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The indirection exists because of scale. At a few hundred points a full descriptor copy per version is a rounding error; at the four thousand points targeted in &lt;em&gt;Core Runtime&lt;/em&gt; it is around 1.6 MB per commit, growing without bound, when a typical commit changes a handful of points. Content-addressing collapses that to one small row per point per version plus one blob per genuinely new descriptor.&lt;/p&gt;

&lt;p&gt;It preserves the property that matters: any historical observation can be reinterpreted under the exact descriptor that produced it, or under any other version, because every version still names a complete descriptor set.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ingest pipeline
&lt;/h2&gt;

&lt;p&gt;Stages, in order, all core-side:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consume&lt;/strong&gt; from the JetStream durable consumer on &lt;code&gt;obs.&amp;gt;&lt;/code&gt;, taking &lt;code&gt;ingested_at&lt;/code&gt; from the message&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate envelope&lt;/strong&gt; — required fields, parseable timestamps, &lt;code&gt;observed_at&lt;/code&gt; not absurdly in the future&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dedup&lt;/strong&gt; on &lt;code&gt;(driver_instance, source_epoch, source_seq)&lt;/code&gt; against an in-memory set of recently seen keys; this is a fast path, and the unique index is the authority&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolve point&lt;/strong&gt; — registry lookup; miss goes to quarantine and the message is acked&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check publisher&lt;/strong&gt; — the host and instance assigned to this point must match the ones the message was published from; a mismatch goes to quarantine with reason &lt;code&gt;wrong_instance&lt;/code&gt; and the message is acked&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unit check&lt;/strong&gt; — driver-supplied &lt;code&gt;unit_native&lt;/code&gt; disagreeing with the descriptor gives quality &lt;code&gt;bad&lt;/code&gt;, reason &lt;code&gt;unit_mismatch&lt;/code&gt;, no conversion attempted&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate value&lt;/strong&gt; — range check, enum codebook lookup; failures give &lt;code&gt;bad&lt;/code&gt; with the offending value preserved in &lt;code&gt;native_text&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convert&lt;/strong&gt; — &lt;code&gt;value_native × factor + offset&lt;/code&gt;, affine-aware&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skew check&lt;/strong&gt; — &lt;code&gt;device_time&lt;/code&gt; against &lt;code&gt;observed_at&lt;/code&gt;, sets &lt;code&gt;skew_flagged&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluate change&lt;/strong&gt; — deadband against the in-memory projection, sets &lt;code&gt;changed&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Append&lt;/strong&gt; to the hypertable for the descriptor's retention class, batched, as &lt;code&gt;INSERT ... ON CONFLICT DO NOTHING ... RETURNING&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit&lt;/strong&gt;, then &lt;strong&gt;ack&lt;/strong&gt; the JetStream messages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update projection&lt;/strong&gt; and &lt;strong&gt;publish&lt;/strong&gt; transitions to &lt;code&gt;state.{point_id}&lt;/code&gt;, for returned rows only&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Stage 5 is what makes bus permissions mean anything.&lt;/strong&gt; Subject scoping confines a host to publishing under its own prefix, but says nothing about which point IDs it puts inside those subjects. Without this check, one compromised driver host could publish readings for every point in the system, including the inputs to thermal interlocks, entirely within its permissions. It is one comparison against the assignment mapping the registry already holds.&lt;/p&gt;

&lt;p&gt;The result is a security signal rather than a data-quality one. A &lt;code&gt;unit_mismatch&lt;/code&gt; is a configuration error; a &lt;code&gt;wrong_instance&lt;/code&gt; is a host claiming points that were never assigned to it, and the count belongs in the alerting path rather than on a dashboard. See &lt;em&gt;Security Model&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 11 batches per class&lt;/strong&gt;, since a batch has to target one table. That is a grouping in the flush, not three pipelines — a batch is partitioned by class immediately before the insert and committed in one transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stages 2 to 10 are the throughput ceiling&lt;/strong&gt;, not the insert. Per-observation validation, registry lookup, codebook resolution and conversion all happen once per row in application code, and that is where sustainable ingest rate is actually determined. It is the unmeasured term in the utilisation arithmetic in &lt;em&gt;Core Runtime&lt;/em&gt;, and it is worth benchmarking against the design rate before sizing anything that depends on it.&lt;/p&gt;

&lt;p&gt;Three ordering rules that are easy to get wrong and expensive to debug:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ack after commit.&lt;/strong&gt; The consumer's ack position is the ingest watermark. Crash between commit and ack, and the redelivered messages carry the same &lt;code&gt;(instance, epoch, seq, ingested_at)&lt;/code&gt; and are swallowed by the unique index. Crash before commit, and they are redelivered and processed properly. This produces exactly-once effects from at-least-once delivery without a separate watermark table — but only because &lt;code&gt;ingested_at&lt;/code&gt; is deterministic. If that ever changes, the whole property goes with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publish after commit.&lt;/strong&gt; Rules must never fire on data that could roll back. A relay that clicks because of an aborted transaction is a bad afternoon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project only what actually inserted.&lt;/strong&gt; &lt;code&gt;ON CONFLICT DO NOTHING&lt;/code&gt; makes a redelivered batch a no-op in the table, but the projection update and the transition publish are not idempotent in the way that matters: re-publishing a transition re-fires the rules engine on an edge that already happened. Stage 13 is driven from the &lt;code&gt;RETURNING&lt;/code&gt; set rather than from the batch submitted. This is the redelivery case doing its job silently, and it is invisible in testing unless a core is crashed mid-batch on purpose.&lt;/p&gt;

&lt;p&gt;Inserts are batched — multi-row &lt;code&gt;INSERT&lt;/code&gt; flushed on 500 rows or 100 ms, whichever comes first. Per-row inserts will not keep up at this scale, and the batch window is invisible next to the polling intervals.&lt;/p&gt;

&lt;p&gt;Failure at stages 6–8 still writes a row. A &lt;code&gt;bad&lt;/code&gt; observation is data — it refreshes freshness, it feeds bad-data rule triggers, and it is the evidence when working out why a sensor went strange at 3am. Silence is the one outcome that helps nobody.&lt;/p&gt;

&lt;p&gt;Failures at stages 4 and 5 do not write a row, because there is no descriptor to write one against, and therefore no class to route to. Both go to quarantine with the full native payload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Projection
&lt;/h2&gt;

&lt;p&gt;The authoritative copy is in memory in the core. Postgres holds a checkpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;point_state&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;point_id&lt;/span&gt;        &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_num&lt;/span&gt;       &lt;span class="nb"&gt;double&lt;/span&gt; &lt;span class="nb"&gt;precision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_bool&lt;/span&gt;      &lt;span class="nb"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value_text&lt;/span&gt;      &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;quality&lt;/span&gt;         &lt;span class="n"&gt;quality&lt;/span&gt;     &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;reason&lt;/span&gt;          &lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;observed_at&lt;/span&gt;     &lt;span class="n"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;ingested_at&lt;/span&gt;     &lt;span class="n"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;changed_at&lt;/span&gt;      &lt;span class="n"&gt;timestamptz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;-- last value change past deadband&lt;/span&gt;
  &lt;span class="n"&gt;quality_since&lt;/span&gt;   &lt;span class="n"&gt;timestamptz&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;watermark_seq&lt;/span&gt;   &lt;span class="nb"&gt;bigint&lt;/span&gt;                &lt;span class="c1"&gt;-- last control_event applied&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write policy: &lt;strong&gt;immediately on quality change, at most every 5 s per point on value change, plus a full flush every 30 s.&lt;/strong&gt; Per-observation &lt;code&gt;UPDATE&lt;/code&gt; on a hot table generates MVCC bloat for no benefit — the value churn does not need durability because the log already has it. Quality changes are rare and operationally important, so those go through synchronously.&lt;/p&gt;

&lt;p&gt;The value in &lt;code&gt;point_state&lt;/code&gt; is never nulled when quality degrades. Consumers get &lt;code&gt;(value, quality, observed_at)&lt;/code&gt; and decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Restart
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Load vocabularies and current registry version&lt;/li&gt;
&lt;li&gt;Load &lt;code&gt;point_state&lt;/code&gt;, force every quality to &lt;code&gt;restored&lt;/code&gt; (except rows already &lt;code&gt;unknown&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Resume the JetStream consumer from its ack position; replay anything the checkpoint missed&lt;/li&gt;
&lt;li&gt;Replay &lt;code&gt;control_event&lt;/code&gt; above each point's &lt;code&gt;watermark_seq&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rehydrate derived-point windows by querying the appropriate class table for the required lookback&lt;/li&gt;
&lt;li&gt;Rehydrate durable timers from &lt;code&gt;control_event&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Start drivers; instances go &lt;code&gt;connecting → connected → ready&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rules leave warmup as their inputs reach &lt;code&gt;live&lt;/code&gt;, or when their warmup deadline expires&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 3 can be blunt precisely because of the dedup key: anything already committed is re-consumed and discarded, so the consumer resumes from a conservative position without the core having to reason about how far it got.&lt;/p&gt;

&lt;p&gt;Step 5 is the quiet payoff of log-first. A 15-minute moving average needs no separately persisted ring buffer — it is a query. Derived points become stateless to restart, which removes an entire category of subtle post-restart wrongness. It is also the step that dominates cold start, and &lt;em&gt;Watchdog &amp;amp; Derived Points&lt;/em&gt; covers how to keep it bounded.&lt;/p&gt;

&lt;p&gt;Step 2's blanket &lt;code&gt;restored&lt;/code&gt; is deliberately pessimistic. Something that was &lt;code&gt;bad&lt;/code&gt; before the restart might be fine now, and the driver will say so within one poll interval.&lt;/p&gt;

&lt;p&gt;Where the restart follows an outage long enough to have built a backlog, steps 3 onward run against a draining queue rather than a current one. What that changes is in &lt;em&gt;Core Runtime&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reprocess
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;value_native&lt;/code&gt; is never rewritten. That is what makes this possible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;reprocess &lt;span class="nt"&gt;--point-glob&lt;/span&gt; &lt;span class="s1"&gt;'boiler.*'&lt;/span&gt; &lt;span class="nt"&gt;--from&lt;/span&gt; 2026-06-01 &lt;span class="nt"&gt;--registry-version&lt;/span&gt; current
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recompute canonical values from native under a chosen registry version, update the affected rows, rebuild the projection for those points, refresh every dependent continuous aggregate over the affected range, and write a &lt;code&gt;reprocess&lt;/code&gt; entry to &lt;code&gt;control_event&lt;/code&gt; recording the scope, the old version, the new one, and the aggregate ranges refreshed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ingested_at&lt;/code&gt; is never rewritten either. Reprocess changes what a row means, not when it arrived, and the dedup key has to keep pointing at the same message.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refreshing the aggregates is part of the operation, not a side effect of it.&lt;/strong&gt; Timescale records an invalidation when the underlying rows change, but the background refresh policy only revisits its own recent window — typically the last day or two. A correction to June's data leaves an invalidation nobody will ever process, and the aggregates keep serving the old numbers indefinitely while the raw table is right. That divergence is worse than the original error, because the raw table and the dashboard now disagree and nothing says so.&lt;/p&gt;

&lt;p&gt;So the reprocess command calls &lt;code&gt;refresh_continuous_aggregate&lt;/code&gt; explicitly for each aggregate over the affected range, after the row updates commit. Two details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Round the range outward to bucket boundaries.&lt;/strong&gt; A range that starts mid-bucket produces a partially recomputed bucket, which is a worse artefact than either the old or the new value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The refresh is point-blind.&lt;/strong&gt; Aggregates bucket by time, not by point glob, so refreshing recomputes every point in those buckets, not just the ones reprocessed. That is more work than the reprocess itself and it is the right trade: filtering by point would mean maintaining a parallel invalidation map, and the whole operation is rare.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The horizon is per class, and partial reprocess is refused
&lt;/h3&gt;

&lt;p&gt;Reprocess can only reach rows that still exist, and raw retention differs by retention class. A point glob can therefore span classes with different horizons, and a range that is valid for a measurement point may be long gone for a diagnostic one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The command validates the whole scope first and refuses outright if any point in it cannot be covered&lt;/strong&gt;, reporting which points and which classes made it impossible. It does not correct the part it can reach.&lt;/p&gt;

&lt;p&gt;That refusal is the important behaviour. Silently correcting two thirds of a glob leaves the system in a state where some points are right, some are wrong, and nothing distinguishes them — which is precisely the divide-and-be-wrong failure the operation exists to prevent. Narrowing the glob or the range is then a deliberate second command, taken with the horizon in view.&lt;/p&gt;

&lt;p&gt;The practical consequence: a unit error found within a class's raw retention is fully correctable, and one found after that is permanent in the aggregates. If a horizon is wrong, the retention policy is the thing to change, not this.&lt;/p&gt;

&lt;p&gt;Compressed chunks need decompress-update-recompress, which is slow, but this is a maintenance operation run rarely. It is built as a real command with a dry-run mode from the start, while the surface is small. Dry run reports the row count, the classes in scope with their horizons, the aggregate ranges it would refresh, and a time estimate, because the refresh is usually the expensive half.&lt;/p&gt;

&lt;p&gt;Reprocess does not re-run rules. Historical automation decisions were made on the data as it stood, and rewriting them would make the control event log a lie.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retention and rollups
&lt;/h2&gt;

&lt;p&gt;The continuous aggregates are defined here as schema; how long anything is kept, which functions each class rolls up with, and how state-class compaction works are all in &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Three properties of the aggregate definitions belong with the schema rather than the policy:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store &lt;code&gt;sum&lt;/code&gt; and &lt;code&gt;count&lt;/code&gt;, not &lt;code&gt;avg&lt;/code&gt;.&lt;/strong&gt; An average is a view expression over the two. The moment anything rolls an hourly bucket up to a day, or a minutely bucket up to an hour, an average of averages is wrong wherever the bucket counts differ — and it is wrong quietly, by a few percent, in exactly the direction nobody checks. Sum and count compose; averages do not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aggregates are defined directly on the raw class tables, never hierarchically.&lt;/strong&gt; Building the hourly on the minutely would be cheaper to maintain and would introduce a refresh ordering dependency that reprocess has to get right every time. Defining both on raw costs some materialisation work and removes the ordering question entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;agg_safe&lt;/code&gt; is enforced in the aggregate definition&lt;/strong&gt;, not only in derived points. An hourly mean of RSSI in a continuous aggregate is exactly as wrong as one computed live, and much harder to notice once it is sitting in a dashboard.&lt;/p&gt;

&lt;p&gt;Only rows where &lt;code&gt;quality = 'live'&lt;/code&gt; are aggregated, and &lt;code&gt;live_count&lt;/code&gt; is carried alongside &lt;code&gt;count&lt;/code&gt; so a gappy hour is visibly gappy rather than silently averaged over three samples.&lt;/p&gt;

&lt;p&gt;Deleting data by age happens in Postgres, under the policies in &lt;em&gt;Retention &amp;amp; Compaction&lt;/em&gt;. The observation stream on the bus is bounded by size instead, for the reasons in &lt;em&gt;Driver Contract&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;This is the step whose claims are most expensive to discover are false, and most of them are otherwise only prose. Prose cannot fail loudly. Each of the following is a test that runs in CI with a fault injector, not a procedure performed by hand once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exactly-once effects from at-least-once delivery.&lt;/strong&gt; Kill the core mid-batch, restart, and assert two things: no duplicate rows, and no transition re-published for a row that was already committed. The second half is the one that gets missed, because the table looks correct either way — it is the rules engine that would have fired twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both crash windows, separately.&lt;/strong&gt; Crash before commit: the messages are redelivered and processed normally. Crash after commit but before ack: the redelivered messages are swallowed by the unique index and produce no projection update. If the second case ever starts inserting duplicates, &lt;code&gt;ingested_at&lt;/code&gt; has stopped being deterministic and the whole property has gone with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publisher check.&lt;/strong&gt; An observation for a point assigned to a different host or instance is quarantined with reason &lt;code&gt;wrong_instance&lt;/code&gt;, no row is written, and the message is acked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class routing.&lt;/strong&gt; One point per retention class, each landing in its own hypertable; a count over the &lt;code&gt;UNION ALL&lt;/code&gt; view equals the sum of the three. A point whose class changes is not silently split across two tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reprocess refuses rather than partially applies.&lt;/strong&gt; A dry run over a glob spanning classes, with one point out of horizon, refuses and names the offending points and classes. Assert that no rows were changed and no aggregate was refreshed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reinterpretation under an older registry version&lt;/strong&gt; reproduces the original canonical value from native, which is the property that makes the whole log-first argument true.&lt;/p&gt;

&lt;p&gt;Two measurements to record rather than assert, because their thresholds are open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sustainable ingest throughput&lt;/strong&gt; against the design rate, measured with synthetic load through stages 2 to 10 rather than against the insert alone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cold-start duration&lt;/strong&gt;, broken down by startup step.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;On Monday - the &lt;a href="https://glitchedpixel.io/blog/sentinel-dev-diary-checks-and-balances/" rel="noopener noreferrer"&gt;Dev Diary&lt;/a&gt;.&lt;/strong&gt; Not one finding this time but the whole apparatus: the five instruments that have grown up around the specification, and the different thing that keeps each of them honest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next part - &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-watchdog-and-derived-points/" rel="noopener noreferrer"&gt;The Watchdog and Derived Points&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; One timer wheel for every freshness deadline, why a sensor that only reports on change cannot be told apart from a dead one unless it is made to heartbeat, and how the restart step that dominates cold start is kept bounded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start of the series: &lt;em&gt;&lt;a href="https://glitchedpixel.io/blog/sentinel-introduction/" rel="noopener noreferrer"&gt;An Introduction&lt;/a&gt;&lt;/em&gt;.&lt;/strong&gt; The map, the two decisions every later document is downstream of, and why a specification at this scale is being published in public while the system it describes gets built.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>database</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
