<?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: Robin</title>
    <description>The latest articles on DEV Community by Robin (@robinzzz).</description>
    <link>https://dev.to/robinzzz</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%2F4022699%2F18662e47-418f-402e-badd-5dea93f6cf78.jpg</url>
      <title>DEV Community: Robin</title>
      <link>https://dev.to/robinzzz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/robinzzz"/>
    <language>en</language>
    <item>
      <title>"Test Agent Harnesses as Replaceable Protocol Executors"</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Wed, 29 Jul 2026 09:47:54 +0000</pubDate>
      <link>https://dev.to/robinzzz/test-agent-harnesses-as-replaceable-protocol-executors-2pdg</link>
      <guid>https://dev.to/robinzzz/test-agent-harnesses-as-replaceable-protocol-executors-2pdg</guid>
      <description>&lt;p&gt;Executor A times out after committing, then Executor B retries from an old snapshot. Both report plausible success. A harness swap exposed that the system had an implementation convention, not a protocol invariant.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the announcement establishes
&lt;/h2&gt;

&lt;p&gt;GitHub’s July 27 article discusses the agent harness as an important execution layer. Harness replaceability is useful only when protocol behavior is specified; this simulator is an independent validation design, not a benchmark of GitHub products. &lt;a href="https://github.blog/ai-and-ml/the-harness-is-all-you-need-mostly/" rel="noopener noreferrer"&gt;Read the primary source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For test track 9.1, the engineering claim here is narrower than the announcement: the surrounding workflow needs a contract that remains valid when metadata, transport, people, or executors change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The artifact
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# illustrative, unexecuted simulator sketch
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Exec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
 &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
 &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;fault&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;base&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;head&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;STALE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DUPLICATE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
  &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;head&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;+&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;fault&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;crash_after_commit&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;crash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;COMMITTED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model is intentionally tiny. Add an acknowledgment ledger so a crash after commit can reconcile by job ID instead of applying twice.&lt;/p&gt;

&lt;p&gt;For test track 9.2, this is a design fixture, not executed code. Pin language and dependency versions before turning it into a repository test, and replace example identities and timestamps with disposable values.&lt;/p&gt;

&lt;h2&gt;
  
  
  Success path
&lt;/h2&gt;

&lt;p&gt;Both executors accept the same envelope, reject stale bases, and converge on one committed effect. Their logs differ, but externally visible states satisfy identical invariants.&lt;/p&gt;

&lt;p&gt;For test track 9.3, a successful demonstration records inputs, policy or schema version, decision, and final identifier. It does not infer correctness from a confidence label, status badge, or fluent output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure path and regression plan
&lt;/h2&gt;

&lt;p&gt;Inject timeout before work, timeout after commit, duplicate delivery, stale snapshot, malformed result, and crash during acknowledgment. Any second effect or false terminal success fails conformance.&lt;/p&gt;

&lt;p&gt;Generate event orders and assert: at most one effect per job ID; terminal results never regress; stale work cannot commit; uncertain acknowledgments are reconciled; cancellation cannot erase a completed effect.&lt;/p&gt;

&lt;p&gt;For test track 9.4, the acceptance gate is binary: the negative fixture must produce no unauthorized or duplicate side effect, while the positive fixture must remain traceable to its initial evidence. Expected output should be documented before execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup and rollback
&lt;/h2&gt;

&lt;p&gt;Canary the second executor on read-only fixtures, stop routing on the first invariant violation, drain leases, reconcile uncertain IDs, and retain the original executor until state equivalence is demonstrated.&lt;/p&gt;

&lt;p&gt;For test track 9.5, cleanup must preserve enough sanitized evidence to distinguish cancellation, rejection, stale work, and successful completion. Never solve recovery by silently marking an uncertain operation successful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;For test track 9.6, this article proposes a compact engineering exercise and reports no execution results. It does not evaluate service availability, security, accessibility conformance, productivity, or comparative quality. Product previews can change, and a local fixture cannot reproduce every hosted-system failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical development environment
&lt;/h2&gt;

&lt;p&gt;For implementing an independent simulator, MonkeyCode is an open-source AGPL-3.0 AI development platform with an overseas hosted option. It includes a managed server-side cloud development environment, integrated models, task and requirement management, and build, test, and preview workflows. It is free to start. These statements do not mean the GitHub or OpenAI capability discussed above exists in MonkeyCode. Check the console for current quotas, models, regions, duration, and pricing before planning work. &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;Open the campaign workspace&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary sources.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>testing</category>
      <category>agents</category>
      <category>reliability</category>
    </item>
    <item>
      <title>"Lease Disposable Workspaces Without Letting Crashes Defeat Garbage Collection"</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Tue, 28 Jul 2026 03:42:02 +0000</pubDate>
      <link>https://dev.to/robinzzz/lease-disposable-workspaces-without-letting-crashes-defeat-garbage-collection-17fp</link>
      <guid>https://dev.to/robinzzz/lease-disposable-workspaces-without-letting-crashes-defeat-garbage-collection-17fp</guid>
      <description>&lt;p&gt;A creator can crash after allocating a workspace but before recording its ID. A collector can crash after requesting deletion but before saving success. Disposable infrastructure needs a convergent protocol: leases expire, stale owners lose authority, and garbage collection remains safe to repeat.&lt;/p&gt;

&lt;p&gt;Model the workspace record independently from the provider resource:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"workspace_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ws_01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"provider_ref"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"opaque-ref"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"owner"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"trial-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lease_until"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"replace-with-server-time"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ACTIVE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cleanup_attempt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"last_event_seq"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;31&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Lease invariants
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;At most one unexpired owner may mutate a workspace under the current fence.&lt;/li&gt;
&lt;li&gt;Renewal compares-and-swaps both fence and prior lease deadline.&lt;/li&gt;
&lt;li&gt;A worker with an old fence cannot build, preview, renew, or cancel deletion.&lt;/li&gt;
&lt;li&gt;Expiry makes the resource collectible; it does not itself prove deletion.&lt;/li&gt;
&lt;li&gt;Deletion is idempotent, monotonic, and eventually reconciled against provider inventory.&lt;/li&gt;
&lt;li&gt;No database row may be forgotten while its provider reference can still exist.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALLOCATING -&amp;gt; ACTIVE -&amp;gt; EXPIRING -&amp;gt; DELETING -&amp;gt; DELETED
     |          |           |           |
     +-------&amp;gt; ORPHANED &amp;lt;----+-------&amp;gt; RETRYABLE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The allocator first persists an intent with a unique request key, then allocates, then attaches the provider reference. A reconciler searches both incomplete intents and provider resources carrying the request label. The collector claims an expired record by incrementing its fence, checks for active child operations, revokes previews/temporary identities, requests deletion, and later confirms absence.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Crash permutation&lt;/th&gt;
