<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[blog]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>https://blog.evangelista.moe/</link><image><url>https://blog.evangelista.moe/favicon.png</url><title>blog</title><link>https://blog.evangelista.moe/</link></image><generator>Ghost 5.30</generator><lastBuildDate>Mon, 11 May 2026 18:56:49 GMT</lastBuildDate><atom:link href="https://blog.evangelista.moe/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[String cheese is a better protein bar]]></title><description><![CDATA[<p>I compared protein bars to string cheese. String cheese wins.</p><h2 id="cost">Cost</h2><p>I compared 5 string cheese brands against 7 protein bars. String cheese costs 29% less per gram of protein.</p><ul><li>String cheese: $0.078 per gram</li><li>Protein bars: $0.111 per gram</li></ul><p>That $2.42 Quest bar? Four Frigo cheese</p>]]></description><link>https://blog.evangelista.moe/string-cheese-vs-protein-bars/</link><guid isPermaLink="false">692a1b8b8b09c10001b6af2e</guid><dc:creator><![CDATA[Marc Evangelista]]></dc:creator><pubDate>Fri, 28 Nov 2025 22:04:32 GMT</pubDate><content:encoded><![CDATA[<p>I compared protein bars to string cheese. String cheese wins.</p><h2 id="cost">Cost</h2><p>I compared 5 string cheese brands against 7 protein bars. String cheese costs 29% less per gram of protein.</p><ul><li>String cheese: $0.078 per gram</li><li>Protein bars: $0.111 per gram</li></ul><p>That $2.42 Quest bar? Four Frigo cheese sticks deliver the same protein. Even organic string cheese (Organic Valley at $0.124/g) beats most bars. Pure Protein matches string cheese on cost ($0.067/g) but uses 25+ ingredients.</p><h2 id="ingredients">Ingredients</h2><p>String cheese: 4 ingredients average. Protein bars: 19.</p><p>String cheese contains milk, salt, enzymes.</p><p>RXBAR markets &quot;No B.S.&quot; simplicity with 7 ingredients. FitCrunch uses 35+ including vegetable glycerin, palm kernel oil, maltitol, and protein isolates.</p><h2 id="carbs">Carbs</h2><p>String cheese: 0-1g carbs. Protein bars: 14-29g.</p><p>Clif Builder&apos;s has 19g sugar. RXBAR uses dates for 14g. &quot;Low sugar&quot; bars use maltitol or erythritol.</p><h2 id="availability">Availability</h2><p>String cheese is sold at grocery stores, gas stations, airports, schools, and vending machines.</p><h2 id="comparison">Comparison</h2><p><strong>String cheese:</strong></p><ul><li>3-4 ingredients</li><li>$0.50 per stick</li><li>Available since 1980s</li></ul><p><strong>Protein bars:</strong></p><ul><li>19-35 ingredients</li><li>$2.50 per bar</li><li>Reformulated constantly</li></ul><h2 id="exception">Exception</h2><p>Lactose intolerance makes protein bars necessary. Dairy-free and vegan options exist.</p><h2 id="conclusion">Conclusion</h2><p>Protein bars work for hiking and travel. For daily protein needs, string cheese costs less and uses fewer ingredients.</p><p>A 12-pack costs $6 and delivers 72-84g of protein.</p>]]></content:encoded></item><item><title><![CDATA[Building Production-Ready AI Agent Orchestration: 30+ Issues, Hard-Won Lessons]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="the-problem-when-ai-coding-assistants-go-rogue">The Problem: When AI Coding Assistants Go Rogue</h2>
<p>AI assistants write code, debug, architect systems. They also create chaos.</p>
<p>I spent three months building an AI agent orchestration system. Not a demo. A production system that completed 30+ GitHub issues, averaging 1-2 days per issue, with 7 issues in the</p>]]></description><link>https://blog.evangelista.moe/production-ai-orchestration/</link><guid isPermaLink="false">68fabde6c0555700012e307e</guid><dc:creator><![CDATA[Marc Evangelista]]></dc:creator><pubDate>Thu, 23 Oct 2025 23:44:38 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="the-problem-when-ai-coding-assistants-go-rogue">The Problem: When AI Coding Assistants Go Rogue</h2>
<p>AI assistants write code, debug, architect systems. They also create chaos.</p>
<p>I spent three months building an AI agent orchestration system. Not a demo. A production system that completed 30+ GitHub issues, averaging 1-2 days per issue, with 7 issues in the last 7 days.</p>
<p>The problem: AI assistants have no memory. They repeat mistakes. Skip validation. Create PRs without documenting learnings. Context-switch and lose everything.</p>
<p>Worse: they can&apos;t manage complex workflows. An issue isn&apos;t just &quot;write code&quot;&#x2014;it&apos;s spec, decomposition, implementation, validation, knowledge extraction, PR, merge, cleanup. Skip knowledge extraction and you&apos;re building on sand.</p>
<p>The challenge: Build something reliable. Enforce workflow discipline. Capture learning. Recover from crashes. Operate autonomously.</p>
<p>This is how I built it.</p>
<h2 id="two-core-innovations">Two Core Innovations</h2>
<h3 id="1-phase-based-state-machine-making-the-implicit-explicit">1. Phase-Based State Machine: Making the Implicit Explicit</h3>
<p><strong>Treat AI workflows like state machines with enforced transitions.</strong></p>
<p>AI agents optimize for task completion. Ask them to &quot;extract learnings before merging&quot;&#x2014;they skip it 60% of the time. Not malicious. Just optional overhead.</p>
<p>The solution isn&apos;t better prompts. Make bad paths impossible.</p>
<p>I designed a five-phase state machine where each phase has:</p>
<ul>
<li><strong>One specialized agent</strong> with a single responsibility</li>
<li><strong>Explicit entry/exit conditions</strong> written to XML state logs</li>
<li><strong>Enforcement gates</strong> that block progression without completion</li>
</ul>
<pre><code>DISCUSSION &#x2192; EXECUTE &#x2192; VALIDATE &#x2192; COMPACT &#x2192; COMPLETE
    &#x2193;           &#x2193;          &#x2193;          &#x2193;          &#x2193;