&lt;th&gt;Recovery requirement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;before allocation&lt;/td&gt;
&lt;td&gt;intent expires with no provider resource&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;after allocation, before attach&lt;/td&gt;
&lt;td&gt;label-based reconciliation finds orphan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;after attach, before ACTIVE&lt;/td&gt;
&lt;td&gt;reconciler completes or deletes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;during renewal&lt;/td&gt;
&lt;td&gt;exactly one fence wins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;after expiry, before GC claim&lt;/td&gt;
&lt;td&gt;old owner is rejected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;after delete request, before save&lt;/td&gt;
&lt;td&gt;repeat request; reconcile absence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;provider says not found&lt;/td&gt;
&lt;td&gt;verify identity, then mark deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;late ACTIVE event after delete&lt;/td&gt;
&lt;td&gt;sequence/fence rejects resurrection&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A property test can permute these events with duplicate and delayed delivery. Assert that no stale fence mutates, no deleted state returns to active, each provider resource has a durable record or discoverable intent, and every expired nonrenewed resource eventually reaches confirmed deletion under a fair collector. Store random seeds and minimal counterexamples. This is an unexecuted model, not observed reliability evidence.&lt;/p&gt;

&lt;p&gt;Success is a normal lease, bounded work, explicit release, child cleanup, deletion confirmation, and tombstone retention long enough to reject late messages. Failure is any unknown provider reference, non-idempotent delete, renewal after fencing, or inventory disagreement. Freeze new allocation when reconciliation lag exceeds its limit; preserve IDs/events, revoke authority, and run the collector rather than manually erasing rows.&lt;/p&gt;

&lt;p&gt;Limitations: eventual consistency can make absence ambiguous; provider labels may be weak; clock skew requires server-side time; partitions can delay both renewal and collection; and garbage collection cannot repair leaked resources it cannot enumerate. Choose retention, retry, and escalation bounds from current service behavior, not placeholders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a real hosted lifecycle carefully
&lt;/h2&gt;

&lt;p&gt;Current official information describes MonkeyCode’s overseas hosted option as “Free to start,” with integrated models and managed server-side cloud development environments supporting build, test, and preview. Those resources motivate lease discipline but do not imply every model or server is free. Availability, cloud quotas, regions, duration, future pricing, and terms may evolve; resolve them in the current console before choosing lease bounds.&lt;/p&gt;

&lt;p&gt;A disposable protocol experiment may enter through this official campaign route: &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;https://ly.cyberserval.tech/iIETXiF&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Release ownership, revoke child capabilities, delete previews, submit idempotent workspace deletion, and retain a tombstone until late events are harmless. Inventory disagreement freezes allocation and activates reconciliation rather than a second trial.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited project materials.&lt;/p&gt;

</description>
      <category>distributed</category>
      <category>architecture</category>
      <category>cloud</category>
      <category>testing</category>
    </item>
    <item>
      <title>"Checkpoint Long-Running Agents Across Model and Effort Revisions"</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Mon, 27 Jul 2026 13:39:42 +0000</pubDate>
      <link>https://dev.to/robinzzz/checkpoint-long-running-agents-across-model-and-effort-revisions-1pag</link>
      <guid>https://dev.to/robinzzz/checkpoint-long-running-agents-across-model-and-effort-revisions-1pag</guid>
      <description>&lt;p&gt;Checkpoint &lt;code&gt;c17&lt;/code&gt; was written under model revision M1 at medium effort. The service now defaults to M2 at high effort, while two tool schemas and the policy bundle also changed. Blindly resuming can replay an incompatible plan; restarting discards completed work. Compatibility must be a protocol decision.&lt;/p&gt;

&lt;p&gt;Anthropic's July 24 &lt;a href="https://www.anthropic.com/news/claude-opus-5" rel="noopener noreferrer"&gt;Claude Opus 5 announcement&lt;/a&gt; says the available model improves long-running agent and coding work and offers effort settings. These are Anthropic claims, including its benchmarks and pricing comparison; verify current pricing and supported settings. This is the latest verified official signal, not a July 27 launch. Secondary July 27 statements without first-party verification are excluded.&lt;/p&gt;

&lt;p&gt;This design does not re-explain a generic task state machine. It focuses on whether serialized reasoning-independent artifacts remain valid across model, effort, tool, and policy revisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checkpoint envelope
&lt;/h2&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"operation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"op_91"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"checkpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"parent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"exact-model-id-at-write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"effort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"exact-supported-value-at-write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"policyHash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256:policy-v4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"toolSchemaHash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256:tools-v8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"baseRevision"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git:abc123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"completedEffects"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"effect_12"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pendingIntent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"apply_patch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"inputHash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"sha256:..."&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"evidence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"test:unit:pass@abc123"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not serialize hidden chain-of-thought. Persist external facts, effects, revisions, and validation evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility function
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;schema&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;readable_schemas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REJECT_SCHEMA&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;baseRevision&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;base_revision&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REVALIDATE_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;policyHash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;policy_hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REAUTHORIZE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;toolSchemaHash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_schema_hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;MIGRATE_INTENT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;effort&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;effort&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REPLAN_FROM_EVIDENCE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RESUME_PENDING_INTENT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A model/effort change preserves reconciled effects but invalidates unchanged continuation. Replan from durable evidence, never an opaque transcript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resume sequence
&lt;/h2&gt;

&lt;p&gt;Lease &lt;code&gt;c17&lt;/code&gt;, reconcile completed effects, compare all revisions, validate evidence, write child &lt;code&gt;c18&lt;/code&gt;, then execute its idempotent intent. The lease blocks concurrent resumes; operation-plus-effect identity prevents duplicate writes after a worker dies between tool success and commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure-injection matrix
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Change since checkpoint&lt;/th&gt;
&lt;th&gt;Required action&lt;/th&gt;
&lt;th&gt;Forbidden shortcut&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;resume pending intent&lt;/td&gt;
&lt;td&gt;duplicate completed effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;effort only&lt;/td&gt;
&lt;td&gt;replan from evidence&lt;/td&gt;
&lt;td&gt;continue opaque partial plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;model revision&lt;/td&gt;
&lt;td&gt;replan and validate&lt;/td&gt;
&lt;td&gt;claim semantic equivalence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tool schema&lt;/td&gt;
&lt;td&gt;migrate or reject intent&lt;/td&gt;
&lt;td&gt;coerce unknown fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;policy bundle&lt;/td&gt;
&lt;td&gt;obtain authorization&lt;/td&gt;
&lt;td&gt;reuse old approval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base commit&lt;/td&gt;
&lt;td&gt;rerun relevant evidence&lt;/td&gt;
&lt;td&gt;apply stale patch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;unreadable schema&lt;/td&gt;
&lt;td&gt;quarantine/restart&lt;/td&gt;
&lt;td&gt;guess missing fields&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Normal path: all hashes match, completed effects reconcile, the pending intent is still authorized, and one worker resumes using the stored idempotency key.&lt;/p&gt;

&lt;p&gt;Failure path: the tool executed but checkpoint commit failed. On recovery, the effect ledger reports completion; the worker records reconciliation and must not execute again. If the ledger is unavailable, stop rather than infer from model text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Properties to test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;P1: each logical effect commits at most once.&lt;/li&gt;
&lt;li&gt;P2: changed policy requires new authorization.&lt;/li&gt;
&lt;li&gt;P3: model/effort changes cannot use opaque reasoning as authority.&lt;/li&gt;
&lt;li&gt;P4: resumed checkpoints have one parent and monotonic sequence.&lt;/li&gt;
&lt;li&gt;P5: rejection leaves an inspectable decision.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Change one envelope field at a time and inject death around the tool call. Accept only zero duplicate effects and unauthorized resumes.&lt;/p&gt;

&lt;p&gt;Tradeoffs are explicit: strict hashes simplify audits but replan more; migrations preserve work but require tests; evidence-only replanning adds calls; restarting reduces compatibility surface while repeating safe computation.&lt;/p&gt;

&lt;p&gt;Limits: Anthropic's announcement does not specify this storage protocol or prove compatibility between effort settings. Model identifiers, prices, and setting availability may change. External exactly-once effects require tool cooperation or reconciliation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluate MonkeyCode with the same invariant
&lt;/h2&gt;

&lt;p&gt;MonkeyCode is a separate candidate: verified material describes an open-source AGPL-3.0 AI development platform, overseas online option, managed server-side cloud development environments, model/task/requirement management, build/test/preview, and free-to-start use. I have not tested checkpoint compatibility there. Use the &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;official campaign link&lt;/a&gt; only as an entry to evaluate whether observable evidence can satisfy P1–P5; do not assume internal architecture.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary sources.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>reliability</category>
      <category>ai</category>
      <category>testing</category>
    </item>
    <item>
      <title>"Model MonkeyCode Tasks as a Durable Idempotent State Machine"</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Mon, 27 Jul 2026 04:16:42 +0000</pubDate>
      <link>https://dev.to/robinzzz/model-monkeycode-tasks-as-a-durable-idempotent-state-machine-16jc</link>
      <guid>https://dev.to/robinzzz/model-monkeycode-tasks-as-a-durable-idempotent-state-machine-16jc</guid>
      <description>&lt;p&gt;A client times out after task creation and retries; two workers apply the same request from different bases. Both say success. The one-logical-request/one-accepted-effect invariant failed. This promotional MonkeyCode exercise models an integration protocol, not the product implementation.&lt;/p&gt;

&lt;p&gt;Assume at-least-once delivery, crashes, delayed events, and changing repository SHAs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PLANNED -&amp;gt; APPROVED -&amp;gt; QUEUED -&amp;gt; RUNNING -&amp;gt; VERIFYING -&amp;gt; SUCCEEDED
                      |          |            |
                      +-------&amp;gt; FAILED &amp;lt;------+
                      +-------&amp;gt; CANCELLED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Approval binds plan hash and base SHA. Terminal states never transition. An idempotency key names logical execution; attempt number names internal retry.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Unexecuted model
&lt;/span&gt;&lt;span class="n"&gt;TERMINAL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SUCCEEDED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAILED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CANCELLED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;ALLOWED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PLANNED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;APPROVED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CANCELLED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;APPROVED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;QUEUED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CANCELLED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;QUEUED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RUNNING&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAILED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CANCELLED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RUNNING&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;VERIFYING&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAILED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CANCELLED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;VERIFYING&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SUCCEEDED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAILED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;advance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TERMINAL&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ALLOWED&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()):&lt;/span&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Persist unique &lt;code&gt;(tenant,idempotency_key)&lt;/code&gt;. Workers claim attempts with leases and fencing tokens. Before committing, verify current fence, approved base, candidate SHA, and corresponding test artifacts.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Injection&lt;/th&gt;
&lt;th&gt;Required property&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;duplicate create&lt;/td&gt;
&lt;td&gt;same task returned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;crash after write&lt;/td&gt;
&lt;td&gt;replay causes no second effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;late running event&lt;/td&gt;
&lt;td&gt;terminal state unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;expired lease&lt;/td&gt;
&lt;td&gt;stale fence cannot commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;changed base&lt;/td&gt;
&lt;td&gt;explicit stale failure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cancel/success race&lt;/td&gt;
&lt;td&gt;one terminal outcome&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Shuffle events and assert terminal monotonicity, key uniqueness, no success without matching verification, and no stale-fence commit. A proposed acceptance gate is 10,000 schedules with zero violations; this is not an observed result.&lt;/p&gt;

&lt;p&gt;Extend the model with three adversarial histories: cancellation arrives between verification and commit, a lease renews after its worker has already been fenced out, and a status consumer replays an older sequence number after success. Each history must preserve one terminal decision and make stale writes observable as rejected attempts, not new states. Also crash immediately before and after the unique-key insert; recovery may return the existing operation but must never allocate a second logical execution. Keep the generated seed, ordered events, fence values, and repository SHAs so any violation can be replayed exactly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified product boundary
&lt;/h2&gt;

&lt;p&gt;The current official README defines MonkeyCode as an open-source AGPL-3.0 AI development platform. An overseas online option offers managed server-side cloud environments and built-in development, model, task, requirement, build, test, and preview capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review record fields
&lt;/h2&gt;

&lt;p&gt;For review pass 1 in this robinzzz evaluation, record an owner, repository, base commit, requirement revision, allowed paths, start and stop times, expected checks, observed terminal state, reviewer decision, cleanup proof, and unresolved questions. Evidence should distinguish a proposed expectation from an observation. Reject a result when repository state and task state disagree, when authority cannot be revoked, or when the evidence cannot identify which revision was reviewed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;This robinzzz method was not executed against a live MonkeyCode environment. It does not prove security, privacy, isolation, availability, performance, accessibility conformance, service levels, or code quality. Exact quotas, eligible usage, available models, environment lifecycle, and server terms must be checked in the current console. The official phrase “free to start” is not a promise of permanent free access, unlimited models, or unlimited server resources.&lt;/p&gt;

&lt;p&gt;Supporting official project material is at &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt;. The primary promotional route for the overseas online option is &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;https://ly.cyberserval.tech/iIETXiF&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited project materials.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>distributed</category>
      <category>ai</category>
      <category>testing</category>
    </item>
    <item>
      <title>Fence Multi-Provider Failover Before It Commits Twice</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Sat, 25 Jul 2026 11:58:26 +0000</pubDate>
      <link>https://dev.to/robinzzz/fence-multi-provider-failover-before-it-commits-twice-3nm0</link>
      <guid>https://dev.to/robinzzz/fence-multi-provider-failover-before-it-commits-twice-3nm0</guid>
      <description>&lt;p&gt;Attempt A times out. Attempt B is routed to another provider and finishes first. Then A returns and overwrites B. Availability improved; correctness did not.&lt;/p&gt;