spec-agent   implement  validator  compact-   merge/
             workers               agent      cleanup
</code></pre>
<p><strong>Compaction is required, not suggested.</strong></p>
<p>Early versions asked agents to &quot;capture learnings.&quot; They skipped it. Current version: pre-merge hooks check for compaction flags. No flag? No PR. Period.</p>
<pre><code class="language-bash"># Pre-merge hook (simplified)
if [ ! -f &quot;.context/compaction-complete.flag&quot; ]; then
    echo &quot;ERROR: Must run compaction before creating PR&quot;
    exit 1
fi
</code></pre>
<p>Result: 100% compaction rate. Zero learning loss.</p>
<p><strong>Why this matters</strong>: Agents lose information between phases. Error patterns, spec divergences, architectural decisions&#x2014;ephemeral unless captured. Mandatory compaction means learning accumulates automatically.</p>
<p>Each worktree gets isolated state in <code>.context/session-log.xml</code>. Phase transitions write explicit markers:</p>
<pre><code class="language-xml">&lt;phase name=&quot;compact&quot; status=&quot;complete&quot; timestamp=&quot;2025-10-20T15:30:45Z&quot;&gt;
  &lt;patterns-extracted&gt;12&lt;/patterns-extracted&gt;
  &lt;session-archived&gt;true&lt;/session-archived&gt;