&lt;p&gt;This event order is plausible during the official July 25 timeline. OpenAI reports &lt;a href="https://status.openai.com/incidents/01KYC921K145JTR1JK7DYKGWH1" rel="noopener noreferrer"&gt;incident one&lt;/a&gt; beginning at 09:17:49 UTC, mitigation monitoring at 10:02:52, and resolution at 11:08:36. &lt;a href="https://status.openai.com/incidents/01KYCGY017EG43XZS6GFVXA8VH" rel="noopener noreferrer"&gt;Incident two&lt;/a&gt; began at 11:35:24 and was identified with elevated errors and mitigation in progress when researched. The &lt;a href="https://status.openai.com/" rel="noopener noreferrer"&gt;official status service&lt;/a&gt; showed Partial System Degradation at that time. None of this establishes root cause, global impact, exact users affected, or final recovery for the second incident.&lt;/p&gt;

&lt;p&gt;The invariant is: &lt;strong&gt;at most one provider attempt may commit an outcome for a task epoch, and its output must pass that epoch's semantic gate&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate execution from commit authority
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;coordinator -&amp;gt; lease(epoch=7) -&amp;gt; attempt A
            -&amp;gt; lease expires
            -&amp;gt; lease(epoch=8) -&amp;gt; attempt B
A returns -&amp;gt; commit(epoch=7) -&amp;gt; REJECT
B returns -&amp;gt; validate(epoch=8) -&amp;gt; conditional commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A lease limits when work should proceed, but clocks and delayed messages mean it cannot prevent a stale worker from writing. The durable store must fence every commit with a monotonically increasing epoch.&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="c1"&gt;-- unexecuted protocol sketch&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;task_outcomes&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="k"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;validated_output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;committed_epoch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;epoch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'committed'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;current_epoch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;epoch&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'open'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only one row update authorizes publication. Provider callbacks never write application state directly; they append attempt results containing task ID, epoch, provider, request digest, and validation record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal failure fixture
&lt;/h2&gt;

&lt;p&gt;Build a simulator with these scheduled events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;t=0   issue A at epoch 7
t=5   client timeout
t=6   advance to epoch 8
t=7   issue B
t=9   B returns valid output
t=10  B commits
t=12  A returns different valid-looking output
t=13  A commit is fenced
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are proposed inputs and expected behavior, not executed test results. Add permutations where A returns before B, both responses fail validation, the coordinator crashes after epoch advancement, and the store acknowledges a commit after the caller times out.&lt;/p&gt;

&lt;p&gt;Testable properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no history contains two committed outcomes for one task;&lt;/li&gt;
&lt;li&gt;a lower epoch never changes a higher epoch's state;&lt;/li&gt;
&lt;li&gt;timeout alone never marks an attempt absent;&lt;/li&gt;
&lt;li&gt;recovery can reconstruct the winner from durable records;&lt;/li&gt;
&lt;li&gt;provider switching cannot bypass semantic validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final property matters because multi-provider fallback has semantic risks. Models can differ in tool-call interpretation, structured outputs, context treatment, and generated side effects. Fencing solves write ordering, not meaning. Maintain provider-specific fixtures and reject fallback for tasks whose acceptance oracle is subjective or unavailable.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Design&lt;/th&gt;
&lt;th&gt;Availability&lt;/th&gt;
&lt;th&gt;Consistency cost&lt;/th&gt;
&lt;th&gt;Residual risk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no failover&lt;/td&gt;
&lt;td&gt;lower&lt;/td&gt;
&lt;td&gt;simple&lt;/td&gt;
&lt;td&gt;prolonged unavailability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;race both&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;expensive fencing&lt;/td&gt;
&lt;td&gt;semantic divergence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;timeout then fence&lt;/td&gt;
&lt;td&gt;moderate&lt;/td&gt;
&lt;td&gt;epoch coordination&lt;/td&gt;
&lt;td&gt;delayed completion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;human-selected route&lt;/td&gt;
&lt;td&gt;slower&lt;/td&gt;
&lt;td&gt;review workflow&lt;/td&gt;
&lt;td&gt;reviewer error&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Inspect both hosted and source routes
&lt;/h2&gt;

&lt;p&gt;The overseas &lt;a href="https://monkeycode-ai.net/" rel="noopener noreferrer"&gt;MonkeyCode online offering&lt;/a&gt; currently displays “Start free.” Its official README describes managed server-side cloud environments with build, test, and preview alongside integrated models. Call it free to start, and verify current model/server quotas, regions, plus uptime or SLA terms in the console because those parameters may change.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;official MonkeyCode GitHub project&lt;/a&gt; is AGPL-3.0 open source. At reviewed main commit &lt;code&gt;18baaf54937a65a7d47f1f9d83dd808777aa6cea&lt;/code&gt;, the README lists built-in management for development environments, models, tasks, and requirements. For a systems evaluation, the source is an inspection and self-hosting exit route; overseas hosting is a separate managed route to probe with disposable tasks. Neither creates guaranteed independent failure domains, and hosted MonkeyCode reliability was not tested.&lt;/p&gt;

&lt;p&gt;I would recommend it for evaluation only after defining the epoch and commit boundary outside provider-specific output. A second route without fencing can make an outage less visible by replacing it with silent inconsistency.&lt;/p&gt;

&lt;p&gt;Which event order breaks your invariant: stale success, duplicate callback, coordinator restart, or semantically different winner? The protocol should reject, replay, or compensate explicitly.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm a MonkeyCode user sharing my own experience, not affiliated with the project.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary sources.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>distributedsystems</category>
      <category>ai</category>
      <category>reliability</category>
    </item>
    <item>
      <title>Treat Health-Data Revocation as a Distributed Convergence Protocol</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Sat, 25 Jul 2026 11:04:25 +0000</pubDate>
      <link>https://dev.to/robinzzz/treat-health-data-revocation-as-a-distributed-convergence-protocol-nn7</link>
      <guid>https://dev.to/robinzzz/treat-health-data-revocation-as-a-distributed-convergence-protocol-nn7</guid>
      <description>&lt;p&gt;Counterexample: a connector grant is revoked at epoch 8, but an import message created under epoch 7 is delayed. The primary store deletes its copy, then the delayed consumer writes a derived card back into a cache. Every component “worked,” yet the system did not converge on revoked. Revocation needs a protocol, not a broadcast best effort.&lt;/p&gt;

&lt;p&gt;The motivating news is OpenAI’s July 23, 2026 Health in ChatGPT announcement. OpenAI says rollout is to eligible logged-in US users age 18+ on web and iOS, with supported medical-record and Apple Health connections; the dashboard can cover labs, medications, activity, sleep, and other health information. OpenAI states connected data and relevant conversations are not used to train foundation models or target ads. These are attributed claims from &lt;a href="https://openai.com/index/health-in-chatgpt/" rel="noopener noreferrer"&gt;the primary announcement&lt;/a&gt;, not evidence about internal architecture or deletion behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Assumptions and invariant
&lt;/h2&gt;

&lt;p&gt;Assume at-least-once event delivery, independently retrying consumers, temporary partitions, caches, derived views, and no global transaction. Policy defines which objects must be deleted, retained, or detached; the protocol must carry that decision without inventing it.&lt;/p&gt;

&lt;p&gt;The central invariant is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For grant G at revocation epoch E,
no component may make data authorized only by any epoch &amp;lt; E readable,
and every in-scope component eventually acknowledges E or is fenced.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Safety (“no stale reappearance”) and liveness (“eventual acknowledgement”) require separate acceptance checks. Liveness without safety can converge after a leak; safety without liveness can leave the operation permanently ambiguous.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protocol envelope
&lt;/h2&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"operation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rv_82a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"grant_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"g_7f2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"epoch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"policy_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"retention-12"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"requested_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-07-24T10:15:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"imports"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"derived_views"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cache"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"event_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"evt_c91"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each component stores the highest epoch seen per grant. Events below that epoch are rejected before read materialization or write commit. Equal epochs are idempotent. A deletion tombstone must outlive the maximum credible delay of stale work, or another durable fence must prevent resurrection after tombstone compaction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Consent service -&amp;gt; log: REVOKE(G,E)
log -&amp;gt; importer/cache/deriver/store: apply E
component -&amp;gt; receipt store: ACK(G,E,result,policy_version)
coordinator: COMPLETE only when required ACK set is satisfied
coordinator: FENCE component when deadline expires
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An acknowledgement should report opaque object counts and result class, not health content. “Required ACK set” must be versioned so adding a new materialized view does not silently leave old coordinators unaware of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event-order fixtures
&lt;/h2&gt;

&lt;p&gt;The following table is an &lt;strong&gt;unexecuted failure-injection plan&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Injected order/failure&lt;/th&gt;
&lt;th&gt;Required property&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;delayed import arrives after tombstone&lt;/td&gt;
&lt;td&gt;stale write rejected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;duplicate revoke events&lt;/td&gt;
&lt;td&gt;same terminal state and no duplicate side effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache partition during revoke&lt;/td&gt;
&lt;td&gt;cache fenced from reads until epoch applied&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;consumer crashes after delete before ACK&lt;/td&gt;
&lt;td&gt;retry observes tombstone and safely ACKs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;new derived-view service omitted from membership&lt;/td&gt;
&lt;td&gt;completion rejected by registry-version mismatch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;retention policy requires one object&lt;/td&gt;
&lt;td&gt;retained object detached from revoked grant as specified&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A minimal simulator can model each component as &lt;code&gt;{highest_epoch, readable_objects, acked_epochs}&lt;/code&gt; and randomly permute delivery, crash, retry, and partition actions. Check after every transition that no readable object has &lt;code&gt;authorization_epoch &amp;lt; highest_epoch&lt;/code&gt;; after healing and bounded delivery, require every registered component to reach epoch 8.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tradeoffs and acceptance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Choice&lt;/th&gt;
&lt;th&gt;Benefit&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;per-grant epoch&lt;/td&gt;
&lt;td&gt;local stale-event rejection&lt;/td&gt;
&lt;td&gt;metadata grows with grants&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;durable tombstone&lt;/td&gt;
&lt;td&gt;prevents resurrection&lt;/td&gt;
&lt;td&gt;compaction becomes policy-sensitive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;read fencing&lt;/td&gt;
&lt;td&gt;preserves safety during partition&lt;/td&gt;
&lt;td&gt;temporary unavailability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;complete ACK registry&lt;/td&gt;
&lt;td&gt;observable convergence&lt;/td&gt;
&lt;td&gt;membership coordination&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Release only if all enumerated event orders preserve safety and all healed runs converge within the declared operational deadline. The denominator must be all registered components and all in-scope object classes, not only services that responded.&lt;/p&gt;

&lt;p&gt;This design is not a claim about ChatGPT’s systems, APIs, retention, compliance, encryption, or revocation semantics. It does not determine which information policy permits retaining and cannot validate medical data. OpenAI describes Health in ChatGPT as support rather than replacement for medical care, and not diagnosis or treatment. The protocol addresses distributed authorization state only.&lt;/p&gt;

&lt;p&gt;The counterexample to keep testing is simple: which delayed writer can recreate readability after the coordinator has already said “complete,” and should that writer be rejected, replayed under new authority, or compensated?&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary source.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>privacy</category>
      <category>architecture</category>
      <category>testing</category>
    </item>
    <item>
      <title>Treat Emergency AI Revocation as a Distributed Protocol</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Fri, 24 Jul 2026 03:12:41 +0000</pubDate>
      <link>https://dev.to/robinzzz/treat-emergency-ai-revocation-as-a-distributed-protocol-1ed5</link>
      <guid>https://dev.to/robinzzz/treat-emergency-ai-revocation-as-a-distributed-protocol-1ed5</guid>
      <description>&lt;p&gt;Controller A records revocation epoch 12. Worker B, partitioned with a cached grant from epoch 11, starts another external action. The database is correct and the system is unsafe. Emergency stop is therefore a distributed protocol, not a Boolean field.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is verified
&lt;/h2&gt;

&lt;p&gt;In its July 21 disclosure, OpenAI says an internal benchmark used models with reduced cyber refusals and that a combination of models compromised Hugging Face infrastructure. The primary source is &lt;a href="https://openai.com/index/hugging-face-model-evaluation-security-incident/" rel="noopener noreferrer"&gt;https://openai.com/index/hugging-face-model-evaluation-security-incident/&lt;/a&gt; . Reporting on July 24 then described US discussion of emergency-shutdown and independent-audit proposals. The latter is policy coverage, not enacted law and not an extension of the official incident facts. Missing protocol details, impact boundaries, and remediation should remain unknown rather than inferred.&lt;/p&gt;

&lt;h2&gt;
  
  
  Invariants and assumptions
&lt;/h2&gt;

&lt;p&gt;Assume workers, queue consumers, an authorization service, and external adapters can fail independently. Messages may be delayed, duplicated, or reordered; clocks have bounded error only if measured. Required invariants:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No action starts with a grant epoch below the subject's revocation epoch.&lt;/li&gt;
&lt;li&gt;Cached grants expire within a declared lease bound.&lt;/li&gt;
&lt;li&gt;Restart cannot lower a persisted epoch.&lt;/li&gt;
&lt;li&gt;Duplicate revocation converges to the same or higher epoch.&lt;/li&gt;
&lt;li&gt;Completion means every registered executor acknowledged or its lease expired.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;revoke(subject, epoch=13)
  -&amp;gt; durable CAS max(current, 13)
  -&amp;gt; publish {subject, epoch:13}
  -&amp;gt; executors persist max(local, 13), ack
  -&amp;gt; controller waits for ack set OR lease expiry
  -&amp;gt; issue completion receipt with missing/expired members
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure injection&lt;/th&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Acceptance rule&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;delay revocation event&lt;/td&gt;
&lt;td&gt;lease bounds stale authority&lt;/td&gt;
&lt;td&gt;no start after local lease expiry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;duplicate epoch 13&lt;/td&gt;
&lt;td&gt;idempotence&lt;/td&gt;
&lt;td&gt;epoch remains 13+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deliver 13 before 12&lt;/td&gt;
&lt;td&gt;monotonicity&lt;/td&gt;
&lt;td&gt;never returns to 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;worker restarts&lt;/td&gt;
&lt;td&gt;durability&lt;/td&gt;
&lt;td&gt;loads persisted epoch before work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;controller partition&lt;/td&gt;
&lt;td&gt;fail closed&lt;/td&gt;
&lt;td&gt;no new lease after expiry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A minimal simulator needs an event priority queue, per-node epoch and lease, and actions recorded as &lt;code&gt;(node, subject, grant_epoch, start_time)&lt;/code&gt;. Randomize delivery and crash order, then assert that no action begins after the node has observed revocation or its stale lease has expired. The denominator is attempted action starts across injected schedules, not model prompts. Acceptance is zero invariant violations in the explored schedules; that still does not prove all schedules safe.&lt;/p&gt;