&lt;/phase&gt;
</code></pre>
<p>The orchestrator reads this state before every action. No guessing, no inference&#x2014;just &quot;what does the XML say?&quot;</p>
<h3 id="2-idempotent-operations-production-reliability-through-retry-safety">2. Idempotent Operations: Production Reliability Through Retry-Safety</h3>
<p><strong>Every operation must be safely retryable.</strong></p>
<p>Agents crash. Models hit rate limits. Networks fail. Context windows overflow. In production, these aren&apos;t edge cases. They&apos;re Tuesday afternoon.</p>
<p><strong>Implementation phase example</strong>: Agent is writing code, crashes after completing 3 of 5 tasks. Re-run the phase command. It reads the XML, sees tasks 1-3 are marked complete, continues from task 4. Same inputs &#x2192; same outputs.</p>
<p><strong>Spec creation example</strong>: Agent drafts spec, crashes before finalizing. Re-run. It reads the partial spec from disk, continues refining. No duplicate work, no lost progress.</p>
<p>The pattern for every phase:</p>
<ul>
<li>Read state from <code>.context/session-log.xml</code></li>
<li>Check completion markers</li>
<li>Perform remaining work</li>
<li>Write state atomically</li>
<li>Set completion flag</li>
</ul>
<p>Across 30+ issues: multiple crashes. Every one recovered by re-running the phase command. No manual repair. No corruption. No lost work.</p>
<p>Crash at any point? Next run reads the XML and continues.</p>
<h2 id="real-world-results">Real-World Results</h2>
<p>30+ issues completed. 1-2 day average. 100% compaction rate. Multiple crashes. Zero data loss.</p>
<p>Peak: 9 issues in 6 days (Oct 1-6).</p>
<p>The system orchestrated its own development.</p>
<h3 id="what-actually-works">What Actually Works</h3>
<p><strong>State machine enforcement</strong>: Zero skipped compactions. The gates work.</p>
<p><strong>Idempotent operations</strong>: Multiple agent crashes across 30+ issues. Every single one recovered cleanly by re-running the phase command.</p>
<p><strong>Worktree isolation</strong>: Ran 3 issues in parallel during peak sprint. Zero cross-contamination.</p>
<p><strong>Organizational learning</strong>: After 30+ issues, complete session archives are preserved in <code>.orchestration/archived-sessions/</code> for post-mortem analysis and future cross-issue pattern detection.</p>
<h3 id="whats-still-hard">What&apos;s Still Hard</h3>
<p><strong>Ambiguous specs kill velocity</strong>: Vague acceptance criteria &#x2192; agent thrashing. System enforces spec finalization but can&apos;t force clarity. That&apos;s human judgment.</p>
<p><strong>Validation must be incremental</strong>: Currently discrete phase after implementation. Better: validate each task as it completes. Architecture permits this. Doesn&apos;t enforce it yet.</p>
<p><strong>Merge conflicts need automation</strong>: Manual rebases required when branches diverge. Rebase-agent proposed (issue #81). Not implemented.</p>
<h2 id="hard-won-lessons">Hard-Won Lessons</h2>
<p><strong>Enforcement beats prompts</strong>: &quot;Please capture learnings&quot; &#x2192; 60% skip rate. Block merges without compaction &#x2192; 100% success.</p>
<p><strong>Observability is mandatory</strong>: XML logs for every transition. When things break, you need the audit trail.</p>
<p><strong>Idempotency from day one</strong>: Network failures, rate limits, context overflows happen regularly. Design for retries from the start.</p>
<p><strong>State machines need explicit markers</strong>: Don&apos;t make orchestrators guess. Require explicit completion markers. No inference.</p>
<h2 id="why-this-matters">Why This Matters</h2>
<p>Agentic systems can be production-ready today. Not demos. 30+ issues prove it.</p>
<p>The key: engineer for reliability, not capability. Don&apos;t prompt &quot;be careful.&quot; Build systems that make failure impossible.</p>
<p>After 30+ issues:</p>
<ul>
<li>Phase-based state machines with enforcement</li>
<li>Idempotent operations</li>
<li>Mandatory learning extraction</li>
</ul>
<p>This isn&apos;t the final answer. It&apos;s proof that agentic systems work when we engineer them properly.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>