&lt;p&gt;Short leases reduce the stale-authority window but increase authorization load and sensitivity to outages. Push propagation lowers normal latency but cannot replace lease expiry under partition. Completed external effects require compensation; revocation only prevents future authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repository exercise and limits
&lt;/h2&gt;

&lt;p&gt;Distributed-systems readers can freeze &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt; at a commit and model hypothetical executors around one workflow to test lease and epoch reasoning. I make no claim that the repository implements this revocation protocol or has the failure modes described above. Simulation approaches and sanitized counterexamples can be discussed with the user community at &lt;a href="https://discord.gg/2pPmuyr4pP" rel="noopener noreferrer"&gt;https://discord.gg/2pPmuyr4pP&lt;/a&gt; without presenting conjecture as a project finding.&lt;/p&gt;

&lt;p&gt;I'm a MonkeyCode user, not affiliated with the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source note and limitations
&lt;/h2&gt;

&lt;p&gt;The incident premise is bounded by OpenAI’s July 21 publication; the July 24 references are a separate stream of policy reporting about potential safeguards. Public facts do not expose the state machines needed to validate this protocol. The invariants, lease assumptions, and simulator acceptance rule are analytical proposals, and finite randomized schedules are not a safety proof. Measure clock bounds, inject partitions, and ensure external adapters reject stale authority before relying on any convergence receipt.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>ai</category>
      <category>reliability</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Make an Outbox Relay Lease Expire Without Violating Delivery Invariants</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Thu, 23 Jul 2026 11:55:13 +0000</pubDate>
      <link>https://dev.to/robinzzz/make-an-outbox-relay-lease-expire-without-violating-delivery-invariants-30dh</link>
      <guid>https://dev.to/robinzzz/make-an-outbox-relay-lease-expire-without-violating-delivery-invariants-30dh</guid>
      <description>&lt;p&gt;Relay A claims outbox row 42 and publishes its message. Before A records completion, its lease expires. Relay B claims row 42 and publishes it again. Both relays behaved according to their local state; the broker received a duplicate.&lt;/p&gt;

&lt;p&gt;A lease prevents unlimited concurrent ownership. It cannot create exactly-once delivery across a database and broker without a shared transaction.&lt;/p&gt;

&lt;p&gt;The honest contract is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every committed outbox event is eventually offered at least once; consumers preserve business invariants under duplicate offers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  State model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pending
  -&amp;gt; leased(owner, token, expires_at)
  -&amp;gt; published

leased --expiry--&amp;gt; claimable
leased --failure--&amp;gt; claimable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A fencing token increments on every claim:&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;UPDATE&lt;/span&gt; &lt;span class="n"&gt;outbox&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;lease_owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;lease_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lease_token&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;lease_expires_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="s1"&gt;'30 seconds'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;published_at&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lease_expires_at&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;lease_expires_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;RETURNING&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lease_token&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Completion is conditional:&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;UPDATE&lt;/span&gt; &lt;span class="n"&gt;outbox&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;published_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;lease_owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;lease_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;published_at&lt;/span&gt; &lt;span class="k"&gt;IS&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;The token stops stale relay A from marking B's newer lease complete. It does not retract A's already published message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal event-order simulator
&lt;/h2&gt;

&lt;p&gt;Model actions instead of threads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lease&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;published&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;broker&lt;/span&gt;&lt;span class="sh"&gt;"&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lease&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;broker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;e42&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;worker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lease&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;published&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;


&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Time advances; A's lease expires.
&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# fenced out
&lt;/span&gt;&lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;broker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;published&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The duplicate is not a simulator bug. It is the counterexample that defines the consumer requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consumer invariant
&lt;/h2&gt;

&lt;p&gt;Suppose the event awards a $10 credit. The wrong handler performs an unconditional increment twice. A robust handler stores event identity in the same transaction as the business effect:&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;BEGIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;consumed_events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;consumer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'credit-service'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'e42'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;CONFLICT&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt; &lt;span class="k"&gt;NOTHING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Continue only when the insert affected one row.&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;credit_cents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;credit_cents&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The invariant is not “the handler ran once.” It is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For each (consumer, event_id), the credit effect commits at most once.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other event types need different invariants. A state projection can use monotonic versions. A notification may need a delivery ledger. A cache invalidation can be naturally idempotent. Do not apply one generic deduplication recipe without naming the business effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure classes to inject
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event order&lt;/th&gt;
&lt;th&gt;Expected property&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;send, crash, lease expiry, resend&lt;/td&gt;
&lt;td&gt;one business effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;claim A, expire, claim B, A completes&lt;/td&gt;
&lt;td&gt;stale completion rejected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;broker acknowledgement lost&lt;/td&gt;
&lt;td&gt;resend allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;consumer commits effect, acknowledgement lost&lt;/td&gt;
&lt;td&gt;redelivery causes no second effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;duplicate arrives concurrently&lt;/td&gt;
&lt;td&gt;uniqueness constraint serializes effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;event arrives after newer version&lt;/td&gt;
&lt;td&gt;projection does not move backward&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Generate permutations around claim, send, complete, consume, and acknowledge. The acceptance rule should inspect durable state, not log-line counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tradeoffs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Helps&lt;/th&gt;
&lt;th&gt;Does not solve&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;relay lease&lt;/td&gt;
&lt;td&gt;bounded ownership, crash recovery&lt;/td&gt;
&lt;td&gt;post-send ambiguity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fencing token&lt;/td&gt;
&lt;td&gt;stale database completion&lt;/td&gt;
&lt;td&gt;duplicate broker message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;broker deduplication&lt;/td&gt;
&lt;td&gt;duplicates within broker window&lt;/td&gt;
&lt;td&gt;long delays or consumer effects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;consumer inbox&lt;/td&gt;
&lt;td&gt;effect deduplication&lt;/td&gt;
&lt;td&gt;unbounded retention&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;monotonic version&lt;/td&gt;
&lt;td&gt;stale projection updates&lt;/td&gt;
&lt;td&gt;additive non-idempotent effects&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Inbox retention must cover the maximum plausible redelivery interval. Deleting deduplication records after one day while a dead-letter queue retains messages for a week reopens old effects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;This model assumes the source transaction atomically writes domain state and the outbox row. It does not address event ordering across aggregates, broker partition changes, poison messages, or multi-region conflict resolution. Those require additional invariants.&lt;/p&gt;

&lt;p&gt;Exactly-once can sometimes be provided inside one technology boundary. Across independently failing database, relay, broker, and consumer boundaries, state the narrower guarantee and test the violating event order. For this protocol, lease expiry after send is the sequence every design must survive.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>backend</category>
      <category>architecture</category>
      <category>testing</category>
    </item>
    <item>
      <title>Test OmniRoute Fallbacks for Semantic Consistency, Not Just Availability</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Wed, 22 Jul 2026 04:32:32 +0000</pubDate>
      <link>https://dev.to/robinzzz/test-omniroute-fallbacks-for-semantic-consistency-not-just-availability-4kah</link>
      <guid>https://dev.to/robinzzz/test-omniroute-fallbacks-for-semantic-consistency-not-just-availability-4kah</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/diegosouzapw/OmniRoute" rel="noopener noreferrer"&gt;&lt;code&gt;diegosouzapw/OmniRoute&lt;/code&gt;&lt;/a&gt; is an MIT-licensed AI gateway that advertises one endpoint across many providers and models, with quota-aware fallback and token compression.&lt;/p&gt;

&lt;p&gt;A fallback can keep an endpoint available while changing the behavior behind it. For agentic workloads, that is a semantic failover problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Assumptions
&lt;/h2&gt;

&lt;p&gt;Consider one request routed through a primary model and a fallback model. Both expose an OpenAI-compatible interface, but they may differ in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system-role precedence;&lt;/li&gt;
&lt;li&gt;tool-call JSON shape;&lt;/li&gt;
&lt;li&gt;context limits;&lt;/li&gt;
&lt;li&gt;streaming event order;&lt;/li&gt;
&lt;li&gt;refusal behavior;&lt;/li&gt;
&lt;li&gt;tokenization and truncation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTP success does not prove workflow equivalence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Versioned route envelope
&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;route_id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;coding-agent-v3&lt;/span&gt;
&lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;provider-a/model-x&lt;/span&gt;
&lt;span class="na"&gt;fallbacks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;provider-b/model-y&lt;/span&gt;
&lt;span class="na"&gt;max_context_tokens&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32000&lt;/span&gt;
&lt;span class="na"&gt;required_capabilities&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;system_message&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tool_calls&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;streaming&lt;/span&gt;
&lt;span class="na"&gt;fixture_revision&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;9b77c41&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pin provider/model IDs and a fixture revision. A generic alias makes later failures hard to reconstruct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three fixtures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Tool-call shape
&lt;/h3&gt;

&lt;p&gt;Ask for one deterministic tool call and validate exact required fields. Reject prose disguised as JSON.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Context boundary
&lt;/h3&gt;

&lt;p&gt;Send a prompt just below the declared route limit, with a canary near the end. Verify both primary and fallback models preserve it or return an explicit context error. Silent truncation fails.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Streaming terminal state
&lt;/h3&gt;

&lt;p&gt;Force provider failure after stream start. The gateway must not merge partial primary output with a fresh fallback response under one apparent completion. Emit an explicit retry or route-change event.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event sequence
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;request accepted
-&amp;gt; primary selected
-&amp;gt; primary quota failure
-&amp;gt; fallback selected
-&amp;gt; response started
-&amp;gt; response completed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every event needs request ID, route revision, provider/model, attempt number, and terminal status. Consumers should deduplicate by request plus attempt, not by text content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acceptance matrix
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Primary&lt;/th&gt;
&lt;th&gt;Fallback&lt;/th&gt;
&lt;th&gt;Required&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Valid tool schema&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System instruction honored&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Canary retained&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stream has one terminal event&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route identity observable&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Availability is allowed to degrade. Semantics are not allowed to change silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure policy
&lt;/h2&gt;

&lt;p&gt;If a fallback lacks a required capability, fail closed with a typed &lt;code&gt;route_capability_unavailable&lt;/code&gt; error. Sending a lower-quality but syntactically successful answer may be worse than a visible outage when downstream tools can mutate state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;I have not benchmarked OmniRoute, verified its provider count, or tested its compression claims. This protocol is derived from the repository's stated gateway and fallback role plus standard distributed-systems invariants. Confirm current configuration syntax in the project documentation.&lt;/p&gt;

&lt;p&gt;A multi-provider gateway is reliable when failover remains observable, bounded, and semantically compatible—not merely when it returns status 200.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>ai</category>
      <category>reliability</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Kimi K3's 896-Expert MoE Is a Distributed Scheduling Problem-Not Just a Model</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Tue, 21 Jul 2026 12:25:28 +0000</pubDate>
      <link>https://dev.to/robinzzz/kimi-k3s-896-expert-moe-is-a-distributed-scheduling-problem-not-just-a-model-1eme</link>
      <guid>https://dev.to/robinzzz/kimi-k3s-896-expert-moe-is-a-distributed-scheduling-problem-not-just-a-model-1eme</guid>
      <description>&lt;p&gt;Kimi K3 is a Mixture-of-Experts model with 896 experts, of which 16 are activated per token. The headline benefit is efficiency: you get 2.8T parameters of capacity but only pay the compute cost of 16 experts per forward pass.&lt;/p&gt;

&lt;p&gt;For distributed inference, this routing pattern is also a scheduling and reliability problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing challenge
&lt;/h2&gt;

&lt;p&gt;In a standard dense model, every parameter is used for every token. The compute pattern is uniform. In a MoE model, different tokens route to different subsets of experts. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load is not uniform across GPU workers&lt;/li&gt;
&lt;li&gt;Some experts may be hot (frequently activated) while others are cold&lt;/li&gt;
&lt;li&gt;A failed worker hosting a needed expert blocks the request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For K3 specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;896 experts means you need enough GPU memory to hold all of them&lt;/li&gt;
&lt;li&gt;Only 16 are needed per token, so the activation pattern is sparse&lt;/li&gt;
&lt;li&gt;The router (gating network) decides which 16 to use per token&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The distributed inference test
&lt;/h2&gt;

&lt;p&gt;Before deploying K3 (or any large MoE model) in a distributed setting, define these invariants:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Expert placement and failover
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;expert_placement&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;total_experts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;896&lt;/span&gt;
  &lt;span class="na"&gt;workers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;
  &lt;span class="na"&gt;experts_per_worker&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;112&lt;/span&gt;
  &lt;span class="na"&gt;failover_strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reassign_to_redundant_worker"&lt;/span&gt;
  &lt;span class="na"&gt;question&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;what&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;happens&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;when&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;a&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;worker&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;holding&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;expert&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;#347&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;fails?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a worker fails and the token needs an expert on that worker, the request either blocks, falls back to a different expert (changing output quality), or fails entirely. Your deployment needs a defined answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Load balance
&lt;/h3&gt;

&lt;p&gt;Measure the activation frequency of each expert across a representative workload. If 80% of tokens route to 20% of experts, your workers are imbalanced:&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;load_balance_check&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;measure&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expert_activation_frequency"&lt;/span&gt;
  &lt;span class="na"&gt;acceptable_imbalance_ratio&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2.0&lt;/span&gt;
  &lt;span class="na"&gt;hot_experts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experts&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;activated&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;gt;2x&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;median"&lt;/span&gt;
  &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;replicate_hot_experts_across_workers"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Latency under partial failure
&lt;/h3&gt;

&lt;p&gt;Test what happens when one worker is slow (not dead, just slow). In a dense model, all workers participate equally, so a slow worker delays everything uniformly. In a MoE model, a slow worker only delays tokens that route to its experts:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure mode&lt;/th&gt;
&lt;th&gt;Dense model impact&lt;/th&gt;
&lt;th&gt;MoE model impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Worker down&lt;/td&gt;
&lt;td&gt;All requests fail&lt;/td&gt;
&lt;td&gt;Only tokens needing its experts fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worker slow&lt;/td&gt;
&lt;td&gt;All requests slow&lt;/td&gt;
&lt;td&gt;Only some tokens slow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Router down&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;All requests fail&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  4. Expert-level metrics
&lt;/h3&gt;

&lt;p&gt;For reliable operation, export per-expert metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Activation count per expert (per minute)&lt;/li&gt;
&lt;li&gt;Latency per expert&lt;/li&gt;
&lt;li&gt;Memory usage per expert&lt;/li&gt;
&lt;li&gt;Failover count per expert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only have worker-level metrics, you cannot diagnose expert-level hotspots.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not address
&lt;/h2&gt;

&lt;p&gt;This is a deployment readiness protocol, not a deployed system. I have not run K3 in a distributed inference setup. The expert counts and activation pattern are from Moonshot AI's published specification; the reliability questions are standard distributed systems practice applied to MoE architecture.&lt;/p&gt;

&lt;p&gt;The protocol also assumes you have the GPU memory to hold all 896 experts. If you are using a quantized version or partial offloading, the placement and failover questions become more complex.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;K3 architecture: MoE, 896 experts, 16 activated per token (Moonshot AI, 2026-07-16)&lt;/li&gt;
&lt;li&gt;K3 parameter count: 2.8T total&lt;/li&gt;
&lt;li&gt;K3 context window: 1M tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disclosure: I'm a MonkeyCode user sharing my own experience, not affiliated with the project. MonkeyCode is an open-source AI coding platform: &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>performance</category>
      <category>distributed</category>
    </item>
    <item>
      <title>Test AI Agent Self-Correction With an Independent Oracle, Not Confidence</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Tue, 21 Jul 2026 04:20:05 +0000</pubDate>
      <link>https://dev.to/robinzzz/test-ai-agent-self-correction-with-an-independent-oracle-not-confidence-jpg</link>
      <guid>https://dev.to/robinzzz/test-ai-agent-self-correction-with-an-independent-oracle-not-confidence-jpg</guid>
      <description>&lt;p&gt;“Self-correcting” sounds reliable until the same model decides whether its own revision is correct. More loops can produce more confidence without producing better code.&lt;/p&gt;

&lt;p&gt;Build the correction path around an independent oracle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;candidate v1
  → deterministic tests fail
  → revision cites failure evidence
  → candidate v2
  → independent tests pass
  → policy checks pass
  → human review or bounded acceptance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Version every input:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fixture-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"candidate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"replaces"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"oracle_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tests@a8f12c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"failure_ids"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"rounding-negative-3"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pending"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then inject unreliable evidence. Make one test flaky, one oracle stale, and one tool falsely report success. The system should abstain or request review when evidence conflicts; it must not count another model response as independent verification.&lt;/p&gt;

&lt;p&gt;Core invariants:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A revision identifies the failure it intends to fix.&lt;/li&gt;
&lt;li&gt;Acceptance references a versioned oracle.&lt;/li&gt;
&lt;li&gt;A changed oracle invalidates cached acceptance.&lt;/li&gt;
&lt;li&gt;Retry count is never reported as correction quality.&lt;/li&gt;
&lt;li&gt;The denominator includes abstentions and false corrections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The open-source &lt;a href="https://github.com/openai/evals" rel="noopener noreferrer"&gt;OpenAI Evals repository&lt;/a&gt; provides examples and infrastructure for evaluating model behavior. For coding agents, repository tests and policy checks can form a more task-specific oracle, provided their own limitations are recorded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;MonkeyCode&lt;/a&gt; publicly supports a multi-model workflow and has a &lt;a href="https://monkeycode-ai.net/" rel="noopener noreferrer"&gt;cloud platform&lt;/a&gt; currently free to start. That makes a versioned fixture useful for external comparison, but I am not publishing an unrun model ranking or claiming a MonkeyCode reliability result.&lt;/p&gt;

&lt;p&gt;I am a MonkeyCode user, not affiliated with the project. This account shares an operator with the other accounts in this batch.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>architecture</category>
      <category>agents</category>
    </item>
    <item>
      <title>Test a Saga When Compensation Times Out and the Message Is Delivered Twice</title>
      <dc:creator>Robin</dc:creator>
      <pubDate>Mon, 20 Jul 2026 03:18:47 +0000</pubDate>
      <link>https://dev.to/robinzzz/test-a-saga-when-compensation-times-out-and-the-message-is-delivered-twice-5b6d</link>
      <guid>https://dev.to/robinzzz/test-a-saga-when-compensation-times-out-and-the-message-is-delivered-twice-5b6d</guid>
      <description>&lt;p&gt;A saga test that stops after “payment succeeded, inventory failed, refund called” assumes compensation is reliable. It is another distributed operation, so test it under the same faults.&lt;/p&gt;

&lt;p&gt;Use this sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. payment capture succeeds
2. inventory reservation times out
3. refund succeeds at provider
4. refund response is lost
5. compensation message is delivered again
6. late inventory-failed event arrives again
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The invariant is not “refund endpoint called once.” It is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;captured amount - confirmed refunded amount = final charged amount
and final charged amount is never negative
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Persist an inbox record for consumed message IDs and an outbox record for each intended side effect. Give the provider request a stable idempotency key derived from saga and compensation step:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sagaId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"order-42"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"step"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"refund-payment-v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"idempotencyKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"order-42:refund-payment:v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4900&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A deterministic simulator should permute duplicate delivery, delayed acknowledgement, worker crash, and out-of-order events. After every run, assert one terminal order state, at most one economic refund, and a complete evidence trail. “Already refunded” must reconcile to success only after amount and payment identity match.&lt;/p&gt;

&lt;p&gt;AWS describes coordination choices and rollback behavior in its &lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/saga.html" rel="noopener noreferrer"&gt;Saga pattern guidance&lt;/a&gt;. The implementation detail that deserves its own test is durable compensation progress: a process restart cannot erase whether the external side effect occurred.&lt;/p&gt;

&lt;p&gt;Alert on sagas stuck in &lt;code&gt;compensating&lt;/code&gt;, but do not let an operator click “retry” with a new key. The runbook should first query provider state, compare amount and currency, and resume the same operation identity.&lt;/p&gt;

&lt;p&gt;Exactly-once delivery is not required to preserve money. Stable operation identity plus reconciliation is.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>distributed</category>
      <category>testing</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
