<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Power of Eloquence</title>
  
  <subtitle>Mastering the Art of Technical Craftsmanship</subtitle>
  <link href="http://awongcm.io/atom.xml" rel="self"/>
  
  <link href="http://awongcm.io/"/>
  <updated>2026-11-15T01:30:57.672Z</updated>
  <id>http://awongcm.io/</id>
  
  <author>
    <name>Andy Wong</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Ditch H2: Real PostgreSQL and Kafka Integration Tests with JUnit and Testcontainers</title>
    <link href="http://awongcm.io/blog/2026/11/15/ditch-h2-real-postgresql-and-kafka-integration-tests-with-junit-and-testcontainers/"/>
    <id>http://awongcm.io/blog/2026/11/15/ditch-h2-real-postgresql-and-kafka-integration-tests-with-junit-and-testcontainers/</id>
    <published>2026-11-15T01:20:20.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: An in-memory H2 database and an embedded broker only prove that your code works against <em>something like</em> production. Testcontainers gives JUnit tests a real PostgreSQL and a real Kafka in Docker. With Spring Boot’s <code>@ServiceConnection</code>, it takes about ten lines of config.</p></blockquote><img src="/images/ai_generated_ditch_h2_postgresql_kafka_junit_testcontainers_integration.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>We’ve all had this build: every test is green, the pipeline is fast, and the team ships with confidence. Then the first deploy hits a real PostgreSQL instance and falls over with <code>ERROR: column &quot;metadata&quot; is of type jsonb but expression is of type character varying</code>.</p><p>The tests weren’t lying, exactly. They were answering a different question. H2 told you your code works against <em>H2</em>.</p><p>I spent a long stretch of my career in Australian banking, where that gap matters a lot. A test that passes in memory and fails in production isn’t a flaky test. It’s an incident report. So as part of my Java comeback series, I’ve been rebuilding my integration-testing habits around <strong>Testcontainers</strong>: real infrastructure, started in Docker, managed by JUnit.</p><p>In this post, we’ll replace H2 and the embedded Kafka broker with the real thing. Whether you’re maintaining a Spring Boot service or just tired of “works on my H2,” you’ll find patterns you can apply on Monday.</p><span id="more"></span><p>By the end of this post, you’ll understand:</p><ul><li>Why in-memory fakes give you false confidence, with a concrete example</li><li>How to wire real PostgreSQL and Kafka into JUnit tests using Testcontainers 2.x and Spring Boot’s <code>@ServiceConnection</code></li><li>How to keep those tests fast enough that your team actually runs them</li></ul><blockquote><p><strong>A quick note on versions:</strong> The title says “JUnit,” not “JUnit 5,” on purpose. JUnit 6 shipped on 30 September 2025 with a Java 17 baseline. The Jupiter programming model (<code>@Test</code>, <code>@BeforeEach</code>, extensions) is the same one you know from JUnit 5. Spring Boot 4 uses JUnit 6 by default. Everything below works on either, as long as you’re on Jupiter.</p><p>The examples target <strong>Spring Boot 4.x</strong> (4.1 is the current stable line, and 4.2 is due later this month), <strong>Testcontainers 2.0.x</strong> and <strong>JUnit 6.1.x</strong>. If you’re still on Boot 3.5, note that its free OSS support ended on 30 June 2026. It also manages Testcontainers <strong>1.x</strong>, so the 1.x artifact names and packages apply there.</p></blockquote><h2 id="Section-1-Why-H2-Lies-to-You"><a href="#Section-1-Why-H2-Lies-to-You" class="headerlink" title="Section 1: Why H2 Lies to You"></a>Section 1: Why H2 Lies to You</h2><h3 id="The-compatibility-mode-trap"><a href="#The-compatibility-mode-trap" class="headerlink" title="The compatibility-mode trap"></a>The compatibility-mode trap</h3><p>H2’s <code>MODE=PostgreSQL</code> is a best-effort imitation, not a promise. It handles basic DDL and simple queries, but production schemas rarely stay basic. Here’s a real-world payments table and a query that any Postgres-backed fintech service might run:</p><pre><code class="hljs sql"><span class="hljs-comment">-- src/main/resources/db/migration/V1__payments.sql</span><span class="hljs-keyword">CREATE TABLE</span> payments (    id               UUID <span class="hljs-keyword">PRIMARY KEY</span> <span class="hljs-keyword">DEFAULT</span> gen_random_uuid(),    idempotency_key  TEXT        <span class="hljs-keyword">NOT NULL</span> <span class="hljs-keyword">UNIQUE</span>,    order_id         UUID        <span class="hljs-keyword">NOT NULL</span>,    amount           <span class="hljs-type">NUMERIC</span>(<span class="hljs-number">19</span>, <span class="hljs-number">4</span>) <span class="hljs-keyword">NOT NULL</span>,    status           TEXT        <span class="hljs-keyword">NOT NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-string">&#x27;PENDING&#x27;</span>,    metadata         JSONB       <span class="hljs-keyword">NOT NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-string">&#x27;&#123;&#125;&#x27;</span>::jsonb,    created_at       TIMESTAMPTZ <span class="hljs-keyword">NOT NULL</span> <span class="hljs-keyword">DEFAULT</span> now());<span class="hljs-comment">-- Partial index: only index the rows we actually poll for</span><span class="hljs-keyword">CREATE</span> INDEX idx_payments_pending <span class="hljs-keyword">ON</span> payments (created_at) <span class="hljs-keyword">WHERE</span> status <span class="hljs-operator">=</span> <span class="hljs-string">&#x27;PENDING&#x27;</span>;</code></pre><pre><code class="hljs java"><span class="hljs-comment">// Idempotent insert + JSONB filtering: everyday Postgres, unsupported or unreliable in H2</span><span class="hljs-meta">@Repository</span><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">PaymentRepository</span> &#123;    <span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> JdbcClient jdbc;    <span class="hljs-keyword">public</span> <span class="hljs-title function_">PaymentRepository</span><span class="hljs-params">(JdbcClient jdbc)</span> &#123;        <span class="hljs-built_in">this</span>.jdbc = jdbc;    &#125;    <span class="hljs-comment">/** Returns 1 if inserted, 0 if this idempotency key was already processed. */</span>    <span class="hljs-keyword">public</span> <span class="hljs-type">int</span> <span class="hljs-title function_">recordPayment</span><span class="hljs-params">(String idempotencyKey, UUID orderId, BigDecimal amount, String metadataJson)</span> &#123;        <span class="hljs-keyword">return</span> jdbc.sql(<span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-string">                INSERT INTO payments (idempotency_key, order_id, amount, metadata)</span><span class="hljs-string">                VALUES (:key, :orderId, :amount, CAST(:metadata AS jsonb))</span><span class="hljs-string">                ON CONFLICT (idempotency_key) DO NOTHING</span><span class="hljs-string">                &quot;&quot;&quot;</span>)            .param(<span class="hljs-string">&quot;key&quot;</span>, idempotencyKey)            .param(<span class="hljs-string">&quot;orderId&quot;</span>, orderId)            .param(<span class="hljs-string">&quot;amount&quot;</span>, amount)            .param(<span class="hljs-string">&quot;metadata&quot;</span>, metadataJson)            .update();    &#125;    <span class="hljs-keyword">public</span> <span class="hljs-type">long</span> <span class="hljs-title function_">countByChannel</span><span class="hljs-params">(String channel)</span> &#123;        <span class="hljs-keyword">return</span> jdbc.sql(<span class="hljs-string">&quot;SELECT count(*) FROM payments WHERE metadata -&gt;&gt; &#x27;channel&#x27; = :channel&quot;</span>)            .param(<span class="hljs-string">&quot;channel&quot;</span>, channel)            .query(Long.class)            .single();    &#125;&#125;</code></pre><p><strong>Key points:</strong></p><ul><li><strong><code>JSONB</code> and the <code>-&gt;&gt;</code> operator</strong> are PostgreSQL features. H2 has its own JSON type with different semantics.</li><li><strong><code>ON CONFLICT ... DO NOTHING</code></strong> is the backbone of idempotent payment processing. If your tests can’t exercise it faithfully, you aren’t testing your idempotency guarantee.</li><li><strong>Partial indexes, <code>gen_random_uuid()</code>, <code>TIMESTAMPTZ</code></strong> behave differently, or not at all, depending on H2 version and mode.</li></ul><p>The usual workaround is a second set of “H2-friendly” migrations. At that point, you’re maintaining a fake schema to test fake behaviour. That’s the real cost.</p><h2 id="Section-2-Real-Infrastructure-with-Testcontainers-2-x"><a href="#Section-2-Real-Infrastructure-with-Testcontainers-2-x" class="headerlink" title="Section 2: Real Infrastructure with Testcontainers 2.x"></a>Section 2: Real Infrastructure with Testcontainers 2.x</h2><p>Testcontainers is a Java library that starts throwaway Docker containers for your tests and cleans them up afterwards. Its sidecar, Ryuk, removes containers even if the JVM crashes. You need a Docker-compatible runtime locally and in CI. GitHub Actions’ Ubuntu runners already have one.</p><h3 id="Dependencies-and-the-2-0-rename-gotcha"><a href="#Dependencies-and-the-2-0-rename-gotcha" class="headerlink" title="Dependencies (and the 2.0 rename gotcha)"></a>Dependencies (and the 2.0 rename gotcha)</h3><p>Testcontainers 2.0 renamed every module artifact to use a consistent <code>testcontainers-</code> prefix. It also moved container classes into per-module packages and removed JUnit 4 support. Old blog posts (and your AI assistant) will happily give you <code>org.testcontainers:postgresql</code>. The 2.x BOM doesn’t manage it, so Maven fails with a missing-version error.</p><p>Spring Boot 4 also split auto-configuration into modules. Having <code>flyway-core</code> on the classpath no longer auto-configures Flyway, so you need the starters explicitly:</p><pre><code class="hljs xml"><span class="hljs-comment">&lt;!-- pom.xml (main): Boot 4 needs explicit starters for Flyway, JDBC and Kafka --&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-boot-starter-flyway<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.flywaydb<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>flyway-database-postgresql<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span> <span class="hljs-comment">&lt;!-- Flyway 10+ ships DB support as separate modules --&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-boot-starter-jdbc<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>   <span class="hljs-comment">&lt;!-- JdbcClient --&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-boot-starter-kafka<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>  <span class="hljs-comment">&lt;!-- Boot 4: replaces a bare spring-kafka dependency --&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.postgresql<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>postgresql<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">scope</span>&gt;</span>runtime<span class="hljs-tag">&lt;/<span class="hljs-name">scope</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span></code></pre><p>Then the test-scoped Testcontainers modules:</p><pre><code class="hljs xml"><span class="hljs-comment">&lt;!-- pom.xml (test): Spring Boot 4 manages the Testcontainers 2.x version for you --&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-boot-testcontainers<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">scope</span>&gt;</span>test<span class="hljs-tag">&lt;/<span class="hljs-name">scope</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.testcontainers<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>testcontainers-junit-jupiter<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>   <span class="hljs-comment">&lt;!-- 1.x: junit-jupiter --&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">scope</span>&gt;</span>test<span class="hljs-tag">&lt;/<span class="hljs-name">scope</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.testcontainers<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>testcontainers-postgresql<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>      <span class="hljs-comment">&lt;!-- 1.x: postgresql --&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">scope</span>&gt;</span>test<span class="hljs-tag">&lt;/<span class="hljs-name">scope</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.testcontainers<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>testcontainers-kafka<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>           <span class="hljs-comment">&lt;!-- 1.x: kafka --&gt;</span>    <span class="hljs-tag">&lt;<span class="hljs-name">scope</span>&gt;</span>test<span class="hljs-tag">&lt;/<span class="hljs-name">scope</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span></code></pre><p>If you’re upgrading an existing codebase, OpenRewrite has a <code>Testcontainers2Dependencies</code> recipe that renames these for you.</p><h3 id="Plain-JUnit-no-Spring-required"><a href="#Plain-JUnit-no-Spring-required" class="headerlink" title="Plain JUnit: no Spring required"></a>Plain JUnit: no Spring required</h3><p>The core model is two annotations. <code>@Testcontainers</code> enables the JUnit extension. <code>@Container</code> marks the containers it manages. A <code>static</code> field means one container for the whole class instead of one per test method.</p><pre><code class="hljs java"><span class="hljs-keyword">import</span> org.junit.jupiter.api.Test;<span class="hljs-keyword">import</span> org.testcontainers.junit.jupiter.Container;<span class="hljs-keyword">import</span> org.testcontainers.junit.jupiter.Testcontainers;<span class="hljs-keyword">import</span> org.testcontainers.postgresql.PostgreSQLContainer; <span class="hljs-comment">// 2.x package (1.x: org.testcontainers.containers)</span><span class="hljs-keyword">import</span> java.sql.DriverManager;<span class="hljs-keyword">import</span> <span class="hljs-keyword">static</span> org.assertj.core.api.Assertions.assertThat;<span class="hljs-meta">@Testcontainers</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">PostgresSmokeTest</span> &#123;    <span class="hljs-meta">@Container</span>    <span class="hljs-keyword">static</span> <span class="hljs-type">PostgreSQLContainer</span> <span class="hljs-variable">postgres</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">PostgreSQLContainer</span>(<span class="hljs-string">&quot;postgres:18-alpine&quot;</span>); <span class="hljs-comment">// pin the tag to your prod major!</span>    <span class="hljs-meta">@Test</span>    <span class="hljs-keyword">void</span> <span class="hljs-title function_">jsonbOperatorsWorkBecauseThisIsRealPostgres</span><span class="hljs-params">()</span> <span class="hljs-keyword">throws</span> Exception &#123;        <span class="hljs-keyword">try</span> (<span class="hljs-type">var</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> DriverManager.getConnection(                postgres.getJdbcUrl(), postgres.getUsername(), postgres.getPassword());             <span class="hljs-type">var</span> <span class="hljs-variable">rs</span> <span class="hljs-operator">=</span> conn.createStatement()                 .executeQuery(<span class="hljs-string">&quot;SELECT &#x27;&#123;\&quot;channel\&quot;:\&quot;mobile\&quot;&#125;&#x27;::jsonb -&gt;&gt; &#x27;channel&#x27;&quot;</span>)) &#123;            rs.next();            assertThat(rs.getString(<span class="hljs-number">1</span>)).isEqualTo(<span class="hljs-string">&quot;mobile&quot;</span>);        &#125;    &#125;&#125;</code></pre><h2 id="Section-3-Spring-Boot-ServiceConnection"><a href="#Section-3-Spring-Boot-ServiceConnection" class="headerlink" title="Section 3: Spring Boot + @ServiceConnection"></a>Section 3: Spring Boot + <code>@ServiceConnection</code></h2><p>Before Spring Boot 3.1, you wired containers into Spring with <code>@DynamicPropertySource</code>, copying JDBC URLs and bootstrap servers into properties by hand. <code>@ServiceConnection</code> does that for you. Spring Boot recognises the container type and builds the connection details automatically.</p><h3 id="One-shared-configuration-for-the-whole-suite"><a href="#One-shared-configuration-for-the-whole-suite" class="headerlink" title="One shared configuration for the whole suite"></a>One shared configuration for the whole suite</h3><p>Rather than declaring containers in every test class, define them once as beans:</p><pre><code class="hljs java"><span class="hljs-meta">@TestConfiguration(proxyBeanMethods = false)</span><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">TestcontainersConfig</span> &#123;    <span class="hljs-meta">@Bean</span>    <span class="hljs-meta">@ServiceConnection</span> <span class="hljs-comment">// -&gt; spring.datasource.* (Flyway runs your real migrations against it)</span>    PostgreSQLContainer <span class="hljs-title function_">postgres</span><span class="hljs-params">()</span> &#123;        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">PostgreSQLContainer</span>(<span class="hljs-string">&quot;postgres:18-alpine&quot;</span>);    &#125;    <span class="hljs-meta">@Bean</span>    <span class="hljs-meta">@ServiceConnection</span> <span class="hljs-comment">// -&gt; spring.kafka.bootstrap-servers</span>    KafkaContainer <span class="hljs-title function_">kafka</span><span class="hljs-params">()</span> &#123;        <span class="hljs-comment">// org.testcontainers.kafka.KafkaContainer = official apache/kafka image, KRaft mode, no ZooKeeper.</span>        <span class="hljs-comment">// Using Confluent images? Use ConfluentKafkaContainer instead.</span>        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">KafkaContainer</span>(<span class="hljs-string">&quot;apache/kafka:4.3.1&quot;</span>); <span class="hljs-comment">// match your brokers&#x27; version</span>    &#125;&#125;</code></pre><p>Because the containers are beans, they share the lifecycle of Spring’s cached application context. Every test class that imports this config and has the same context setup reuses the same PostgreSQL and Kafka. You don’t pay a container startup per class.</p><p>Bonus: the same config gives you a local dev environment. Point a <code>TestApplication</code> <code>main</code> method at <code>SpringApplication.from(Application::main).with(TestcontainersConfig.class).run(args)</code>, and <code>./mvnw spring-boot:test-run</code> boots your app with real infrastructure. No <code>docker-compose.yml</code> to keep in sync.</p><h2 id="Real-World-Example-Idempotent-Payment-Events-End-to-End"><a href="#Real-World-Example-Idempotent-Payment-Events-End-to-End" class="headerlink" title="Real-World Example: Idempotent Payment Events End to End"></a>Real-World Example: Idempotent Payment Events End to End</h2><p>Let’s test the full flow. A <code>payment-events</code> message arrives on Kafka, a listener persists it, and a duplicate delivery must <strong>not</strong> create a second row. This is at-least-once delivery, the thing that keeps payment engineers up at night.</p><pre><code class="hljs java"><span class="hljs-meta">@Component</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">PaymentEventListener</span> &#123;    <span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> PaymentRepository payments;    PaymentEventListener(PaymentRepository payments) &#123;        <span class="hljs-built_in">this</span>.payments = payments;    &#125;    <span class="hljs-comment">// Message key = idempotency key; value = &quot;orderId,amount,channel&quot; (kept simple for the demo)</span>    <span class="hljs-meta">@KafkaListener(topics = &quot;payment-events&quot;, groupId = &quot;payments-service&quot;)</span>    <span class="hljs-keyword">void</span> <span class="hljs-title function_">onPaymentEvent</span><span class="hljs-params">(ConsumerRecord&lt;String, String&gt; record)</span> &#123;        String[] parts = record.value().split(<span class="hljs-string">&quot;,&quot;</span>);        payments.recordPayment(            record.key(),            UUID.fromString(parts[<span class="hljs-number">0</span>]),            <span class="hljs-keyword">new</span> <span class="hljs-title class_">BigDecimal</span>(parts[<span class="hljs-number">1</span>]),            <span class="hljs-string">&quot;&#123;\&quot;channel\&quot;:\&quot;%s\&quot;&#125;&quot;</span>.formatted(parts[<span class="hljs-number">2</span>]));    &#125;&#125;</code></pre><pre><code class="hljs java"><span class="hljs-meta">@SpringBootTest(properties = &quot;spring.kafka.consumer.auto-offset-reset=earliest&quot;)</span><span class="hljs-meta">@Import(TestcontainersConfig.class)</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">PaymentEventFlowIT</span> &#123;    <span class="hljs-meta">@Autowired</span> KafkaTemplate&lt;String, String&gt; kafka;    <span class="hljs-meta">@Autowired</span> PaymentRepository payments;    <span class="hljs-meta">@Autowired</span> JdbcClient jdbc;    <span class="hljs-meta">@Test</span>    <span class="hljs-keyword">void</span> <span class="hljs-title function_">duplicateDeliveryIsProcessedExactlyOnce</span><span class="hljs-params">()</span> &#123;        <span class="hljs-type">String</span> <span class="hljs-variable">idempotencyKey</span> <span class="hljs-operator">=</span> <span class="hljs-string">&quot;pay-&quot;</span> + UUID.randomUUID(); <span class="hljs-comment">// unique per test: no cleanup coupling</span>        <span class="hljs-type">String</span> <span class="hljs-variable">payload</span> <span class="hljs-operator">=</span> UUID.randomUUID() + <span class="hljs-string">&quot;,149.95,mobile&quot;</span>;        <span class="hljs-comment">// Simulate Kafka&#x27;s at-least-once delivery: same event, twice</span>        kafka.send(<span class="hljs-string">&quot;payment-events&quot;</span>, idempotencyKey, payload);        kafka.send(<span class="hljs-string">&quot;payment-events&quot;</span>, idempotencyKey, payload);        <span class="hljs-comment">// Async consumer: poll instead of Thread.sleep()</span>        await().atMost(Duration.ofSeconds(<span class="hljs-number">15</span>)).untilAsserted(() -&gt; &#123;            <span class="hljs-type">long</span> <span class="hljs-variable">rows</span> <span class="hljs-operator">=</span> jdbc.sql(<span class="hljs-string">&quot;SELECT count(*) FROM payments WHERE idempotency_key = :k&quot;</span>)                .param(<span class="hljs-string">&quot;k&quot;</span>, idempotencyKey)                .query(Long.class)                .single();            assertThat(rows).isEqualTo(<span class="hljs-number">1</span>); <span class="hljs-comment">// ON CONFLICT DO NOTHING, proven against real Postgres</span>        &#125;);        assertThat(payments.countByChannel(<span class="hljs-string">&quot;mobile&quot;</span>)).isGreaterThanOrEqualTo(<span class="hljs-number">1</span>); <span class="hljs-comment">// real JSONB query</span>    &#125;&#125;</code></pre><p>This one test exercises real Kafka serialisation, consumer-group offset handling, your actual Flyway migrations, the unique constraint, and the JSONB operator. H2 plus <code>@EmbeddedKafka</code> could only approximate two of those five.</p><p>Notice the test generates its own idempotency key instead of truncating tables. Because the containers are shared across the suite, <strong>test isolation comes from unique data, not a fresh database</strong>. That’s also how your service behaves in production.</p><h2 id="Best-Practices-and-Recommendations"><a href="#Best-Practices-and-Recommendations" class="headerlink" title="Best Practices and Recommendations"></a>Best Practices and Recommendations</h2><h3 id="Do’s-✅"><a href="#Do’s-✅" class="headerlink" title="Do’s ✅"></a>Do’s ✅</h3><ul><li><strong>Pin image tags</strong> (<code>postgres:18-alpine</code>) to match your production major version, so a surprise <code>latest</code> upgrade can’t break CI.</li><li><strong>Share containers through cached contexts</strong> or a singleton config. Startup cost should be paid once per suite, not once per class.</li><li><strong>Name integration tests <code>*IT</code></strong> and run them with Maven Failsafe. Unit tests stay sub-second and the contract stays clear.</li><li><strong>Use Awaitility</strong> for anything asynchronous. Kafka consumers don’t finish on your schedule.</li></ul><h3 id="Don’ts-❌"><a href="#Don’ts-❌" class="headerlink" title="Don’ts ❌"></a>Don’ts ❌</h3><ul><li><strong>Avoid <code>@DirtiesContext</code></strong>. It throws away the cached context, and with it your containers, so the next class starts them again.</li><li><strong>Don’t keep H2 “just for unit tests”</strong> that touch SQL. If it hits a database, it hits the real one.</li><li><strong>Never hardcode ports.</strong> Testcontainers maps to random host ports. Always ask the container (<code>getJdbcUrl()</code>, <code>getBootstrapServers()</code>), or let <code>@ServiceConnection</code> do it.</li></ul><h2 id="Performance-Considerations"><a href="#Performance-Considerations" class="headerlink" title="Performance Considerations"></a>Performance Considerations</h2><p>Expect a few seconds of startup for PostgreSQL and a little more for Kafka on the first run, plus the one-off image pull. Three levers keep it manageable:</p><ol><li><strong>Context caching</strong>, as shown above. This is the biggest win by far.</li><li><strong>Reusable containers for local dev</strong>: add <code>testcontainers.reuse.enable=true</code> to <code>~/.testcontainers.properties</code> and call <code>.withReuse(true)</code> on the container. Containers survive between runs. Keep this off in CI.</li><li><strong>Pre-pull images in CI</strong>, or cache them, so the pipeline isn’t bound by Docker Hub.</li></ol><h2 id="Troubleshooting-Guide"><a href="#Troubleshooting-Guide" class="headerlink" title="Troubleshooting Guide"></a>Troubleshooting Guide</h2><table><thead><tr><th>Problem</th><th>Cause</th><th>Solution</th></tr></thead><tbody><tr><td><code>Could not find a valid Docker environment</code></td><td>No Docker daemon, or socket not visible</td><td>Start Docker Desktop &#x2F; Colima &#x2F; Podman, check <code>docker info</code>; on Colima, set <code>DOCKER_HOST</code></td></tr><tr><td><code>&#39;dependencies.dependency.version&#39; for org.testcontainers:postgresql:jar is missing</code></td><td>1.x artifact names on a 2.x BOM</td><td>Use <code>testcontainers-postgresql</code>, <code>testcontainers-kafka</code>, etc.</td></tr><tr><td>Migrations never run; tables missing after upgrading to Boot 4</td><td><code>flyway-core</code> alone no longer auto-configures</td><td>Add <code>spring-boot-starter-flyway</code> (plus <code>flyway-database-postgresql</code>)</td></tr><tr><td><code>PostgreSQLContainer</code> import doesn’t compile</td><td>Package moved in 2.0</td><td>Import from <code>org.testcontainers.postgresql</code> &#x2F; <code>org.testcontainers.kafka</code></td></tr><tr><td>Kafka test passes locally, times out in CI</td><td>Consumer starts after the message is sent</td><td>Set <code>auto-offset-reset=earliest</code> and widen the Awaitility timeout</td></tr><tr><td>Suite gets slower with every new test class</td><td>Contexts differ or <code>@DirtiesContext</code></td><td>Standardise on one <code>@Import(TestcontainersConfig.class)</code> setup</td></tr></tbody></table><h2 id="Further-Reading"><a href="#Further-Reading" class="headerlink" title="Further Reading"></a>Further Reading</h2><ul><li><a href="https://java.testcontainers.org/">Testcontainers for Java: official docs</a></li><li><a href="https://docs.spring.io/spring-boot/reference/testing/testcontainers.html">Spring Boot reference: Testcontainers and service connections</a></li><li><a href="https://docs.docker.com/guides/testcontainers-java-spring-boot-kafka/">Testing a Spring Boot Kafka listener using Testcontainers (Docker guide)</a></li><li><a href="https://docs.junit.org/6.0.0/release-notes/">JUnit 6 release notes</a></li><li><a href="https://docs.openrewrite.org/recipes/java/testing/testcontainers/testcontainers2dependencies">OpenRewrite: Testcontainers 2 dependency rename recipe</a></li></ul><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>H2 was a reasonable compromise when spinning up a real database for every build was painful. That’s no longer true. With Testcontainers 2.x and <code>@ServiceConnection</code>, real PostgreSQL and real Kafka cost you one config class and a Docker daemon. In return, your idempotency guarantees, JSONB queries, and migrations get tested against the engines that will actually run them.</p><p>The bigger shift is mindset. Integration tests should answer “will this work in production?”, not “will this work in a simulator?” In regulated domains like banking, that difference shows up as audit findings and incidents.</p><p><strong>Your next steps:</strong></p><ol><li>Find one repository test that runs on H2, move it onto <code>TestcontainersConfig</code>, and see what breaks. Something usually does.</li><li>Delete your H2-specific migration scripts, and the <code>h2</code> dependency with them.</li><li>Add a <code>*IT</code> Failsafe stage to your pipeline so these tests gate every merge.</li></ol><p>What’s the nastiest H2-vs-production surprise you’ve hit? Tell me in the comments. I’m collecting war stories.</p><p>Till next time, Happy Coding!</p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: An in-memory H2 database and an embedded broker only prove that your code works against &lt;em&gt;something like&lt;/em&gt; production. Testcontainers gives JUnit tests a real PostgreSQL and a real Kafka in Docker. With Spring Boot’s &lt;code&gt;@ServiceConnection&lt;/code&gt;, it takes about ten lines of config.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_ditch_h2_postgresql_kafka_junit_testcontainers_integration.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;We’ve all had this build: every test is green, the pipeline is fast, and the team ships with confidence. Then the first deploy hits a real PostgreSQL instance and falls over with &lt;code&gt;ERROR: column &amp;quot;metadata&amp;quot; is of type jsonb but expression is of type character varying&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The tests weren’t lying, exactly. They were answering a different question. H2 told you your code works against &lt;em&gt;H2&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I spent a long stretch of my career in Australian banking, where that gap matters a lot. A test that passes in memory and fails in production isn’t a flaky test. It’s an incident report. So as part of my Java comeback series, I’ve been rebuilding my integration-testing habits around &lt;strong&gt;Testcontainers&lt;/strong&gt;: real infrastructure, started in Docker, managed by JUnit.&lt;/p&gt;
&lt;p&gt;In this post, we’ll replace H2 and the embedded Kafka broker with the real thing. Whether you’re maintaining a Spring Boot service or just tired of “works on my H2,” you’ll find patterns you can apply on Monday.&lt;/p&gt;</summary>
    
    
    
    
    <category term="java" scheme="http://awongcm.io/tags/java/"/>
    
    <category term="kafka" scheme="http://awongcm.io/tags/kafka/"/>
    
    <category term="testing" scheme="http://awongcm.io/tags/testing/"/>
    
    <category term="spring-boot" scheme="http://awongcm.io/tags/spring-boot/"/>
    
    <category term="testcontainers" scheme="http://awongcm.io/tags/testcontainers/"/>
    
    <category term="postgresql" scheme="http://awongcm.io/tags/postgresql/"/>
    
  </entry>
  
  <entry>
    <title>Receipts, Not Vibes: How to Ask an Agent to Audit (and Finally Finish) Your GitHub Backlog</title>
    <link href="http://awongcm.io/blog/2026/10/24/receipts-not-vibes-how-to-ask-an-agent-to-audit-and-finally-finish-your-github-backlog/"/>
    <id>http://awongcm.io/blog/2026/10/24/receipts-not-vibes-how-to-ask-an-agent-to-audit-and-finally-finish-your-github-backlog/</id>
    <published>2026-10-24T04:53:49.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_receipt_not_vibes_github_backlog_finish.jpeg" class="center" width="500" height="500" title="Generated AI image by Gemini Nano Banana Generated AI image by Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Gemini Nano Banana</p></em></p><blockquote><p><strong>TL;DR</strong> — Experienced engineers don’t lack ideas. We have backlogs of half-finished repos that life got in the way of. AI agents now make it realistic to finish them, but only if you can tell what’s actually done. I asked an agent to audit all 70 of my own GitHub repos against hard evidence of agent work, not my memory and not README vibes. It came back with 40 repos carrying receipts, 30 without, and an honest list of leftovers that didn’t fit the story I wanted to tell. Below is the protocol, the prompt, the real numbers, and why a classified inventory beats a highlight reel — whether you have a career break or just one evening a week.</p></blockquote><p>Over twenty-plus years of software engineering, I’ve amassed, to date, over 70 (not 60 - as per my original post <a href="/blog/2026/01/04/the-future-of-the-ai-era-for-developers-what-2026-really-means-for-software-builders/" title="The Future of the AI Era for Developers: What 2026 Really Means for Software Builders">claim</a> earlier in the year) personal repos on GitHub. (Yes, that many — and that’s with forks excluded, plus my private repos mentioned in this article)</p><p>Scroll through them and you can read my career like tree rings. Plenty started life as learning side projects: a new language, a framework I wanted to get my hands on, a kata to keep my skills from going rusty. Others were genuine pet-project ideas of my own, the kind I was properly excited about the night I typed <code>git init</code>.</p><p>The trouble is how many of them stopped halfway.</p><p>Not because the ideas were bad. Because life happened. A demanding day job, family, and all the commitments that come with both. Every evening on the laptop was an evening not spent on something (or someone) else. For most of my career, the advice for staying sharp was some version of <em>just build things</em> — good advice for a 23-year-old’s calendar. Somewhere past the twenty-year mark, it quietly turns into a trade: <strong>self-learning versus lifestyle</strong>. Lifestyle usually won, and rightly so. The half-finished repos just kept piling up.</p><p>And suddenly.</p><span id="more"></span><p>Two things changed at once. I was on a career break mid-year of 2026, and AI agents have finally become good enough to do serious work. For the first time, I can go back through that ‘backlog’ and actually either finish or enhance those projects, in a span of time that would have been unthinkable a several years ago prior to AI-era. <code>jukebox-aurora</code>, an Angular jukebox I’d left on Angular 5 for years, was on Angular 19 with a working build again after a cloud-agent Phase 1 — work that used to mean a month of evenings I never had.</p><p>Here’s my claim, and the rest of this post is the evidence for it. Agents don’t replace taste. They don’t decide what’s worth building, and they don’t own the judgement on whether it’s any good. What they <em>do</em> is compress execution — enough that you no longer have to choose between learning and living.</p><p>But.</p><p>“I’ve been building heaps with AI lately” is a vibe. Vibes don’t survive an interview, and they certainly don’t survive your own honest scrutiny six months later. So before I said anything about my own work, I wanted receipts.</p><h2 id="Why-I-didn’t-trust-my-own-memory"><a href="#Why-I-didn’t-trust-my-own-memory" class="headerlink" title="Why I didn’t trust my own memory"></a>Why I didn’t trust my own memory</h2><p>When I sat down to take stock of what I’d actually built with agents over the past year or so, my first instinct was to just list it from memory. The expense tracker rebuild. The Java toy robot. That language app. A handful of others.</p><p>Then I tried to count, and realised I had no idea.</p><p>Memory is a terrible source of truth for this. It over-weights the projects you’re proud of and the ones you’ve recently blogged about. It forgets the half-finished branch from four months ago. And it happily blurs “I used an agent for a bit of boilerplate” with “an agent did most of this”. If I’m going to point at a portfolio and call it evidence, the evidence has to come from somewhere that doesn’t flatter me.</p><p>This is the same theme I keep circling back to in this blog. In <em><a href="/blog/2026/06/14/context-engineering-for-developers-mastering-the-art-of-prompting-systems-agents-and-memory/" title="Context Engineering for Developers: Mastering the Art of Prompting Systems, Agents, and Memory">Context Engineering</a></em>, it was the quality of what you hand the model. In <em><a href="/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/" title="Don&#39;t Let AI Dull Your Software Engineering Edge">Dont Let AI Dull Your Edge&#39;</a></em>, it was not outsourcing your judgement. In <em><a href="/blog/2026/09/12/from-roadmap-to-repo-proving-nine-java-disciplines-in-one-ecommerce-api/" title="From Roadmap to Repo: Proving Nine Java Disciplines in One Ecommerce API">From Roadmap to Repo</a></em>, it was that plans are cheap and receipts are not. This post is the Saturday-night, applied version of all three: an audit you can re-run, and a portfolio you can actually point at.</p><h2 id="The-method-six-steps-to-receipts"><a href="#The-method-six-steps-to-receipts" class="headerlink" title="The method: six steps to receipts"></a>The method: six steps to receipts</h2><p>Here’s the protocol. None of it is clever prompt poetry. The skill is in the grounding — telling the agent exactly what counts as evidence and refusing to let it fill gaps with enthusiasm.</p><h3 id="1-Point-the-agent-at-a-source-of-truth"><a href="#1-Point-the-agent-at-a-source-of-truth" class="headerlink" title="1. Point the agent at a source of truth"></a>1. Point the agent at a source of truth</h3><p>Give it your GitHub account, not your recollection. Default-branch commit history and pull requests are the record. Explicitly tell it <em>not</em> to use anything you’ve said about your projects in previous chats, or anything it “remembers” about you. If your agent has memory features, this matters more than you’d think — it will happily repeat your own highlight reel back to you as if it were a finding.</p><h3 id="2-Define-evidence-before-you-ask-anything"><a href="#2-Define-evidence-before-you-ask-anything" class="headerlink" title="2. Define evidence before you ask anything"></a>2. Define evidence before you ask anything</h3><p>This is the step most people skip, and it’s the whole game. For my scan I used Cursor as the tool under audit, so evidence meant one of three concrete things:</p><ul><li>The commit author is <code>Cursor Agent</code> (<code>cursoragent@cursor.com</code>) — a cloud&#x2F;background agent made the commit.</li><li>The commit message carries a <code>Co-authored-by: Cursor</code> trailer — IDE agent work I accepted and committed.</li><li>There’s a pull request from a <code>cursor/</code> head branch.</li></ul><p>Not a README that says “built with AI”. Not a vague recollection that “I think Cursor helped with the tests”. If it isn’t one of those identities in the git record, it doesn’t count. Swap in your own tool’s fingerprints (Claude Code, Copilot and friends all leave different marks), but write them down <em>before</em> the audit runs.</p><h3 id="3-Force-a-full-inventory-—-including-the-empty-rows"><a href="#3-Force-a-full-inventory-—-including-the-empty-rows" class="headerlink" title="3. Force a full inventory — including the empty rows"></a>3. Force a full inventory — including the empty rows</h3><p>Ask for every owned, non-fork repo. Every single one, including the ones with <strong>no evidence</strong>. This sounds like busywork, and that’s exactly why it matters. A highlight reel is what you get when you let the model (or yourself) choose what to show. The “No evidence” rows are what keep the rest honest. They also tell you something useful: which projects predate your agent workflow, and which ones you built some other way.</p><h3 id="4-Classify-with-explicit-rules"><a href="#4-Classify-with-explicit-rules" class="headerlink" title="4. Classify with explicit rules"></a>4. Classify with explicit rules</h3><p>Don’t let the agent invent its own categories. I used four:</p><table><thead><tr><th>Class</th><th>Rule</th></tr></thead><tbody><tr><td><strong>Completed</strong></td><td>A substantial slice shipped — a new app, a modernisation, or a finished phase</td></tr><tr><td><strong>Enhanced</strong></td><td>Agent work on an existing product, not a rewrite</td></tr><tr><td><strong>In progress</strong></td><td>There’s an open <code>cursor/</code> PR</td></tr><tr><td><strong>No evidence</strong></td><td>None of the identities from step 2</td></tr></tbody></table><p>The rules are deliberately boring. Boring rules are re-runnable rules. If I scan again in six months, I want the same definitions so the numbers mean something.</p><h3 id="5-Demand-the-limitations"><a href="#5-Demand-the-limitations" class="headerlink" title="5. Demand the limitations"></a>5. Demand the limitations</h3><p>Every audit has blind spots, and you want them stated up front rather than discovered when someone asks a pointed question. For mine, the obvious ones were:</p><ul><li>It searched default branches only, so work on abandoned feature branches is invisible.</li><li>If co-author trailers were disabled for a stretch, that work looks human.</li><li>Work done with other tools (Claude, Copilot, plain ChatGPT copy-paste) doesn’t register as Cursor evidence at all.</li></ul><p>Asking the agent to list these is a small thing, but it changes the tone of the whole report. It stops reading like a sales pitch and starts reading like an audit.</p><h3 id="6-Ask-the-career-question-last"><a href="#6-Ask-the-career-question-last" class="headerlink" title="6. Ask the career question last"></a>6. Ask the career question last</h3><p>Only after the inventory is complete and classified do you ask the question you actually care about:</p><blockquote><p>Given the hours I really have, which three are portfolio-grade now, which three are one Saturday from done, and which should stay frozen?</p></blockquote><p>Order matters here. If you ask “what’s portfolio-worthy?” first, the model will go looking for things to praise. Ask it last, against a complete and honest table, and it has to reason from the evidence instead of towards a flattering answer.</p><h3 id="The-prompt-skeleton"><a href="#The-prompt-skeleton" class="headerlink" title="The prompt skeleton"></a>The prompt skeleton</h3><p>Here’s roughly what I pasted. It’s short on purpose — the structure does the work, not the word count.</p><pre><code class="hljs text">Audit my personal GitHub account &#123;user&#125;.Sources of truth: default-branch commits and pull requests. Do not use my memory.Count as Cursor/agent evidence only if:- author is Cursor Agent (cursoragent@cursor.com), or- message contains Co-authored-by: Cursor, or- there is a cursor/ head branch PR.Classify every owned, non-fork repo as:Completed | In progress | Enhanced | No evidence.Completed = a substantial slice shipped (new app, modernization, or finished phase).Enhanced = agent work on an existing product, not a rewrite.In progress = open cursor/ PR.No evidence = none of the identities above.List all repos, including No evidence. Quote sample commits/PRs.State search limitations.Then recommend, given ~one evening a week: 3 portfolio-grade, 3 next Saturdays, 3 to freeze.</code></pre><p>A quick walk through why each block is there. The <strong>sources of truth</strong> line stops the agent leaning on anything I’ve told it before. The <strong>evidence</strong> block is the definition from step 2 — without it, “agent-built” becomes whatever the model feels like. The <strong>classification</strong> rules make the output comparable across runs. <strong>“Including No evidence”</strong> and <strong>“Quote sample commits&#x2F;PRs”</strong> are the two lines that force receipts: if it can’t quote a commit, it can’t claim the class. <strong>“State search limitations”</strong> gets you step 5 for free. And the recommendation line comes dead last, with my real time budget baked in, so “portfolio-grade” is judged against one evening a week rather than a fantasy calendar.</p><p>Strip any one of those lines and you’ll see the output get vaguer and more complimentary. Touch wood, that’s the most useful thing I learned from the whole exercise.</p><h2 id="The-worked-example-70-repos-one-honest-table"><a href="#The-worked-example-70-repos-one-honest-table" class="headerlink" title="The worked example: 70 repos, one honest table"></a>The worked example: 70 repos, one honest table</h2><p>I ran this against my own account, <code>awongCM</code>, on 10 September 2026 (at the time of doing the code audit). Forks excluded, that’s <strong>70 repos</strong> I own — some going back to as far back as 2013! I have accumulated my learning&#x2F;pet project repos over the years since then but, as life goes on and gets in the way, they never got finished.</p><p>The headline:</p><ul><li><strong>40 repos</strong> with Cursor evidence</li><li><strong>30 repos</strong> with none</li></ul><p>And of those 40:</p><ul><li><strong>28 completed</strong></li><li><strong>5 in progress</strong></li><li><strong>7 enhanced</strong></li></ul><p>My gut said maybe a dozen. Forty was higher than I’d guessed — and the thirty empty rows were a sharper correction than the forty filled ones. See the snapshot of my Cursor-generated canvas report below.</p><img src="/images/cursor_agent_github_audit_canvas_70_repos.jpeg" class="center" width="800" title="Cursor agent GitHub audit canvas — 70 personal repos Cursor agent GitHub audit canvas — 70 personal repos"><p><em><p style="text-align: center;">The Cursor canvas from the audit: 40 &#x2F; 70 with agent evidence, 30 empty rows, and where the commits actually landed.</p></em></p><h3 id="Where-the-receipts-were-heaviest"><a href="#Where-the-receipts-were-heaviest" class="headerlink" title="Where the receipts were heaviest"></a>Where the receipts were heaviest</h3><p>Three repos stood out, and interestingly they each represent a different <em>way</em> of working with agents.</p><p><strong><code>mindyourlanguage</code> — 67 cloud-agent commits.</strong> This is the one where the agent did the most autonomous work: commits authored by <code>Cursor Agent</code> itself, not co-authored in my editor. It’s a Chinese–English phrase learner I started because I wanted something I would actually use — Web Speech TTS, a phrasebook, practice history, CEDICT refresh, and a Render deploy — not another tutorial dictionary. I kept product taste and the practice UX for myself; I handed the background agent the long autonomous stretches: Phase 3–5.5 implementation, Render&#x2F;npm CI fight fixes, and the CEDICT import plumbing.</p><p><strong><code>expense-savings-tracker</code> — 141 IDE co-authored commits.</strong> The opposite pattern. Almost all of this was me in the IDE, steering an agent turn by turn and committing with the <code>Co-authored-by: Cursor</code> trailer. It’s also a modernisation rather than a greenfield toy: an Expo React Native + TypeScript app on Supabase, reworked behind a repository pattern with swappable data adapters, and later grown a Next.js web front end in the same monorepo. One hundred and forty-one commits is a lot of evenings — but it’s a lot <em>fewer</em> evenings than it would have been without the agent. I’d would say it took about 12 weeks of weekend evenings roughly to finish, alongside dveloping my with other AI pet projects running in the background during my career break - which was really enjoyable and fun process overall. It’s not just working on the mobile app alone only, but also I have tentatively completed my personal finance dashboard app (first iteration) on top of this repo as well. <strong>NB:</strong> <em>this repo is marked as private. Apologies in advance it is not for public viewing.</em></p><p><strong><code>java-toy-robot</code> — 23 agent commits and 16 <code>cursor/</code> PRs.</strong> The PR-driven pattern. Here the agent worked on branches and I reviewed pull requests, which is the closest of the three to how I’d run agents in a real team. It sits on my Java comeback track — the same accountability habit as <em>From Roadmap to Repo</em>, just on a smaller kata. The sixteen PRs walked Phases 2–4 in slices: file input, package restructure, injectable table, CI, edge-case tests, CLI errors, README polish.</p><p>Three repos, three different collaboration styles: autonomous background agent, pair-programming in the IDE, and branch-and-PR review. If I’d listed my work from memory, I’d have lumped them all together as “built with AI”. The receipts show they’re genuinely different skills.</p><h3 id="Modernisations-and-salvages-not-just-demos"><a href="#Modernisations-and-salvages-not-just-demos" class="headerlink" title="Modernisations and salvages, not just demos"></a>Modernisations and salvages, not just demos</h3><p>One thing the classification made obvious: a decent chunk of the “Completed” and “Enhanced” rows weren’t new projects at all. They were old repos I’d reopened and dragged into this decade — upgraded tooling, typed codebases, working builds where there used to be a broken <code>npm install</code>.</p><p><code>tv-show-angularjs</code> went from a dated AngularJS TV-premieres browser to Angular 19 against the TVMaze API, with Render and CI on top. <code>go-slackbot</code> got salvaged onto modern Socket Mode instead of rotting as an abandoned intent. <code>weather-widget-editor</code> left its old stack for Vite, React, and TypeScript.</p><p>That’s the bit that surprised me most, emotionally speaking. Some of those repos had been sitting untouched for years, the kind of project you feel faintly guilty about every time GitHub shows it in your list. An agent didn’t just help me build new things; it gave old ideas a second life in a couple of evenings each.</p><h3 id="The-honest-leftovers"><a href="#The-honest-leftovers" class="headerlink" title="The honest leftovers"></a>The honest leftovers</h3><p>And then there are the rows that didn’t fit the story I wanted. I’m including them on purpose.</p><ul><li><strong><code>hello-claude-world</code></strong> — clearly AI-assisted, but it’s <em>Claude</em>, not Cursor. Under my evidence rules, it’s “No evidence”. Correctly so.</li><li><strong><code>copilot-models-testing</code></strong> — same story, but Copilot.</li><li><strong><code>cashflow-forecasting</code></strong> — this one stung a little. It’s my TypeScript&#x2F;LangGraph cash-flow forecasting engine, and it <em>looks</em> agent-built to anyone reading the code. But there’s no Cursor trailer, no <code>Cursor Agent</code> author, no <code>cursor/</code> branch. So it lands in “No evidence” too. Looking back at the history, most of that work was me plus Claude Code (and a later “added cursor mcp” commit), not Cursor’s co-author trailers — so under <em>these</em> evidence rules, the empty row is correct. <strong>NB:</strong> <em>this repo is marked as private. Apologies in advance it is not for public viewing</em></li></ul><p>It would have been very easy to quietly move <code>cashflow-forecasting</code> into the “agent-built” pile. It’s one of my more serious learning projects, and it’s part of how I talk about what I’ve been working on. But the whole point of defining evidence up front is that you don’t get to overrule it when the answer is inconvenient. If I want that repo to count, the fix is to record the work properly going forward — not to edit the audit.</p><p>The other 27 “No evidence” repos are mostly what you’d expect: older projects from before I worked this way, learning repos, a few experiments built entirely by hand. None of that is a failure. It’s just a different era of the same journey.</p><h3 id="What-the-agent-recommended"><a href="#What-the-agent-recommended" class="headerlink" title="What the agent recommended"></a>What the agent recommended</h3><p>Against “~one evening a week,” the audit’s closing recommendation came out like this:</p><p><strong>Portfolio-grade now</strong></p><ol><li><code>mindyourlanguage</code> — public, deployed, and the densest cloud-agent receipt trail</li><li><code>expense-savings-tracker</code> — the heaviest IDE co-author trail, plus a web dashboard on top of the mobile app</li><li><code>java-toy-robot</code> — small enough to explain in an interview, with sixteen reviewable <code>cursor/</code> PRs</li></ol><p><strong>One Saturday from done</strong></p><ol><li><code>jukebox-aurora</code> — Phase 1 (Angular 5→19) merged; Phase 2 Spotify still open</li><li><code>depot</code> — Phase 0 stabilize merged; Phase 1 Rails 7.2 &#x2F; Hotwire &#x2F; Render still open</li><li><code>py-grawler-tool</code> — crawl + search API merged; Phase 2 browser frontend still open</li></ol><p><strong>Freeze for now</strong></p><ol><li><code>go-ping-imgur</code> — open <code>cursor/</code> PR, but a thin CLI not worth the next evening</li><li><code>3d-image-gallery-css3</code> — modernization PR open; low career signal relative to the others</li><li>The long tail of pre-agent learning repos (<code>ls-ruby-wrapper</code>, <code>ruby-game-of-life</code>, and friends) — keep them public, stop feeling guilty</li></ol><p>I agreed with the spine. I overruled one emphasis: for a <em>public</em> hiring conversation I’d swap <code>expense-savings-tracker</code> (private) for <code>ecommerce-api</code> or <code>ml-gladiator</code> on the portfolio-grade list, and keep the expense tracker as the private proof of sustained IDE pairing. That’s the judgement the audit is supposed to leave with me, not with the model.</p><p>The full inventory lived as a Cursor canvas beside the chat — seventy rows, filters for Completed &#x2F; In progress &#x2F; Enhanced &#x2F; No evidence — rather than a public URL. The numbers above are what matters; the canvas was the working surface.</p><h2 id="The-career-case-earned-not-claimed"><a href="#The-career-case-earned-not-claimed" class="headerlink" title="The career case (earned, not claimed)"></a>The career case (earned, not claimed)</h2><p>Here’s where I’ll put my hiring hat on for a moment.</p><p>Nobody hiring a senior engineer in 2026 is going to sit and watch you type. What they’re increasingly trying to work out is something harder: <em>can this person ship working systems with agents, and still own the judgement?</em> Can they tell the difference between a diff that’s correct and a diff that merely compiles? Do they know when to hand work off and when to keep it?</p><p>A graveyard of tutorial clones doesn’t answer that. Neither does “I use AI every day” on a CV. Both are noise.</p><p>What <em>does</em> answer it is something like this:</p><ol><li><strong>A classified inventory</strong> — here’s everything I own, here’s the evidence of how it was built, including the bits that don’t flatter me.</li><li><strong>Five to eight running apps</strong> you can actually open, click through, and talk about in depth.</li><li><strong>A clear story of the different ways you worked with agents</strong> — autonomous, pair-programmed, PR-reviewed — and why each repo got the mode it did.</li></ol><p>That combination says more than any line on a resume. It says you can deliver, and it says you’re honest about how. In banking and financial services especially, where I’ve spent most of my career, that second part matters a lot. “Trust me, it works” doesn’t pass a change review, and it shouldn’t pass a portfolio review either.</p><p>And here’s the part I keep coming back to: <strong>this is career capital you can grow without taking a sabbatical.</strong> One evening a week, aimed properly, compounds. The audit tells you where to aim.</p><h2 id="Concluding-thoughts-life-not-hustle"><a href="#Concluding-thoughts-life-not-hustle" class="headerlink" title="Concluding thoughts: life, not hustle"></a>Concluding thoughts: life, not hustle</h2><p>I want to be careful about how this lands, because there’s a version of this post that’s just another productivity sermon. <em>Use agents and you can ship three apps a week!</em> That’s not the point, and honestly it’s not how I want to live.</p><p>And to be clear about one thing: <strong>please don’t take a career break just to do this.</strong> Mine happened for its own reasons, and the backlog work is something I’m doing <em>during</em> it, not the reason for it. Stepping away from paid work so you can spin up a fleet of agents and push your repo completion rate towards 100% is optimising the wrong number. A portfolio with forty “Completed” rows nobody can explain in an interview is just a bigger graveyard. The audit is meant to make you <em>more</em> selective — three portfolio-grade apps you genuinely own beat thirty you merely supervised.</p><p>The point is smaller and, I think, more useful. The gap between “I have an idea” and “there’s a working repo” used to be measured in weekends I didn’t have. Now, for most of us, it can be measured in evenings we do. The next idea doesn’t have to cost a cancelled weekend or another night of only-half-present on the couch. It can just become a repo, at the pace a full life allows.</p><p>Keep the learning loop. Keep building. But stop treating your lifestyle as the tax you pay for curiosity — and when you do build, keep the receipts.</p><p>Thus, my challenge to you: paste the prompt above, point it at your own account, and see what comes back. I’d genuinely love to hear how your numbers compare (and which inconvenient leftovers you found).</p><p>Till next time, Happy Coding! Keep Learning and Growing! 👨‍💻</p><p><strong>PS:</strong> The audit only works because the tools leave fingerprints. Cursor’s <code>Co-authored-by: Cursor</code> trailer and <code>Cursor Agent</code> commit identity are what made “agent work” searchable instead of vibes; GitHub’s commit and PR search did the rest. If your tool of choice leaves a different mark, write that mark down <em>before</em> you run the scan — otherwise you’re back to memory.</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_receipt_not_vibes_github_backlog_finish.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Gemini Nano Banana Generated AI image by Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — Experienced engineers don’t lack ideas. We have backlogs of half-finished repos that life got in the way of. AI agents now make it realistic to finish them, but only if you can tell what’s actually done. I asked an agent to audit all 70 of my own GitHub repos against hard evidence of agent work, not my memory and not README vibes. It came back with 40 repos carrying receipts, 30 without, and an honest list of leftovers that didn’t fit the story I wanted to tell. Below is the protocol, the prompt, the real numbers, and why a classified inventory beats a highlight reel — whether you have a career break or just one evening a week.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Over twenty-plus years of software engineering, I’ve amassed, to date, over 70 (not 60 - as per my original post &lt;a href=&quot;/blog/2026/01/04/the-future-of-the-ai-era-for-developers-what-2026-really-means-for-software-builders/&quot; title=&quot;The Future of the AI Era for Developers: What 2026 Really Means for Software Builders&quot;&gt;claim&lt;/a&gt; earlier in the year) personal repos on GitHub. (Yes, that many — and that’s with forks excluded, plus my private repos mentioned in this article)&lt;/p&gt;
&lt;p&gt;Scroll through them and you can read my career like tree rings. Plenty started life as learning side projects: a new language, a framework I wanted to get my hands on, a kata to keep my skills from going rusty. Others were genuine pet-project ideas of my own, the kind I was properly excited about the night I typed &lt;code&gt;git init&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The trouble is how many of them stopped halfway.&lt;/p&gt;
&lt;p&gt;Not because the ideas were bad. Because life happened. A demanding day job, family, and all the commitments that come with both. Every evening on the laptop was an evening not spent on something (or someone) else. For most of my career, the advice for staying sharp was some version of &lt;em&gt;just build things&lt;/em&gt; — good advice for a 23-year-old’s calendar. Somewhere past the twenty-year mark, it quietly turns into a trade: &lt;strong&gt;self-learning versus lifestyle&lt;/strong&gt;. Lifestyle usually won, and rightly so. The half-finished repos just kept piling up.&lt;/p&gt;
&lt;p&gt;And suddenly.&lt;/p&gt;</summary>
    
    
    
    
    <category term="github" scheme="http://awongcm.io/tags/github/"/>
    
    <category term="agentic-coding" scheme="http://awongcm.io/tags/agentic-coding/"/>
    
    <category term="ai" scheme="http://awongcm.io/tags/ai/"/>
    
    <category term="cursor" scheme="http://awongcm.io/tags/cursor/"/>
    
    <category term="career" scheme="http://awongcm.io/tags/career/"/>
    
    <category term="portfolio" scheme="http://awongcm.io/tags/portfolio/"/>
    
  </entry>
  
  <entry>
    <title>Jev, Decoded: What a System One Model Is Actually Good For in Agentic Coding (and What It Isn&#39;t)</title>
    <link href="http://awongcm.io/blog/2026/09/29/jev-decoded-what-a-system-one-model-is-actually-good-for-in-agentic-coding-and-what-it-isn-t/"/>
    <id>http://awongcm.io/blog/2026/09/29/jev-decoded-what-a-system-one-model-is-actually-good-for-in-agentic-coding-and-what-it-isn-t/</id>
    <published>2026-09-29T23:38:06.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: Jev is a genuinely useful, very fast <em>decision</em> component you can wire into an agent loop for routing, triage and gating — but it isn’t a coding model, it isn’t a new form of AI, and it isn’t “193x” anything by default. Learn the narrow job it does well, and let the rest of the noise go.</p></blockquote><img src="/images/ai_generated_jev_what_is_good_for_or_not.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>If your LinkedIn or X feed looked anything like mine during September, Jev was everywhere. “Jev just killed LLMs.” “Swap your coding agent’s brain for Jev and save 400x.” Carousels, reels and threads — many from accounts that, as far as I could tell, had never made a single API call to it.</p><p>I’ve been writing a series on the disciplines forming around AI agents — context, harness, loop and graph engineering, etc. My rule for that series has been simple: separate what changes <em>how we build</em> from what only changes <em>what we post about</em>. So before forming an opinion on Jev, I went to the primary sources: TypeSafe’s own documentation, their published failure modes, and the handful of independent benchmarks that actually showed their working.</p><p>In this post, we’ll set the record straight on what Jev is and where it fits in LLM-driven agentic coding. Whether you’re building agent harnesses or just wondering if you’ve missed something big, you’ll leave with a practical filter.</p><span id="more"></span><p>By the end of this post, you’ll understand:</p><ul><li>What a “System One” model is and how it differs from the LLM driving your coding agent</li><li>Where Jev genuinely earns a place in an agent loop — with working code</li><li>Which claims are hype, and where Jev is simply the wrong tool</li></ul><h2 id="Section-1-What-Jev-Actually-Is"><a href="#Section-1-What-Jev-Actually-Is" class="headerlink" title="Section 1: What Jev Actually Is"></a>Section 1: What Jev Actually Is</h2><h3 id="A-decision-model-not-a-coding-model"><a href="#A-decision-model-not-a-coding-model" class="headerlink" title="A decision model, not a coding model"></a>A decision model, not a coding model</h3><p>Jev comes from TypeSafe AI, a San Francisco lab that came out of stealth on 15 September 2026 with a $40M seed round. They call it a <strong>System One</strong> model — a nod to Kahneman’s fast-versus-slow thinking. It doesn’t write code, chat, or generate text. You hand it some <em>state</em> (text or JSON) plus a set of typed questions, and it returns typed answers with probabilities:</p><ul><li><strong>Choice</strong> — picks one option from a set you define, with a probability for every option</li><li><strong>Score</strong> — places something on an ordered rubric you define</li><li><strong>Noul</strong> — the probability that a yes&#x2F;no statement is true</li></ul><p>Because it isn’t generating tokens one at a time, it’s fast and cheap: TypeSafe quotes around 100 ms per call, $0.042 per million input tokens, and no charge for output tokens.</p><p>Here’s the part most hype posts skipped. TypeSafe’s own docs have a page written specifically for people who arrived hoping to plug Jev into Claude Code or Cursor, and it says plainly that Jev is not a drop-in replacement — there is no model setting that turns your coding agent into a “Jev agent”. The vendor is <em>less</em> excited about that use case than the influencers are. That alone should tell you something.</p><p>The mental model I’ve landed on: <strong>the LLM is the worker; Jev is an <code>if</code> statement that can read.</strong></p><h2 id="Section-2-Where-Jev-Genuinely-Earns-Its-Place"><a href="#Section-2-Where-Jev-Genuinely-Earns-Its-Place" class="headerlink" title="Section 2: Where Jev Genuinely Earns Its Place"></a>Section 2: Where Jev Genuinely Earns Its Place</h2><p>Agent loops are full of small, closed-set judgments we currently pay a frontier model to deliberate over: which skill to load, which subset of tools to expose this step, whether a failing test deserves another expensive reasoning pass, whether an output clears a quality rubric. That’s exactly Jev’s sweet spot.</p><h3 id="Example-a-test-failure-triage-gate"><a href="#Example-a-test-failure-triage-gate" class="headerlink" title="Example: a test-failure triage gate"></a>Example: a test-failure triage gate</h3><p>This gate sits between “tests failed” and “send the lot to the frontier model”:</p><pre><code class="hljs python"><span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-string">Test-failure triage gate for a coding-agent loop.</span><span class="hljs-string">Jev picks the category; plain code decides what happens next.</span><span class="hljs-string">Requires: pip install typesafe-sdk  and  TYPESAFE_API_KEY in the environment.</span><span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-keyword">import</span> re<span class="hljs-keyword">from</span> typesafe_sdk <span class="hljs-keyword">import</span> Choice, TypeSafeClientclient = TypeSafeClient()  <span class="hljs-comment"># defaults to jev-latest</span>AUTO_ACT = <span class="hljs-number">0.90</span>   <span class="hljs-comment"># act without escalation above this - tune on your own data</span>MIN_TRUST = <span class="hljs-number">0.50</span>  <span class="hljs-comment"># below this, Jev is telling you it doesn&#x27;t know</span>MISSING_MODULE = re.<span class="hljs-built_in">compile</span>(<span class="hljs-string">r&quot;No module named &#x27;([\w\.]+)&#x27;&quot;</span>)<span class="hljs-keyword">def</span> <span class="hljs-title function_">triage</span>(<span class="hljs-params">test_output: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:    <span class="hljs-comment"># 1. Deterministic first: if a regex can answer it, you don&#x27;t need a model.</span>    <span class="hljs-keyword">match</span> = MISSING_MODULE.search(test_output)    <span class="hljs-keyword">if</span> <span class="hljs-keyword">match</span>:        <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;install:<span class="hljs-subst">&#123;<span class="hljs-keyword">match</span>.group(<span class="hljs-number">1</span>)&#125;</span>&quot;</span>    <span class="hljs-comment"># 2. Send only the tail of the log - big, noisy state costs accuracy.</span>    tail = <span class="hljs-string">&quot;\n&quot;</span>.join(test_output.splitlines()[-<span class="hljs-number">40</span>:])    <span class="hljs-keyword">try</span>:        response = client.system_one(            state=tail,            questions=&#123;                <span class="hljs-string">&quot;cause&quot;</span>: Choice(                    instructions=<span class="hljs-string">&quot;What is the most likely cause of this failing test run?&quot;</span>,                    criteria=&#123;                        <span class="hljs-string">&quot;environment_flake&quot;</span>: <span class="hljs-string">&quot;Transient infrastructure problem such as a network timeout or a port already in use&quot;</span>,                        <span class="hljs-string">&quot;logic_bug&quot;</span>: <span class="hljs-string">&quot;The code under test returned a wrong result or raised an unexpected error&quot;</span>,                        <span class="hljs-string">&quot;stale_test&quot;</span>: <span class="hljs-string">&quot;The test itself is outdated, e.g. it asserts on behaviour that was intentionally changed&quot;</span>,                    &#125;,                ),            &#125;,        )    <span class="hljs-keyword">except</span> Exception:        <span class="hljs-comment"># 3. Fail open: if Jev is slow or down, fall back to the normal path.</span>        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;escalate:frontier_llm&quot;</span>    cause = response.answers[<span class="hljs-string">&quot;cause&quot;</span>]    <span class="hljs-keyword">if</span> cause.confidence &lt; MIN_TRUST:        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;escalate:frontier_llm&quot;</span>   <span class="hljs-comment"># genuinely unsure - let System Two think</span>    <span class="hljs-keyword">if</span> cause.choice == <span class="hljs-string">&quot;environment_flake&quot;</span>:        <span class="hljs-comment"># Retrying is cheap and reversible, so only automate it when confident</span>        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;retry&quot;</span> <span class="hljs-keyword">if</span> cause.confidence &gt;= AUTO_ACT <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;escalate:frontier_llm&quot;</span>    <span class="hljs-keyword">if</span> cause.choice == <span class="hljs-string">&quot;logic_bug&quot;</span>:        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;escalate:frontier_llm&quot;</span>   <span class="hljs-comment"># real reasoning needed - that&#x27;s the LLM&#x27;s job</span>    <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;escalate:human&quot;</span>              <span class="hljs-comment"># a stale test means intent changed - a human decides</span><span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&quot;__main__&quot;</span>:    log = <span class="hljs-string">&quot;E   requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host=&#x27;api.internal&#x27;, port=443)&quot;</span>    <span class="hljs-built_in">print</span>(triage(log))</code></pre><p><strong>Key points:</strong></p><ul><li><strong>Jev decides, code acts.</strong> Jev never runs a command; it returns a label and your code owns every side effect.</li><li><strong>Confidence is the real feature.</strong> In an independent benchmark of 100 support tickets, every one of the 47 answers Jev returned at ≥0.99 confidence matched the consensus of three other models, while agreement fell to 72% in its lowest-confidence band. A model that knows when it doesn’t know is worth more in a loop than one that’s marginally more accurate.</li><li><strong>Fail open.</strong> Jev is an optimisation, not a dependency. If it’s unavailable, the agent should behave exactly as it did before you added it.</li></ul><p>This shape is showing up in real harness work too. The community project <em>jev-for-all</em> uses Jev to pick skills and tool subsets inside OpenCode and Claude Code, and reports zero wrong picks across 64 real requests against a 22-skill roster, at roughly half a cent per full run. Small, measured, reversible — that’s the pattern.</p><h2 id="Section-3-Where-the-Hype-Overreaches"><a href="#Section-3-Where-the-Hype-Overreaches" class="headerlink" title="Section 3: Where the Hype Overreaches"></a>Section 3: Where the Hype Overreaches</h2><p><strong>“193x faster, 444x cheaper.”</strong> TypeSafe’s headline numbers compare Jev against top-tier frontier models on multi-step workflows, and their own launch post footnotes them as the high end of real-world gains. An independent team re-ran 100 triage tickets against mid-tier models (Claude Sonnet 5, GPT-5.6 Sol, Gemini 3.8 Flash) and measured 4–7x faster and 31–65x cheaper. Still excellent! But a multiple is a property of the comparison, not the model.</p><p><strong>“Zero hallucinations.”</strong> Jev can’t return an option you didn’t define. That’s <em>zero out-of-schema outputs</em> — not zero wrong answers. It can still pick “Billing” when the answer was “Technical”.</p><p><strong>“Frontier-grade accuracy.”</strong> TypeSafe’s own workflow evaluation grades Jev against answers from other frontier models rather than independently verified ground truth. That measures agreement, not correctness, and independent evaluations are still small.</p><p><strong>“A brand-new kind of AI.”</strong> Classifying text against arbitrary labels has been standard NLP practice since the NLI-based zero-shot classifiers of 2019–2020. The fair read: an old problem with a new, well-engineered architecture and developer experience. A real improvement — not a paradigm shift.</p><p><strong>“Stop burning 50,000 tokens on <code>pip install scipy</code>.”</strong> Some wrapper projects lead with this. But <code>No module named &#39;scipy&#39;</code> is a regex, not a judgment — which is why step 1 in the code above never calls a model at all.</p><h2 id="Section-4-Where-Jev-Is-the-Wrong-Tool"><a href="#Section-4-Where-Jev-Is-the-Wrong-Tool" class="headerlink" title="Section 4: Where Jev Is the Wrong Tool"></a>Section 4: Where Jev Is the Wrong Tool</h2><p>Credit to TypeSafe: they publish a “jaggedness” page listing <code>jev-1.13</code>‘s known failure modes. Translated for agentic coding:</p><ol><li><strong>Generating anything</strong> — patches, commit messages, explanations. It isn’t trained for generation.</li><li><strong>Maths, counting and dates</strong> — “Did the build get 30% slower?” or “Does this cert expire before quarter end?” belong in code.</li><li><strong>Large, noisy state</strong> — dumping a 500-line traceback degrades accuracy. Filter first.</li><li><strong>Indirection and double negatives</strong> — it reads literally. In TypeSafe’s words, it answers “the question you wrote, not the one you meant.”</li><li><strong>Adversarial content</strong> — state is treated as data, not as hostile input, and injected text can move the answer. This matters because several community projects pitch Jev as a security gate for agent tool calls. Use it as <em>a</em> layer, never <em>the</em> layer; permission checks stay deterministic.</li></ol><p>Here’s what “keep the maths in code” looks like in practice:</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> typesafe_sdk <span class="hljs-keyword">import</span> Noul<span class="hljs-comment"># ❌ Don&#x27;t: ask a decision model to do arithmetic buried in text</span>bad_question = Noul(instructions=<span class="hljs-string">&quot;The build took more than 30% longer than the previous run&quot;</span>)<span class="hljs-comment"># ✅ Do: compute it in code, and save Jev for genuinely semantic judgments</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">build_regressed</span>(<span class="hljs-params">current_secs: <span class="hljs-built_in">float</span>, previous_secs: <span class="hljs-built_in">float</span>, threshold: <span class="hljs-built_in">float</span> = <span class="hljs-number">0.30</span></span>) -&gt; <span class="hljs-built_in">bool</span>:    <span class="hljs-keyword">if</span> previous_secs &lt;= <span class="hljs-number">0</span>:        <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">&quot;previous_secs must be positive&quot;</span>)    <span class="hljs-keyword">return</span> (current_secs - previous_secs) / previous_secs &gt; threshold<span class="hljs-built_in">print</span>(build_regressed(<span class="hljs-number">390.0</span>, <span class="hljs-number">290.0</span>))  <span class="hljs-comment"># True - a 34% slowdown, no model required</span></code></pre><p>Two more considerations I’d raise in any bank design review:</p><ul><li><strong>Data egress.</strong> Harness plugins typically ship the conversation tail — including tool output — to a hosted endpoint (<em>jev-for-all</em> sends up to 6,000 characters to OpenRouter’s alpha Decisions API), and TypeSafe’s service is currently hosted on the US West Coast. If your agent touches customer data or source you can’t export, talk to your risk team first.</li><li><strong>Maturity.</strong> The company went public a fortnight ago, the model is in early access, and TypeSafe itself says it can’t yet prove its pricing isn’t subsidised. Great for experiments; architect so you can swap it out.</li></ul><h2 id="Best-Practices-and-Recommendations"><a href="#Best-Practices-and-Recommendations" class="headerlink" title="Best Practices and Recommendations"></a>Best Practices and Recommendations</h2><h3 id="Do’s-✅"><a href="#Do’s-✅" class="headerlink" title="Do’s ✅"></a>Do’s ✅</h3><ul><li><strong>Do use Jev for closed-set decisions</strong> in the loop — routing, triage, rubric gates — because that’s what it was built for.</li><li><strong>Do gate on confidence</strong>, with thresholds that scale with the cost of being wrong.</li><li><strong>Do fail open</strong>, so Jev only ever removes work rather than adding a failure point.</li></ul><h3 id="Don’ts-❌"><a href="#Don’ts-❌" class="headerlink" title="Don’ts ❌"></a>Don’ts ❌</h3><ul><li><strong>Don’t treat it as a coding-agent LLM</strong> — the vendor itself says it isn’t one.</li><li><strong>Don’t reach for a model when a regex or parser will do.</strong></li><li><strong>Don’t make it your only guardrail</strong> against prompt injection.</li></ul><h2 id="Troubleshooting-Guide"><a href="#Troubleshooting-Guide" class="headerlink" title="Troubleshooting Guide"></a>Troubleshooting Guide</h2><table><thead><tr><th>Problem</th><th>Cause</th><th>Solution</th></tr></thead><tbody><tr><td>Answers look confidently wrong</td><td>Criteria are vague or overlapping</td><td>Write explicit, mutually exclusive criteria with boundary cases</td></tr><tr><td>Accuracy drops on long logs</td><td>Too much irrelevant state</td><td>Send only the tail or the relevant fields</td></tr><tr><td>Counts&#x2F;durations are off</td><td>Arithmetic asked of the model</td><td>Compute in code; ask Jev only the semantic part</td></tr></tbody></table><h2 id="Further-Reading"><a href="#Further-Reading" class="headerlink" title="Further Reading"></a>Further Reading</h2><ul><li><a href="https://docs.typesafe.ai/introduction/coding-agents">TypeSafe docs: Jev with coding agents</a></li><li><a href="https://docs.typesafe.ai/model-jaggedness/jev-1.13.md">TypeSafe docs: Jev 1.13 jaggedness</a></li><li><a href="https://docs.typesafe.ai/confidence.md">TypeSafe docs: Confidence</a></li><li><a href="https://www.kdnuggets.com/what-everyone-is-getting-wrong-about-typesafe-ais-jev">KDnuggets: What Everyone Is Getting Wrong About TypeSafe AI’s Jev</a></li><li><a href="https://dev.to/arifulislamat/typesafes-jev-model-is-it-really-193x-faster-and-444x-cheaper-56oa">DEV Community: Is It Really 193x Faster and 444x Cheaper?</a></li><li><a href="https://github.com/emirbartu/jev-for-all">jev-for-all on GitHub</a></li></ul><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>Jev is a good tool with a narrow job: fast, cheap, calibrated decisions inside software you already control. In an agent loop, that means routing, triage and gating — and letting your LLM keep doing the reasoning and the writing. Everything beyond that, from “LLM killer” to “400x savings on your coding agent”, came from the feed, not from the docs.</p><p>And that’s the bigger lesson during September. Every few weeks there’s a new name, a new multiplier and a new wave of posts built to farm engagement. The engineers who get the most out of this era aren’t the ones who read every post — they’re the ones who read the primary source, run one honest experiment, keep what’s useful and discard what isn’t.</p><p><strong>Your next steps:</strong></p><ol><li>Read TypeSafe’s jaggedness page before forming (or sharing) a hot take.</li><li>Find one closed-set decision in your agent loop you currently pay a frontier model for, and trial Jev behind a confidence gate.</li><li>Next time a post promises a 400x anything, ask one question: <em>compared to what?</em></li></ol><h2 id="Till-next-time-Happy-Coding"><a href="#Till-next-time-Happy-Coding" class="headerlink" title="Till next time, Happy Coding!"></a>Till next time, Happy Coding!</h2>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Jev is a genuinely useful, very fast &lt;em&gt;decision&lt;/em&gt; component you can wire into an agent loop for routing, triage and gating — but it isn’t a coding model, it isn’t a new form of AI, and it isn’t “193x” anything by default. Learn the narrow job it does well, and let the rest of the noise go.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_jev_what_is_good_for_or_not.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;If your LinkedIn or X feed looked anything like mine during September, Jev was everywhere. “Jev just killed LLMs.” “Swap your coding agent’s brain for Jev and save 400x.” Carousels, reels and threads — many from accounts that, as far as I could tell, had never made a single API call to it.&lt;/p&gt;
&lt;p&gt;I’ve been writing a series on the disciplines forming around AI agents — context, harness, loop and graph engineering, etc. My rule for that series has been simple: separate what changes &lt;em&gt;how we build&lt;/em&gt; from what only changes &lt;em&gt;what we post about&lt;/em&gt;. So before forming an opinion on Jev, I went to the primary sources: TypeSafe’s own documentation, their published failure modes, and the handful of independent benchmarks that actually showed their working.&lt;/p&gt;
&lt;p&gt;In this post, we’ll set the record straight on what Jev is and where it fits in LLM-driven agentic coding. Whether you’re building agent harnesses or just wondering if you’ve missed something big, you’ll leave with a practical filter.&lt;/p&gt;</summary>
    
    
    
    
    <category term="jev" scheme="http://awongcm.io/tags/jev/"/>
    
    <category term="typeSafe-aI" scheme="http://awongcm.io/tags/typeSafe-aI/"/>
    
    <category term="system-one-models" scheme="http://awongcm.io/tags/system-one-models/"/>
    
    <category term="agentic-coding" scheme="http://awongcm.io/tags/agentic-coding/"/>
    
    <category term="ai-agents" scheme="http://awongcm.io/tags/ai-agents/"/>
    
    <category term="ai-Engineering" scheme="http://awongcm.io/tags/ai-Engineering/"/>
    
    <category term="llm" scheme="http://awongcm.io/tags/llm/"/>
    
    <category term="harness-engineering" scheme="http://awongcm.io/tags/harness-engineering/"/>
    
    <category term="ai-hype" scheme="http://awongcm.io/tags/ai-hype/"/>
    
  </entry>
  
  <entry>
    <title>Back to the Gym: Fighting Engineering Skill Atrophy with CodeCrafters</title>
    <link href="http://awongcm.io/blog/2026/09/23/back-to-the-gym-fighting-engineering-skill-atrophy-with-codecrafters/"/>
    <id>http://awongcm.io/blog/2026/09/23/back-to-the-gym-fighting-engineering-skill-atrophy-with-codecrafters/</id>
    <published>2026-09-23T09:00:00.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: AI has made us faster, but speed without reps quietly erodes the skills we need to supervise the code AI writes for us. Platforms like <a href="https://codecrafters.io/">CodeCrafters</a> give you a structured, test-driven way to rebuild real systems — Redis, Git, SQLite, a shell — with your own hands. Treat it as the gym your engineering craft now needs.</p></blockquote><img src="/images/ai_generated_back_to_the_gym_codecrafters.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>Here’s a small, uncomfortable experiment. Open a blank file, switch off your AI assistant, and write a TCP server that speaks just enough of the Redis protocol to answer <code>PING</code> with <code>PONG</code>. No autocomplete. No chat window. Just you, the docs, and a terminal.</p><p>If that made you hesitate even slightly — you’re not alone, and it’s not a character flaw. It’s atrophy.</p><p>Back in April, I wrote <a href="/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/" title="Don&#39;t Let AI Dull Your Software Engineering Edge">Dont Let AI Dull Your Software Engineering Edge&#39;</a>, which was about <em>how you prompt</em> — forming a hypothesis before asking, tracing generated code instead of accepting it. That post was about using AI well. This one is about the other half of the equation: deliberately spending time <em>without</em> it, so the muscles AI can’t exercise for you stay strong.</p><p>By the end of this post, you’ll understand:</p><span id="more"></span><ul><li>What the research now says about AI assistance and skill formation</li><li>How CodeCrafters is designed to put the struggle back into learning</li><li>What a first challenge actually feels like, with a hand-written example</li><li>A practical routine for keeping your craft sharp alongside your AI-powered day job</li></ul><h2 id="The-Atrophy-Is-Real-and-Now-Measured"><a href="#The-Atrophy-Is-Real-and-Now-Measured" class="headerlink" title="The Atrophy Is Real (and Now Measured)"></a>The Atrophy Is Real (and Now Measured)</h2><p>For a while, “AI is making us worse engineers” was mostly vibes. In January, that changed. Anthropic ran a <a href="https://www.anthropic.com/research/AI-assistance-coding-skills">randomised controlled trial</a> with 52 developers learning a new Python library — half with AI assistance, half coding by hand. The AI group scored 17% lower on a follow-up comprehension quiz, and the speed-up they got wasn’t even statistically significant.</p><p>The detail that stuck with me: the widest gap was in <strong>debugging</strong> — spotting when code is wrong and explaining why. That’s precisely the skill you need most when your job increasingly becomes reviewing what an agent produced.</p><p>It wasn’t all doom, though. How people used AI mattered enormously. Participants who asked conceptual questions or used AI to check their understanding scored well; those who delegated code generation wholesale scored lowest. The researchers’ own summary is worth sitting with: <em>“Cognitive effort—and even getting painfully stuck—is likely important for fostering mastery.”</em></p><p>A fair caveat: this study looked at junior engineers picking up an unfamiliar library with a chat-based assistant, not seasoned engineers working in a domain they know. But the authors themselves suspect agentic tools could make the effect <em>stronger</em>, not weaker. If you’ve spent the last year watching an agent loop through your codebase (I’ve written a whole <a href="https://www.awongcm.io/blog/2026/08/23/loop-engineering-teaching-ai-agents-how-to-think/">series</a> on building those loops), that should give you pause.</p><p>So the question becomes: where do we get our reps?</p><h2 id="Enter-CodeCrafters-Rebuild-the-Tools-You-Use-Every-Day"><a href="#Enter-CodeCrafters-Rebuild-the-Tools-You-Use-Every-Day" class="headerlink" title="Enter CodeCrafters: Rebuild the Tools You Use Every Day"></a>Enter CodeCrafters: Rebuild the Tools You Use Every Day</h2><p><a href="https://codecrafters.io/">CodeCrafters</a> is a Y Combinator–backed platform built on a simple premise: you learn how systems really work by rebuilding them from scratch. The team behind it also maintains the enormously popular <a href="https://github.com/codecrafters-io/build-your-own-x">build-your-own-x</a> repository on GitHub, so this idea has deep roots.</p><p>The catalogue currently includes eleven challenges — your own Redis, Git, SQLite, Kafka, shell, grep, HTTP server, DNS server, BitTorrent client, interpreter, and (fittingly for this blog) Claude Code. These aren’t weekend toys. The Redis track alone runs to 97 stages, walking you from a bare TCP listener to replication and beyond.</p><h3 id="How-it-works"><a href="#How-it-works" class="headerlink" title="How it works"></a>How it works</h3><p>The workflow is refreshingly unglamorous:</p><ol><li><strong>Pick a challenge and a language.</strong> Python, Go, Rust, Java, TypeScript and many more are supported.</li><li><strong>Code in your own setup.</strong> Your IDE, your terminal, your debugger — no toy browser editor.</li><li><strong><code>git push</code> to test.</strong> Each push runs the stage’s test suite against your implementation and reports back within seconds, with hints if you’re stuck.</li></ol><p>That last point is what makes it work. You get a tight feedback loop — the same thing that makes AI feel so productive — but <em>you</em> are the one closing it.</p><h3 id="A-philosophy-that-matches-the-problem"><a href="#A-philosophy-that-matches-the-problem" class="headerlink" title="A philosophy that matches the problem"></a>A philosophy that matches the problem</h3><p>What sold me wasn’t the catalogue; it was their <a href="https://codecrafters.io/philosophy">philosophy page</a>. It argues that tutorials feel like progress but mostly build recognition rather than ability, and that friction is the point. They’re also refreshingly honest about AI: they don’t tell you to abandon it, and they openly admit AI can solve many of their stages. Their counter is a line I’ll be stealing for conference talks: <em>“You don’t go to the gym to move metal from A to B.”</em></p><p>That’s the key distinction. <strong>CodeCrafters doesn’t ban AI — the discipline is yours to bring.</strong> The platform gives you the weights; you decide not to use the forklift.</p><h2 id="What-a-First-Challenge-Feels-Like"><a href="#What-a-First-Challenge-Feels-Like" class="headerlink" title="What a First Challenge Feels Like"></a>What a First Challenge Feels Like</h2><p>To make this concrete, here’s roughly where the Redis track begins: a server that accepts connections and responds to commands in RESP (the REdis Serialization Protocol). Here’s a hand-written warm-up that goes a little past the first stages by handling multiple clients and <code>ECHO</code> (try writing your own version before reading it):</p><pre><code class="hljs python"><span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-string">mini_redis.py - a tiny Redis-compatible server, written by hand.</span><span class="hljs-string">Supports PING and ECHO over the RESP protocol, with many clients at once.</span><span class="hljs-string">Run:  python3 mini_redis.py     Test: redis-cli -p 6380 PING</span><span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-keyword">import</span> asyncioHOST, PORT = <span class="hljs-string">&quot;127.0.0.1&quot;</span>, <span class="hljs-number">6380</span>  <span class="hljs-comment"># 6380 so we don&#x27;t clash with a real Redis on 6379</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">ProtocolError</span>(<span class="hljs-title class_ inherited__">Exception</span>):    <span class="hljs-string">&quot;&quot;&quot;Raised when the client sends bytes that aren&#x27;t valid RESP.&quot;&quot;&quot;</span><span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">read_command</span>(<span class="hljs-params">reader: asyncio.StreamReader</span>) -&gt; <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>]:    <span class="hljs-string">&quot;&quot;&quot;</span><span class="hljs-string">    Parse one RESP array of bulk strings, e.g. b&quot;*2\r\n$4\r\nECHO\r\n$2\r\nhi\r\n&quot;</span><span class="hljs-string">    -&gt; [&quot;ECHO&quot;, &quot;hi&quot;]. readuntil/readexactly handle partial TCP reads for us.</span><span class="hljs-string">    &quot;&quot;&quot;</span>    header = <span class="hljs-keyword">await</span> reader.readuntil(<span class="hljs-string">b&quot;\r\n&quot;</span>)          <span class="hljs-comment"># e.g. b&quot;*2\r\n&quot;</span>    <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> header.startswith(<span class="hljs-string">b&quot;*&quot;</span>):        <span class="hljs-keyword">raise</span> ProtocolError(<span class="hljs-string">f&quot;expected array, got <span class="hljs-subst">&#123;header!r&#125;</span>&quot;</span>)    count = <span class="hljs-built_in">int</span>(header[<span class="hljs-number">1</span>:-<span class="hljs-number">2</span>])    parts = []    <span class="hljs-keyword">for</span> _ <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(count):        size_line = <span class="hljs-keyword">await</span> reader.readuntil(<span class="hljs-string">b&quot;\r\n&quot;</span>)   <span class="hljs-comment"># e.g. b&quot;$4\r\n&quot;</span>        <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> size_line.startswith(<span class="hljs-string">b&quot;$&quot;</span>):            <span class="hljs-keyword">raise</span> ProtocolError(<span class="hljs-string">f&quot;expected bulk string, got <span class="hljs-subst">&#123;size_line!r&#125;</span>&quot;</span>)        size = <span class="hljs-built_in">int</span>(size_line[<span class="hljs-number">1</span>:-<span class="hljs-number">2</span>])        data = <span class="hljs-keyword">await</span> reader.readexactly(size + <span class="hljs-number">2</span>)     <span class="hljs-comment"># payload + trailing \r\n</span>        parts.append(data[:-<span class="hljs-number">2</span>].decode())    <span class="hljs-keyword">return</span> parts<span class="hljs-keyword">def</span> <span class="hljs-title function_">bulk</span>(<span class="hljs-params">value: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">bytes</span>:    <span class="hljs-string">&quot;&quot;&quot;Encode a RESP bulk string: $&lt;len&gt;\r\n&lt;data&gt;\r\n (len is in bytes).&quot;&quot;&quot;</span>    raw = value.encode()    <span class="hljs-keyword">return</span> <span class="hljs-string">b&quot;$&quot;</span> + <span class="hljs-built_in">str</span>(<span class="hljs-built_in">len</span>(raw)).encode() + <span class="hljs-string">b&quot;\r\n&quot;</span> + raw + <span class="hljs-string">b&quot;\r\n&quot;</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">handle</span>(<span class="hljs-params">command: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>]</span>) -&gt; <span class="hljs-built_in">bytes</span>:    name, args = command[<span class="hljs-number">0</span>].upper(), command[<span class="hljs-number">1</span>:]    <span class="hljs-keyword">if</span> name == <span class="hljs-string">&quot;PING&quot;</span>:        <span class="hljs-keyword">return</span> <span class="hljs-string">b&quot;+PONG\r\n&quot;</span>                           <span class="hljs-comment"># simple string reply</span>    <span class="hljs-keyword">if</span> name == <span class="hljs-string">&quot;ECHO&quot;</span> <span class="hljs-keyword">and</span> <span class="hljs-built_in">len</span>(args) == <span class="hljs-number">1</span>:        <span class="hljs-keyword">return</span> bulk(args[<span class="hljs-number">0</span>])    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;-ERR unknown or malformed command &#x27;<span class="hljs-subst">&#123;name&#125;</span>&#x27;\r\n&quot;</span>.encode()<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">serve_client</span>(<span class="hljs-params">reader, writer</span>):    peer = writer.get_extra_info(<span class="hljs-string">&quot;peername&quot;</span>)    <span class="hljs-keyword">try</span>:        <span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:                                    <span class="hljs-comment"># one connection, many commands</span>            command = <span class="hljs-keyword">await</span> read_command(reader)            writer.write(handle(command))            <span class="hljs-keyword">await</span> writer.drain()    <span class="hljs-keyword">except</span> asyncio.IncompleteReadError:        <span class="hljs-keyword">pass</span>                                           <span class="hljs-comment"># client hung up - normal</span>    <span class="hljs-keyword">except</span> (ProtocolError, ValueError) <span class="hljs-keyword">as</span> err:        writer.write(<span class="hljs-string">f&quot;-ERR protocol error: <span class="hljs-subst">&#123;err&#125;</span>\r\n&quot;</span>.encode())        <span class="hljs-keyword">await</span> writer.drain()    <span class="hljs-keyword">finally</span>:        writer.close()        <span class="hljs-keyword">await</span> writer.wait_closed()        <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;closed <span class="hljs-subst">&#123;peer&#125;</span>&quot;</span>)<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">main</span>():    server = <span class="hljs-keyword">await</span> asyncio.start_server(serve_client, HOST, PORT)    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;mini-redis listening on <span class="hljs-subst">&#123;HOST&#125;</span>:<span class="hljs-subst">&#123;PORT&#125;</span>&quot;</span>)    <span class="hljs-keyword">async</span> <span class="hljs-keyword">with</span> server:        <span class="hljs-keyword">await</span> server.serve_forever()<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&quot;__main__&quot;</span>:    asyncio.run(main())</code></pre><p>Seventy-odd lines. An AI would produce it in two seconds. But writing it yourself forces you through lessons no generated snippet teaches:</p><ul><li><strong>TCP is a stream, not a message queue.</strong> A single <code>recv()</code> can hand you half a command or three commands glued together. Using <code>readuntil</code>&#x2F;<code>readexactly</code> isn’t style — it’s correctness.</li><li><strong>Lengths are in bytes, not characters.</strong> Send <code>ECHO héy</code> and a naive <code>len(str)</code> gives you a corrupted reply. The <code>bulk()</code> helper encodes first for exactly this reason.</li><li><strong>A connection outlives a command.</strong> Forget the <code>while True</code> loop and your server answers one <code>PING</code> and then goes silent — a bug that looks baffling until you’ve made it once.</li></ul><p>That’s the kind of understanding that compounds. The next time a production Redis client times out, you won’t be guessing.</p><p>For my own first challenge, I skipped Redis and went straight for <strong>Build your own Shell — in Java</strong>. It felt like the natural next step after my <a href="https://www.awongcm.io/blog/2026/08/10/my-java-comeback-a-concrete-roadmap-back-to-mastery-not-just-muscle-memory/">Java comeback</a> roadmap. I’d been rebuilding Java fundamentals on paper, and here was a chance to put them under real pressure: parsing commands, launching processes, and wiring up the plumbing a terminal hides from you every day. I did it on the free tier, and it’s been a genuinely positive experience (and more importantly - I had fun doing it 🙂). Every <code>git push</code> that turned a stage green felt earned in a way a generated diff never does. Doing it without AI also showed me exactly where my Java was solid, where it was still muscle memory and how to get better at both.</p><h3 id="Common-pitfalls-when-starting-out"><a href="#Common-pitfalls-when-starting-out" class="headerlink" title="Common pitfalls when starting out"></a>Common pitfalls when starting out</h3><table><thead><tr><th>Problem</th><th>Cause</th><th>Solution</th></tr></thead><tbody><tr><td>First <code>PING</code> works, second hangs</td><td>Handling one command per connection</td><td>Loop reading commands until the client disconnects</td></tr><tr><td>Second client can’t connect</td><td>Blocking, single-threaded accept loop</td><td>Use <code>asyncio</code>, threads, or an event loop (a later stage will force this)</td></tr><tr><td>Garbled replies for non-ASCII input</td><td>Using character length instead of byte length</td><td>Encode to bytes before measuring</td></tr><tr><td><code>nc</code> &#x2F; <code>telnet</code> gets a protocol error</td><td>Real Redis also accepts “inline” commands; this sketch doesn’t</td><td>Test with <code>redis-cli</code>, or add inline parsing as a stretch goal</td></tr><tr><td>Tests fail but it “works locally”</td><td>Missing <code>\r\n</code> terminators</td><td>Re-read the RESP spec — the tests are stricter than your eyes</td></tr></tbody></table><h2 id="A-Practical-Routine-AI-for-Work-Reps-for-Craft"><a href="#A-Practical-Routine-AI-for-Work-Reps-for-Craft" class="headerlink" title="A Practical Routine: AI for Work, Reps for Craft"></a>A Practical Routine: AI for Work, Reps for Craft</h2><p>I’m not arguing for going back to 2019. I rebuilt my <a href="https://www.awongcm.io/blog/2026/08/05/from-no-code-to-native-what-rebuilding-my-expense-tracker-taught-me-about-ai-assisted-skill-acquisition/">expense tracker</a> in React Native with heavy AI help and I’d do it again. The goal is balance — use AI where delivery matters, and protect dedicated time where <em>learning</em> matters.</p><h3 id="Do’s-✅"><a href="#Do’s-✅" class="headerlink" title="Do’s ✅"></a>Do’s ✅</h3><ul><li><p><strong>Schedule it like training.</strong> Two or three focused sessions a week beat a heroic weekend binge.</p></li><li><p><strong>Switch the assistant off at the editor level</strong>, not just in your head. In VS Code, a workspace-level or similar <code>.vscode/settings.json</code> does the job:</p><pre><code class="hljs json"><span class="hljs-punctuation">&#123;</span>  <span class="hljs-comment">// Practice repo only: no inline AI suggestions, no ghost text</span>  <span class="hljs-attr">&quot;github.copilot.enable&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">&#123;</span> <span class="hljs-attr">&quot;*&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span> <span class="hljs-punctuation">&#125;</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">&quot;editor.inlineSuggest.enabled&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">&#125;</span></code></pre></li><li><p><strong>Read the primary source.</strong> Challenges nudge you towards specs — the RESP docs, Git’s object format, SQLite’s file format. Reading specs is itself a skill that’s atrophying.</p></li><li><p><strong>Pick a language you want to deepen.</strong> Rebuilding a shell or Redis in a language you’re rusty in exercises two muscles at once — systems knowledge and language fluency.</p></li></ul><h3 id="Don’ts-❌"><a href="#Don’ts-❌" class="headerlink" title="Don’ts ❌"></a>Don’ts ❌</h3><ul><li><strong>Don’t paste the stage description into a chatbot.</strong> You’ll pass the tests and learn nothing — the Anthropic study’s lowest scorers were the pure delegators.</li><li><strong>Don’t peek at other solutions too early.</strong> Community solutions are brilliant <em>after</em> you pass a stage; before that, they rob you of the struggle.</li><li><strong>Don’t treat getting stuck as failure.</strong> Stuck is where the learning happens.</li></ul><h3 id="On-cost"><a href="#On-cost" class="headerlink" title="On cost"></a>On cost</h3><p>There’s a free tier with limited content, so you can try a challenge before committing. My Shell-in-Java run was entirely free, which says a lot about how much value you can get before paying anything. Paid memberships unlock everything (three-month, annual and lifetime options), and there are team plans for groups of five or more. CodeCrafters even has an <a href="https://codecrafters.io/expense">expense page</a> nudging you to ask your manager to fund it from the AI budget — which, for engineering leaders reading this, is a genuinely good use of it. Check the <a href="https://codecrafters.io/pricing">pricing page</a> for current plans if you’re interested in supporting the platform. Otherwise, start with the free tier, master one or two challenges would be suffice. If you like to do more, the paid tiers are worth considering.</p><p>Be sure to check out the links below for further reading.</p><h2 id="Further-Reading"><a href="#Further-Reading" class="headerlink" title="Further Reading"></a>Further Reading</h2><ul><li><a href="https://codecrafters.io/philosophy">CodeCrafters — Philosophy</a></li><li><a href="https://www.anthropic.com/research/AI-assistance-coding-skills">How AI assistance impacts the formation of coding skills — Anthropic Research</a></li><li><a href="https://github.com/codecrafters-io/build-your-own-x">build-your-own-x on GitHub</a></li><li><a href="https://redis.io/docs/latest/develop/reference/protocol-spec/">Redis serialization protocol (RESP) specification</a></li><li><a href="https://www.awongcm.io/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/">Don’t Let AI Dull Your Software Engineering Edge</a></li></ul><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>AI has given us the most productive era in software history. But productivity and competence are two different things, and the evidence now suggests the first can quietly eat into the second — especially in debugging and comprehension, the very skills we need to keep AI-generated systems honest.</p><p>CodeCrafters won’t fix that on its own. What it offers is a well-built gym: real systems, real specs, your own tools, and a feedback loop tight enough to keep you coming back. The discipline of leaving the AI switched off is still yours to bring - much akin to switching off your calculator when you’re doing calculations by hand. Only reach for the calculator when you’re stuck. </p><p>That’s the whole point — and it’s what this blog has always been about: mastering the craft, not just shipping the output.</p><p>Thus I highly recommend you trying out CodeCrafters for yourself. It’s a great way to keep your skills sharp alongside your AI-powered day job.  I’m still keeping my craft sharp without losing my edge 🙂.</p><p><strong>Your next steps:</strong></p><ol><li>Pick one CodeCrafters challenge — Redis or Shell are great first choices — and complete the first three stages with AI fully disabled.</li><li>Block out two recurring “no-AI” practice sessions in your calendar this week.</li><li>Post your reflections on the experience and understand what you learned in getting unstuck as you go through the challenges.</li><li>Only then - you discover growth and mastery in the process.</li></ol><p>Till next time, Happy Coding! Keep Learning and Growing!</p><hr>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: AI has made us faster, but speed without reps quietly erodes the skills we need to supervise the code AI writes for us. Platforms like &lt;a href=&quot;https://codecrafters.io/&quot;&gt;CodeCrafters&lt;/a&gt; give you a structured, test-driven way to rebuild real systems — Redis, Git, SQLite, a shell — with your own hands. Treat it as the gym your engineering craft now needs.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_back_to_the_gym_codecrafters.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;Here’s a small, uncomfortable experiment. Open a blank file, switch off your AI assistant, and write a TCP server that speaks just enough of the Redis protocol to answer &lt;code&gt;PING&lt;/code&gt; with &lt;code&gt;PONG&lt;/code&gt;. No autocomplete. No chat window. Just you, the docs, and a terminal.&lt;/p&gt;
&lt;p&gt;If that made you hesitate even slightly — you’re not alone, and it’s not a character flaw. It’s atrophy.&lt;/p&gt;
&lt;p&gt;Back in April, I wrote &lt;a href=&quot;/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/&quot; title=&quot;Don&amp;#39;t Let AI Dull Your Software Engineering Edge&quot;&gt;Dont Let AI Dull Your Software Engineering Edge&amp;#39;&lt;/a&gt;, which was about &lt;em&gt;how you prompt&lt;/em&gt; — forming a hypothesis before asking, tracing generated code instead of accepting it. That post was about using AI well. This one is about the other half of the equation: deliberately spending time &lt;em&gt;without&lt;/em&gt; it, so the muscles AI can’t exercise for you stay strong.&lt;/p&gt;
&lt;p&gt;By the end of this post, you’ll understand:&lt;/p&gt;</summary>
    
    
    
    
    <category term="java" scheme="http://awongcm.io/tags/java/"/>
    
    <category term="codecrafters" scheme="http://awongcm.io/tags/codecrafters/"/>
    
    <category term="skill-atrophy" scheme="http://awongcm.io/tags/skill-atrophy/"/>
    
    <category term="deliberate-practice" scheme="http://awongcm.io/tags/deliberate-practice/"/>
    
    <category term="ai-assisted-development" scheme="http://awongcm.io/tags/ai-assisted-development/"/>
    
    <category term="career-growth" scheme="http://awongcm.io/tags/career-growth/"/>
    
  </entry>
  
  <entry>
    <title>From Roadmap to Repo: Proving Nine Java Disciplines in One Ecommerce API</title>
    <link href="http://awongcm.io/blog/2026/09/12/from-roadmap-to-repo-proving-nine-java-disciplines-in-one-ecommerce-api/"/>
    <id>http://awongcm.io/blog/2026/09/12/from-roadmap-to-repo-proving-nine-java-disciplines-in-one-ecommerce-api/</id>
    <published>2026-09-12T10:34:32.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: Last month I published a nine-discipline roadmap for restarting my Java journey. This is the receipt. <a href="https://github.com/awongCM/ecommerce-api"><code>awongCM/ecommerce-api</code></a> is a Spring Boot 3.5 &#x2F; Java 25 ecommerce API where every discipline on that table — from <code>Optional</code> chains to sealed types, virtual threads, ZGC, GraalVM native image and a Spring AI triage consumer — is a file you can open, a test you can run, or an honest “not measured” row in the architecture doc. Here’s the walkthrough, the code, the gotchas that bit me, and the gaps I refused to paper over.</p></blockquote><img src="/images/ai_generated_roadmap_to_repo_capstone_project.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>In <a href="/blog/2026/08/10/my-java-comeback-a-concrete-roadmap-back-to-mastery-not-just-muscle-memory/" title="My Java Comeback: A Concrete Roadmap Back to Mastery (Not Just Muscle Memory)">My Java Comeback</a> post, I did the thing engineers do when they want to be held accountable: I published a plan. Nine disciplines, three delivery phases, and a capstone at the end that would prove disciplines 1 through 8 worked together rather than as nine separate weekend tutorials.</p><p>Plans are cheap. So here is the capstone: <strong><a href="https://github.com/awongCM/ecommerce-api"><code>awongCM/ecommerce-api</code></a></strong> — a production-shaped REST API for an ecommerce store. Register, browse a catalogue, fill a cart, check out, get charged, receive an order-created event downstream.</p><p>Two honest notes before we start.</p><span id="more"></span><p>First, the roadmap said “payments-domain simulation.” What I actually built is an <strong>ecommerce shell around a payments hot path</strong>. That was deliberate. Everybody already has a mental model of a checkout button, which means the domain never becomes the hard part of the post — the <em>engineering</em> stays the hard part. And the interesting bits (idempotency, optimistic locking, circuit breakers, transactional outbox, FK-safe transaction boundaries) are payments problems regardless of the shopfront wrapped around them.</p><p>Second, this is not a “look how clever I am” tour. Two of the nine disciplines are only <strong>partially</strong> proven, and the architecture doc says so in a table with the word <em>not measured</em> in it. That’s the point. A capstone you can’t critique isn’t evidence of anything.</p><p>By the end of this post you’ll have:</p><ul><li>A <strong>scoreboard pattern</strong> you can apply to your own comeback project — discipline mapped to a verifiable artifact, not a claim</li><li>Real code for the modern-Java moves that actually change how you write services</li><li>The failure modes that cost me hours, so they cost you minutes</li></ul><h2 id="The-scoreboard-nine-disciplines-nine-pieces-of-evidence"><a href="#The-scoreboard-nine-disciplines-nine-pieces-of-evidence" class="headerlink" title="The scoreboard: nine disciplines, nine pieces of evidence"></a>The scoreboard: nine disciplines, nine pieces of evidence</h2><p>The rule I set for myself: a discipline is only “done” when someone else can verify it without taking my word for it. Not “I read about virtual threads” — a file, a flag, a test, or a measured number.</p><table><thead><tr><th>#</th><th>Discipline</th><th>Evidence in the repo</th></tr></thead><tbody><tr><td>1</td><td>Syntax &amp; core APIs</td><td><code>Optional</code> chaining in <code>OrderService.checkout</code>, <code>Page&lt;T&gt;.map(ProductDTO::from)</code>, text blocks in AI prompts</td></tr><tr><td>2</td><td>Design patterns</td><td>Strategy (<code>PaymentGatewayClient</code> + <code>@ConditionalOnProperty</code>), State (<code>Order.transitionTo</code>), Outbox, Adapter (Jersey vs MVC)</td></tr><tr><td>3</td><td>Spring Boot &amp; microservices</td><td>Layered services, <code>ArchitectureTest</code> (ArchUnit), Actuator custom endpoint, Testcontainers integration tests</td></tr><tr><td>4</td><td>JVM internals &amp; tuning</td><td><code>-XX:+UseZGC</code> in the <code>Dockerfile</code>, <code>scripts/capture-checkout-jfr.sh</code></td></tr><tr><td>5</td><td>Concurrency</td><td>Virtual threads, <code>StructuredTaskScope</code> post-commit, <code>InventoryServiceConcurrencyTest</code></td></tr><tr><td>6</td><td>Modern Java features</td><td><code>sealed interface PaymentOutcome</code>, records everywhere, record deconstruction patterns</td></tr><tr><td>7</td><td>Cloud-native</td><td>Multi-stage <code>Dockerfile</code>, <code>-Pnative</code> GraalVM profile, <code>k8s/</code> manifests with liveness&#x2F;readiness probes</td></tr><tr><td>8</td><td>AI-native Java</td><td><code>OrderAnomalyTriageConsumer</code> + Spring AI 1.1.x, feature-flagged, off the checkout transaction</td></tr><tr><td>9</td><td>Capstone</td><td>All of the above in one running system — <strong>plus a metrics table that still says “not measured”</strong></td></tr></tbody></table><p>One note on how the rest of this post is arranged: the sections below are grouped by how these disciplines actually compose in the code, not by number. Disciplines 1, 2 and 6 share a section because modern Java collapses them into the same handful of language features, and concurrency (5) comes before JVM tuning (4) because the most interesting thing in a flight recording is a virtual-thread event — which won’t mean much until virtual threads are on the table. The scoreboard above is the index; use it if you want to jump straight to one row.</p><h2 id="Disciplines-1-2-and-6-the-language-does-more-of-the-work-now"><a href="#Disciplines-1-2-and-6-the-language-does-more-of-the-work-now" class="headerlink" title="Disciplines 1, 2 and 6: the language does more of the work now"></a>Disciplines 1, 2 and 6: the language does more of the work now</h2><p>I’m collapsing these three because in modern Java they collapse in practice. Half the “patterns” I’d have hand-rolled in Java 8 are now language features.</p><h3 id="Sealed-types-replace-the-instanceof-ladder"><a href="#Sealed-types-replace-the-instanceof-ladder" class="headerlink" title="Sealed types replace the instanceof ladder"></a>Sealed types replace the <code>instanceof</code> ladder</h3><p>A payment attempt has exactly three observable outcomes. In 2016 I’d have modelled that with an enum plus a nullable message field, or a small hierarchy and a chain of <code>instanceof</code> checks. In Java 25 it’s a sealed interface with record variants:</p><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">sealed</span> <span class="hljs-keyword">interface</span> <span class="hljs-title class_">PaymentOutcome</span>        <span class="hljs-keyword">permits</span> PaymentOutcome.Captured,                PaymentOutcome.GatewayUnavailable,                PaymentOutcome.Failed &#123;    <span class="hljs-comment">/** Payment was captured successfully. */</span>    <span class="hljs-keyword">record</span> <span class="hljs-title class_">Captured</span><span class="hljs-params">(String gatewayReference, String cardLast4)</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PaymentOutcome</span> &#123;&#125;    <span class="hljs-comment">/** Circuit is open or all retries exhausted — gateway is not reachable. */</span>    <span class="hljs-keyword">record</span> <span class="hljs-title class_">GatewayUnavailable</span><span class="hljs-params">(String reason)</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PaymentOutcome</span> &#123;&#125;    <span class="hljs-comment">/** Gateway reachable but returned a business failure (declined, invalid token). */</span>    <span class="hljs-keyword">record</span> <span class="hljs-title class_">Failed</span><span class="hljs-params">(String reason)</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PaymentOutcome</span> &#123;&#125;&#125;</code></pre><p>The payoff is at the call site, inside the checkout orchestration:</p><pre><code class="hljs java"><span class="hljs-type">PaymentOutcome</span> <span class="hljs-variable">outcome</span> <span class="hljs-operator">=</span> paymentService.processPayment(order, request.getPaymentToken());<span class="hljs-keyword">switch</span> (outcome) &#123;    <span class="hljs-keyword">case</span> PaymentOutcome.Captured c -&gt; &#123;        order.transitionTo(OrderStatus.CONFIRMED);        log.info(<span class="hljs-string">&quot;Checkout captured, ref=&#123;&#125;&quot;</span>, c.gatewayReference());    &#125;    <span class="hljs-keyword">case</span> PaymentOutcome.GatewayUnavailable u -&gt; &#123;        releaseReservedStock(cart);        order.transitionTo(OrderStatus.CANCELLED);        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">IllegalStateException</span>(<span class="hljs-string">&quot;Payment gateway unavailable: &quot;</span> + u.reason());    &#125;    <span class="hljs-keyword">case</span> PaymentOutcome.Failed f -&gt; &#123;        releaseReservedStock(cart);        order.transitionTo(OrderStatus.CANCELLED);        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">IllegalStateException</span>(<span class="hljs-string">&quot;Payment failed: &quot;</span> + f.reason());    &#125;&#125;</code></pre><p><strong>Key points:</strong></p><ul><li><strong>No <code>default</code> branch.</strong> Because the interface is sealed and the switch is exhaustive, the compiler proves I’ve handled every case. Add a fourth outcome — say <code>RequiresAction</code> for 3DS — and this file stops compiling. That’s the feature.</li><li><strong>A decline is not an outage.</strong> Keeping those as distinct types forced me to keep them distinct in behaviour: retryable gateway exceptions get rethrown so Resilience4j can open the circuit, while business declines return <code>Failed</code> immediately. Collapse them into one “payment failed” boolean and you get a circuit breaker that trips on customers typing the wrong CVV.</li><li><strong>This is the Visitor pattern, retired.</strong> Sealed hierarchy plus exhaustive matching does what Visitor existed to do, minus the ceremony.</li></ul><p>Record patterns tighten it further. In the AI triage service, a private sealed result type gets deconstructed in the guard itself:</p><pre><code class="hljs java"><span class="hljs-keyword">private</span> <span class="hljs-keyword">sealed</span> <span class="hljs-keyword">interface</span> <span class="hljs-title class_">PrepareResult</span> &#123;    <span class="hljs-keyword">record</span> <span class="hljs-title class_">AlreadyTriaged</span><span class="hljs-params">()</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PrepareResult</span> &#123;&#125;    <span class="hljs-keyword">record</span> <span class="hljs-title class_">NoPayment</span><span class="hljs-params">()</span>      <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PrepareResult</span> &#123;&#125;    <span class="hljs-keyword">record</span> <span class="hljs-title class_">Ready</span><span class="hljs-params">(Payment payment)</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">PrepareResult</span> &#123;&#125;&#125;<span class="hljs-comment">// ...</span><span class="hljs-type">PrepareResult</span> <span class="hljs-variable">prepared</span> <span class="hljs-operator">=</span> readTx.execute(status -&gt; prepare(orderId, event.getOrderNumber()));<span class="hljs-keyword">if</span> (!(prepared <span class="hljs-keyword">instanceof</span> PrepareResult.Ready(Payment payment))) &#123;    <span class="hljs-keyword">return</span>;   <span class="hljs-comment">// already triaged, or nothing to triage</span>&#125;<span class="hljs-comment">// `payment` is in scope here, typed, non-null</span></code></pre><p>Three early-exit reasons, one branch, no null checks.</p><h3 id="The-patterns-that-didn’t-get-replaced"><a href="#The-patterns-that-didn’t-get-replaced" class="headerlink" title="The patterns that didn’t get replaced"></a>The patterns that didn’t get replaced</h3><p>Not everything collapses. <strong>Strategy</strong> is alive and well — the payment gateway is an interface with two implementations selected by configuration:</p><pre><code class="hljs java"><span class="hljs-meta">@Bean</span><span class="hljs-meta">@ConditionalOnProperty(</span><span class="hljs-meta">    name = &quot;app.payment-gateway.provider&quot;,</span><span class="hljs-meta">    havingValue = &quot;mock&quot;,</span><span class="hljs-meta">    matchIfMissing = true)</span>PaymentGatewayClient <span class="hljs-title function_">mockPaymentGatewayClient</span><span class="hljs-params">()</span> &#123;    <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">MockPaymentGatewayClient</span>();&#125;</code></pre><p>That single <code>matchIfMissing = true</code> is why <code>mvn verify</code> works on a laptop with no Stripe keys — a small decision that pays for itself every time someone clones the repo.</p><p><strong>State</strong> survives too, as an exhaustive enum switch guarding order transitions:</p><pre><code class="hljs java"><span class="hljs-keyword">private</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">validateTransition</span><span class="hljs-params">(OrderStatus from, OrderStatus to)</span> &#123;    <span class="hljs-type">boolean</span> <span class="hljs-variable">valid</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">switch</span> (from) &#123;        <span class="hljs-keyword">case</span> PENDING     -&gt; to == OrderStatus.CONFIRMED  || to == OrderStatus.CANCELLED;        <span class="hljs-keyword">case</span> CONFIRMED   -&gt; to == OrderStatus.PROCESSING || to == OrderStatus.CANCELLED;        <span class="hljs-keyword">case</span> PROCESSING  -&gt; to == OrderStatus.SHIPPED;        <span class="hljs-keyword">case</span> SHIPPED     -&gt; to == OrderStatus.DELIVERED;        <span class="hljs-keyword">case</span> DELIVERED   -&gt; to == OrderStatus.REFUNDED;        <span class="hljs-keyword">case</span> CANCELLED, REFUNDED -&gt; <span class="hljs-literal">false</span>;    &#125;;    <span class="hljs-keyword">if</span> (!valid) &#123;        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">IllegalStateException</span>(<span class="hljs-string">&quot;Invalid transition: &quot;</span> + from + <span class="hljs-string">&quot; → &quot;</span> + to);    &#125;&#125;</code></pre><p>Illegal states become unrepresentable <em>at the boundary where it matters</em> — an admin can’t mark a cancelled order as shipped, and the rule lives in the domain object rather than scattered across controllers.</p><p>And discipline 1 — the unglamorous one — shows up everywhere once you look: the idempotency check is a three-line <code>Optional</code> chain, pagination is <code>Page&lt;T&gt;.map(ProductDTO::from)</code>, and the AI system prompt is a text block instead of a <code>StringBuilder</code> crime scene.</p><h2 id="Discipline-3-Spring-Boot-that-doesn’t-rot"><a href="#Discipline-3-Spring-Boot-that-doesn’t-rot" class="headerlink" title="Discipline 3: Spring Boot that doesn’t rot"></a>Discipline 3: Spring Boot that doesn’t rot</h2><p>Anyone can wire a controller to a repository. The discipline is keeping the layers honest six months later, so I made the build enforce it with ArchUnit:</p><pre><code class="hljs java"><span class="hljs-meta">@ArchTest</span><span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> <span class="hljs-type">ArchRule</span> <span class="hljs-variable">web_layers_must_not_access_repositories</span> <span class="hljs-operator">=</span>    noClasses()        .that().resideInAnyPackage(<span class="hljs-string">&quot;..controller..&quot;</span>, <span class="hljs-string">&quot;..jersey..&quot;</span>)        .should().dependOnClassesThat().resideInAnyPackage(<span class="hljs-string">&quot;..repository..&quot;</span>)        .because(<span class="hljs-string">&quot;HTTP adapters delegate to services, not repositories&quot;</span>);<span class="hljs-meta">@ArchTest</span><span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> <span class="hljs-type">ArchRule</span> <span class="hljs-variable">no_field_injection</span> <span class="hljs-operator">=</span>    noFields().should().beAnnotatedWith(Autowired.class)        .because(<span class="hljs-string">&quot;Use constructor injection for required dependencies&quot;</span>);</code></pre><p>This caught a real leak: several controllers were injecting <code>CustomerRepository</code> just to turn a JWT email into a customer id. The fix was a one-method <code>CustomerLookupService</code> — and now the rule stops it coming back.</p><p>The rest of discipline 3 is the boring-but-necessary layer:</p><ul><li><strong>Testing by intent, not by ritual.</strong> Mockito for service rules, <code>@WebMvcTest</code> for HTTP mapping and security wiring, <code>@DataJpaTest</code> on H2 for queries, and Testcontainers Postgres for checkout — because H2 is not Postgres when dialect, Flyway and locking behaviour matter. The base class degrades gracefully: <code>@Testcontainers(disabledWithoutDocker = true)</code> means a contributor with no Docker still gets a green <code>mvn verify</code>.</li><li><strong>Observability that says something.</strong> A custom <code>/actuator/inventory</code> low-stock endpoint and a payment-gateway health indicator, with liveness and readiness split so a flaky gateway doesn’t get the pod restarted.</li><li><strong>Two HTTP stacks on one core.</strong> Spring MVC at <code>/api/v1/*</code> and Jersey (JAX-RS) at <code>/jersey/*</code>, sharing security, services and persistence. It’s the Adapter pattern as a live experiment, and it proves the business logic genuinely doesn’t know what web framework is in front of it.</li><li><strong>Resilience at the edges only.</strong> Circuit breaker and retry around the payment gateway, a rate limiter on product search. Nowhere else.</li></ul><h2 id="Discipline-5-concurrency-and-the-part-everyone-gets-wrong"><a href="#Discipline-5-concurrency-and-the-part-everyone-gets-wrong" class="headerlink" title="Discipline 5: concurrency, and the part everyone gets wrong"></a>Discipline 5: concurrency, and the part everyone gets wrong</h2><p>This was the discipline I was most sure was overdue, and the one that taught me the most.</p><p>Checkout ends with two independent jobs: write an audit record, and fire a notification. Classic <code>@Async</code> territory — except <code>@Async</code> inside a transaction is a trap. Fork before commit and your audit row can describe an order that never existed.</p><p>So the fan-out is registered as an <strong>after-commit</strong> callback and executed on virtual threads with <code>StructuredTaskScope</code>:</p><pre><code class="hljs java"><span class="hljs-keyword">try</span> (<span class="hljs-type">var</span> <span class="hljs-variable">scope</span> <span class="hljs-operator">=</span> StructuredTaskScope.open(        StructuredTaskScope.Joiner.awaitAllSuccessfulOrThrow(),        cfg -&gt; cfg.withThreadFactory(Thread.ofVirtual().factory()))) &#123;    scope.fork(() -&gt; auditService.logSync(        <span class="hljs-string">&quot;Order&quot;</span>, savedOrder.getId().toString(),        <span class="hljs-string">&quot;CHECKOUT&quot;</span>, <span class="hljs-literal">null</span>, savedOrder.getOrderNumber(),        auditContext.actor(), auditContext.traceId()));    scope.fork(() -&gt; log.info(<span class="hljs-string">&quot;Checkout notification for order &#123;&#125; (customer &#123;&#125;)&quot;</span>,        savedOrder.getOrderNumber(), customerId));    scope.join();&#125;</code></pre><p><strong>Key points:</strong></p><ul><li><strong>This is post-commit parallelism, not fire-and-forget.</strong> The <code>join()</code> means the response doesn’t return until both tasks finish. I’m buying <em>parallelism</em>, not hidden latency — and if one task fails, the scope tells me instead of swallowing it into a thread pool.</li><li><strong>Context does not ride along.</strong> MDC and <code>SecurityContextHolder</code> are thread-local; virtual threads forked from a scope don’t inherit them. Every forked audit write logged <code>actor=system</code> until I snapshotted the context on the request thread first:</li></ul><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">record</span> <span class="hljs-title class_">AuditContext</span><span class="hljs-params">(String actor, String traceId)</span> &#123;&#125;<span class="hljs-keyword">public</span> AuditContext <span class="hljs-title function_">captureContext</span><span class="hljs-params">()</span> &#123;    <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">AuditContext</span>(getCurrentUser(), MDC.get(<span class="hljs-string">&quot;traceId&quot;</span>));&#125;</code></pre><p>That five-line record is the single most useful thing I learned this whole phase. <strong>If you take one thing from discipline 5: virtual threads change your throughput model, not your context-propagation model.</strong></p><ul><li><strong>Outbox stays inside the transaction.</strong> Only independent, non-transactional work belongs in the post-commit scope. The Kafka event row is written in the <em>same</em> transaction as the order — more on that next.</li></ul><p>The oversell test proves the other half of the story. Two virtual threads race for the last unit of stock behind a <code>CountDownLatch</code>, against <code>@Version</code> optimistic locking plus <code>@Retryable</code>:</p><pre><code class="hljs java"><span class="hljs-keyword">try</span> (<span class="hljs-type">ExecutorService</span> <span class="hljs-variable">vt</span> <span class="hljs-operator">=</span> Executors.newVirtualThreadPerTaskExecutor()) &#123;    <span class="hljs-comment">// both threads block on startGate, then call reserveStock(productId, 1)</span>&#125;assertThat(successes.get()).isEqualTo(<span class="hljs-number">1</span>);assertThat(insufficient.get()).isEqualTo(<span class="hljs-number">1</span>);assertThat(product.getStockQuantity()).isZero();</code></pre><p>One winner, one <code>InsufficientStockException</code>, zero oversell. That assertion is worth more than any paragraph I could write about optimistic locking.</p><h2 id="The-transaction-decisions-worth-stealing"><a href="#The-transaction-decisions-worth-stealing" class="headerlink" title="The transaction decisions worth stealing"></a>The transaction decisions worth stealing</h2><p>Two choices in this repo took the longest to reason about, and they’re the ones I’d defend in an interview.</p><p><strong>Payment joins the checkout transaction.</strong> A <code>payments</code> row has a foreign key to <code>orders</code>. Run payment in <code>REQUIRES_NEW</code> and the insert can fire before the order row is visible to that new transaction — FK violation, or worse, an orphan payment. So <code>PaymentService.processPayment</code> uses default <code>REQUIRED</code> propagation and commits with the order. The trade-off is honest: the transaction is held open while the gateway responds. At real scale you’d authorise synchronously and capture asynchronously. At this scale, correctness beats hold time.</p><p><strong>Kafka publishing goes through a transactional outbox.</strong> Publishing directly from the service is a dual-write: the DB commits and the broker doesn’t, or the reverse. Instead <code>OutboxService.enqueueOrderCreated</code> writes a <code>PENDING</code> row inside the checkout transaction, and a scheduled <code>OutboxPoller</code> publishes after commit and marks it <code>SENT</code>. Consumers get at-least-once delivery and must dedupe. The MVP limits are documented rather than hidden — no <code>SELECT … FOR UPDATE SKIP LOCKED</code> for multi-instance pollers yet, no dead-letter cap on retries.</p><h2 id="Discipline-4-JVM-tuning-you-can-actually-observe"><a href="#Discipline-4-JVM-tuning-you-can-actually-observe" class="headerlink" title="Discipline 4: JVM tuning you can actually observe"></a>Discipline 4: JVM tuning you can actually observe</h2><p>Generational ZGC is on by default in the container:</p><pre><code class="hljs dockerfile"><span class="hljs-keyword">ENTRYPOINT</span><span class="language-bash"> [<span class="hljs-string">&quot;java&quot;</span>, \</span><span class="language-bash">  <span class="hljs-string">&quot;--enable-preview&quot;</span>, \</span><span class="language-bash">  <span class="hljs-string">&quot;-XX:+UseContainerSupport&quot;</span>, \</span><span class="language-bash">  <span class="hljs-string">&quot;-XX:MaxRAMPercentage=75.0&quot;</span>, \</span><span class="language-bash">  <span class="hljs-string">&quot;-XX:+UseZGC&quot;</span>, \</span><span class="language-bash">  <span class="hljs-string">&quot;-jar&quot;</span>, <span class="hljs-string">&quot;/app/app.jar&quot;</span>]</span></code></pre><p>On JDK 25, enabling ZGC gets you the generational collector — the separate <code>-XX:+ZGenerational</code> flag was removed in JDK 24. The young&#x2F;old split means less live data scanned per cycle, which matters for the long-lived order and payment objects this app holds. You pay a little extra footprint for coloured pointers.</p><p><code>scripts/capture-checkout-jfr.sh</code> takes a 60-second Java Flight Recorder profile you open in JDK Mission Control. Three things worth looking for:</p><ul><li><code>jdk.VirtualThreadPinned</code> events — if a library’s <code>synchronized</code> block pins a carrier thread, this is where it shows up. JDK 24 unpinned most Hibernate&#x2F;JDBC cases, but “most” isn’t “all”.</li><li>GC pause distribution — under ZGC these should be microseconds. If you’re seeing milliseconds, something else is going on.</li><li><code>jdk.ObjectAllocationInNewTLAB</code> flame graphs — which service method is manufacturing the most garbage.</li></ul><p>One caveat baked into the script’s docs: it targets a <strong>host-run JDK</strong>, because <code>jcmd</code> and <code>jps</code> don’t exist in <code>eclipse-temurin:25-jre</code>.</p><h2 id="Discipline-7-cloud-native-with-the-asterisk-left-in"><a href="#Discipline-7-cloud-native-with-the-asterisk-left-in" class="headerlink" title="Discipline 7: cloud-native, with the asterisk left in"></a>Discipline 7: cloud-native, with the asterisk left in</h2><p>The <code>Dockerfile</code> is multi-stage with a JVM runtime as the default target, a non-root user, an Actuator-based <code>HEALTHCHECK</code>, and an <strong>optional</strong> GraalVM native stage you have to ask for:</p><pre><code class="hljs bash">docker build --target native-runtime -t ecommerce-api:native .</code></pre><p><code>k8s/</code> has deployment manifests with separate liveness and readiness probes, ConfigMap and Secret wiring, plus a local Colima setup.</p><p>Why bother with native at all? Startup drops from roughly eight seconds to under half a second, and idle RSS from around 350 MB to around 80 MB. Those numbers decide whether scale-to-zero is viable.</p><p><strong>Here’s the asterisk.</strong> Native image builds succeed with GraalVM 25 (~227 MB binary on arm64), but Jersey’s reflection-heavy JAX-RS runtime is <strong>unverified</strong> under native, and the Spring AI starters are JVM-only. So the JVM image stays the production default and native is a second artifact, clearly labelled. The alternative — quietly claiming “cloud-native ✅” — would have been a lie in a table cell.</p><h2 id="Discipline-8-AI-on-the-JVM-without-wrecking-the-hot-path"><a href="#Discipline-8-AI-on-the-JVM-without-wrecking-the-hot-path" class="headerlink" title="Discipline 8: AI on the JVM without wrecking the hot path"></a>Discipline 8: AI on the JVM without wrecking the hot path</h2><p>This is the discipline most likely to be done badly, and I deliberately shipped it as a <strong>separate pull request</strong> after the platform work merged, so it couldn’t quietly bend the architecture to suit itself.</p><p>The design rule I wrote down before any code: <strong>AI classifies and drafts; Java commits money and inventory.</strong></p><p>So the triage feature is a <em>sibling Kafka consumer</em> on <code>orders.created</code> — consumer group <code>order-anomaly-triage</code>, running alongside the notification consumer, nowhere near <code>OrderService.checkout</code>. It loads payment data in a short read transaction, calls the model <strong>outside any transaction</strong>, then persists a structured label in a second write transaction:</p><pre><code class="hljs java"><span class="hljs-type">PrepareResult</span> <span class="hljs-variable">prepared</span> <span class="hljs-operator">=</span> readTx.execute(status -&gt; prepare(orderId, event.getOrderNumber()));<span class="hljs-keyword">if</span> (!(prepared <span class="hljs-keyword">instanceof</span> PrepareResult.Ready(Payment payment))) &#123;    <span class="hljs-keyword">return</span>;&#125;<span class="hljs-comment">// LLM call intentionally outside any DB transaction</span><span class="hljs-type">AnomalyClassificationResult</span> <span class="hljs-variable">result</span> <span class="hljs-operator">=</span> classify(event, payment);validateResult(result);writeTx.executeWithoutResult(status -&gt; persist(orderId, event.getOrderNumber(), result));</code></pre><p>Labels are a closed set — <code>LIKELY_FRAUD</code>, <code>GATEWAY_NOISE</code>, <code>CUSTOMER_RETRY</code>, <code>OPS_REVIEW</code> — with <code>OPS_REVIEW</code> as the uncertainty default. Everything else about it is defensive on purpose:</p><ul><li><strong>Flag default off</strong> (<code>ORDER_ANOMALY_TRIAGE_ENABLED</code>), and a startup validator that <strong>fails fast</strong> if you enable it in Docker without a real API key. Silent stub responses in production would be worse than a crash.</li><li><strong>Idempotent on <code>order_id</code></strong> — a unique constraint, with a concurrent-insert <code>DataIntegrityViolationException</code> treated as success rather than an error.</li><li><strong>PII redaction before the prompt leaves the building</strong> — customer name, email local-part, card last4 and gateway reference are all masked when the provider is external.</li><li><strong>Output validation</strong> — classification present, rationale non-blank, confidence inside 0–1, or it throws. Model output is untrusted input.</li><li><strong>A <code>@Primary</code> <code>StubChatModel</code> in dev and tests</strong>, so <code>mvn verify</code> needs no API key and no network.</li></ul><p>Notice what’s <em>not</em> here: no RAG, no tools, no auto-refund, no LLM anywhere near a payment capture. Those were deliberate omissions, documented as out of scope. A thin “call an LLM from a controller” wrapper would have ticked the table cell and proved nothing.</p><h2 id="Discipline-9-the-capstone-including-what-it-can’t-prove-yet"><a href="#Discipline-9-the-capstone-including-what-it-can’t-prove-yet" class="headerlink" title="Discipline 9: the capstone, including what it can’t prove yet"></a>Discipline 9: the capstone, including what it can’t prove yet</h2><p>Nine is where the previous eight either compose or fall over. One checkout request touches modern language features (sealed outcome), patterns (strategy gateway, state machine), Spring Boot layering, optimistic locking, Resilience4j, the transactional outbox, post-commit virtual threads, Kafka, and — optionally, well downstream — Spring AI.</p><p>And here is the row I left in <code>ARCHITECTURE.md</code>:</p><table><thead><tr><th>Metric</th><th>JVM (ZGC, Java 25)</th><th>Native (GraalVM 25)</th></tr></thead><tbody><tr><td>Startup to first health</td><td>not measured</td><td>n&#x2F;a</td></tr><tr><td>RSS at idle</td><td>not measured</td><td>n&#x2F;a</td></tr><tr><td>20-concurrent checkout (virtual threads)</td><td>not measured</td><td>n&#x2F;a</td></tr></tbody></table><p><code>scripts/checkout-load.sh</code> fires N concurrent checkouts with unique idempotency keys, but in its current form the concurrent requests share one cart — so after the first success the rest fail on an empty cart. It’s a working harness and weak evidence, and calling it “20-concurrent checkout proven” would be exactly the kind of résumé-driven engineering this whole roadmap was meant to avoid.</p><p><strong>Unmeasured is a finding, not a failure.</strong> It’s the next task, written down where I can’t forget it.</p><h2 id="Troubleshooting-the-gotchas-that-cost-me-hours"><a href="#Troubleshooting-the-gotchas-that-cost-me-hours" class="headerlink" title="Troubleshooting: the gotchas that cost me hours"></a>Troubleshooting: the gotchas that cost me hours</h2><table><thead><tr><th>Problem</th><th>Cause</th><th>Fix</th></tr></thead><tbody><tr><td><code>class file version 69.0 vs runtime max 61.0</code></td><td>sdkman loads after Homebrew in <code>~/.zshrc</code> and pins Java 17</td><td>Export <code>JAVA_HOME</code> to the JDK 25 path explicitly; confirm with <code>mvn -v</code></td></tr><tr><td>Surefire: “Could not self-attach”</td><td>Mockito can’t dynamically attach on JDK 25</td><td>Add <code>-javaagent:$&#123;org.mockito:mockito-core:jar&#125; -XX:+EnableDynamicAgentLoading</code> to <code>argLine</code></td></tr><tr><td><code>java -jar</code> fails after a clean build</td><td><code>--enable-preview</code> is needed at runtime too, not just compile</td><td>Add it to the Docker <code>ENTRYPOINT</code> and Maven <code>jvmArguments</code></td></tr><tr><td>Native build: <code>UnsupportedFeatureException</code> on Logback</td><td><code>--initialize-at-build-time=org.slf4j</code> puts <code>LogbackMDCAdapter</code> in the image heap while Logback stays run-time init</td><td>Don’t pass that flag; native-image builds cleanly without it</td></tr><tr><td>Flyway fails on Postgres in Docker</td><td>Flyway 11 split out database modules</td><td>Add <code>flyway-database-postgresql</code></td></tr><tr><td><code>No default constructor found</code> on a service</td><td>Two constructors confused Spring’s autowiring</td><td>Mark the production constructor <code>@Autowired</code>; keep test factories private</td></tr><tr><td>Mockito strict-stubbing failures on passthrough mocks</td><td>Unused stubs on a <code>TransactionTemplate</code> mock</td><td>Use <code>lenient()</code> for genuinely conditional stubs</td></tr><tr><td>Audit rows logged as <code>actor=system</code></td><td>MDC &#x2F; <code>SecurityContext</code> don’t propagate into forked virtual threads</td><td>Snapshot context on the request thread, pass it explicitly</td></tr></tbody></table><h2 id="Do’s-and-don’ts-for-building-your-own-capstone"><a href="#Do’s-and-don’ts-for-building-your-own-capstone" class="headerlink" title="Do’s and don’ts for building your own capstone"></a>Do’s and don’ts for building your own capstone</h2><p><strong>Do:</strong></p><ul><li><strong>Make each discipline verifiable by someone else.</strong> A file, a test, a flag, a measured number. “I learned about X” is not evidence.</li><li><strong>Ship the risky discipline as its own PR.</strong> AI went in separately from the platform work precisely so it couldn’t reshape the architecture while nobody was looking.</li><li><strong>Write the trade-off down next to the decision.</strong> “Payment shares the checkout transaction, which lengthens hold time, which we’d fix with async capture at 10× traffic” is an interview answer. “We use <code>@Transactional</code>“ is not.</li><li><strong>Leave the gaps visible.</strong> The “not measured” table is the most credible thing in the repo.</li></ul><p><strong>Don’t:</strong></p><ul><li><strong>Don’t let a table cell drive the design.</strong> A one-line LLM call would have marked discipline 8 complete and taught me nothing.</li><li><strong>Don’t assume modern runtime means modern behaviour.</strong> Virtual threads give you cheap concurrency, not automatic context propagation. Sealed types give you exhaustiveness, not correctness.</li><li><strong>Don’t mock what correctness depends on.</strong> Checkout tests run against real Postgres via Testcontainers because H2 isn’t Postgres where it counts.</li><li><strong>Don’t confuse a harness with evidence.</strong> A load script that runs is not a load test that proves anything.</li></ul><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>The roadmap post was the hypothesis: that treating Java as a genuine restart rather than a refresh would produce something with a bigger trajectory than picking up where I left off. This repo is the experiment, and the result is roughly what I hoped for — seven disciplines demonstrably landed, two partially, and a clear, honest list of what remains.</p><p>If you’re carrying your own “I should get back into X” list, steal the scoreboard idea more than the stack. Pick a domain your reader already understands. Force every discipline to produce an artifact someone can open. And when a discipline only half-lands, write the half down.</p><p><strong>Your next steps:</strong></p><ol><li><strong>Clone it and run <code>mvn -q verify</code></strong> with JDK 25 — Docker optional, no API keys needed. Then open <code>PaymentOutcome</code> and try adding a fourth outcome; the compiler will show you exactly where exhaustiveness earns its keep.</li><li><strong>Pick one discipline you’d claim on your CV</strong> and go find the artifact that proves it. If there isn’t one, that’s your next weekend.</li><li><strong>Steal the <code>AuditContext</code> pattern</strong> before your first <code>StructuredTaskScope</code> fan-out silently loses your trace IDs.</li></ol><p><strong>My next steps:</strong> run <code>scripts/checkout-load.sh</code> properly (one cart per virtual user), capture JVM and native RSS, and fill in that table. Then verify Jersey under GraalVM native, or document why it stays JVM-only for good.</p><p>If you’ve built your own comeback capstone — or you look at these transaction boundaries and think I’ve got one of them wrong — I’d genuinely like to hear it. Drop a comment or open an issue on the repo.</p><p>Till next time, Happy Coding!</p><p><strong>PS</strong>: If you’re earlier in your career and this looks intimidating, read the scoreboard table again and notice how ordinary most of the rows are. Constructor injection. A test that asserts one winner. A flag that defaults to off. Mastery here isn’t exotic knowledge — it’s refusing to tick a box you can’t defend.</p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Last month I published a nine-discipline roadmap for restarting my Java journey. This is the receipt. &lt;a href=&quot;https://github.com/awongCM/ecommerce-api&quot;&gt;&lt;code&gt;awongCM/ecommerce-api&lt;/code&gt;&lt;/a&gt; is a Spring Boot 3.5 &amp;#x2F; Java 25 ecommerce API where every discipline on that table — from &lt;code&gt;Optional&lt;/code&gt; chains to sealed types, virtual threads, ZGC, GraalVM native image and a Spring AI triage consumer — is a file you can open, a test you can run, or an honest “not measured” row in the architecture doc. Here’s the walkthrough, the code, the gotchas that bit me, and the gaps I refused to paper over.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_roadmap_to_repo_capstone_project.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;In &lt;a href=&quot;/blog/2026/08/10/my-java-comeback-a-concrete-roadmap-back-to-mastery-not-just-muscle-memory/&quot; title=&quot;My Java Comeback: A Concrete Roadmap Back to Mastery (Not Just Muscle Memory)&quot;&gt;My Java Comeback&lt;/a&gt; post, I did the thing engineers do when they want to be held accountable: I published a plan. Nine disciplines, three delivery phases, and a capstone at the end that would prove disciplines 1 through 8 worked together rather than as nine separate weekend tutorials.&lt;/p&gt;
&lt;p&gt;Plans are cheap. So here is the capstone: &lt;strong&gt;&lt;a href=&quot;https://github.com/awongCM/ecommerce-api&quot;&gt;&lt;code&gt;awongCM/ecommerce-api&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; — a production-shaped REST API for an ecommerce store. Register, browse a catalogue, fill a cart, check out, get charged, receive an order-created event downstream.&lt;/p&gt;
&lt;p&gt;Two honest notes before we start.&lt;/p&gt;</summary>
    
    
    
    
    <category term="java" scheme="http://awongcm.io/tags/java/"/>
    
    <category term="springboot" scheme="http://awongcm.io/tags/springboot/"/>
    
    <category term="jvm" scheme="http://awongcm.io/tags/jvm/"/>
    
    <category term="kafka" scheme="http://awongcm.io/tags/kafka/"/>
    
    <category term="spring-ai" scheme="http://awongcm.io/tags/spring-ai/"/>
    
    <category term="graalvm" scheme="http://awongcm.io/tags/graalvm/"/>
    
    <category term="software-engineering" scheme="http://awongcm.io/tags/software-engineering/"/>
    
  </entry>
  
  <entry>
    <title>Graph Engineering: Wiring Agents Into an Organization</title>
    <link href="http://awongcm.io/blog/2026/09/01/graph-engineering-wiring-agents-into-an-organization/"/>
    <id>http://awongcm.io/blog/2026/09/01/graph-engineering-wiring-agents-into-an-organization/</id>
    <published>2026-09-01T08:30:00.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: <em>Loop engineering taught one agent how to keep going without you in the room. Graph engineering is what happens once there’s more than one agent — and someone has to decide who talks to whom, in what order, and who’s allowed to see what.</em></p></blockquote><img src="/images/ai_generated_graph_engineering_after_loop_engineering.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>In my last  <a href="/blog/2026/08/23/loop-engineering-teaching-ai-agents-how-to-think/" title="Loop Engineering: Teaching AI Agents How to Think">article</a>, I wrote about loop engineering — the outer cycle that lets an agent run to completion without you steering it turn by turn. Wrap a task in a trigger, a verifiable goal, a real verifier, and stop rules, and you have something that can run unattended for hours instead of minutes.</p><p>That post assumed one agent. One loop, one harness underneath it, one job.</p><span id="more"></span><p>But if I were to actually ship the same loop into production, the next probable problem that would show up almost immediately is: the loop that fixes bugs isn’t the loop that should review the fix, and the loop that reviews the fix definitely isn’t the loop that should decide whether to deploy it. One instruction from a person was quietly spawning half a dozen agents, each with a different job, and nothing in “loop engineering” told me how those agents should be connected to each other.</p><p>That’s the layer this post is about: <strong>graph engineering</strong> — designing the topology that connects multiple agents into something closer to an organization than a single worker.</p><hr><h2 id="What-Is-Graph-Engineering"><a href="#What-Is-Graph-Engineering" class="headerlink" title="What Is Graph Engineering?"></a>What Is Graph Engineering?</h2><p>Graph engineering is the discipline of designing the structure that multiple agents run inside: which specialized nodes exist, which edges are allowed to route work between them, and what shared state travels along those edges as the graph executes.</p><p>The term itself has a messier origin story than “loop engineering” did, and it’s worth being upfront about that rather than pretending it arrived fully formed. The earliest serious use I could find is a July 4, 2026 post by Josh Simmons, “We Are Entering the Graph Engineering Phase,” which named the shift before almost anyone else was talking about it. It stayed a niche observation for two weeks. Then, on July 18, Peter Steinberger — one of the same voices who helped popularize loop engineering — tweeted something close to “are we still talking loops or did we shift to graphs yet?” and it took off, racking up millions of views within days.</p><p>I want to flag something most of the recap posts skip: by several accounts, that tweet was at least partly a joke — a dig at an industry that mints a new “X engineering” term every few weeks, not a considered technical claim. Hamel Husain’s reply to the whole thing was, reportedly, a single “Stop it” GIF. That’s worth remembering before you put “graph engineering” on a slide with a straight face.</p><p>Here’s the thing, though: the joke pointed at something real. Two things happened after it that turned “graph engineering” from a tweet into an actual discipline.</p><p>First, LangChain — who arguably has the strongest claim to prior art here, given LangGraph has existed since 2023 — published a response on July 22 arguing the term isn’t new, it’s just the latest label for what LangGraph has done from the start: build the explicit graph structures that route work between agents, tools, and humans. Their point is fair. It’s also the same thing people said about loop engineering when it showed up (“isn’t this just a while-loop with extra steps?”), and it didn’t stop that term from becoming useful shorthand.</p><p>Second, an arXiv survey — “Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence,” submitted August 21 and revised August 26 — gave the term an actual definition with some rigor behind it. Their framing is the cleanest I’ve seen: prompt, context, harness, and loop engineering all optimize <em>individual</em> agent behavior. Graph engineering is the first layer that optimizes the <em>system</em> — explicit, dynamic structures representing tasks, agents, and state, evolving as the graph runs.</p><p>So: born as a half-joke on July 4, viral as a real joke on July 18, contested as marketing on July 22, formalized as a research topic by August 26. Less than two months, start to finish. I’m writing about it anyway, because underneath the naming churn is a genuine engineering problem I ran into myself the week after my loop engineering post went out.</p><hr><h2 id="Where-This-Sits-Next-to-Loop-Engineering"><a href="#Where-This-Sits-Next-to-Loop-Engineering" class="headerlink" title="Where This Sits Next to Loop Engineering"></a>Where This Sits Next to Loop Engineering</h2><p>Extending the ladder from the last few posts:</p><ul><li><strong>Context engineering</strong> answers: <em>what do I put in front of the model right now?</em></li><li><strong>Harness engineering</strong> answers: <em>how does the model act on that — which tools, how is one step validated and executed?</em></li><li><strong>Loop engineering</strong> answers: <em>what happens after that step — do we go again, and for how long?</em></li><li><strong>Graph engineering</strong> answers: <em>which agent does this next, what are they allowed to see, and who do they hand off to?</em></li></ul><p>A loop governs one agent’s campaign toward one goal. A graph governs the org chart those campaigns live inside. You can have four excellent loops — each with a tight verifier and sane stop rules — wired together so badly that the fix-it loop and the review-it loop are the same underlying agent talking to itself, which is exactly the “model grading its own homework” failure I warned about last time, just moved up a level.</p><hr><h2 id="The-Three-Things-Every-Graph-Needs"><a href="#The-Three-Things-Every-Graph-Needs" class="headerlink" title="The Three Things Every Graph Needs"></a>The Three Things Every Graph Needs</h2><p>Strip away the framework-specific vocabulary (nodes, edges, state — LangGraph’s terms, but the shape is universal) and every working multi-agent graph decomposes into three parts.</p><h3 id="1-Nodes-—-the-specialized-workers"><a href="#1-Nodes-—-the-specialized-workers" class="headerlink" title="1. Nodes — the specialized workers"></a>1. Nodes — the specialized workers</h3><p>Not every node has to be an LLM call. A node can be an agent (with its own loop, its own harness), a deterministic function (a linter, a test runner, a formatter), a router that decides where to send work next, or a human checkpoint. Treating “call a person for approval” as just another node type, rather than a special case bolted on afterward, is what makes a graph actually safe to run unattended for the parts that should run unattended.</p><h3 id="2-Edges-—-who’s-allowed-to-talk-to-whom"><a href="#2-Edges-—-who’s-allowed-to-talk-to-whom" class="headerlink" title="2. Edges — who’s allowed to talk to whom"></a>2. Edges — who’s allowed to talk to whom</h3><p>An edge is a permitted transition, not a suggestion. If your bug-fixing agent can silently hand its own output straight to a “mark as resolved” node with no review edge in between, you don’t have a review process — you have a rubber stamp with extra latency. Edges are where you encode the org chart: who reports to whom, what needs a second opinion, what’s allowed to happen without one.</p><h3 id="3-Shared-state-—-what-travels-along-the-graph"><a href="#3-Shared-state-—-what-travels-along-the-graph" class="headerlink" title="3. Shared state — what travels along the graph"></a>3. Shared state — what travels along the graph</h3><p>This is the part that’s easy to get wrong in a way that doesn’t show up until week three. If every node keeps its own private context and only passes along a one-line summary, the graph slowly develops the multi-agent version of a game of telephone — the reviewer agent approving something the writer agent never actually did, because the summary it received didn’t say what really happened. Shared state needs to be explicit about what’s authoritative (the actual diff, the actual test output) versus what’s a convenience summary for a node that doesn’t need the full detail.</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass, field<span class="hljs-keyword">from</span> enum <span class="hljs-keyword">import</span> Enum<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Callable</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">NodeType</span>(<span class="hljs-title class_ inherited__">Enum</span>):    AGENT = <span class="hljs-string">&quot;agent&quot;</span>          <span class="hljs-comment"># LLM-backed, has its own loop</span>    FUNCTION = <span class="hljs-string">&quot;function&quot;</span>    <span class="hljs-comment"># deterministic — linter, test runner, formatter</span>    ROUTER = <span class="hljs-string">&quot;router&quot;</span>        <span class="hljs-comment"># decides which edge to take next</span>    HUMAN = <span class="hljs-string">&quot;human&quot;</span>          <span class="hljs-comment"># a checkpoint that pauses for a person</span><span class="hljs-meta">@dataclass</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">GraphNode</span>:    name: <span class="hljs-built_in">str</span>    node_type: NodeType    handler: <span class="hljs-type">Callable</span>         <span class="hljs-comment"># what actually runs</span>    allowed_next: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>]   <span class="hljs-comment"># the edges — who this node is permitted to hand off to</span><span class="hljs-meta">@dataclass</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">GraphState</span>:    task_id: <span class="hljs-built_in">str</span>    authoritative: <span class="hljs-built_in">dict</span> = field(default_factory=<span class="hljs-built_in">dict</span>)  <span class="hljs-comment"># the real artifacts: diffs, test results</span>    summaries: <span class="hljs-built_in">dict</span> = field(default_factory=<span class="hljs-built_in">dict</span>)       <span class="hljs-comment"># convenience context for nodes that don&#x27;t need it all</span>    history: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>] = field(default_factory=<span class="hljs-built_in">list</span>)    <span class="hljs-comment"># which nodes have run, in order</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">AgentGraph</span>:    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, nodes: <span class="hljs-built_in">dict</span>[<span class="hljs-built_in">str</span>, GraphNode], entry: <span class="hljs-built_in">str</span></span>):        <span class="hljs-variable language_">self</span>.nodes = nodes        <span class="hljs-variable language_">self</span>.entry = entry    <span class="hljs-keyword">def</span> <span class="hljs-title function_">run</span>(<span class="hljs-params">self, state: GraphState</span>) -&gt; GraphState:        current = <span class="hljs-variable language_">self</span>.entry        <span class="hljs-keyword">while</span> current <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:            node = <span class="hljs-variable language_">self</span>.nodes[current]            state = node.handler(state)          <span class="hljs-comment"># each handler owns its own loop internally</span>            state.history.append(current)            next_node = <span class="hljs-variable language_">self</span>._route(node, state)            <span class="hljs-keyword">if</span> next_node <span class="hljs-keyword">and</span> next_node <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> node.allowed_next:                <span class="hljs-comment"># the edge doesn&#x27;t exist — fail loud, don&#x27;t silently reroute</span>                <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">f&quot;<span class="hljs-subst">&#123;current&#125;</span> tried to hand off to <span class="hljs-subst">&#123;next_node&#125;</span>, but that edge isn&#x27;t defined&quot;</span>)            current = next_node        <span class="hljs-keyword">return</span> state    <span class="hljs-keyword">def</span> <span class="hljs-title function_">_route</span>(<span class="hljs-params">self, node: GraphNode, state: GraphState</span>) -&gt; <span class="hljs-built_in">str</span> | <span class="hljs-literal">None</span>:        <span class="hljs-comment"># a router node decides dynamically; other nodes usually have one fixed next step</span>        <span class="hljs-keyword">if</span> node.node_type == NodeType.ROUTER:            <span class="hljs-keyword">return</span> node.handler.decide(state)        <span class="hljs-keyword">return</span> node.allowed_next[<span class="hljs-number">0</span>] <span class="hljs-keyword">if</span> node.allowed_next <span class="hljs-keyword">else</span> <span class="hljs-literal">None</span></code></pre><p>Notice what this doesn’t do: it doesn’t decide <em>how</em> the fix-it agent fixes the bug, or when it’s allowed to stop retrying. That’s still loop engineering’s job, running inside the <code>AGENT</code> node’s handler. The graph only decides where the output of that loop is allowed to go next. Same relationship as last post’s harness-inside-loop diagram, one level up.</p><hr><h2 id="Where-Graph-Engineering-Goes-Wrong"><a href="#Where-Graph-Engineering-Goes-Wrong" class="headerlink" title="Where Graph Engineering Goes Wrong"></a>Where Graph Engineering Goes Wrong</h2><table><thead><tr><th>Symptom</th><th>Usually caused by</th></tr></thead><tbody><tr><td>The reviewer always approves</td><td>The “review” node is the same agent that wrote the code, just called again — no independent edge, no independent context</td></tr><tr><td>Work silently vanishes</td><td>A node fails and there’s no edge defined for the failure case, so the graph just stops with no record of why</td></tr><tr><td>Everyone re-derives the same context</td><td>Shared state has no authoritative source, so every node reconstructs its own version from scratch, and they drift apart</td></tr><tr><td>A human checkpoint gets skipped under load</td><td>The human node is treated as optional latency to route around instead of a real edge in the graph</td></tr><tr><td>The graph works in the demo, falls apart in production</td><td>It was designed top-down as an org chart before a single node’s loop was proven reliable on its own</td></tr></tbody></table><p>That last row is the one I’d flag hardest, because it’s the same lesson from the loop engineering post, just recurring one layer up: don’t reach for a five-node graph with routers and sub-routers before you’ve proven that two nodes handing off to each other actually works. A graph amplifies whatever’s inside its nodes — a node with a weak loop doesn’t get more reliable by being connected to three other nodes, it just gets more expensive to route around when it fails.</p><hr><h2 id="They-Nest-They-Don’t-Compete"><a href="#They-Nest-They-Don’t-Compete" class="headerlink" title="They Nest, They Don’t Compete"></a>They Nest, They Don’t Compete</h2><p>A loop without a graph is a single agent that can run itself to completion, alone — useful, but everything has to go through that one agent, including work it isn’t actually well-suited for. A graph without solid loops inside its nodes is just an org chart connecting agents that individually don’t know when to stop — you’ve structured the chaos without reducing it.</p><p>The boundary is the same shape as the loop-and-harness boundary from last time: a loop’s stop rules govern one agent’s campaign; a graph’s edges govern which campaign runs next and who’s allowed to see the result. Neither replaces context or harness engineering underneath it — a node with bad context or a leaky harness is still a bad node, no matter how well-designed the graph around it is.</p><hr><h2 id="What-to-Build-Next"><a href="#What-to-Build-Next" class="headerlink" title="What to Build Next"></a>What to Build Next</h2><p>If you’ve got more than one agent in production, or you’re about to:</p><p><strong>Short term (this sprint):</strong></p><ul><li><input disabled="" type="checkbox"> Draw your current setup as an actual graph — nodes and edges — even if it’s informal today; you’ll usually find an edge you didn’t know existed</li><li><input disabled="" type="checkbox"> Check whether any “review” node is secretly the same agent as the node it’s reviewing</li><li><input disabled="" type="checkbox"> Decide what’s authoritative state versus convenience summary, and stop letting nodes silently drift on the latter</li></ul><p><strong>Medium term (next month):</strong></p><ul><li><input disabled="" type="checkbox"> Make failure an explicit edge, not an undefined case that just halts the graph</li><li><input disabled="" type="checkbox"> Turn human approval steps into real graph nodes with defined edges in and out, not a side-channel Slack message</li><li><input disabled="" type="checkbox"> Log the path each run actually took through the graph, not just the final output — you’ll need it the first time someone asks “why did it do that”</li></ul><p><strong>Longer term:</strong></p><ul><li><input disabled="" type="checkbox"> Build reusable node types for your team’s recurring roles (a review node, a deploy-gate node) the way you’d build a shared loop library</li><li><input disabled="" type="checkbox"> Track which edges get used versus which ones exist for a case that’s never happened, and prune accordingly</li><li><input disabled="" type="checkbox"> Revisit this in a few months — “graph engineering” may not be the name that sticks, but the underlying problem of governing multi-agent topology isn’t going away</li></ul><hr><h2 id="Closing-Thought"><a href="#Closing-Thought" class="headerlink" title="Closing Thought"></a>Closing Thought</h2><p>Loop engineering was about deciding, without you in the room, whether one agent’s next step actually moved the task forward. Graph engineering is about deciding, without you in the room, which agent gets the next step at all — and who’s allowed to check its work.</p><p>I’ll be honest about where this term stands: it hasn’t “won” the way loop engineering did. It was arguably half a joke to start with, and serious people I respect think it’s mostly a new label on ideas LangGraph has shipped for three years. I think both things can be true at once — the name is contested, and the problem it’s pointing at is real. The engineering teams that build genuinely trustworthy multi-agent systems won’t be the ones with the cleverest single loop. They’ll be the ones who can draw their agents’ org chart on a whiteboard and explain, edge by edge, why each connection exists.</p><p>Till next time, Happy Coding!</p><hr><h2 id="References"><a href="#References" class="headerlink" title="References"></a>References</h2><ol><li>Josh Simmons, “We Are Entering the Graph Engineering Phase,” July 4, 2026.</li><li>Peter Steinberger, viral post on the shift from loops to graphs, July 18, 2026 (widely reported as at least partly satirical).</li><li>LangChain (Harrison Chase, Sydney Runkle), <a href="https://www.langchain.com/blog/3-years-of-graph-engineering-with-langgraph">“3 Years of Graph Engineering with LangGraph,”</a> July 22, 2026.</li><li>“Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence,” <a href="https://arxiv.org/abs/2608.21156">arXiv:2608.21156</a>, submitted August 21, 2026, revised August 26, 2026.</li><li>Boris Cherny, “Steps of AI Adoption,” July 17, 2026.</li></ol>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: &lt;em&gt;Loop engineering taught one agent how to keep going without you in the room. Graph engineering is what happens once there’s more than one agent — and someone has to decide who talks to whom, in what order, and who’s allowed to see what.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_graph_engineering_after_loop_engineering.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;In my last  &lt;a href=&quot;/blog/2026/08/23/loop-engineering-teaching-ai-agents-how-to-think/&quot; title=&quot;Loop Engineering: Teaching AI Agents How to Think&quot;&gt;article&lt;/a&gt;, I wrote about loop engineering — the outer cycle that lets an agent run to completion without you steering it turn by turn. Wrap a task in a trigger, a verifiable goal, a real verifier, and stop rules, and you have something that can run unattended for hours instead of minutes.&lt;/p&gt;
&lt;p&gt;That post assumed one agent. One loop, one harness underneath it, one job.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai-engineering, large-language-models, loop-engineering, harness-engineering, ai-agents, agentic-ai, claude, developer-tools, graph-engineering, multi-agent-systems" scheme="http://awongcm.io/tags/ai-engineering-large-language-models-loop-engineering-harness-engineering-ai-agents-agentic-ai-claude-developer-tools-graph-engineering-multi-agent-systems/"/>
    
  </entry>
  
  <entry>
    <title>Loop Engineering: Teaching AI Agents How to Think</title>
    <link href="http://awongcm.io/blog/2026/08/23/loop-engineering-teaching-ai-agents-how-to-think/"/>
    <id>http://awongcm.io/blog/2026/08/23/loop-engineering-teaching-ai-agents-how-to-think/</id>
    <published>2026-08-23T12:00:00.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: <em>You’ve learned to shape what goes into the model. You’ve learned to build the harness that lets it act safely. Now comes the layer that decides when the agent is actually done — and who’s really driving between now and then.</em></p></blockquote><img src="/images/ai_generated_loop_engineering_after_harness_engineering.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>In my last <a href="/blog/2026/07/05/harness-engineering-the-next-layer-every-developer-should-master-after-context-engineering/" title="Harness Engineering: The Next Layer Every Developer Should Master After Context Engineering">article</a>, I wrote about harness engineering — the runtime scaffolding that turns a model into an agent: tool calling, guardrails, state tracking, evaluation. If you’ve built one of those, you already have an agent that can act safely inside a single task.</p><p>But there’s a question harness engineering doesn’t answer: <strong>who decides what the agent tries next, and when it stops trying?</strong></p><span id="more"></span><p>For most of 2025 and early 2026, the honest answer was “you do.” You typed the next instruction, read the output, decided if it was good enough, and typed again. That’s fine for a five-minute task. It falls apart the moment you want an agent to run for three hours, overnight, or on a schedule while you’re asleep.</p><p>That’s the layer this post is about: <strong>loop engineering</strong> — designing the system that prompts, verifies, retries, and stops an agent, so you’re no longer the one doing it turn by turn.</p><hr><h2 id="What-Is-Loop-Engineering"><a href="#What-Is-Loop-Engineering" class="headerlink" title="What Is Loop Engineering?"></a>What Is Loop Engineering?</h2><p>Loop engineering is the discipline of designing the outer cycle that runs an agent to completion — instead of you sitting in the loop, steering every step.</p><p>The framing crystallised in June 2026, when Boris Cherny, who leads Claude Code at Anthropic, put it bluntly: “I don’t prompt Claude anymore. I have loops running that prompt Claude.” Around the same time, Addy Osmani and Peter Steinberger were converging on the same observation from different corners of the AI-coding world — that the real bottleneck had quietly shifted from writing a good prompt to designing the system that decides what to prompt next.</p><p>Here’s the mental model I’ve found most useful: <strong>a loop is a task plus a check.</strong> A task without a check is just hope. If you ask an agent to fix a bug once and eyeball the diff, that’s prompting. If you wrap that same request in a system that runs the fix, runs the tests, feeds any failure back in as fresh context, and repeats until the suite is green or a limit is hit — that’s a loop.</p><p>The intelligence still lives in the model. The reliability now lives in the loop.</p><hr><h2 id="Where-This-Sits-Next-to-Context-and-Harness-Engineering"><a href="#Where-This-Sits-Next-to-Context-and-Harness-Engineering" class="headerlink" title="Where This Sits Next to Context and Harness Engineering"></a>Where This Sits Next to Context and Harness Engineering</h2><p>It’s worth being precise about the boundary, because the three disciplines are easy to blur together.</p><ul><li><strong>Context engineering</strong> answers: <em>what do I put in front of the model right now?</em></li><li><strong>Harness engineering</strong> answers: <em>how does the model act on that — which tools it can call, how a single step is validated and executed?</em></li><li><strong>Loop engineering</strong> answers: <em>what happens after that step — do we go again, and if so, with what, and for how long?</em></li></ul><p>A harness governs one step. A loop governs the campaign. You can have an excellent harness — clean tool validation, solid guardrails, good logging — wrapped in a terrible loop that has no real stopping condition, and the agent will still spin uselessly for hours or quietly declare victory on the wrong thing.</p><hr><h2 id="The-Four-Components-Every-Loop-Needs"><a href="#The-Four-Components-Every-Loop-Needs" class="headerlink" title="The Four Components Every Loop Needs"></a>The Four Components Every Loop Needs</h2><p>Every agent loop, no matter the framework, decomposes into four parts. Miss one and the loop either never starts, never stops, or stops without knowing whether it actually succeeded.</p><h3 id="1-Trigger-—-what-starts-the-cycle"><a href="#1-Trigger-—-what-starts-the-cycle" class="headerlink" title="1. Trigger — what starts the cycle"></a>1. Trigger — what starts the cycle</h3><p>A schedule, an event (a PR opens, a test fails, a ticket lands), or a plain instruction from a person. The trigger is what lets a loop run without you sitting there to press go.</p><h3 id="2-Goal-—-a-verifiable-end-state-not-a-vibe"><a href="#2-Goal-—-a-verifiable-end-state-not-a-vibe" class="headerlink" title="2. Goal — a verifiable end state, not a vibe"></a>2. Goal — a verifiable end state, not a vibe</h3><p>“Make the code better” is not a goal a machine can check. “All tests pass,” “P95 latency under 300ms,” “zero open Sev-1 issues” — those are goals. If you can’t write a check for it, the loop can’t know when it’s done.</p><h3 id="3-Verifier-—-how-the-loop-knows-it’s-done"><a href="#3-Verifier-—-how-the-loop-knows-it’s-done" class="headerlink" title="3. Verifier — how the loop knows it’s done"></a>3. Verifier — how the loop knows it’s done</h3><p>This is the part worth being paranoid about. Prefer a deterministic check — a test suite exit code, a schema validator, a linter — over asking the same model to grade its own output. A model marking its own homework is the one failure mode that quietly poisons every other safeguard you build. When you do need a model as verifier, use a separate agent with different instructions, so the one that wrote the code isn’t also the one that approves it.</p><h3 id="4-Stop-rules-—-multiple-independent-exits"><a href="#4-Stop-rules-—-multiple-independent-exits" class="headerlink" title="4. Stop rules — multiple independent exits"></a>4. Stop rules — multiple independent exits</h3><p>At minimum: a success exit when the verifier confirms the goal, a hard iteration cap so a stuck loop can’t run forever, and a budget cap so a runaway loop can’t burn your token spend overnight. Skipping the iteration and budget caps is how people wake up to a five-figure API bill and an agent that looped for nine hundred rounds on a problem it was never going to solve.</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass<span class="hljs-keyword">from</span> enum <span class="hljs-keyword">import</span> Enum<span class="hljs-keyword">class</span> <span class="hljs-title class_">StopReason</span>(<span class="hljs-title class_ inherited__">Enum</span>):    SUCCESS = <span class="hljs-string">&quot;success&quot;</span>    MAX_ITERATIONS = <span class="hljs-string">&quot;max_iterations&quot;</span>    BUDGET_EXCEEDED = <span class="hljs-string">&quot;budget_exceeded&quot;</span>    NOT_DONE = <span class="hljs-string">&quot;not_done&quot;</span><span class="hljs-meta">@dataclass</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">LoopConfig</span>:    goal_check: <span class="hljs-built_in">callable</span>          <span class="hljs-comment"># deterministic verifier, e.g. run_tests() -&gt; bool</span>    max_iterations: <span class="hljs-built_in">int</span> = <span class="hljs-number">8</span>    max_cost_usd: <span class="hljs-built_in">float</span> = <span class="hljs-number">5.00</span><span class="hljs-keyword">class</span> <span class="hljs-title class_">LoopController</span>:    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config: LoopConfig</span>):        <span class="hljs-variable language_">self</span>.config = config        <span class="hljs-variable language_">self</span>.iteration = <span class="hljs-number">0</span>        <span class="hljs-variable language_">self</span>.spend = <span class="hljs-number">0.0</span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">should_stop</span>(<span class="hljs-params">self, goal_met: <span class="hljs-built_in">bool</span></span>) -&gt; StopReason | <span class="hljs-literal">None</span>:        <span class="hljs-keyword">if</span> goal_met:            <span class="hljs-keyword">return</span> StopReason.SUCCESS        <span class="hljs-keyword">if</span> <span class="hljs-variable language_">self</span>.iteration &gt;= <span class="hljs-variable language_">self</span>.config.max_iterations:            <span class="hljs-keyword">return</span> StopReason.MAX_ITERATIONS        <span class="hljs-keyword">if</span> <span class="hljs-variable language_">self</span>.spend &gt;= <span class="hljs-variable language_">self</span>.config.max_cost_usd:            <span class="hljs-keyword">return</span> StopReason.BUDGET_EXCEEDED        <span class="hljs-keyword">return</span> <span class="hljs-literal">None</span></code></pre><p>Notice this is deliberately small. It doesn’t decide <em>what</em> the agent does next — that’s still the harness’s job. It only decides whether to let the harness run again.</p><hr><h2 id="A-Minimal-Loop-Wrapped-Around-a-Harness"><a href="#A-Minimal-Loop-Wrapped-Around-a-Harness" class="headerlink" title="A Minimal Loop Wrapped Around a Harness"></a>A Minimal Loop Wrapped Around a Harness</h2><p>If you built something like the <code>AgentHarness</code> from the harness engineering post — the piece that validates a tool call, executes it, and tracks state for one step — the loop is the layer that sits one level up and decides whether to call that harness again.</p><pre><code class="hljs python"><span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">run_loop</span>(<span class="hljs-params">task_input: <span class="hljs-built_in">str</span>, context: RequestContext,</span><span class="hljs-params">                    harness: AgentHarness, controller: LoopController</span>) -&gt; LoopResult:    last_result = <span class="hljs-literal">None</span>    <span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:        <span class="hljs-comment"># 1. Act: run one harness pass (gather, act, one tool call, update state)</span>        last_result = <span class="hljs-keyword">await</span> harness.run(task_input, context)        <span class="hljs-comment"># 2. Verify: deterministic check, not the model grading itself</span>        goal_met = controller.config.goal_check(last_result)        <span class="hljs-comment"># 3. Decide: should this loop go again?</span>        reason = controller.should_stop(goal_met)        <span class="hljs-keyword">if</span> reason <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:            <span class="hljs-keyword">return</span> LoopResult(final=last_result, reason=reason,                               iterations=controller.iteration)        <span class="hljs-comment"># 4. Feed the failure back in as fresh context for the next pass</span>        task_input = last_result.build_feedback_prompt()        controller.iteration += <span class="hljs-number">1</span></code></pre><p>The shape is intentionally boring: act, verify, decide, feed back. Everything sophisticated in a mature agent system — worktrees for parallel attempts, sub-agents that verify instead of the writer grading itself, persistent state that survives a restart — is a variation on this same skeleton, not a replacement for it.</p><hr><h2 id="Where-Loops-Go-Wrong"><a href="#Where-Loops-Go-Wrong" class="headerlink" title="Where Loops Go Wrong"></a>Where Loops Go Wrong</h2><p>Most broken loops trace back to a missing or weak version of one of the four components above:</p><table><thead><tr><th>Symptom</th><th>Usually caused by</th></tr></thead><tbody><tr><td>Agent declares victory too early</td><td>Goal is vague, not a real check</td></tr><tr><td>Agent runs forever, making no progress</td><td>No iteration cap, or the verifier never returns true or false cleanly</td></tr><tr><td>Agent “fixes” the same thing repeatedly</td><td>No feedback path — the failure isn’t being fed back into the next attempt</td></tr><tr><td>Surprise five-figure bill</td><td>No budget cap, or the cap wasn’t wired to actually halt execution</td></tr><tr><td>Agent’s own output convinces itself the job is done</td><td>Verifier reaches for a second LLM call before exhausting the deterministic check sitting right there — a test suite, a schema, a linter, a status code</td></tr></tbody></table><p>The deepest failure, though, is subtler than any single row: reaching for a five-agent orchestration with a planner and a vector memory before you’ve proven that one act-verify cycle works at all. A loop amplifies whatever is inside it — a weak verifier doesn’t make the loop safer, it just makes the agent’s mistakes more expensive to repeat. Start with the simplest loop that could possibly work, usually one act, one deterministic check, and only add machinery when a real failure forces it.</p><hr><h2 id="They-Nest-They-Don’t-Compete"><a href="#They-Nest-They-Don’t-Compete" class="headerlink" title="They Nest, They Don’t Compete"></a>They Nest, They Don’t Compete</h2><p>A harness without a loop is an agent that can act once, safely, and then stop — useful, but you’re still the one deciding whether to run it again. A loop without a harness has nothing trustworthy to call on each cycle; it’s just retrying blind. You need both, and the boundary between them is exactly the line between <em>one step</em> and <em>the whole task</em>: the harness’s own loop guard stops a single step from spinning, while the loop’s stop rules stop the entire campaign.</p><hr><h2 id="What-to-Build-Next"><a href="#What-to-Build-Next" class="headerlink" title="What to Build Next"></a>What to Build Next</h2><p>If you have an agent doing real work today, or you’re about to:</p><p><strong>Short term (this sprint):</strong></p><ul><li><input disabled="" type="checkbox"> Write your goal as an executable check, not a sentence — before writing any loop code</li><li><input disabled="" type="checkbox"> Add a hard iteration cap and a budget cap to any agent that currently runs unattended</li><li><input disabled="" type="checkbox"> Confirm your verifier is deterministic; if it’s a second model call, make it a genuinely separate agent from the one doing the work</li></ul><p><strong>Medium term (next month):</strong></p><ul><li><input disabled="" type="checkbox"> Build the feedback path — feed the exact failure back into the next iteration, not just “try again”</li><li><input disabled="" type="checkbox"> Instrument iteration count, stop reason, and cost per run so a stuck loop shows up in a dashboard, not a surprise invoice</li><li><input disabled="" type="checkbox"> Separate “the loop’s persistent state” from the model’s conversation history, so a restarted loop doesn’t start amnesiac</li></ul><p><strong>Longer term:</strong></p><ul><li><input disabled="" type="checkbox"> Build a small library of reusable loops for your team’s recurring tasks, the way you’d build a shared tool registry</li><li><input disabled="" type="checkbox"> Push toward parallel, isolated attempts (separate worktrees or sandboxes) once a single loop is proven trustworthy</li><li><input disabled="" type="checkbox"> Track which verifier caught which class of failure, so you know where to tighten the check rather than add another agent</li></ul><hr><h2 id="Closing-Thought"><a href="#Closing-Thought" class="headerlink" title="Closing Thought"></a>Closing Thought</h2><p>Context engineering is about crafting the right input. Harness engineering is about building the system that governs what the model is allowed to do with it, one step at a time. Loop engineering is about deciding, without you in the room, whether that step actually moved the task forward — and when to call it done.</p><p>The agents that run unattended and don’t embarrass you in production won’t be the ones built on the cleverest single prompt. They’ll be the ones sitting inside a loop with a real goal, a verifier that isn’t grading its own homework, and stop rules that actually fire.</p><p>That loop is the layer that finally lets you stop being the one pressing “go” every single time.</p><p>Till next time, Happy Coding!</p><hr><h2 id="References"><a href="#References" class="headerlink" title="References"></a>References</h2><ol><li>Boris Cherny, quoted in Satvik Paramkusam, <a href="https://www.buildfastwithai.com/blogs/loop-engineering-ai-agents-guide">“Loop Engineering: Complete Guide for AI Agents (2026),”</a> Build Fast with AI, July 14, 2026.</li><li>Addy Osmani, <a href="https://addyosmani.com/blog/loop-engineering/">“Loop Engineering,”</a> addyosmani.com, June 2026.</li><li>Valentina Alto, <a href="https://valentinaalto.medium.com/introducing-loop-engineering-ac7a6098bb10">“Introducing Loop Engineering,”</a> Medium, July 2026.</li><li>Divy Yadav, <a href="https://medium.com/ai-engineering-simplified/loop-engineering-explained-4-ai-agent-loops-every-ai-developer-must-know-in-2026-7e1852392cc2">“Loop Engineering Explained: 4 AI Agent Loops Every AI Developer Must Know in 2026,”</a> AI Engineering Simplified, Medium, June 2026.</li><li>explainx.ai, <a href="https://explainx.ai/blog/what-is-loop-engineering-ai-agents-2026">“What Is Loop Engineering? Beyond Prompt Engineering in 2026,”</a> explainx.ai Blog, July 18, 2026.</li><li>Anthropic, <a href="https://www.anthropic.com/engineering/building-effective-agents">“Building Effective Agents,”</a> Anthropic Engineering.</li><li>Anthropic, <a href="https://docs.claude.com/en/api/agent-sdk/overview">“Claude Agent SDK Overview,”</a> Claude Docs.</li></ol>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: &lt;em&gt;You’ve learned to shape what goes into the model. You’ve learned to build the harness that lets it act safely. Now comes the layer that decides when the agent is actually done — and who’s really driving between now and then.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_loop_engineering_after_harness_engineering.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;In my last &lt;a href=&quot;/blog/2026/07/05/harness-engineering-the-next-layer-every-developer-should-master-after-context-engineering/&quot; title=&quot;Harness Engineering: The Next Layer Every Developer Should Master After Context Engineering&quot;&gt;article&lt;/a&gt;, I wrote about harness engineering — the runtime scaffolding that turns a model into an agent: tool calling, guardrails, state tracking, evaluation. If you’ve built one of those, you already have an agent that can act safely inside a single task.&lt;/p&gt;
&lt;p&gt;But there’s a question harness engineering doesn’t answer: &lt;strong&gt;who decides what the agent tries next, and when it stops trying?&lt;/strong&gt;&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai-engineering, large-language-models, loop-engineering, harness-engineering, ai-agents, agentic-ai, claude, developer-tools" scheme="http://awongcm.io/tags/ai-engineering-large-language-models-loop-engineering-harness-engineering-ai-agents-agentic-ai-claude-developer-tools/"/>
    
  </entry>
  
  <entry>
    <title>My Java Comeback: A Concrete Roadmap Back to Mastery (Not Just Muscle Memory)</title>
    <link href="http://awongcm.io/blog/2026/08/10/my-java-comeback-a-concrete-roadmap-back-to-mastery-not-just-muscle-memory/"/>
    <id>http://awongcm.io/blog/2026/08/10/my-java-comeback-a-concrete-roadmap-back-to-mastery-not-just-muscle-memory/</id>
    <published>2026-08-10T11:02:22.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: I’m restarting my Java journey — but this time with a phased, deliberate roadmap instead of just picking up where I left off. Here’s the plan: seven core disciplines I’m rebuilding from the ground up — syntax and core APIs, design patterns, Spring Boot and microservices, JVM internals and performance tuning, concurrency and parallelism, modern language features, and cloud-native architecture — followed by three phases that turn the learning into something real and provable.</p></blockquote><img src="/images/ai_generated_java_comeback_mastery_comeback.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>My last post <a href="/blog/2026/07/28/write-once-remember-forever-a-quarter-century-late-love-letter-to-java/" title="Write Once, Remember Forever: A Quarter-Century Late Love Letter to Java">here</a> was a tribute to <em>The Java Story</em> documentary — a trip back to my university days and the pioneers who shaped the language I first fell in love with. Writing it did something I didn’t expect: it left me wanting to build in Java again, this time with career capital behind it instead of academic capital.</p><span id="more"></span><p>That pull needed somewhere to go, so I went looking for what “building in Java again” should actually mean in 2026. That’s how I ended up watching Richard Fichtner’s JavaOne 2026 talk, <em>“How to (Re)start Your Java Journey in 2026.”</em> Fichtner is a Java Champion and JUG leader who’s been in the ecosystem for over 20 years, and his session was built for exactly the audience I fall into: not brand new to Java, but returning after a stretch away and needing to modernize the mental model, not just the muscle memory (see Youtube thumbnail below)</p><div class="video-container"><iframe src="https://www.youtube.com/embed/38LLdQtxdhI" frameborder="0" loading="lazy" allowfullscreen></iframe></div><p>That framing landed hard. I’ve spent 20+ years as a polyglot engineer — Java, Python, TypeScript&#x2F;Node, Go, Ruby — and some of my most production-critical work has been in Java microservices in enterprise environments, including designing and building the CI&#x2F;CD pipelines and ETL application for a real-time payments platform rails. But over the last couple of years, my day-to-day gravity shifted toward other stacks. Java didn’t leave my toolkit, but it stopped being where I was pushing hardest.</p><p>So this isn’t a “brush up on syntax” post, and it isn’t nostalgia either — that was the last one. This is the actual roadmap I’m using to turn “I want to build in Java again” into something with a bigger trajectory than before, and I’m publishing it so I can hold myself to it.</p><h2 id="Why-“Restart-”-Not-“Return”"><a href="#Why-“Restart-”-Not-“Return”" class="headerlink" title="Why “Restart,” Not “Return”"></a>Why “Restart,” Not “Return”</h2><p>The instinct when picking a language back up is to assume it’s mostly the same, just with a few new keywords. Java in 2026 doesn’t reward that assumption — LTS releases, language features, frameworks, and runtime behavior have all moved since I was last deep in the language. Treating this as a light refresh would leave real gaps. That’s the gap this roadmap is built to close, discipline by discipline.</p><p>One honest note before the list: I’m working from Fichtner’s session description, not a full transcript, so where I say a topic is “in the talk” I mean it’s named in the official synopsis — build and testing tools, modern frameworks, deployment platforms, performance-tuned runtimes, and cloud-native development are the themes Oracle published going in. Some of what I need is in there. Some of it isn’t, and that’s fine — the talk was the trigger for this roadmap, not the ceiling on it.</p><h2 id="The-Roadmap-Nine-Disciplines-Three-Delivery-Phases"><a href="#The-Roadmap-Nine-Disciplines-Three-Delivery-Phases" class="headerlink" title="The Roadmap: Nine Disciplines, Three Delivery Phases"></a>The Roadmap: Nine Disciplines, Three Delivery Phases</h2><table><thead><tr><th>#</th><th>Discipline</th><th>Target</th><th>Where it comes from</th></tr></thead><tbody><tr><td>1</td><td>Refresh syntax &amp; core APIs</td><td>Collections, streams, generics, exception handling</td><td>Not in the talk’s synopsis — mine to own</td></tr><tr><td>2</td><td>Design patterns: structural &amp; behavioural</td><td>GoF patterns, read through a modern Java lens</td><td>Not in the talk’s synopsis — mine to own</td></tr><tr><td>3</td><td>Spring Boot &amp; microservices</td><td>Idiomatic Spring Boot, service boundaries, observability</td><td>Matches “modern frameworks” in the synopsis</td></tr><tr><td>4</td><td>JVM internals &amp; performance tuning</td><td>Generational ZGC, JFR profiling, heap&#x2F;startup tuning</td><td>Matches “performance-tuned runtimes” in the synopsis</td></tr><tr><td>5</td><td>Concurrency &amp; parallelism</td><td>Virtual threads, structured concurrency, scoped values</td><td>Runtime-adjacent, but not named directly — mine to own</td></tr><tr><td>6</td><td>Modern Java features</td><td>Records, sealed classes, pattern matching for switch</td><td>Not in the talk’s synopsis — mine to own</td></tr><tr><td>7</td><td>Cloud-native development &amp; architecture</td><td>GraalVM native image, containerization, deployment platforms</td><td>Named directly in the synopsis</td></tr><tr><td>8</td><td>AI-native Java</td><td>Spring AI &#x2F; LangChain4j on top of my existing RAG experience</td><td>Named directly in the synopsis</td></tr><tr><td>9</td><td>Capstone project</td><td>A payments-domain project proving disciplines 1–8 together</td><td>Beyond the talk — mine to own</td></tr></tbody></table><p><strong>1 — Refresh syntax &amp; core APIs.</strong> Before anything else, the unglamorous work: collections, streams, generics, exception handling, <code>var</code>, text blocks, current Maven&#x2F;Gradle conventions. The fastest way to slow down every phase after this one is to still be guessing at API names while trying to learn a framework on top of them. Fichtner’s talk doesn’t dwell here — it’s aimed at people navigating the <em>ecosystem</em>, not relearning the <em>language</em> — which is exactly why I’m not skipping it.</p><p><strong>2 — Design patterns: structural &amp; behavioural.</strong> Revisiting the GoF structural patterns (Adapter, Decorator, Facade, Composite, Proxy) and behavioural patterns (Strategy, Observer, Command, Template Method, Visitor) — not as museum pieces, but through what modern Java now does natively. Sealed classes plus exhaustive pattern matching largely replace the classic Visitor pattern. Lambdas collapse most single-method Strategy implementations down to a one-liner. Records simplify a lot of what Builder and Value Object existed to solve. I want both forms cold: the classic shape, because legacy codebases and interview panels still expect it, and the modern equivalent, because that’s what I’ll actually be writing.</p><p><strong>3 — Spring Boot &amp; microservices.</strong> Current idiomatic Spring Boot — configuration, dependency injection conventions, service boundaries, observability via Actuator, structured logging, and distributed tracing — plus Testcontainers-based integration testing so services get tested against real dependencies instead of mocks. This is the closest match to what Fichtner’s synopsis calls “modern frameworks,” even though Spring Boot isn’t named directly.</p><p><strong>4 — JVM internals &amp; performance tuning.</strong> Generational ZGC behaviour, JFR (Java Flight Recorder) profiling, heap and startup tuning, and reading a thread dump or flame graph without guessing. “Performance-tuned runtimes” is called out explicitly in the talk’s synopsis — this is where I expect the talk to actually pay off.</p><p><strong>5 — Concurrency &amp; parallelism.</strong> This is the phase I’m most confident is overdue. Virtual threads, introduced in JDK 21, had a well-known pinning limitation around <code>synchronized</code> blocks that was substantially fixed in JDK 24. Structured Concurrency and Scoped Values — long-running previews since JDK 21 — are now finalized in JDK 25, the current LTS release since September 2025. That means JDK 25 is the first LTS where virtual threads behave the way the original pitch promised, and where I have a real answer to <code>ThreadLocal</code> instead of reaching for it out of habit.</p><p><strong>6 — Modern Java features.</strong> Records, sealed classes, and pattern matching for switch — how they combine to make illegal states genuinely unrepresentable and cut boilerplate that used to need a pattern (see discipline 2) to work around. Not named in the talk’s synopsis, but non-negotiable for writing Java that looks like it was written in 2026 rather than 2016.</p><p><strong>7 — Cloud-native development &amp; architecture.</strong> GraalVM native image compilation, containerization, and deployment platforms — fast startup, low memory footprint, the economics that actually matter for cloud-native Java. This one’s named directly in the talk’s synopsis alongside AI integration and sustainable computing.</p><p><strong>8 — AI-native Java.</strong> Not on the list I was asked to prioritise, but too relevant to drop: bringing my existing RAG and agentic-workflow experience from other stacks into the JVM ecosystem via Spring AI or LangChain4j, rather than learning AI integration and Java at the same time.</p><p><strong>9 — Capstone project.</strong> Theory doesn’t survive contact with a real system. My capstone is a payments-domain simulation — leaning into the same problem space as my earlier production work — built using disciplines 1 through 8 together: virtual threads under load, structured concurrency for orchestrating downstream calls, and an AI-assisted layer for anomaly triage.</p><h2 id="Do’s-and-Don’ts-for-a-Deliberate-Restart"><a href="#Do’s-and-Don’ts-for-a-Deliberate-Restart" class="headerlink" title="Do’s and Don’ts for a Deliberate Restart"></a>Do’s and Don’ts for a Deliberate Restart</h2><p><strong>Do:</strong></p><ul><li><strong>Sequence deliberately</strong> — syntax and patterns before frameworks, runtime model before architecture. Each discipline assumes the one before it.</li><li><strong>Build something with real constraints</strong> — a toy CRUD app won’t surface the problems a capstone project will.</li><li><strong>Timebox each discipline</strong> — an open-ended “get back into Java” goal never finishes.</li></ul><p><strong>Don’t:</strong></p><ul><li><strong>Don’t assume your old Java is current Java</strong> — patterns and habits that were best practice five years ago (heavy <code>ThreadLocal</code> use, manual thread-pool tuning, GoF patterns applied where a record now does the job) have modern replacements.</li><li><strong>Don’t let the talk’s agenda define your whole plan</strong> — mine covers three disciplines a conference session was never going to include.</li><li><strong>Don’t treat AI integration as a bolt-on</strong> — if it’s part of your target architecture, design for it from discipline 3 onward, not as an afterthought at the capstone.</li></ul><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>Watching one conference talk isn’t what’s driving this — it’s the prompt that made me turn “I should get back into Java” into an actual plan with phases and a capstone at the end of it. Java in 2026 is a genuinely different platform from the one I left several years ago, and treating this as a real restart rather than a refresh is the only way the trajectory ends up bigger than before.</p><p><strong>Next steps for me:</strong></p><ol><li>Work through disciplines 1 and 2 — syntax&#x2F;core APIs and design patterns — and ship a short code sample from each to my pet project Java repo hosted on GitHub</li><li>Get a Spring Boot service running against Testcontainers, then a GraalVM native image build on top of it</li><li>Post a follow-up once I can turn my pet project into the capstone project and have a working first slice</li></ol><p>If you’re a senior engineer sitting on your own “I should get back into X” list, I’d genuinely like to hear how you’re structuring it — drop a comment or reach out.</p><p>Till next time, Happy Coding!</p><p><strong>PS</strong>: This post is also applicable for junior developers who are looking in to starting their career or interested in Java, but don’t know where to start. So please feel free to encourage yourself to start your Java journey by following this roadmap, if you’re reading this! </p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: I’m restarting my Java journey — but this time with a phased, deliberate roadmap instead of just picking up where I left off. Here’s the plan: seven core disciplines I’m rebuilding from the ground up — syntax and core APIs, design patterns, Spring Boot and microservices, JVM internals and performance tuning, concurrency and parallelism, modern language features, and cloud-native architecture — followed by three phases that turn the learning into something real and provable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_java_comeback_mastery_comeback.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;My last post &lt;a href=&quot;/blog/2026/07/28/write-once-remember-forever-a-quarter-century-late-love-letter-to-java/&quot; title=&quot;Write Once, Remember Forever: A Quarter-Century Late Love Letter to Java&quot;&gt;here&lt;/a&gt; was a tribute to &lt;em&gt;The Java Story&lt;/em&gt; documentary — a trip back to my university days and the pioneers who shaped the language I first fell in love with. Writing it did something I didn’t expect: it left me wanting to build in Java again, this time with career capital behind it instead of academic capital.&lt;/p&gt;</summary>
    
    
    
    
    <category term="java, springboot, jvm, software-engineering, tech-careers, career-growth" scheme="http://awongcm.io/tags/java-springboot-jvm-software-engineering-tech-careers-career-growth/"/>
    
  </entry>
  
  <entry>
    <title>From No-Code to Native: What Rebuilding My Expense Tracker Taught Me About AI-Assisted Skill Acquisition</title>
    <link href="http://awongcm.io/blog/2026/08/05/from-no-code-to-native-what-rebuilding-my-expense-tracker-taught-me-about-ai-assisted-skill-acquisition/"/>
    <id>http://awongcm.io/blog/2026/08/05/from-no-code-to-native-what-rebuilding-my-expense-tracker-taught-me-about-ai-assisted-skill-acquisition/</id>
    <published>2026-08-05T23:00:00.000Z</published>
    <updated>2026-11-15T01:30:57.672Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: With the right AI-assisted workflow, an experienced full-stack engineer can pick up a completely unfamiliar tech domain — for me, that was React Native&#x2F;Expo mobile development — and ship a working, polished product. The tooling didn’t do the work for me, but it collapsed the learning curve enough that domain expertise stopped being a gatekeeper.</p></blockquote><img src="/images/ai_generated_no_code_to_native_ai_skill_acquisition.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>A few months now, I’ve been working on my personal finance tracker lived inside Glide — a no-code app builder that got me from idea to “something I could use” for my own needs. It did its job. But every time I wanted a slightly different chart, a different navigation pattern, or just a UI that didn’t feel like a template, I hit a wall. Glide is great for speed; it is not great for control.</p><p>I’ve been using Glide mobile app for several years keeping track of my expenses and I thought it does pretty good job. A simple mobile app that I ‘built’ without actual mobile development experience. Until its major constraints starting to surface which irked my mobile experience when Glide decided to make unannounced changes to its UI template - <em>without my consent</em> 💢🚫🤬. I’ve been meaning to move away from Glide app platform since then. I really want to own the entire mobile development process by myself.</p><p>With AI - it handed me that opportunity.</p><span id="more"></span><p>So I did something I hadn’t done in twenty-plus years of shipping software: I built a mobile app from scratch. Not a prototype, not a toy — a real Expo&#x2F;React Native app, backed by Supabase, now handling hundreds of real transactions across income, expenses, and budgets.</p><p>What made this possible wasn’t that I secretly had mobile dev experience I’d never mentioned. I didn’t. It’s that I paired deliberate, AI-assisted development with the same engineering discipline I’d apply to any unfamiliar backend system, and treated “I don’t know React Native” as a solvable constraint rather than a blocker.</p><p>In this post, I’ll walk through what that migration actually looked like, what the AI-assisted workflow got right, where it didn’t replace judgment, and why I think this pattern generalizes to any engineer facing an unfamiliar stack.</p><p>By the end of this post, you’ll understand:</p><ul><li>Why no-code tools hit a UI&#x2F;UX ceiling that custom development doesn’t</li><li>How I approached learning Expo&#x2F;React Native as a backend-leaning engineer</li><li>Why AI-assisted tooling changes the calculus on “domain-agnostic” engineering</li></ul><h2 id="The-Starting-Point-A-Purple-App-With-a-Ceiling"><a href="#The-Starting-Point-A-Purple-App-With-a-Ceiling" class="headerlink" title="The Starting Point: A Purple App With a Ceiling"></a>The Starting Point: A Purple App With a Ceiling</h2><p>The original version of my expense tracker was built in Glide — a perfectly functional purple-themed app with tabs for Home, Expenses, Category tabs only. It tracked hundreds of transactions, showed year-over-year spending trends, and let me log expenses and categories of expenses on the go.</p><p>The problem wasn’t functionality. It was flexibility. Glide’s component library is fixed. Want a custom chart interaction, a different card layout, or a navigation flow that doesn’t fit the template? You’re stuck. Every UI decision was really Glide’s decision, not mine. As someone who spent two decades caring about clean architecture and maintainable systems, handing that control to a no-code layer started to itch.</p><div style="display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:24px 0;">  <figure style="margin:0;">    <img src="/images/glide-01-add-expense.png" alt="Glide app: add expense form" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Add expense — fixed form layout, no custom validation states</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/glide-02-categories.png" alt="Glide app: categories grid" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Categories — stock photo tiles, not editable beyond Glide's grid component</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/glide-03-expenses-list.png" alt="Glide app: expenses list" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Expenses list — functional, but every row shares the same template</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/glide-04-home-budgets.png" alt="Glide app: home budgets overview" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Home — monthly budget summary, plain text-first layout</figcaption>  </figure></div><p><em>The original Glide build: fast to ship, but every screen shares the same rigid template — no custom charts, no bespoke navigation, no brand identity beyond a colour swap.</em></p><h2 id="Reframing-the-Problem-Domain-Gap-Not-Skill-Ceiling"><a href="#Reframing-the-Problem-Domain-Gap-Not-Skill-Ceiling" class="headerlink" title="Reframing the Problem: Domain Gap, Not Skill Ceiling"></a>Reframing the Problem: Domain Gap, Not Skill Ceiling</h2><p>Here’s the mental shift that mattered most: I stopped treating “I’ve never built a mobile app” as a statement about my ceiling and started treating it as a statement about my current context window.</p><p>I already knew the shape of the problem — monorepo structure, data modeling, state management, API design, TypeScript. What I didn’t know was Expo’s conventions, React Native’s component model, and the mobile-specific gotchas (navigation stacks, platform-specific styling, native module quirks). That’s a narrower gap than “learn mobile development from zero,” and it’s exactly the kind of gap AI-assisted tooling such as Cursor or Claude or similar is good at closing quickly — not by writing the app for me, but by acting as a fast, contextual reference for a stack I hadn’t internalized yet. (<strong>PS</strong>: I lied about just being backend-learning engineer. I was doing front-end developer early part in my career before pivoting away from it. So I got good head start with that fundamentals in the beginning already!)</p><p><strong>Key points:</strong></p><ul><li>The underlying engineering skills (data modeling, API design, testing discipline) transferred directly</li><li>The unfamiliar surface area was narrower than it looked — mostly framework conventions, not new fundamentals</li><li>AI tooling is most valuable exactly at that boundary: translating known concepts into unfamiliar syntax and idioms</li></ul><h3 id="Common-Pitfalls-to-Avoid"><a href="#Common-Pitfalls-to-Avoid" class="headerlink" title="Common Pitfalls to Avoid"></a>Common Pitfalls to Avoid</h3><ol><li><p><strong>Treating AI output as done rather than draft</strong></p><ul><li>What happens: You accept generated navigation or state logic without understanding why it works</li><li>Why it’s problematic: You end up with a codebase you can’t debug when it breaks</li><li>Better approach: Ask the tool to explain the Expo Router or state pattern it just used before moving on — treat it like reading a colleague’s PR, not copying an answer key</li></ul></li><li><p><strong>Skipping the data-layer groundwork</strong></p><ul><li>What happens: Screens end up talking to Supabase directly, with query logic and types scattered across components</li><li>Why it’s problematic: Every schema change turns into a hunt-and-fix across the codebase instead of a single, contained update</li><li>Better approach: Define your types and API client as a dedicated layer from day one, so screens only ever consume it — never talk to Supabase directly</li></ul></li></ol><h2 id="The-Rebuild-Expo-and-Supabase"><a href="#The-Rebuild-Expo-and-Supabase" class="headerlink" title="The Rebuild: Expo and Supabase"></a>The Rebuild: Expo and Supabase</h2><p>The new architecture is an Expo&#x2F;React Native app sitting on top of Supabase for auth, database, and storage. This is a genuinely different shape of system than the banking platform and API work I’ve spent most of my career on, and that was the point.</p><p>Here’s roughly what the structure looks like conceptually:</p><pre><code class="hljs plaintext">expense-savings-tracker-mobile/├── app/                  # Expo Router screens (Home, Expenses, Wallet, Statistics, Profile)├── components/           # Reusable UI — cards, list rows, charts├── lib/│   ├── types.ts          # TypeScript types matching the Supabase schema│   └── api-client.ts     # Supabase client + query logic└── supabase/    └── schema.sql        # Source of truth for the data model</code></pre><p>This example demonstrates the core idea by keeping the data layer separate from the UI: every screen consumes <code>lib/api-client.ts</code> rather than talking to Supabase directly, so a schema change only needs to be reflected in one place. Notice how the <code>app/</code> and <code>components/</code> folders only contain rendering logic — everything else is a clean, typed interface underneath.</p><div style="display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:24px 0;">  <figure style="margin:0;">    <img src="/images/expo-01-home-budgets.png" alt="Expo app: home budgets overview" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Home — custom gradient header, card-based monthly budget summary</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/expo-02-expenses-list.png" alt="Expo app: expenses list" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Expenses — custom list rows, category icons, pagination control</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/expo-03-wallet.png" alt="Expo app: wallet income view" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Wallet — new income/goals view that didn't exist in the Glide version</figcaption>  </figure>  <figure style="margin:0;">    <img src="/images/expo-04-statistics.png" alt="Expo app: statistics chart" style="width:100%;border-radius:8px;" />    <figcaption style="font-size:0.85em;color:#666;margin-top:4px;">Statistics — custom charting with configurable time ranges (Day/Week/Month/Year)</figcaption>  </figure></div><p><em>The rebuilt Expo&#x2F;React Native app: same underlying data, fully custom UI, and entirely new views (like Wallet) that the no-code template couldn’t accommodate.</em></p><h2 id="Best-Practices-and-Recommendations"><a href="#Best-Practices-and-Recommendations" class="headerlink" title="Best Practices and Recommendations"></a>Best Practices and Recommendations</h2><h3 id="Do’s-✅"><a href="#Do’s-✅" class="headerlink" title="Do’s ✅"></a>Do’s ✅</h3><ul><li><strong>Do build the data layer first</strong>: Your types and Supabase queries are the part that doesn’t care what screen ends up rendering them</li><li><strong>Do ask the AI tool to explain, not just generate</strong>: For genuine skill transfer instead of copy-paste debt</li><li><strong>Do keep your existing engineering discipline intact</strong>: Code review habits, type safety, and testing don’t change just because the framework is new</li></ul><h3 id="Don’ts-❌"><a href="#Don’ts-❌" class="headerlink" title="Don’ts ❌"></a>Don’ts ❌</h3><ul><li><strong>Avoid skipping the “why” behind framework conventions</strong>: It leads to a codebase you can extend only by asking the AI tool again, every time</li><li><strong>Don’t assume feature parity means architectural parity</strong>: Mobile navigation, gestures, and platform quirks are a real domain, not a skin</li><li><strong>Never treat the no-code migration as “done” the day it compiles</strong>: Real validation is weeks of daily use with real transactions</li></ul><h2 id="Troubleshooting-Guide"><a href="#Troubleshooting-Guide" class="headerlink" title="Troubleshooting Guide"></a>Troubleshooting Guide</h2><table><thead><tr><th>Problem</th><th>Cause</th><th>Solution</th></tr></thead><tbody><tr><td>Types drift between screens</td><td>Components querying Supabase directly instead of through a shared client</td><td>Centralize types and queries in one <code>lib/api-client.ts</code> and import everywhere</td></tr><tr><td>Navigation feels unfamiliar coming from web routing</td><td>Different mental model (stack&#x2F;tab navigators vs URL routes)</td><td>Spend focused time on Expo Router’s file-based routing before building screens</td></tr><tr><td>AI-generated code “works” but you can’t explain it</td><td>Accepting output without a review pass</td><td>Ask for a walkthrough of the generated code before integrating it</td></tr></tbody></table><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>The purple Glide app got me started. The green Expo app is the one I actually own — architecturally, visually, and in terms of what it can become next. What changed in between wasn’t a sudden burst of mobile development talent; it was a deliberate, AI-assisted approach to closing a specific, well-scoped knowledge gap using engineering fundamentals I already had.</p><p>That’s the bigger takeaway for anyone who’s spent years specializing in one part of the stack: the boundary between “backend engineer” and “full-stack, technology-agnostic engineer” is a lot more permeable now than it used to be. The fundamentals still have to be there. But with the right AI-assisted workflow, the unfamiliar surface of a new domain stops being the thing that keeps you out of it.</p><p><strong>Your next steps:</strong></p><ol><li>Pick one project where a no-code or off-the-shelf tool is capping what you can build</li><li>Scope the actual unfamiliar surface area — it’s usually smaller than “learn X from scratch”</li><li>Use an AI-assisted workflow to close that gap deliberately, explaining as you go rather than accepting output blindly</li></ol><p>With that, the whole world of unknown software engineering domains to explore becomes limitless at your disposal!</p><p>For my next exciting pet project coming out from all this, I’m thinking of designing and building my personal finance dashboard that monitors the personal financial well-being overall. So stay tuned.</p><p>Till next time, Happy Coding!</p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: With the right AI-assisted workflow, an experienced full-stack engineer can pick up a completely unfamiliar tech domain — for me, that was React Native&amp;#x2F;Expo mobile development — and ship a working, polished product. The tooling didn’t do the work for me, but it collapsed the learning curve enough that domain expertise stopped being a gatekeeper.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_no_code_to_native_ai_skill_acquisition.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;A few months now, I’ve been working on my personal finance tracker lived inside Glide — a no-code app builder that got me from idea to “something I could use” for my own needs. It did its job. But every time I wanted a slightly different chart, a different navigation pattern, or just a UI that didn’t feel like a template, I hit a wall. Glide is great for speed; it is not great for control.&lt;/p&gt;
&lt;p&gt;I’ve been using Glide mobile app for several years keeping track of my expenses and I thought it does pretty good job. A simple mobile app that I ‘built’ without actual mobile development experience. Until its major constraints starting to surface which irked my mobile experience when Glide decided to make unannounced changes to its UI template - &lt;em&gt;without my consent&lt;/em&gt; 💢🚫🤬. I’ve been meaning to move away from Glide app platform since then. I really want to own the entire mobile development process by myself.&lt;/p&gt;
&lt;p&gt;With AI - it handed me that opportunity.&lt;/p&gt;</summary>
    
    
    
    
    <category term="react-native, expo, ai-assisted-development, supabase, career-growth" scheme="http://awongcm.io/tags/react-native-expo-ai-assisted-development-supabase-career-growth/"/>
    
  </entry>
  
  <entry>
    <title>Write Once, Remember Forever: A Quarter-Century Late Love Letter to Java</title>
    <link href="http://awongcm.io/blog/2026/07/28/write-once-remember-forever-a-quarter-century-late-love-letter-to-java/"/>
    <id>http://awongcm.io/blog/2026/07/28/write-once-remember-forever-a-quarter-century-late-love-letter-to-java/</id>
    <published>2026-07-28T12:30:00.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: A documentary reminded me that Java was the first language that made programming feel like magic — and twenty-five years later, I finally sat down to say thank you.</p></blockquote><img src="/images/ai_generated_write_once_love_letter_java.png" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>A few of my old Java engineering community contacts shared the same link this week: <em>The Java Story</em>, the official documentary tracing thirty-plus years of the language from a secret set-top-box project called “Oak” to the backbone of enterprise computing as we know it today. I didn’t expect it to hit me the way it did. I watched it the way you watch an old family video — a lump in the throat you weren’t prepared for, at footage of people you never met but somehow still feel like you grew up alongside.</p><p>Because I was there too, in my own small way. Not in the room at Sun Microsystems, obviously. But in a university computer lab, almost a quarter of a century ago, when Java had just landed in the curriculum and none of us really understood what we were holding. I remember the hum of the CRT monitors, the smell of instant coffee, the quiet thrill of a program finally compiling after an hour of chasing a missing semicolon. That memory has stayed with me longer than most things from that era of my life have any right to.</p><p>This post isn’t a tutorial. There’s no code to run, no gotchas to debug. It’s a love letter — to the language that made computer science feel like wonder before it ever became my career, and to the pioneers who are still, three decades on, quietly carrying it forward.</p><span id="more"></span><h2 id="The-Language-That-Made-CS-Fun"><a href="#The-Language-That-Made-CS-Fun" class="headerlink" title="The Language That Made CS Fun"></a>The Language That Made CS Fun</h2><p>I still remember the exact moment <code>public static void main(String[] args)</code> finally made sense to me — that small, private “oh” of understanding that every engineer chases for the rest of their career and rarely feels as purely as they did the first time. It wasn’t the syntax that hooked me. It was the promise underneath it. Write once, run anywhere. As a student, that idea felt almost rebellious: one program, no matter whose machine you ran it on. Against the fragmented, platform-locked world we’d been taught to expect, Java felt like the future had quietly walked into our lecture hall and sat down beside us.</p><p>The documentary does a good job capturing exactly that feeling, straight from the people who built it. Watching James Gosling talk about the language’s origins, or hearing Joshua Bloch explain the thinking behind the Collections Framework, or James Duncan Davidson recount building Tomcat — it took me right back to that lab. These weren’t abstract historical figures to me. They were the reason my textbooks made sense.</p><p>What struck me watching it now, as someone who’s spent twenty-plus years in software engineering, is how much of what I do daily still traces back to decisions made in that era. Every time I’ve reasoned about garbage collection, thread safety, or platform independence, I’ve been standing on scaffolding those early engineers built when the industry didn’t yet believe it needed it.</p><h2 id="The-Road-Not-Fully-Taken-—-Until-Now"><a href="#The-Road-Not-Fully-Taken-—-Until-Now" class="headerlink" title="The Road Not (Fully) Taken — Until Now"></a>The Road Not (Fully) Taken — Until Now</h2><p>Here’s the part I’ll be honest about: I didn’t stay purely on the Java path. My career took me through New Zealand freelance work, pre-enterprise Java, .NET apps for small companies, and eventually a genuinely polyglot stretch projects in Australia — Node.js, React, Ruby, Python, TypeScript, Go. Java became one instrument in a much bigger orchestra rather than the only one I played, and for a long time I made peace with that as simply how my story went.</p><p>Watching the documentary, though, that peace turned into something more restless — a longing I hadn’t let myself feel in years. There’s a version of this career where I stayed inside the JVM ecosystem the whole way through, rode the “dark ages” of the mid-2010s, and watched Java 8 and lambdas breathe new life into the language from the inside. I’ll never get that exact version of my career back. But sitting with the film, I realised I don’t actually want to mourn that road — I want to walk back onto it, just further down the path than where I left it.</p><p>Because here’s the thing the documentary made me see clearly: the person who first fell in love with Java in that university lab had only academic capital to offer it — enthusiasm, curiosity, and a syllabus. The person writing this post has twenty-plus years of career capital instead: real production systems, real incident reviews, real conversations with the people who actually use what gets built. Going back to writing Java now isn’t nostalgia for its own sake. It’s an invitation to build with the language again, but this time with the weight of everything I’ve learned about how software actually gets built and consumed by the people at the other end of it.</p><h2 id="A-Tribute-to-the-Pioneers"><a href="#A-Tribute-to-the-Pioneers" class="headerlink" title="A Tribute to the Pioneers"></a>A Tribute to the Pioneers</h2><p>The documentary’s real gift is putting faces and voices to decisions I’ve only ever encountered as design patterns and JEPs. Mark Reinhold and Brian Goetz, still actively steering the language’s evolution at Oracle. Rod Johnson and Gavin King, whose work on Spring and Hibernate quietly reshaped how an entire generation of us structure enterprise applications — architecture I still lean on conceptually today, wherever I’m coding. Kim Polese, Java’s first product manager, whose early bets on the language shaped its market trajectory before most of us had even heard of it.</p><p>What I find remarkable, watching it as someone now well into a senior engineering career, is that this isn’t a story about a language that had one good decade and coasted. It’s a story about a community that had every reason to let Java quietly fade during the difficult years — and chose instead to rebuild it, generation after generation, and hand it forward. That’s a harder thing to sustain than a clever initial design. It takes stewardship.</p><p>So this is my small, quarter-century-late thank-you note. To the pioneers who made a computer science curriculum feel like an adventure rather than a chore: I hope you have many more years of the success you’ve clearly earned, and I hope the next generation of engineers gets even a fraction of the wonder I felt in that first lab session.</p><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>I sat with this documentary expecting a nice hour of nostalgia. What I didn’t expect was to close my laptop afterward and genuinely want to open an IDE and start writing Java again — not as an academic exercise, but as someone who now has two decades of scar tissue and hard-won judgement to bring back to a language I first met with nothing but wide eyes and a syllabus. That’s the quiet gift of watching your origin story told well: it doesn’t just make you remember who you were. It makes you want to become that person again, on purpose, with everything you’ve since learned.</p><p>So this isn’t a farewell letter after all. It’s closer to a homecoming.</p><p><strong>If you were there too:</strong></p><ol><li>Watch the documentary if you haven’t (see Youtube thumbnail) — it’s worth the hour and change, and worth having tissues nearby.</li><li>Go find your old university Java assignments if you still have them. Mine are cringeworthy and I love them.</li><li>If Java shaped you the way it shaped me, consider this your sign to go build something in it again — not for the syllabus this time, but for everything you’ve learned since.</li></ol><div class="video-container"><iframe src="https://www.youtube.com/embed/ZqGSg4b_cZA" frameborder="0" loading="lazy" allowfullscreen></iframe></div><p>Here’s to the pioneers, and to every engineer who’s still, in some quiet way, finding their way home to the platform that first taught them to fall in love with building things.</p><p>Till next time, Happy Coding! Here’s to being a student for life!</p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: A documentary reminded me that Java was the first language that made programming feel like magic — and twenty-five years later, I finally sat down to say thank you.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_write_once_love_letter_java.png&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;A few of my old Java engineering community contacts shared the same link this week: &lt;em&gt;The Java Story&lt;/em&gt;, the official documentary tracing thirty-plus years of the language from a secret set-top-box project called “Oak” to the backbone of enterprise computing as we know it today. I didn’t expect it to hit me the way it did. I watched it the way you watch an old family video — a lump in the throat you weren’t prepared for, at footage of people you never met but somehow still feel like you grew up alongside.&lt;/p&gt;
&lt;p&gt;Because I was there too, in my own small way. Not in the room at Sun Microsystems, obviously. But in a university computer lab, almost a quarter of a century ago, when Java had just landed in the curriculum and none of us really understood what we were holding. I remember the hum of the CRT monitors, the smell of instant coffee, the quiet thrill of a program finally compiling after an hour of chasing a missing semicolon. That memory has stayed with me longer than most things from that era of my life have any right to.&lt;/p&gt;
&lt;p&gt;This post isn’t a tutorial. There’s no code to run, no gotchas to debug. It’s a love letter — to the language that made computer science feel like wonder before it ever became my career, and to the pioneers who are still, three decades on, quietly carrying it forward.&lt;/p&gt;</summary>
    
    
    
    
    <category term="java, open-source, programming-language, early-career, uni-graduate" scheme="http://awongcm.io/tags/java-open-source-programming-language-early-career-uni-graduate/"/>
    
  </entry>
  
  <entry>
    <title>The 2026 AI Model Landscape for Developers: A Mid-Year Deep Dive Across Closed and Open Models</title>
    <link href="http://awongcm.io/blog/2026/07/19/the-2026-ai-model-landscape-for-developers-a-mid-year-deep-dive-across-closed-and-open-models/"/>
    <id>http://awongcm.io/blog/2026/07/19/the-2026-ai-model-landscape-for-developers-a-mid-year-deep-dive-across-closed-and-open-models/</id>
    <published>2026-07-19T04:30:00.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p><strong>TL;DR</strong>: Six months ago I published a Copilot-specific model guide. Almost every name on it has since been superseded. This mid-year update widens the lens beyond GitHub Copilot to every environment — Cursor, Codex, Windsurf&#x2F;Devin, Claude Code, or a raw API — and gives each current model the same exhaustive <em>best for &#x2F; when to use &#x2F; trade-offs &#x2F; pro tip</em> treatment. It covers the closed-source frontier (Anthropic, OpenAI, Google, xAI) and the open-weight surge (GLM, DeepSeek, Kimi, Qwen, MiniMax, Nemotron, Mistral) that has, this year, become genuinely production-grade.</p></blockquote><img src="/images/ai_generated_2026_mid_year_models_for_developers.png" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>Back in January I wrote a <a href="/blog/2026/01/24/github-copilot-ai-models-a-developer-s-guide-to-choosing-the-right-model/" title="GitHub Copilot AI Models: A Developer&#39;s Guide to Choosing the Right Model">guide</a> to GitHub Copilot’s model picker — GPT-5, the early Claude 4 lineup, Gemini previews, and which to reach for when. That post aged in weeks, which six months on feels like the whole point of writing about this space.</p><p>Since then: Anthropic shipped Sonnet 5 and Opus 4.8, launched a new top tier (Fable 5), and had to pull that top model off the market for three weeks under a US export-control order before restoring it. OpenAI iterated through GPT-5.4, 5.5, and the GPT-5.6 “Sol &#x2F; Terra &#x2F; Luna” family, and merged its Codex and general-purpose stacks into one model. Google shipped Gemini 3.5 Flash but scrapped and rebuilt its next flagship from scratch. xAI turned Grok into a coding-first model co-trained with Cursor. And a cluster of open-weight labs — Z.ai’s GLM, DeepSeek, Moonshot’s Kimi, Alibaba’s Qwen, MiniMax, and NVIDIA’s Nemotron — closed the gap on the frontier to single benchmark digits while running at a fraction of the cost.</p><p>This time the post is not Copilot-specific. If you’re in Cursor, Codex, Windsurf, Claude Code, or straight through an API, the same models and trade-offs apply — only the interface changes. The discipline is the same as January: match the model to the task, not the task to whatever’s newest. There are just a lot more models now.</p><span id="more"></span><p>By the end you’ll understand:</p><ul><li>The current closed-source frontier and where each model earns its keep</li><li>Which open-weight models are now genuinely production-viable, and for what</li><li>A practical routing framework and a scenario-based playbook you can lift into your own team</li></ul><p>A note on benchmarks before we start: I cite a few scores below (SWE-Bench Pro, Terminal-Bench, the Artificial Analysis Intelligence Index) as directional signals, not gospel. Several are vendor-reported, index methodologies changed mid-year (Artificial Analysis moved to v4.1 in June, which reshuffled a lot of open-weight numbers), and the only benchmark that truly matters is your own eval on your own codebase. Treat everything here as a starting shortlist, then verify.</p><hr><h2 id="Part-1-The-Closed-Source-Frontier"><a href="#Part-1-The-Closed-Source-Frontier" class="headerlink" title="Part 1: The Closed-Source Frontier"></a>Part 1: The Closed-Source Frontier</h2><h3 id="Anthropic"><a href="#Anthropic" class="headerlink" title="Anthropic"></a>Anthropic</h3><h4 id="Claude-Sonnet-5-the-new-default"><a href="#Claude-Sonnet-5-the-new-default" class="headerlink" title="Claude Sonnet 5 (the new default)"></a>Claude Sonnet 5 (the new default)</h4><p>Released June 30, 2026, Sonnet 5 replaced Sonnet 4.6 as the default across Free and Pro, and it’s the model most professional work should route to first. It matches Opus 4.8 on a lot of everyday knowledge-work and coding tasks at meaningfully lower cost.</p><p><strong>Best for:</strong></p><ul><li>Everyday coding, feature work, and refactors</li><li>Code review and clean, well-reasoned review comments</li><li>Production-grade output where quality matters but the task isn’t extreme</li><li>Document comprehension and general reasoning</li></ul><p><strong>When to use:</strong></p><ul><li>As your day-to-day default, full stop</li><li>When you’d have reached for Opus out of habit but the task doesn’t truly need it</li><li>Customer-facing or maintainability-sensitive code</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Introductory pricing ($2&#x2F;M input, $10&#x2F;M output through Aug 31, 2026; then $3&#x2F;$15) — cheaper than Opus but not the cheapest option</li><li>Its updated tokenizer maps the same input to roughly 1.0–1.35× more tokens than before, so budget on realized token counts, not old assumptions</li><li>For genuinely long-horizon or architecturally gnarly work, it can visibly trail Opus</li></ul><p><strong>Pro tip:</strong> Make Sonnet 5 your default and only escalate when you can <em>feel</em> it struggling. The most common cost mistake in 2026 is reaching for the biggest model by reflex.</p><h4 id="Claude-Opus-4-8-the-deployable-flagship"><a href="#Claude-Opus-4-8-the-deployable-flagship" class="headerlink" title="Claude Opus 4.8 (the deployable flagship)"></a>Claude Opus 4.8 (the deployable flagship)</h4><p>Opus 4.8 is the heavyweight you can actually use today — the strongest generally-deployable Claude for hard reasoning and long-horizon agentic chains. On independent coding indices it sits at the top of the pack (~56 on Artificial Analysis’s coding measure, ahead of every open-weight model).</p><p><strong>Best for:</strong></p><ul><li>Long-horizon agentic work spanning many files, tests, and follow-up fixes</li><li>The hardest architectural and debugging problems</li><li>Repo-level coding where correctness across a large change matters</li></ul><p><strong>When to use:</strong></p><ul><li>Sonnet 5 has visibly hit its ceiling on a task</li><li>Mission-adjacent work where a wrong answer is expensive</li><li>Multi-step agent runs that need to stay coherent over a long session</li></ul><p><strong>Trade-offs:</strong></p><ul><li>$5&#x2F;M input, $25&#x2F;M output (Fast mode $10&#x2F;$50) — roughly double Sonnet</li><li>Slower than Sonnet and Haiku</li><li>Overkill (and a budget drain) for routine work</li></ul><p><strong>Pro tip:</strong> Opus 4.8 has a 1M-token context window. Use it deliberately for whole-codebase reasoning, but don’t leave an agent parked on Opus for tasks Sonnet would clear — the output-token bill compounds fast.</p><h4 id="Claude-Haiku-4-5-speed-and-scale"><a href="#Claude-Haiku-4-5-speed-and-scale" class="headerlink" title="Claude Haiku 4.5 (speed and scale)"></a>Claude Haiku 4.5 (speed and scale)</h4><p>Still the fast&#x2F;cheap tier and more capable than its price suggests (“near-frontier” in Anthropic’s framing). At $1&#x2F;M input, $5&#x2F;M output it’s the cheapest Claude.</p><p><strong>Best for:</strong></p><ul><li>Real-time completion, boilerplate, syntax fixes, scaffolding</li><li>High-volume, low-complexity tasks (classification, routing, extraction, summarization)</li><li>Repetitive CRUD and standard patterns</li></ul><p><strong>When to use:</strong></p><ul><li>You need instant feedback while typing</li><li>Running a high-throughput pipeline where per-call cost dominates</li><li>The task is well-defined and doesn’t need deep reasoning</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Not for architectural decisions or complex multi-step reasoning</li><li>Less depth than Sonnet&#x2F;Opus on ambiguous problems</li></ul><p><strong>Pro tip:</strong> Haiku is a superb <em>first-pass and triage</em> model. Let it draft, classify, or route, and escalate only the cases that actually need a bigger model.</p><h4 id="Claude-Fable-5-the-Mythos-tier"><a href="#Claude-Fable-5-the-Mythos-tier" class="headerlink" title="Claude Fable 5 (the Mythos tier)"></a>Claude Fable 5 (the Mythos tier)</h4><p>Fable 5 is the first model in Anthropic’s new “Mythos” tier, sitting <em>above</em> Opus. It launched June 9, was suspended worldwide on June 12 under a US Department of Commerce export-control directive, and was restored July 1 once the controls lifted. If it vanished from your tooling in June, that’s why. It’s back now at $10&#x2F;M input, $50&#x2F;M output.</p><p><strong>Best for:</strong></p><ul><li>The highest-stakes architecture and long-horizon planning</li><li>Problems that genuinely stump Opus</li><li>Repo-level coding at the frontier (it leads some repo-level coding measures)</li></ul><p><strong>When to use:</strong></p><ul><li>Truly critical work where quality is the only metric and budget is secondary</li><li>Deep architectural planning where you want the strongest available reasoning</li></ul><p><strong>Trade-offs:</strong></p><ul><li>The most expensive option here, on premium usage-based billing</li><li>Availability has a recent history of policy volatility — worth keeping a fallback (Opus 4.8) wired up in production</li><li>Mythos 5, its sibling, remains limited to approved partners</li></ul><p><strong>Pro tip:</strong> Treat Fable 5 the way January’s post treated Opus — the big gun, used sparingly. For most “hard” tasks, Opus 4.8 gets you there for half the price.</p><h3 id="OpenAI"><a href="#OpenAI" class="headerlink" title="OpenAI"></a>OpenAI</h3><p>OpenAI’s naming moved fast this year (5.2 → 5.4 → 5.5 → 5.6). The two things that matter for developers: the GPT-5.6 family split into three durable tiers, and the Codex and general-purpose stacks merged.</p><h4 id="GPT-5-6-Sol-flagship"><a href="#GPT-5-6-Sol-flagship" class="headerlink" title="GPT-5.6 Sol (flagship)"></a>GPT-5.6 Sol (flagship)</h4><p>Launched July 9, 2026, Sol is the top tier — built for frontier reasoning and long-horizon agentic work. It leads on agentic&#x2F;terminal benchmarks (strong BrowseComp, OSWorld, and Terminal-Bench numbers) and, notably, does so using fewer output tokens than many rivals.</p><p><strong>Best for:</strong></p><ul><li>Long-horizon coding agents that persist across files, tests, and fixes</li><li>Complex multi-file debugging and architecture decisions</li><li>Security-sensitive review and cybersecurity research</li><li>Terminal-heavy, tool-coordination-heavy agent runs</li></ul><p><strong>When to use:</strong></p><ul><li>The task needs max reasoning or “ultra” mode</li><li>You’re on GPT-5.5 or older and doing serious agentic coding — this is the upgrade</li><li>Escalation target for the hardest work in a tiered setup</li></ul><p><strong>Trade-offs:</strong></p><ul><li>$5&#x2F;M input, $30&#x2F;M output — same input price as GPT-5.5, premium output</li><li>Only Sol supports the deepest reasoning effort levels</li><li>Overkill for routine work</li></ul><p><strong>Pro tip:</strong> Sol’s edge is <em>token efficiency at depth</em> — it stays oriented on long tasks and does the unglamorous follow-through. Reserve it for the runs where that persistence pays for the output price.</p><h4 id="GPT-5-6-Terra-balanced"><a href="#GPT-5-6-Terra-balanced" class="headerlink" title="GPT-5.6 Terra (balanced)"></a>GPT-5.6 Terra (balanced)</h4><p>The mid tier at $2.50&#x2F;M input, $15&#x2F;M output — positioned as the everyday business default.</p><p><strong>Best for:</strong></p><ul><li>Scoped implementation and first-pass code review</li><li>Large-scale business workflows: support, internal tools, document analysis</li><li>The main execution lane in a routed system, with Sol as escalation</li></ul><p><strong>When to use:</strong></p><ul><li>Everyday coding and research that doesn’t need Sol-level depth</li><li>You’re currently on GPT-5.4 — Terra replaces it at the same price with better scores</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Here’s the honest catch: several independent analyses find Terra rarely sits on the cost-performance frontier — for many effort levels, a Luna or Sol setting gives you either better quality at the same price or the same quality cheaper</li><li>“Safe middle” can mean “not optimal for either axis”</li></ul><p><strong>Pro tip:</strong> Don’t adopt Terra by default just because it’s the middle. Benchmark it against Luna-high and Sol-low on <em>your</em> tasks; sometimes the barbell (cheap Luna + occasional Sol) beats the middle.</p><h4 id="GPT-5-6-Luna-fast-and-cheap"><a href="#GPT-5-6-Luna-fast-and-cheap" class="headerlink" title="GPT-5.6 Luna (fast and cheap)"></a>GPT-5.6 Luna (fast and cheap)</h4><p>The lightweight tier at $1&#x2F;M input, $6&#x2F;M output, performing near GPT-5.5 on several tests despite the low price.</p><p><strong>Best for:</strong></p><ul><li>High-volume, low-complexity work: summaries, drafting, routing, monitoring, labeling</li><li>The repetitive layer of an agentic system</li><li>Simple coding and content tasks</li></ul><p><strong>When to use:</strong></p><ul><li>Speed and cost are the primary constraints</li><li>First-pass triage before deciding whether to escalate</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Falls short on deep reasoning, long-context retention, and nuance-critical output</li><li>8-point Intelligence Index gap to Sol — real for frontier problems, irrelevant for routine ones</li></ul><p><strong>Pro tip:</strong> Luna + Sol is a strong barbell: run the routine layer on Luna, route only the hard calls up to Sol, and you’ll often beat a Terra-everywhere setup on both cost and quality.</p><h4 id="GPT-5-3-Codex-the-unified-coding-model"><a href="#GPT-5-3-Codex-the-unified-coding-model" class="headerlink" title="GPT-5.3-Codex (the unified coding model)"></a>GPT-5.3-Codex (the unified coding model)</h4><p>The structural shift for developers: GPT-5.3-Codex merged the Codex and general-purpose GPT-5 training stacks into one model — best-in-class code generation <em>plus</em> reasoning, about 25% faster than its predecessor. OpenAI called it its “first model instrumental in creating itself.” It’s the workhorse in the Codex CLI, IDE extension, and cloud.</p><p><strong>Best for:</strong></p><ul><li>Agentic, project-scale software engineering: refactors, migrations, long-running tasks with research and tool use</li><li>Work where you’d previously have juggled “the reasoning model” and “the coding model”</li><li>Long-horizon coding via context compaction across multiple windows</li></ul><p><strong>When to use:</strong></p><ul><li>You live in Codex surfaces (CLI, IDE, cloud, code review)</li><li>Large code changes that need to stay coherent over hours</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Codex-optimized; general chat isn’t its point</li><li>A smaller <strong>GPT-5.3-Codex-Spark</strong> variant runs on Cerebras hardware at 1,000+ tokens&#x2F;second for real-time coding — text-only, and a different point on the speed&#x2F;depth curve</li></ul><p><strong>Pro tip:</strong> If you were context-switching between a “thinking” model and a “coding” model in your Codex workflow, stop — this collapses that decision into one. Use Spark for the tight inner loop, 5.3-Codex for the heavier changes.</p><h3 id="Google"><a href="#Google" class="headerlink" title="Google"></a>Google</h3><h4 id="Gemini-3-5-Flash-shipped-and-solid"><a href="#Gemini-3-5-Flash-shipped-and-solid" class="headerlink" title="Gemini 3.5 Flash (shipped and solid)"></a>Gemini 3.5 Flash (shipped and solid)</h4><p>Announced at I&#x2F;O in May and shipped the same day, Flash is Google’s available, high-volume workhorse (roughly $1.50&#x2F;M input, $9&#x2F;M output).</p><p><strong>Best for:</strong></p><ul><li>Fast iterations and high-volume agent pipelines</li><li>Multimodal work (text + images + audio + video)</li><li>Standard coding patterns and quick prototyping</li></ul><p><strong>When to use:</strong></p><ul><li>Throughput, cost, or multimodality is the priority</li><li>You want a capable non-OpenAI&#x2F;Anthropic perspective in the mix</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Flash tier — not the deepest reasoner in the family</li><li>Early testers flagged token-efficiency quirks in extended workflows</li></ul><p><strong>Pro tip:</strong> Flash is genuinely strong for multimodal agent work — screenshots to code, diagram reasoning, video transcript synthesis — where its modality support matters more than raw index rank.</p><h4 id="Gemini-3-5-Pro-pending-—-plan-around-the-uncertainty"><a href="#Gemini-3-5-Pro-pending-—-plan-around-the-uncertainty" class="headerlink" title="Gemini 3.5 Pro (pending — plan around the uncertainty)"></a>Gemini 3.5 Pro (pending — plan around the uncertainty)</h4><p>As I write this, Gemini 3.5 Pro is <em>not</em> confirmed shipped. Google reportedly scrapped the original base model over gaps in multi-step math and tool-calling reliability and restarted pretraining on a native Gemini 3 foundation. A July 17 target has been widely reported but not officially confirmed by Google — no model card, no official pricing. Leaks point to a 2M-token context window (twice Opus 4.8’s 1M) and a strengthened Deep Think mode.</p><p><strong>Best for (reportedly):</strong></p><ul><li>Whole-codebase reasoning and repository-wide refactoring, if the 2M context holds up</li><li>Long-document and multimodal work at the frontier</li></ul><p><strong>When to use:</strong></p><ul><li>Wait for the model card. Until Google publishes one, treat every spec as rumor with strong sourcing</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Not reliably available as a public API flagship as of mid-July</li><li>Early testers reportedly found it trailing Fable 5 and GPT-5.6 on coding and long-horizon reasoning</li><li>Launches into a market where GPT-5.6 Sol and Grok 4.5 already shipped (July 9)</li></ul><p><strong>Pro tip:</strong> Don’t architect around 3.5 Pro yet. Use Gemini 3.1 Pro (preview) or 3.5 Flash today, and re-evaluate once there’s an actual model card and independent benchmarks — which, given the rebuild story, is worth waiting for.</p><h3 id="xAI"><a href="#xAI" class="headerlink" title="xAI"></a>xAI</h3><h4 id="Grok-4-5-the-value-coding-play"><a href="#Grok-4-5-the-value-coding-play" class="headerlink" title="Grok 4.5 (the value coding play)"></a>Grok 4.5 (the value coding play)</h4><p>Launched July 8, 2026, Grok 4.5 is xAI’s first coding-and-agentic-first model — co-trained with Cursor on real developer session data, built on a 1.5T-parameter foundation. It lands #4 on the Artificial Analysis Intelligence Index (<del>54), tops the index on agentic tool use, and posts strong Terminal-Bench (83.3%) and SWE-Bench Pro (</del>64.7%) numbers — at $2&#x2F;M input, $6&#x2F;M output, over 60% cheaper than Opus 4.8 or GPT-5.5.</p><p><strong>Best for:</strong></p><ul><li>Agentic, tool-heavy, long-running coding sessions on a budget</li><li>High-volume engineering work where value-per-task matters</li><li>Teams already in Cursor (tight integration)</li></ul><p><strong>When to use:</strong></p><ul><li>You want Opus-4.7-class coding at roughly half the per-task cost</li><li>Agentic tool use is the core of your workload</li></ul><p><strong>Trade-offs:</strong></p><ul><li>500K context window — large, but half of Opus&#x2F;GLM’s 1M</li><li>No published formal system card &#x2F; safety eval at launch, which matters for regulated environments</li><li>Musk himself framed it as “roughly comparable to Opus 4.7” — very good, not the outright frontier</li><li>One caveat on its Cursor benchmark: an earlier Cursor codebase snapshot was reportedly in training, so treat CursorBench numbers with a pinch of salt</li></ul><p><strong>Pro tip:</strong> For cost-sensitive agentic coding, Grok 4.5 is one of the best value picks in the market right now. Just do your own eval rather than trusting the co-trained-tool benchmark, and mind the system-card gap if you’re in a regulated shop.</p><h4 id="Grok-Code-Fast-the-unlimited-tier-workhorse"><a href="#Grok-Code-Fast-the-unlimited-tier-workhorse" class="headerlink" title="Grok Code Fast (the unlimited-tier workhorse)"></a>Grok Code Fast (the unlimited-tier workhorse)</h4><p>Still playing the role it did in January: fast, high-volume, low-stakes coding without eating premium quota.</p><p><strong>Best for:</strong> boilerplate, quick iterations, high-frequency low-complexity tasks.<br><strong>When to use:</strong> unlimited daily grind work where velocity beats sophistication.<br><strong>Trade-offs:</strong> not for architecture or complex reasoning.<br><strong>Pro tip:</strong> pair it with a frontier model — Grok Code Fast for the volume, something bigger for the hard 10%.</p><hr><h2 id="Part-2-The-Open-Weight-Surge"><a href="#Part-2-The-Open-Weight-Surge" class="headerlink" title="Part 2: The Open-Weight Surge"></a>Part 2: The Open-Weight Surge</h2><p>This is the section that barely existed in January. A year ago open-weight models were for local tinkering; in mid-2026 they’re in real pipelines, and on independent benchmarks the best of them trail the best closed model by single digits, not a chasm. Licenses have also matured — GLM, Kimi, and DeepSeek now ship under MIT; Qwen-Coder and Devstral under Apache 2.0 — so commercial use is genuinely viable.</p><h4 id="GLM-5-2-Z-ai-—-the-open-weight-leader"><a href="#GLM-5-2-Z-ai-—-the-open-weight-leader" class="headerlink" title="GLM-5.2 (Z.ai) — the open-weight leader"></a>GLM-5.2 (Z.ai) — the open-weight leader</h4><p>Currently the strongest open-weight model overall: #1 open on the Artificial Analysis Intelligence Index (<del>51, ~5 points below Fable 5) and top open on SWE-Bench Pro (</del>62.1%), with a 1M-token context window under MIT license.</p><p><strong>Best for:</strong></p><ul><li>Long-horizon agentic coding and project-level software engineering</li><li>The open-weight default when you want one model to cover most work</li><li>Teams wanting frontier-adjacent quality without closed-API lock-in</li></ul><p><strong>When to use:</strong></p><ul><li>You need self-hostable or non-US-vendor weights with near-frontier coding</li><li>Long-context, multi-step engineering agents</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Frontier-tier hardware to self-host (270–400 GB class — think 80GB multi-GPU rigs or an M3 Ultra)</li><li>It “thinks” a lot — output-token consumption can climb (realized ~$0.45&#x2F;$3.31 per M on hosted routes)</li><li>Not DeepSeek-cheap, though well below closed frontier</li></ul><p><strong>Pro tip:</strong> GLM-5.2 is the one to test first if you’re evaluating a single open-weight model for serious engineering. Watch the output-token bill on verbose reasoning tasks — its quality is real but so is its token appetite.</p><h4 id="DeepSeek-V4-Pro-and-Flash-—-the-cost-efficient-frontier"><a href="#DeepSeek-V4-Pro-and-Flash-—-the-cost-efficient-frontier" class="headerlink" title="DeepSeek V4 (Pro and Flash) — the cost-efficient frontier"></a>DeepSeek V4 (Pro and Flash) — the cost-efficient frontier</h4><p>DeepSeek V4 comes in a large MIT-licensed <strong>Pro</strong> (a ~1.6T-param flagship with full 1M context at no premium) and a cheap <strong>Flash</strong> ($0.14&#x2F;M input, $0.28&#x2F;M output, 1M context). <strong>Migration note:</strong> DeepSeek is retiring the legacy <code>deepseek-chat</code> and <code>deepseek-reasoner</code> API aliases around July 24, 2026 as V4 graduates from preview to stable — if you have anything in production on the old names, calendar that now.</p><p><strong>Best for:</strong></p><ul><li>Cost-efficient frontier reasoning (Pro) and cheap high-volume long-context work (Flash)</li><li>Budget-sensitive pipelines that still need a million-token window</li><li>Self-hosted deployments needing permissive licensing</li></ul><p><strong>When to use:</strong></p><ul><li>Per-token cost is a hard constraint but you still want strong reasoning</li><li>Long-context tasks at high volume where Flash’s pricing is transformative</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Pro is huge — serious self-host footprint</li><li>The July 24 alias retirement is a hard deadline with no announced extension</li><li>Some benchmark leadership claims are vendor-run; verify</li></ul><p><strong>Pro tip:</strong> DeepSeek V4 Flash is arguably the best cost-per-long-context-token deal in the market. Use it for high-volume RAG, log analysis, or bulk transformation where a 1M window at ~$0.14 input changes the economics entirely.</p><h4 id="Kimi-K2-6-x2F-K2-7-Code-Moonshot-AI-—-the-multimodal-agentic-wildcard"><a href="#Kimi-K2-6-x2F-K2-7-Code-Moonshot-AI-—-the-multimodal-agentic-wildcard" class="headerlink" title="Kimi K2.6 &#x2F; K2.7 Code (Moonshot AI) — the multimodal agentic wildcard"></a>Kimi K2.6 &#x2F; K2.7 Code (Moonshot AI) — the multimodal agentic wildcard</h4><p>An open-weight, native multimodal agentic model (text + image + video), 256K context, MIT-licensed, aimed at long-horizon coding and autonomous execution — with model-card claims of coordinating hundreds of sub-agents across thousands of steps. Its lineage got attention when Cursor’s Composer 2 situation revealed a major tool had deployed an earlier Kimi under a different name — a decent capability signal.</p><p><strong>Best for:</strong></p><ul><li>Multimodal agent work: reading screenshots, inspecting UI states, reasoning over diagrams or video</li><li>Long autonomous coding sessions and multi-file editing</li><li>Sub-agent orchestration workflows</li></ul><p><strong>When to use:</strong></p><ul><li>Your agent needs to <em>see</em> as well as read</li><li>Long-running autonomous execution is central</li></ul><p><strong>Trade-offs:</strong></p><ul><li>The headline sub-agent&#x2F;autonomy claims deserve careful verification in your own harness before you trust them in production</li><li>K2.7 Code is the newer coding-focused point release; confirm which variant your host serves</li></ul><p><strong>Pro tip:</strong> Kimi is the open-weight lane to test first when <em>modality</em> is your differentiator. If your agent’s job involves visual state, it’s a stronger fit than text-only rivals with higher raw index scores.</p><h4 id="Qwen3-Coder-Next-x2F-Qwen3-6-Alibaba-—-the-practical-local-coder"><a href="#Qwen3-Coder-Next-x2F-Qwen3-6-Alibaba-—-the-practical-local-coder" class="headerlink" title="Qwen3-Coder-Next &#x2F; Qwen3.6 (Alibaba) — the practical local coder"></a>Qwen3-Coder-Next &#x2F; Qwen3.6 (Alibaba) — the practical local coder</h4><p>Alibaba plays both ends. <strong>Qwen3-Coder-Next</strong> is a smaller, efficient MoE (~80B total, ~3B active) under Apache 2.0, built for self-hosted coding agents — the one in this group you can realistically run on a good workstation. Note: Alibaba’s <em>strongest</em> coding model, <strong>Qwen3.7-Max</strong>, is API-only and closed, so don’t go hunting for weights that aren’t published.</p><p><strong>Best for:</strong></p><ul><li>Self-hosted &#x2F; IDE-integrated coding agents on workstation-class hardware</li><li>Privacy- or residency-constrained coding where the model must stay local</li><li>Apache 2.0 commercial clarity</li></ul><p><strong>When to use:</strong></p><ul><li>You want genuinely self-hostable code assistance without a multi-GPU rig</li><li>On a 24–48GB setup where the big MoEs won’t fit</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Not the top of any leaderboard — it’s the efficient pick, not the peak</li><li>The best Qwen coder (3.7-Max) is closed, so the open one is a step below the family’s ceiling</li></ul><p><strong>Pro tip:</strong> Qwen3-Coder-Next punches above its size for local work. On an M4 Max or a 2×48GB pair it’s a legitimate “self-hosted and genuinely good at code” option — the realistic on-ramp to running a coding agent entirely on your own hardware.</p><h4 id="MiniMax-M3-Shanghai-—-the-cheap-long-context-multimodal"><a href="#MiniMax-M3-Shanghai-—-the-cheap-long-context-multimodal" class="headerlink" title="MiniMax M3 (Shanghai) — the cheap long-context multimodal"></a>MiniMax M3 (Shanghai) — the cheap long-context multimodal</h4><p>Launched June 1, M3 pairs frontier-ish coding with a 1M-token context and native multimodality via a sparse-attention (MSA) architecture that makes million-token inference far cheaper (<del>428B total &#x2F; ~23B active MoE). Realized hosted pricing is startlingly low (</del>$0.30&#x2F;$1.20 per M, rising above 512K context). Independent verification is encouraging — in one third-party bug-hunt test it matched Opus 4.8 at medium effort while costing 18–27× less.</p><p><strong>Best for:</strong></p><ul><li>Cheap long-context multimodal agents (screenshots, UI, diagrams, video at 1M context)</li><li>High-throughput workloads where the sparse-attention speed-up matters</li><li>Cost-dominated pipelines that still want multimodality</li></ul><p><strong>When to use:</strong></p><ul><li>You need multimodal <em>and</em> long-context <em>and</em> low cost together</li><li>Bulk agentic work where per-run cost is the deciding factor</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Many headline benchmarks are vendor-run</li><li>The downloadable weights carry a commercially <em>restricted</em> custom license — read it before you ship (this is the exception to the “open licenses matured” point above)</li><li>Index score dropped from ~55 to ~44 when Artificial Analysis moved to v4.1 — not a regression, a re-weighting, but a reminder not to compare across index versions</li></ul><p><strong>Pro tip:</strong> M3’s differentiator is <em>modality at long context for near-zero cost</em>, not raw index rank. For high-volume visual-agent work it’s hard to beat on economics — just clear the custom license with whoever owns legal.</p><h4 id="Nemotron-3-NVIDIA-—-the-reproducible-enterprise-pick"><a href="#Nemotron-3-NVIDIA-—-the-reproducible-enterprise-pick" class="headerlink" title="Nemotron 3 (NVIDIA) — the reproducible enterprise pick"></a>Nemotron 3 (NVIDIA) — the reproducible enterprise pick</h4><p>NVIDIA’s open model line (Super &#x2F; Ultra tiers), notable less for topping leaderboards (Ultra ~48 on the AA index) than for publishing full weights, training data, recipes, and evaluation resources — with deployment cookbooks for vLLM, SGLang, and TensorRT-LLM.</p><p><strong>Best for:</strong></p><ul><li>Auditable, reproducible multi-agent systems</li><li>Regulated or compliance-heavy enterprise deployments where provenance matters</li><li>Teams that need to <em>study and modify</em> the whole system, not just the weights</li></ul><p><strong>When to use:</strong></p><ul><li>Reproducibility, auditability, and documented deployment are hard requirements</li><li>You’re standardizing on NVIDIA inference infrastructure</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Not the raw-capability leader among open weights</li><li>Larger tiers need serious hardware</li></ul><p><strong>Pro tip:</strong> If your blocker to adopting open weights is <em>governance</em> rather than capability, Nemotron 3 is the path of least resistance — the documentation and reproducibility story is the product.</p><h4 id="Mistral-Large-3-x2F-Small-4-x2F-Medium-3-5-—-the-European-open-route"><a href="#Mistral-Large-3-x2F-Small-4-x2F-Medium-3-5-—-the-European-open-route" class="headerlink" title="Mistral (Large 3 &#x2F; Small 4 &#x2F; Medium 3.5) — the European open route"></a>Mistral (Large 3 &#x2F; Small 4 &#x2F; Medium 3.5) — the European open route</h4><p>Mistral’s open-weight lineup remains the go-to for multilingual and EU-hosted enterprise work, spanning a capable Large down to an edge-friendly Small.</p><p><strong>Best for:</strong> multilingual applications, EU data-residency deployments, a tiered open-weight family from one vendor.<br><strong>When to use:</strong> European enterprise contexts, or when you want an open-weight ladder (Small → Medium → Large) under one roof.<br><strong>Trade-offs:</strong> not chasing the top of the global coding leaderboard; positioned on enterprise fit and language coverage.<br><strong>Pro tip:</strong> For EU-regulated deployments, Mistral’s combination of open weights and European provenance often clears procurement hurdles that a US or Chinese model won’t.</p><hr><h2 id="Part-3-Beyond-Copilot-—-Where-You-Actually-Run-These"><a href="#Part-3-Beyond-Copilot-—-Where-You-Actually-Run-These" class="headerlink" title="Part 3: Beyond Copilot — Where You Actually Run These"></a>Part 3: Beyond Copilot — Where You Actually Run These</h2><p>January’s guide assumed GitHub Copilot. A growing share of this work now happens elsewhere, so here’s the quick lay of the land.</p><p><strong>GitHub Copilot</strong> remains the broadest-reach option — the one tool running natively across VS Code, JetBrains, Visual Studio, Xcode, and Eclipse, with an ever-expanding model roster. But two things changed: it paused new Pro&#x2F;Pro+ signups earlier this year, and it moved to usage-based credit billing on June 1 (Pro’s $10 now buys a monthly credit allowance, not unlimited agent use). If you’re recommending it to a team, the old “unlimited for $10” mental model no longer holds. Still the right default if your team spans multiple IDEs.</p><p><strong>Cursor</strong> ships its own frontier coding model, <strong>Composer 2.5</strong>, as the Pro default — reportedly matching Opus-4.7&#x2F;GPT-5.5-class benchmarks at a fraction of per-token cost ($0.50&#x2F;M input, $2.50&#x2F;M output) — alongside third-party model access (Claude, GPT, Gemini, Kimi, Grok). Its edge is deep codebase indexing and IDE-native parallel agents. It’s become the default pick for many now that Copilot paused signups.</p><p><strong>Codex</strong> (OpenAI) is the home turf for GPT-5.3-Codex and the GPT-5.6 family — CLI, IDE extension, cloud, and code review, oriented around agentic, long-running tasks.</p><p><strong>Windsurf → Devin Desktop</strong>: Cognition rebranded Windsurf to Devin Desktop in June, bundling the Devin Cloud agent and a terminal CLI and adopting the open Agent Client Protocol. It leans toward a <em>delegated</em> agent that opens PRs on your behalf, versus Cursor’s in-editor pair-programmer model.</p><p><strong>Claude Code</strong> remains the pick for deep, multi-file agentic work driven by Anthropic’s models directly.</p><p>None of these are mutually exclusive. The pattern I see working is a layered stack: a broad-reach inline tool (Copilot) for daily autocomplete, a purpose-built agentic IDE (Cursor &#x2F; Claude Code &#x2F; Devin) for heavy multi-file work, and a direct API or open-weight route for high-volume, cost-sensitive pipelines.</p><hr><h2 id="Part-4-Matching-Model-to-Task-—-The-Mid-2026-Framework"><a href="#Part-4-Matching-Model-to-Task-—-The-Mid-2026-Framework" class="headerlink" title="Part 4: Matching Model to Task — The Mid-2026 Framework"></a>Part 4: Matching Model to Task — The Mid-2026 Framework</h2><p>The core advice hasn’t changed — match model to task — but the menu has. Here’s the updated routing table:</p><table><thead><tr><th>Task</th><th>Reach for</th></tr></thead><tbody><tr><td>Everyday coding &#x2F; default</td><td>Claude Sonnet 5, GPT-5.6 Terra, Gemini 3.5 Flash</td></tr><tr><td>Long-horizon, architecturally hard</td><td>Claude Opus 4.8, GPT-5.6 Sol, GPT-5.3-Codex</td></tr><tr><td>Highest-stakes &#x2F; mission-critical</td><td>Claude Fable 5 (sparingly)</td></tr><tr><td>Fast, high-volume, low-complexity</td><td>Claude Haiku 4.5, GPT-5.6 Luna, Grok Code Fast</td></tr><tr><td>Cost-sensitive agentic coding</td><td>Grok 4.5, DeepSeek V4 Flash</td></tr><tr><td>Self-hosted &#x2F; data-residency</td><td>GLM-5.2, DeepSeek V4 Pro, Qwen3-Coder-Next</td></tr><tr><td>Multimodal &#x2F; visual agents</td><td>Kimi K2.6&#x2F;K2.7, MiniMax M3, Gemini 3.5 Flash</td></tr><tr><td>Cheap long-context bulk work</td><td>DeepSeek V4 Flash, MiniMax M3</td></tr><tr><td>Reproducible &#x2F; audited enterprise</td><td>Nemotron 3, Mistral (EU)</td></tr></tbody></table><h3 id="A-scenario-playbook"><a href="#A-scenario-playbook" class="headerlink" title="A scenario playbook"></a>A scenario playbook</h3><p><strong>Building a new REST API:</strong> architecture with Opus 4.8 or Sol → scaffolding on Haiku 4.5 or Grok Code Fast → business logic on Sonnet 5 or GPT-5.3-Codex → security review on Opus 4.8 → tests on Haiku&#x2F;Luna → docs on Sonnet 5.</p><p><strong>Debugging a production issue:</strong> stack-trace triage on Luna or Haiku → root-cause on Sonnet 5, escalating to Opus 4.8 or Sol if it’s genuinely deep → fix and verify on Sonnet 5.</p><p><strong>High-volume feature grind on a budget:</strong> boilerplate on Grok Code Fast or DeepSeek V4 Flash → standard implementations on Grok 4.5 → the hard 10% on Opus 4.8 or Sol → review on Sonnet 5.</p><p><strong>Self-hosted &#x2F; air-gapped coding agent:</strong> GLM-5.2 if you have the hardware and want peak open-weight quality; Qwen3-Coder-Next if you’re on workstation-class hardware; Nemotron 3 if governance and auditability are the real constraints.</p><p><strong>Multimodal agent (reads UI, diagrams, video):</strong> MiniMax M3 for cheap long-context multimodality, Kimi K2.6&#x2F;K2.7 for autonomous multimodal execution, Gemini 3.5 Flash for a closed-source option.</p><hr><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>Six months in this industry is a full model generation, sometimes two. January’s specific model names are mostly retired, but the discipline that post argued for — understand the trade-offs, don’t default to whatever’s newest — matters <em>more</em> now, not less, because the field widened from “four labs shipping GPT and Claude variants” to “four closed labs plus a genuinely competitive open-weight ecosystem, reachable from half a dozen different IDEs.”</p><p>The single highest-leverage habit is building fluency across a small portfolio rather than marrying one model: one closed-frontier default (Sonnet 5 or Terra), one cost-efficient workhorse (Grok 4.5, DeepSeek V4 Flash), and increasingly one open-weight option you can self-host (GLM-5.2 or Qwen3-Coder-Next). Then switch deliberately based on what the task actually needs.</p><p><strong>Your next steps:</strong></p><ol><li>Re-evaluate your default. If you’ve been on the same model since January, the cost&#x2F;capability curves have moved under you — Sonnet 5 and the GPT-5.6 tiers alone change the math.</li><li>Pressure-test one open-weight model (GLM-5.2 or DeepSeek V4 are the easiest on-ramps) against your current default on a <em>real</em> task, not a toy benchmark.</li><li>Check the deadlines: DeepSeek’s July 24 API-alias retirement, and Copilot’s June billing change if your cost model still assumes “unlimited.”</li><li>Watch Gemini 3.5 Pro and DeepSeek V4 stable — both land within days of each other. Wait for model cards and independent benchmarks before committing.</li><li>Above all: benchmark on your own codebase. Every number in this post is a shortlist signal, not a decision.</li></ol><p>Till next time, Happy Coding and Keep AI Learning!</p>]]></content>
    
    
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Six months ago I published a Copilot-specific model guide. Almost every name on it has since been superseded. This mid-year update widens the lens beyond GitHub Copilot to every environment — Cursor, Codex, Windsurf&amp;#x2F;Devin, Claude Code, or a raw API — and gives each current model the same exhaustive &lt;em&gt;best for &amp;#x2F; when to use &amp;#x2F; trade-offs &amp;#x2F; pro tip&lt;/em&gt; treatment. It covers the closed-source frontier (Anthropic, OpenAI, Google, xAI) and the open-weight surge (GLM, DeepSeek, Kimi, Qwen, MiniMax, Nemotron, Mistral) that has, this year, become genuinely production-grade.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;img src=&quot;/images/ai_generated_2026_mid_year_models_for_developers.png&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;Back in January I wrote a &lt;a href=&quot;/blog/2026/01/24/github-copilot-ai-models-a-developer-s-guide-to-choosing-the-right-model/&quot; title=&quot;GitHub Copilot AI Models: A Developer&amp;#39;s Guide to Choosing the Right Model&quot;&gt;guide&lt;/a&gt; to GitHub Copilot’s model picker — GPT-5, the early Claude 4 lineup, Gemini previews, and which to reach for when. That post aged in weeks, which six months on feels like the whole point of writing about this space.&lt;/p&gt;
&lt;p&gt;Since then: Anthropic shipped Sonnet 5 and Opus 4.8, launched a new top tier (Fable 5), and had to pull that top model off the market for three weeks under a US export-control order before restoring it. OpenAI iterated through GPT-5.4, 5.5, and the GPT-5.6 “Sol &amp;#x2F; Terra &amp;#x2F; Luna” family, and merged its Codex and general-purpose stacks into one model. Google shipped Gemini 3.5 Flash but scrapped and rebuilt its next flagship from scratch. xAI turned Grok into a coding-first model co-trained with Cursor. And a cluster of open-weight labs — Z.ai’s GLM, DeepSeek, Moonshot’s Kimi, Alibaba’s Qwen, MiniMax, and NVIDIA’s Nemotron — closed the gap on the frontier to single benchmark digits while running at a fraction of the cost.&lt;/p&gt;
&lt;p&gt;This time the post is not Copilot-specific. If you’re in Cursor, Codex, Windsurf, Claude Code, or straight through an API, the same models and trade-offs apply — only the interface changes. The discipline is the same as January: match the model to the task, not the task to whatever’s newest. There are just a lot more models now.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai, large-language-models, productivity, developer-tools, ai-programming, software-development, tech-guide, software-engineering, developer-resources" scheme="http://awongcm.io/tags/ai-large-language-models-productivity-developer-tools-ai-programming-software-development-tech-guide-software-engineering-developer-resources/"/>
    
  </entry>
  
  <entry>
    <title>Harness Engineering: The Next Layer Every Developer Should Master After Context Engineering</title>
    <link href="http://awongcm.io/blog/2026/07/05/harness-engineering-the-next-layer-every-developer-should-master-after-context-engineering/"/>
    <id>http://awongcm.io/blog/2026/07/05/harness-engineering-the-next-layer-every-developer-should-master-after-context-engineering/</id>
    <published>2026-07-05T07:01:36.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_harness_engineering_next_layer_after_context_engineering_1.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><blockquote><p><em>You’ve learned to write better prompts. You’ve learned to structure context. Now it’s time to think about what turns a model into an agent — and what keeps that agent under control once it’s running.</em></p></blockquote><hr><h2 id="What-Is-Harness-Engineering"><a href="#What-Is-Harness-Engineering" class="headerlink" title="What Is Harness Engineering?"></a>What Is Harness Engineering?</h2><p>In my previous <a href="/blog/2026/06/14/context-engineering-for-developers-mastering-the-art-of-prompting-systems-agents-and-memory/" title="Context Engineering for Developers: Mastering the Art of Prompting Systems, Agents, and Memory">article</a>, I mentioned context engineering quite a bit and how it’s important for developers to master in this AI era we’re in. If you’ve spent time on context engineering, you already understand one truth: <strong>the quality of what you give an AI model matters as much as the model itself.</strong></p><p>Harness engineering is the discipline that comes next — and it’s a bigger shift than it first sounds.</p><p>Context engineering answers <em>what do I put in the prompt?</em> Harness engineering answers a different question: <em>how does the model actually act — calling tools, tracking state across steps, staying inside guardrails — and how do I control that?</em></p><span id="more"></span><p>A <strong>harness</strong> is the runtime infrastructure that turns a model into an agent. It’s everything outside the model weights themselves: the tool-calling layer, the state and conversation tracking across multi-step tasks, the guardrails that stop an agent from looping or taking an unsafe action, and the evaluation loop that tells you whether the agent is actually working.</p><p>The simplest way to say it: <strong>the model is the brain, the harness is the hands.</strong> A frontier model with no harness is a very smart thing that can only talk. A harness is what lets it act — call your APIs, execute multi-step workflows, hold state across a task, and be observed and corrected in production.</p><p>Static context isn’t enough once a model needs to <em>do</em> something rather than just <em>say</em> something. That’s the transition harness engineering is built for.</p><hr><h2 id="Why-This-Matters-Now"><a href="#Why-This-Matters-Now" class="headerlink" title="Why This Matters Now"></a>Why This Matters Now</h2><p>AI agents are no longer demos. They’re executing real workflows — calling backend APIs, orchestrating multi-step tasks, running in CI pipelines, financial systems, and customer-facing tools, often with no human checking every step.</p><p>That shift changes the engineering contract.</p><p>When an agent is a demo, one wrong tool call is a funny anecdote. When it’s in production, one wrong tool call is a defect category — or an incident. An agent that gets stuck in a tool-calling loop, silently drifts off task, or calls a destructive API with malformed arguments isn’t a prompting problem. It’s a harness problem.</p><p>This is also, deliberately, the layer prompt engineering and context engineering both live inside of. Prompt and context engineering shape what the model sees and how it reasons. Harness engineering decides what the model is <em>allowed to do</em> with that reasoning — and it’s increasingly seen as the next phase of AI engineering maturity, following prompt engineering and context engineering.</p><hr><h2 id="The-Anatomy-of-an-Agent-Harness"><a href="#The-Anatomy-of-an-Agent-Harness" class="headerlink" title="The Anatomy of an Agent Harness"></a>The Anatomy of an Agent Harness</h2><p>There’s no single, universally agreed decomposition of a harness yet — this is a fast-moving area, and different teams and labs slice it slightly differently. What follows is one useful way to organise the concerns, drawing on the common ground across current practice. You don’t need all five for every use case, but you should make a conscious decision about each one.</p><h3 id="1-Structured-Output-amp-Validation"><a href="#1-Structured-Output-amp-Validation" class="headerlink" title="1. Structured Output &amp; Validation"></a>1. Structured Output &amp; Validation</h3><p>Before your harness lets the model’s output become an action, it has to ask: <em>is this actually usable?</em></p><p>This starts with the model’s own output — is it valid JSON, does it match the schema you need — and extends to validating the inputs <em>it</em> wants to send onward, whether that’s a tool call’s arguments or a downstream API payload.</p><p>Practical starting points:</p><ul><li>Validate tool-call arguments against a schema before execution, not after</li><li>Reject or repair malformed structured output rather than silently passing it through</li><li>Check data consistency between what the model <em>says</em> it did and what it’s actually about to do</li><li>Define what “invalid output” means for your use case and handle it explicitly</li></ul><pre><code class="hljs python"><span class="hljs-keyword">from</span> pydantic <span class="hljs-keyword">import</span> BaseModel, ValidationError<span class="hljs-keyword">class</span> <span class="hljs-title class_">ToolCall</span>(<span class="hljs-title class_ inherited__">BaseModel</span>):    tool_name: <span class="hljs-built_in">str</span>    arguments: <span class="hljs-built_in">dict</span>    reasoning: <span class="hljs-built_in">str</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">validate_tool_call</span>(<span class="hljs-params">raw_output: <span class="hljs-built_in">str</span></span>) -&gt; ToolCall:    <span class="hljs-keyword">try</span>:        data = json.loads(raw_output)        <span class="hljs-keyword">return</span> ToolCall(**data)    <span class="hljs-keyword">except</span> json.JSONDecodeError:        <span class="hljs-keyword">raise</span> ToolCallParseError(<span class="hljs-string">f&quot;Model returned non-JSON tool call: <span class="hljs-subst">&#123;raw_output[:<span class="hljs-number">200</span>]&#125;</span>&quot;</span>)    <span class="hljs-keyword">except</span> ValidationError <span class="hljs-keyword">as</span> e:        <span class="hljs-keyword">raise</span> ToolCallValidationError(<span class="hljs-string">f&quot;Tool call failed schema validation: <span class="hljs-subst">&#123;e&#125;</span>&quot;</span>)</code></pre><h3 id="2-Function-amp-Tool-Calling"><a href="#2-Function-amp-Tool-Calling" class="headerlink" title="2. Function &amp; Tool Calling"></a>2. Function &amp; Tool Calling</h3><p>This is where an agent stops being a chatbot and starts being able to act.</p><p>Your harness is responsible for the tool registry (what the agent is allowed to call), executing the actual API action once a tool call is validated, and returning the result back into the agent’s context in a form it can reason about on the next step.</p><p>Key practices:</p><ul><li>Keep the tool registry explicit and versioned — don’t let an agent discover capabilities it wasn’t scoped to have</li><li>Separate “the model decided to call a tool” from “the tool was actually executed” — these are different trust boundaries</li><li>Log every tool invocation with its arguments and result, not just the model’s final answer</li></ul><pre><code class="hljs python"><span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">execute_tool_call</span>(<span class="hljs-params">tool_call: ToolCall, registry: ToolRegistry</span>) -&gt; ToolResult:    <span class="hljs-keyword">if</span> tool_call.tool_name <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> registry:        <span class="hljs-keyword">return</span> ToolResult.rejected(<span class="hljs-string">f&quot;Unknown tool: <span class="hljs-subst">&#123;tool_call.tool_name&#125;</span>&quot;</span>)    tool = registry[tool_call.tool_name]    <span class="hljs-keyword">try</span>:        output = <span class="hljs-keyword">await</span> tool.execute(**tool_call.arguments)        <span class="hljs-keyword">return</span> ToolResult.success(output)    <span class="hljs-keyword">except</span> ToolExecutionError <span class="hljs-keyword">as</span> e:        <span class="hljs-keyword">return</span> ToolResult.failure(<span class="hljs-built_in">str</span>(e))</code></pre><h3 id="3-Operational-Guardrails-amp-Control"><a href="#3-Operational-Guardrails-amp-Control" class="headerlink" title="3. Operational Guardrails &amp; Control"></a>3. Operational Guardrails &amp; Control</h3><p>Guardrails are constraints your harness enforces independently of the model’s own judgement — a defence-in-depth layer you should not rely on the model alone to provide, especially in production.</p><p>For agents specifically, this includes a failure mode that doesn’t exist for a single call: <strong>loop prevention.</strong> An agent that can call its own tools and re-evaluate its plan can, without a hard stop, call the same tool repeatedly, burn budget, or spiral without making progress.</p><p>Guardrails to define explicitly:</p><ul><li><strong>Step and loop limits</strong> — a hard ceiling on how many tool calls or reasoning steps a single task can take</li><li><strong>Safety constraints</strong> — actions the agent is never allowed to take regardless of what it reasons its way into (e.g. destructive operations, financial transfers)</li><li><strong>Error handling &amp; retries</strong> — exponential backoff with jitter for transient tool failures, distinct from giving up and escalating</li><li><strong>Confidence&#x2F;latency budgets</strong> — a defined behaviour when a step hasn’t resolved within your time or certainty threshold, rather than hanging indefinitely</li></ul><pre><code class="hljs python"><span class="hljs-keyword">class</span> <span class="hljs-title class_">LoopGuard</span>:    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, max_steps: <span class="hljs-built_in">int</span> = <span class="hljs-number">10</span></span>):        <span class="hljs-variable language_">self</span>.max_steps = max_steps        <span class="hljs-variable language_">self</span>.step_count = <span class="hljs-number">0</span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">check</span>(<span class="hljs-params">self</span>) -&gt; <span class="hljs-literal">None</span>:        <span class="hljs-variable language_">self</span>.step_count += <span class="hljs-number">1</span>        <span class="hljs-keyword">if</span> <span class="hljs-variable language_">self</span>.step_count &gt; <span class="hljs-variable language_">self</span>.max_steps:            <span class="hljs-keyword">raise</span> LoopLimitExceeded(<span class="hljs-string">f&quot;Agent exceeded <span class="hljs-subst">&#123;self.max_steps&#125;</span> steps without completion&quot;</span>)</code></pre><h3 id="4-State-amp-Dialogue-Management"><a href="#4-State-amp-Dialogue-Management" class="headerlink" title="4. State &amp; Dialogue Management"></a>4. State &amp; Dialogue Management</h3><p>A single AI call has no memory problem — you send the messages, you get a response. An agent running a multi-step task does. Your harness has to track conversation flow, task progress, and the results of prior tool calls, and feed the right slice of that back into context on each step without letting it balloon indefinitely.</p><ul><li>Track task state (what’s been done, what’s pending) separately from raw conversation history</li><li>Decide explicitly what gets summarised or dropped as a task grows long, rather than letting context silently fill up</li><li>Persist state across sessions if the task can be paused and resumed</li></ul><pre><code class="hljs python"><span class="hljs-keyword">class</span> <span class="hljs-title class_">AgentState</span>:    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, task_id: <span class="hljs-built_in">str</span></span>):        <span class="hljs-variable language_">self</span>.task_id = task_id        <span class="hljs-variable language_">self</span>.completed_steps: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">dict</span>] = []        <span class="hljs-variable language_">self</span>.pending_steps: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">str</span>] = []    <span class="hljs-keyword">def</span> <span class="hljs-title function_">record_step</span>(<span class="hljs-params">self, tool_call: ToolCall, result: ToolResult</span>) -&gt; <span class="hljs-literal">None</span>:        <span class="hljs-variable language_">self</span>.completed_steps.append(&#123;            <span class="hljs-string">&quot;tool&quot;</span>: tool_call.tool_name,            <span class="hljs-string">&quot;result&quot;</span>: result.summary(),        &#125;)</code></pre><h3 id="5-Continuous-Evaluation-amp-Testing"><a href="#5-Continuous-Evaluation-amp-Testing" class="headerlink" title="5. Continuous Evaluation &amp; Testing"></a>5. Continuous Evaluation &amp; Testing</h3><p>If you cannot see what your agent is doing in production, you cannot improve it and you cannot trust it.</p><p>This goes further than logging latency and token counts for a single call — you need to evaluate <em>agent behaviour</em>: did it choose the right tool, did it stop when it should have, did the task actually succeed end to end. This is the “eval harness” layer — a fixed set of scenarios you can run against a given agent configuration to catch regressions before they reach production.</p><pre><code class="hljs python"><span class="hljs-keyword">import</span> structloglogger = structlog.get_logger()<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">run_agent_step</span>(<span class="hljs-params">state: AgentState, tool_call: ToolCall, correlation_id: <span class="hljs-built_in">str</span></span>) -&gt; ToolResult:    logger.info(<span class="hljs-string">&quot;tool_call_start&quot;</span>, correlation_id=correlation_id,                task_id=state.task_id, tool=tool_call.tool_name)    result = <span class="hljs-keyword">await</span> execute_tool_call(tool_call, registry)    logger.info(<span class="hljs-string">&quot;tool_call_complete&quot;</span>, correlation_id=correlation_id,                task_id=state.task_id, tool=tool_call.tool_name, success=result.success)    <span class="hljs-keyword">return</span> result</code></pre><p>At minimum, instrument: per-step latency, tool-call success&#x2F;failure rates by tool, loop-limit triggers, and downstream task success rate — not just whether the model returned <em>a</em> response, but whether the agent’s actions actually resolved the task.</p><hr><h2 id="A-Minimal-Working-Agent-Harness"><a href="#A-Minimal-Working-Agent-Harness" class="headerlink" title="A Minimal Working Agent Harness"></a>A Minimal Working Agent Harness</h2><p>Here’s the shape of these five concerns assembled — not meant to be copy-pasted directly, but to show where each concern lives and what happens when it fails.</p><pre><code class="hljs python"><span class="hljs-keyword">class</span> <span class="hljs-title class_">AgentHarness</span>:    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config: HarnessConfig, registry: ToolRegistry</span>):        <span class="hljs-variable language_">self</span>.config = config        <span class="hljs-variable language_">self</span>.registry = registry        <span class="hljs-variable language_">self</span>.loop_guard = LoopGuard(max_steps=config.max_steps)        <span class="hljs-variable language_">self</span>.logger = structlog.get_logger()    <span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">run</span>(<span class="hljs-params">self, task_input: <span class="hljs-built_in">str</span>, context: RequestContext</span>) -&gt; HarnessResult:        correlation_id = context.correlation_id        state = AgentState(task_id=context.task_id)        <span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> state.is_complete():            <span class="hljs-comment"># 1. Guardrail: loop/step limit</span>            <span class="hljs-keyword">try</span>:                <span class="hljs-variable language_">self</span>.loop_guard.check()            <span class="hljs-keyword">except</span> LoopLimitExceeded <span class="hljs-keyword">as</span> e:                <span class="hljs-keyword">return</span> HarnessResult.guardrail_blocked(<span class="hljs-built_in">str</span>(e))            <span class="hljs-comment"># 2. Model proposes next action</span>            raw_output = <span class="hljs-keyword">await</span> call_model(assemble_prompt(state, context))            <span class="hljs-comment"># 3. Structured output validation</span>            <span class="hljs-keyword">try</span>:                tool_call = validate_tool_call(raw_output)            <span class="hljs-keyword">except</span> (ToolCallParseError, ToolCallValidationError) <span class="hljs-keyword">as</span> e:                <span class="hljs-variable language_">self</span>.logger.warning(<span class="hljs-string">&quot;tool_call_invalid&quot;</span>, correlation_id=correlation_id, error=<span class="hljs-built_in">str</span>(e))                <span class="hljs-keyword">return</span> HarnessResult.fallback(get_fallback_response())            <span class="hljs-comment"># 4. Function &amp; tool calling</span>            result = <span class="hljs-keyword">await</span> run_agent_step(state, tool_call, correlation_id)            <span class="hljs-comment"># 5. State management</span>            state.record_step(tool_call, result)        <span class="hljs-keyword">return</span> HarnessResult.success(state)</code></pre><hr><h2 id="The-Connection-to-Context-Engineering"><a href="#The-Connection-to-Context-Engineering" class="headerlink" title="The Connection to Context Engineering"></a>The Connection to Context Engineering</h2><table><thead><tr><th>Context Engineering</th><th>Harness Engineering</th></tr></thead><tbody><tr><td>What goes in the prompt</td><td>How the agent’s actions get executed and controlled</td></tr><tr><td>How to structure examples</td><td>How to validate a tool call before it runs</td></tr><tr><td>How to frame instructions</td><td>How to stop an agent that’s stuck in a loop</td></tr><tr><td>What context to retrieve</td><td>How to track state across a multi-step task</td></tr><tr><td>How to format output</td><td>How to evaluate whether the agent’s actions actually worked</td></tr></tbody></table><p>They’re two lenses on the same problem, at different points in the pipeline: <strong>how do you make an AI system behave predictably in a system you’re responsible for?</strong> Context engineering shapes what the model reasons over. Harness engineering governs what it’s allowed to do with that reasoning.</p><hr><h2 id="What-to-Build-Next"><a href="#What-to-Build-Next" class="headerlink" title="What to Build Next"></a>What to Build Next</h2><p>If you have an agent running in production (or approaching it), here’s a practical checklist:</p><p><strong>Short term (this sprint):</strong></p><ul><li><input disabled="" type="checkbox"> Add a hard step&#x2F;loop limit — know what happens when an agent doesn’t converge</li><li><input disabled="" type="checkbox"> Add structured logging with correlation IDs to every tool call, not just the final response</li><li><input disabled="" type="checkbox"> Add a fallback — a defined “stop and escalate” path is better than a hanging or looping task</li></ul><p><strong>Medium term (next month):</strong></p><ul><li><input disabled="" type="checkbox"> Add schema validation for every tool call’s arguments, not just the final output</li><li><input disabled="" type="checkbox"> Build explicit state tracking separate from raw conversation history</li><li><input disabled="" type="checkbox"> Build a basic dashboard for tool-call success rate, loop-limit triggers, and task completion rate</li></ul><p><strong>Longer term:</strong></p><ul><li><input disabled="" type="checkbox"> Build an eval harness to test agent behaviour changes before shipping them</li><li><input disabled="" type="checkbox"> Formalise your tool registry and versioning so agent capabilities are explicit, not discovered</li><li><input disabled="" type="checkbox"> Connect downstream task-success signals back to the specific harness configuration that produced them</li></ul><hr><h2 id="Closing-Thought"><a href="#Closing-Thought" class="headerlink" title="Closing Thought"></a>Closing Thought</h2><p>Context engineering is about crafting the right input. Harness engineering is about building the system that decides what the model is allowed to <em>do</em> with it — which tools it can call, how far it can run before something checks in, and how you’ll know if it actually worked.</p><p>The developers who ship reliable agents in 2026 won’t just be good prompt engineers. They’ll be engineers who understand where an agent’s actions can go wrong at each step, and who build the scaffolding that makes those actions observable, bounded, and testable.</p><p>That scaffolding is the harness. And building it well is an engineering discipline, not an afterthought.</p><p>Till next time, Happy coding and keep learning!</p><hr><h2 id="References"><a href="#References" class="headerlink" title="References"></a>References</h2><ol><li>Rick Hightower, <a href="https://freedium-mirror.cfd/https://pub.spillwave.com/harness-engineering-vs-context-engineering-the-model-is-the-cpu-the-harness-is-the-os-51b28c5bddbb">“Harness Engineering vs Context Engineering: The Model is the CPU, the Harness is the OS,”</a> Spillwave, March 17, 2026.</li><li>NxCode Team, <a href="https://www.nxcode.io/resources/news/what-is-harness-engineering-complete-guide-2026">“What Is Harness Engineering? Complete Guide for AI Agent Development (2026),”</a> NxCode, March 26, 2026.</li><li>Birgitta Böckeler, <a href="https://martinfowler.com/articles/harness-engineering.html">“Harness Engineering for Coding Agent Users,”</a> martinfowler.com, April 2, 2026.</li><li>Vivek Trivedy, <a href="https://www.langchain.com/blog/the-anatomy-of-an-agent-harness">“The Anatomy of an Agent Harness,”</a> LangChain Blog, March 10, 2026.</li><li>Vivek Trivedy, <a href="https://www.langchain.com/blog/improving-deep-agents-with-harness-engineering">“Improving Deep Agents with Harness Engineering,”</a> LangChain Blog, February 17, 2026.</li></ol>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_harness_engineering_next_layer_after_context_engineering_1.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You’ve learned to write better prompts. You’ve learned to structure context. Now it’s time to think about what turns a model into an agent — and what keeps that agent under control once it’s running.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&quot;What-Is-Harness-Engineering&quot;&gt;&lt;a href=&quot;#What-Is-Harness-Engineering&quot; class=&quot;headerlink&quot; title=&quot;What Is Harness Engineering?&quot;&gt;&lt;/a&gt;What Is Harness Engineering?&lt;/h2&gt;&lt;p&gt;In my previous &lt;a href=&quot;/blog/2026/06/14/context-engineering-for-developers-mastering-the-art-of-prompting-systems-agents-and-memory/&quot; title=&quot;Context Engineering for Developers: Mastering the Art of Prompting Systems, Agents, and Memory&quot;&gt;article&lt;/a&gt;, I mentioned context engineering quite a bit and how it’s important for developers to master in this AI era we’re in. If you’ve spent time on context engineering, you already understand one truth: &lt;strong&gt;the quality of what you give an AI model matters as much as the model itself.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Harness engineering is the discipline that comes next — and it’s a bigger shift than it first sounds.&lt;/p&gt;
&lt;p&gt;Context engineering answers &lt;em&gt;what do I put in the prompt?&lt;/em&gt; Harness engineering answers a different question: &lt;em&gt;how does the model actually act — calling tools, tracking state across steps, staying inside guardrails — and how do I control that?&lt;/em&gt;&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai-engineering, large-language-models, harness-engineering, ai-agents, memory-management, claude, agentic-ai, developer-tools" scheme="http://awongcm.io/tags/ai-engineering-large-language-models-harness-engineering-ai-agents-memory-management-claude-agentic-ai-developer-tools/"/>
    
  </entry>
  
  <entry>
    <title>Context Engineering for Developers: Mastering the Art of Prompting Systems, Agents, and Memory</title>
    <link href="http://awongcm.io/blog/2026/06/14/context-engineering-for-developers-mastering-the-art-of-prompting-systems-agents-and-memory/"/>
    <id>http://awongcm.io/blog/2026/06/14/context-engineering-for-developers-mastering-the-art-of-prompting-systems-agents-and-memory/</id>
    <published>2026-06-14T09:23:43.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_context_engineering_for_developers.jpeg" class="center" width="500" height="500" title="Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana"><p><em><p style="text-align: center;">Generated AI image by Google Gemini Nano Banana</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><blockquote><p><em>“Prompting is easy. Getting reliable behavior from an AI system is hard.”</em></p></blockquote><p>If you’ve ever built or worked anything serious with LLMs, you’ve already discovered the truth:<br><strong>hallucinations, drifting answers, and inconsistent behavior are not bugs — they are symptoms of bad context.</strong></p><p>Here’s a number that should change how you think about this: developers in 2026 can fully delegate only 0–20% of tasks to AI agents — even though those agents are completing an average of 20 autonomous actions per run. The bottleneck isn’t model intelligence. It’s context quality.</p><p>In 2026, the most important AI skill for developers is no longer prompt engineering.<br>It is <strong>context engineering</strong>.</p><p>This post explains what that really means, and how developers can build AI systems that are <strong>predictable, grounded, and production-grade</strong>.</p><span id="more"></span><hr><h2 id="The-Real-Problem-With-AI-Isn’t-Intelligence-—-It’s-Memory"><a href="#The-Real-Problem-With-AI-Isn’t-Intelligence-—-It’s-Memory" class="headerlink" title="The Real Problem With AI Isn’t Intelligence — It’s Memory"></a>The Real Problem With AI Isn’t Intelligence — It’s Memory</h2><p>Large Language Models don’t “know” things the way databases do.</p><p>They operate on:</p><ul><li>A finite context window</li><li>Probabilistic token prediction</li><li>Partial, lossy recall</li></ul><p>If you don’t control what goes into the context, you get:</p><ul><li>Hallucinations</li><li>Confabulations</li><li>Inconsistent answers</li><li>Fabricated facts</li><li>Broken reasoning chains</li></ul><p>Most developers blame the model.</p><p>The real problem is:<br><strong>we are giving it garbage context.</strong></p><hr><h2 id="What-Is-Context-Engineering"><a href="#What-Is-Context-Engineering" class="headerlink" title="What Is Context Engineering?"></a>What Is Context Engineering?</h2><p>Context engineering is the discipline of <strong>designing, curating, structuring, and governing everything the AI sees before it produces an answer.</strong></p><p>That includes:</p><ul><li>System instructions</li><li>Developer prompts</li><li>User inputs</li><li>Retrieved documents</li><li>Tool results</li><li>Agent memory</li><li>Conversation history</li></ul><blockquote><p>Context engineering is architecture for LLMs.</p></blockquote><p>The term was popularised in June 2025 by Shopify CEO Tobi Lütke, who called it “the art of providing all the context for the task to be plausibly solvable by the LLM,” and Andrej Karpathy, who defined it more precisely as “the delicate art and science of filling the context window with just the right information for the next step.” The framing has since become the standard vocabulary in serious AI engineering circles — picked up by Gartner and practitioners across the industry.</p><hr><h2 id="Prompt-Engineering-vs-Context-Engineering"><a href="#Prompt-Engineering-vs-Context-Engineering" class="headerlink" title="Prompt Engineering vs Context Engineering"></a>Prompt Engineering vs Context Engineering</h2><table><thead><tr><th>Prompt Engineering</th><th>Context Engineering</th></tr></thead><tbody><tr><td>One-off instructions</td><td>End-to-end system design</td></tr><tr><td>Single message</td><td>Multi-turn, multi-source</td></tr><tr><td>Manual tweaking</td><td>Programmatic control</td></tr><tr><td>Fragile</td><td>Resilient</td></tr><tr><td>ChatGPT style</td><td>Production AI systems</td></tr></tbody></table><p>Prompting is writing.</p><p>Context engineering is <strong>software engineering</strong>.</p><p>The “prompt engineer” job title is already fading — Fast Company reported in mid-2025 that it has “all but disappeared” as a standalone role, with the skill being absorbed into every developer who works with AI. But the underlying discipline has never been more valuable.</p><hr><h2 id="The-Three-Pillars-of-Context-Engineering"><a href="#The-Three-Pillars-of-Context-Engineering" class="headerlink" title="The Three Pillars of Context Engineering"></a>The Three Pillars of Context Engineering</h2><p>To build reliable AI systems, you must control three things:</p><h3 id="1️⃣-Instructions"><a href="#1️⃣-Instructions" class="headerlink" title="1️⃣ Instructions"></a>1️⃣ Instructions</h3><p>What is the AI allowed to do?</p><p>This lives in:</p><ul><li>System prompts</li><li>Role definitions</li><li>Output schemas</li><li>Guardrails</li></ul><p>Example:</p><blockquote><p>“You are a financial risk analyst. Only answer using provided documents. If unsure, say ‘unknown’.”</p></blockquote><p>Without strict instructions, models will invent answers.</p><hr><h3 id="2️⃣-Knowledge-Retrieval"><a href="#2️⃣-Knowledge-Retrieval" class="headerlink" title="2️⃣ Knowledge (Retrieval)"></a>2️⃣ Knowledge (Retrieval)</h3><p>LLMs should not rely on internal training data for facts.</p><p>Instead, they should use:</p><ul><li>Vector search</li><li>Document retrieval</li><li>Structured databases</li><li>APIs</li></ul><p>This is why <strong>RAG (Retrieval Augmented Generation)</strong> exists.</p><p>No retrieval → hallucinations.</p><hr><h3 id="3️⃣-Memory"><a href="#3️⃣-Memory" class="headerlink" title="3️⃣ Memory"></a>3️⃣ Memory</h3><p>Agents need memory to:</p><ul><li>Track goals</li><li>Store decisions</li><li>Maintain conversation state</li><li>Avoid contradictions</li></ul><p>Memory can be:</p><ul><li>Short-term (context window)</li><li>Long-term (databases, embeddings)</li><li>Structured (JSON, key-value, events)</li></ul><p>If you don’t manage memory, agents become confused, repetitive, or inconsistent.</p><hr><h2 id="Why-Most-AI-Apps-Break"><a href="#Why-Most-AI-Apps-Break" class="headerlink" title="Why Most AI Apps Break"></a>Why Most AI Apps Break</h2><p>Most AI apps fail because:</p><ul><li>They dump too much text into the prompt</li><li>They don’t filter or rank knowledge</li><li>They let conversations grow forever</li><li>They don’t validate outputs</li><li>They trust the model blindly</li></ul><p>The model isn’t broken.</p><p>The <strong>context pipeline</strong> is.</p><hr><h2 id="How-Context-Fails-A-Practical-Taxonomy"><a href="#How-Context-Fails-A-Practical-Taxonomy" class="headerlink" title="How Context Fails: A Practical Taxonomy"></a>How Context Fails: A Practical Taxonomy</h2><p>This is the part most tutorials skip. When your agent starts behaving strangely in production, you need a vocabulary to diagnose it. There are four named failure modes every developer should know:</p><p><strong>Context poisoning.</strong> A hallucination or error enters the context early — and then gets referenced again and again across subsequent turns. The model reasons confidently on top of a false premise. The tell: the agent keeps building on something that was never true.</p><p><strong>Context distraction.</strong> The context grows so large that the model over-focuses on its accumulated history and neglects what it learned in training. Instead of reasoning fresh, it leans on past actions and repeats them. Agents that feel “stuck in a loop” are often suffering from this.</p><p><strong>Context confusion.</strong> Multiple conflicting instructions or facts exist in the context window simultaneously. The model tries to satisfy all of them and ends up satisfying none — producing hedged, incoherent, or contradictory output.</p><p><strong>Lost in the middle.</strong> Stanford NLP research documented that language models process information at the beginning and end of the context window more reliably than content buried in the middle. If your most important instructions or retrieved documents land in the middle of a long context, they are effectively invisible to the model. This is a structural property of how transformers attend to tokens — not a model bug you can prompt your way out of.</p><p>Understanding these four failure modes turns a vague “the agent is acting weird” into an actual engineering diagnosis — and gives you a clear lever to pull.</p><hr><h2 id="Context-Is-a-Data-Pipeline"><a href="#Context-Is-a-Data-Pipeline" class="headerlink" title="Context Is a Data Pipeline"></a>Context Is a Data Pipeline</h2><p>Treat AI like any other data system:</p><pre><code class="hljs plaintext">User Input↓Instruction Layer↓Retrieval Layer↓Memory Layer↓LLM↓Validation↓Output</code></pre><p>Each layer must be engineered.</p><p>This is why AI engineering looks more like <strong>data engineering</strong> than like chatbots.</p><hr><h2 id="1️⃣-RAG-Retrieval-Augmented-Generation-Examples"><a href="#1️⃣-RAG-Retrieval-Augmented-Generation-Examples" class="headerlink" title="1️⃣ RAG (Retrieval Augmented Generation) Examples"></a>1️⃣ RAG (Retrieval Augmented Generation) Examples</h2><h3 id="LlamaIndex-Basic-RAG-Implementation"><a href="#LlamaIndex-Basic-RAG-Implementation" class="headerlink" title="LlamaIndex - Basic RAG Implementation"></a><strong>LlamaIndex - Basic RAG Implementation</strong></h3><p><strong>Repository:</strong> <a href="https://github.com/run-llama/llama_index">run-llama&#x2F;llama_index</a><br><strong>Stars:</strong> 46.3k</p><p><strong>Simple RAG Example:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">import</span> os<span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> VectorStoreIndex, SimpleDirectoryReaderos.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>] = <span class="hljs-string">&quot;YOUR_OPENAI_API_KEY&quot;</span><span class="hljs-comment"># Load documents</span>documents = SimpleDirectoryReader(<span class="hljs-string">&quot;YOUR_DATA_DIRECTORY&quot;</span>).load_data()<span class="hljs-comment"># Create vector index</span>index = VectorStoreIndex.from_documents(documents)<span class="hljs-comment"># Query the index</span>query_engine = index.as_query_engine()response = query_engine.query(<span class="hljs-string">&quot;What is context engineering?&quot;</span>)</code></pre><p><strong>Persistent Storage Example:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> StorageContext, load_index_from_storage<span class="hljs-comment"># Save to disk</span>index.storage_context.persist()<span class="hljs-comment"># Reload from disk</span>storage_context = StorageContext.from_defaults(persist_dir=<span class="hljs-string">&quot;./storage&quot;</span>)index = load_index_from_storage(storage_context)</code></pre><p><strong>Advanced RAG with Custom LLM (Llama 2):</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> Settings, VectorStoreIndex, SimpleDirectoryReader<span class="hljs-keyword">from</span> llama_index.embeddings.huggingface <span class="hljs-keyword">import</span> HuggingFaceEmbedding<span class="hljs-keyword">from</span> llama_index.llms.replicate <span class="hljs-keyword">import</span> Replicate<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer<span class="hljs-comment"># Configure LLM</span>Settings.llm = Replicate(    model=<span class="hljs-string">&quot;meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e&quot;</span>,    temperature=<span class="hljs-number">0.01</span>,    additional_kwargs=&#123;<span class="hljs-string">&quot;top_p&quot;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&quot;max_new_tokens&quot;</span>: <span class="hljs-number">300</span>&#125;,)<span class="hljs-comment"># Set tokenizer</span>Settings.tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;NousResearch/Llama-2-7b-chat-hf&quot;</span>)<span class="hljs-comment"># Set embedding model</span>Settings.embed_model = HuggingFaceEmbedding(model_name=<span class="hljs-string">&quot;BAAI/bge-small-en-v1.5&quot;</span>)<span class="hljs-comment"># Build index</span>documents = SimpleDirectoryReader(<span class="hljs-string">&quot;YOUR_DATA_DIRECTORY&quot;</span>).load_data()index = VectorStoreIndex.from_documents(documents)</code></pre><p><strong>Key Features:</strong></p><ul><li>Vector embeddings for semantic search</li><li>Multiple LLM support (OpenAI, Llama 2, etc.)</li><li>Persistent storage</li><li>300+ integrations available</li></ul><hr><h3 id="LangChain-RAG-with-Chat-History"><a href="#LangChain-RAG-with-Chat-History" class="headerlink" title="LangChain - RAG with Chat History"></a><strong>LangChain - RAG with Chat History</strong></h3><p><strong>Repository:</strong> <a href="https://github.com/langchain-ai/langchain">langchain-ai&#x2F;langchain</a><br><strong>Documentation:</strong> <a href="https://python.langchain.com/docs/how_to/qa_chat_history_how_to/">QA with Chat History</a></p><p><strong>RAG with Conversational Memory:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> create_history_aware_retriever, create_retrieval_chain<span class="hljs-keyword">from</span> langchain.chains.combine_documents <span class="hljs-keyword">import</span> create_stuff_documents_chain<span class="hljs-keyword">from</span> langchain_community.vectorstores <span class="hljs-keyword">import</span> Chroma<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAI, OpenAIEmbeddings<span class="hljs-keyword">from</span> langchain_core.prompts <span class="hljs-keyword">import</span> ChatPromptTemplate, MessagesPlaceholder<span class="hljs-comment"># Initialize LLM</span>llm = ChatOpenAI(model=<span class="hljs-string">&quot;gpt-3.5-turbo&quot;</span>, temperature=<span class="hljs-number">0</span>)<span class="hljs-comment"># Create vector store</span>vectorstore = Chroma.from_documents(    documents=docs,    embedding=OpenAIEmbeddings())retriever = vectorstore.as_retriever()<span class="hljs-comment"># System prompt for contextualization</span>contextualize_q_system_prompt = <span class="hljs-string">&quot;&quot;&quot;Given a chat history and the latest user question \</span><span class="hljs-string">which might reference context in the chat history, formulate a standalone question \</span><span class="hljs-string">which can be understood without the chat history. Do NOT answer the question, \</span><span class="hljs-string">just reformulate it if needed and otherwise return it as is.&quot;&quot;&quot;</span>contextualize_q_prompt = ChatPromptTemplate.from_messages([    (<span class="hljs-string">&quot;system&quot;</span>, contextualize_q_system_prompt),    MessagesPlaceholder(<span class="hljs-string">&quot;chat_history&quot;</span>),    (<span class="hljs-string">&quot;human&quot;</span>, <span class="hljs-string">&quot;&#123;input&#125;&quot;</span>),])<span class="hljs-comment"># Create history-aware retriever</span>history_aware_retriever = create_history_aware_retriever(    llm, retriever, contextualize_q_prompt)<span class="hljs-comment"># QA system prompt</span>qa_system_prompt = <span class="hljs-string">&quot;&quot;&quot;You are an assistant for question-answering tasks. \</span><span class="hljs-string">Use the following pieces of retrieved context to answer the question. \</span><span class="hljs-string">If you don&#x27;t know the answer, just say that you don&#x27;t know. \</span><span class="hljs-string">Use three sentences maximum and keep the answer concise.\n\n&#123;context&#125;&quot;&quot;&quot;</span>qa_prompt = ChatPromptTemplate.from_messages([    (<span class="hljs-string">&quot;system&quot;</span>, qa_system_prompt),    MessagesPlaceholder(<span class="hljs-string">&quot;chat_history&quot;</span>),    (<span class="hljs-string">&quot;human&quot;</span>, <span class="hljs-string">&quot;&#123;input&#125;&quot;</span>),])<span class="hljs-comment"># Create RAG chain</span>question_answer_chain = create_stuff_documents_chain(llm, qa_prompt)rag_chain = create_retrieval_chain(history_aware_retriever, question_answer_chain)<span class="hljs-comment"># Use with chat history</span>chat_history = []response = rag_chain.invoke(&#123;    <span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;What is context engineering?&quot;</span>,    <span class="hljs-string">&quot;chat_history&quot;</span>: chat_history&#125;)</code></pre><hr><h3 id="Chroma-Vector-Database-for-RAG"><a href="#Chroma-Vector-Database-for-RAG" class="headerlink" title="Chroma - Vector Database for RAG"></a><strong>Chroma - Vector Database for RAG</strong></h3><p><strong>Repository:</strong> <a href="https://github.com/chroma-core/chroma">chroma-core&#x2F;chroma</a></p><p><strong>Basic Usage:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">import</span> chromadb<span class="hljs-keyword">from</span> chromadb.config <span class="hljs-keyword">import</span> Settings<span class="hljs-comment"># Initialize client</span>client = chromadb.Client(Settings(    chroma_db_impl=<span class="hljs-string">&quot;duckdb+parquet&quot;</span>,    persist_directory=<span class="hljs-string">&quot;./chroma_db&quot;</span>))<span class="hljs-comment"># Create collection</span>collection = client.create_collection(name=<span class="hljs-string">&quot;my_collection&quot;</span>)<span class="hljs-comment"># Add documents</span>collection.add(    documents=[<span class="hljs-string">&quot;This is document 1&quot;</span>, <span class="hljs-string">&quot;This is document 2&quot;</span>],    metadatas=[&#123;<span class="hljs-string">&quot;source&quot;</span>: <span class="hljs-string">&quot;doc1&quot;</span>&#125;, &#123;<span class="hljs-string">&quot;source&quot;</span>: <span class="hljs-string">&quot;doc2&quot;</span>&#125;],    ids=[<span class="hljs-string">&quot;id1&quot;</span>, <span class="hljs-string">&quot;id2&quot;</span>])<span class="hljs-comment"># Query</span>results = collection.query(    query_texts=[<span class="hljs-string">&quot;What is context engineering?&quot;</span>],    n_results=<span class="hljs-number">2</span>)</code></pre><hr><h2 id="2️⃣-AI-Agents-with-Memory-Examples"><a href="#2️⃣-AI-Agents-with-Memory-Examples" class="headerlink" title="2️⃣ AI Agents with Memory Examples"></a>2️⃣ AI Agents with Memory Examples</h2><h3 id="LlamaIndex-Agent-Workflows"><a href="#LlamaIndex-Agent-Workflows" class="headerlink" title="LlamaIndex - Agent Workflows"></a><strong>LlamaIndex - Agent Workflows</strong></h3><p><strong>Repository:</strong> <a href="https://github.com/run-llama/llama_index">run-llama&#x2F;llama_index</a><br><strong>Path:</strong> <code>llama-index-core/llama_index/core/agent/</code></p><p><strong>Agent with Tools:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core.agent <span class="hljs-keyword">import</span> ReActAgent<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool<span class="hljs-keyword">from</span> llama_index.llms.openai <span class="hljs-keyword">import</span> OpenAI<span class="hljs-comment"># Define tools</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">multiply</span>(<span class="hljs-params">a: <span class="hljs-built_in">int</span>, b: <span class="hljs-built_in">int</span></span>) -&gt; <span class="hljs-built_in">int</span>:    <span class="hljs-string">&quot;&quot;&quot;Multiply two integers.&quot;&quot;&quot;</span>    <span class="hljs-keyword">return</span> a * b<span class="hljs-keyword">def</span> <span class="hljs-title function_">add</span>(<span class="hljs-params">a: <span class="hljs-built_in">int</span>, b: <span class="hljs-built_in">int</span></span>) -&gt; <span class="hljs-built_in">int</span>:    <span class="hljs-string">&quot;&quot;&quot;Add two integers.&quot;&quot;&quot;</span>    <span class="hljs-keyword">return</span> a + bmultiply_tool = FunctionTool.from_defaults(fn=multiply)add_tool = FunctionTool.from_defaults(fn=add)<span class="hljs-comment"># Create agent</span>llm = OpenAI(model=<span class="hljs-string">&quot;gpt-4&quot;</span>)agent = ReActAgent.from_tools(    [multiply_tool, add_tool],    llm=llm,    verbose=<span class="hljs-literal">True</span>)<span class="hljs-comment"># Run agent</span>response = agent.chat(<span class="hljs-string">&quot;What is (121 + 2) * 5?&quot;</span>)<span class="hljs-built_in">print</span>(response)</code></pre><p><strong>Agent with Memory and Context:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core.agent <span class="hljs-keyword">import</span> ReActAgent<span class="hljs-keyword">from</span> llama_index.core.memory <span class="hljs-keyword">import</span> ChatMemoryBuffer<span class="hljs-comment"># Create memory buffer</span>memory = ChatMemoryBuffer.from_defaults(token_limit=<span class="hljs-number">3000</span>)<span class="hljs-comment"># Create agent with memory</span>agent = ReActAgent.from_tools(    tools=[multiply_tool, add_tool],    llm=llm,    memory=memory,    verbose=<span class="hljs-literal">True</span>)<span class="hljs-comment"># Multi-turn conversation</span>agent.chat(<span class="hljs-string">&quot;My name is John&quot;</span>)agent.chat(<span class="hljs-string">&quot;What&#x27;s my name?&quot;</span>)  <span class="hljs-comment"># Agent remembers</span></code></pre><hr><h3 id="LangChain-Agent-with-Memory"><a href="#LangChain-Agent-with-Memory" class="headerlink" title="LangChain - Agent with Memory"></a><strong>LangChain - Agent with Memory</strong></h3><p><strong>Repository:</strong> <a href="https://github.com/langchain-ai/langchain">langchain-ai&#x2F;langchain</a></p><p><strong>Agent with Conversation Memory:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.agents <span class="hljs-keyword">import</span> AgentExecutor, create_openai_functions_agent<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAI<span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationBufferMemory<span class="hljs-keyword">from</span> langchain_core.prompts <span class="hljs-keyword">import</span> ChatPromptTemplate, MessagesPlaceholder<span class="hljs-keyword">from</span> langchain.tools <span class="hljs-keyword">import</span> Tool<span class="hljs-comment"># Define tools</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">search_tool</span>(<span class="hljs-params">query: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:    <span class="hljs-string">&quot;&quot;&quot;Search for information.&quot;&quot;&quot;</span>    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Results for: <span class="hljs-subst">&#123;query&#125;</span>&quot;</span>tools = [    Tool(        name=<span class="hljs-string">&quot;Search&quot;</span>,        func=search_tool,        description=<span class="hljs-string">&quot;Useful for searching information&quot;</span>    )]<span class="hljs-comment"># Create prompt with memory placeholder</span>prompt = ChatPromptTemplate.from_messages([    (<span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;You are a helpful assistant with access to tools.&quot;</span>),    MessagesPlaceholder(variable_name=<span class="hljs-string">&quot;chat_history&quot;</span>),    (<span class="hljs-string">&quot;human&quot;</span>, <span class="hljs-string">&quot;&#123;input&#125;&quot;</span>),    MessagesPlaceholder(variable_name=<span class="hljs-string">&quot;agent_scratchpad&quot;</span>),])<span class="hljs-comment"># Initialize LLM</span>llm = ChatOpenAI(temperature=<span class="hljs-number">0</span>)<span class="hljs-comment"># Create agent</span>agent = create_openai_functions_agent(llm, tools, prompt)<span class="hljs-comment"># Add memory</span>memory = ConversationBufferMemory(    memory_key=<span class="hljs-string">&quot;chat_history&quot;</span>,    return_messages=<span class="hljs-literal">True</span>)<span class="hljs-comment"># Create executor</span>agent_executor = AgentExecutor(    agent=agent,    tools=tools,    memory=memory,    verbose=<span class="hljs-literal">True</span>)<span class="hljs-comment"># Run with memory</span>agent_executor.invoke(&#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;My favorite color is blue&quot;</span>&#125;)agent_executor.invoke(&#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;What&#x27;s my favorite color?&quot;</span>&#125;)</code></pre><hr><h2 id="3️⃣-Memory-Store-Examples"><a href="#3️⃣-Memory-Store-Examples" class="headerlink" title="3️⃣ Memory Store Examples"></a>3️⃣ Memory Store Examples</h2><h3 id="LangChain-Multiple-Memory-Types"><a href="#LangChain-Multiple-Memory-Types" class="headerlink" title="LangChain - Multiple Memory Types"></a><strong>LangChain - Multiple Memory Types</strong></h3><p><strong>1. Conversation Buffer Memory (Short-term):</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationBufferMemorymemory = ConversationBufferMemory()memory.save_context(&#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;Hi&quot;</span>&#125;, &#123;<span class="hljs-string">&quot;output&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>&#125;)memory.save_context(&#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;What&#x27;s AI?&quot;</span>&#125;, &#123;<span class="hljs-string">&quot;output&quot;</span>: <span class="hljs-string">&quot;Artificial Intelligence&quot;</span>&#125;)<span class="hljs-built_in">print</span>(memory.load_memory_variables(&#123;&#125;))<span class="hljs-comment"># Output: &#123;&#x27;history&#x27;: &#x27;Human: Hi\nAI: Hello!\nHuman: What\&#x27;s AI?\nAI: Artificial Intelligence&#x27;&#125;</span></code></pre><p><strong>2. Conversation Summary Memory:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationSummaryMemory<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAIllm = ChatOpenAI(temperature=<span class="hljs-number">0</span>)memory = ConversationSummaryMemory(llm=llm)memory.save_context(    &#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;Tell me about context engineering&quot;</span>&#125;,    &#123;<span class="hljs-string">&quot;output&quot;</span>: <span class="hljs-string">&quot;Context engineering is the discipline of designing and curating everything the AI sees...&quot;</span>&#125;)<span class="hljs-built_in">print</span>(memory.load_memory_variables(&#123;&#125;))<span class="hljs-comment"># Returns summarized version</span></code></pre><p><strong>3. Vector Store Memory (Long-term):</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> VectorStoreRetrieverMemory<span class="hljs-keyword">from</span> langchain_community.vectorstores <span class="hljs-keyword">import</span> Chroma<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> OpenAIEmbeddings<span class="hljs-comment"># Create vector store</span>vectorstore = Chroma(    embedding_function=OpenAIEmbeddings(),    persist_directory=<span class="hljs-string">&quot;./memory_db&quot;</span>)<span class="hljs-comment"># Create retriever memory</span>retriever = vectorstore.as_retriever(search_kwargs=&#123;<span class="hljs-string">&quot;k&quot;</span>: <span class="hljs-number">2</span>&#125;)memory = VectorStoreRetrieverMemory(retriever=retriever)<span class="hljs-comment"># Save context</span>memory.save_context(    &#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;My favorite programming language is Python&quot;</span>&#125;,    &#123;<span class="hljs-string">&quot;output&quot;</span>: <span class="hljs-string">&quot;That&#x27;s great! Python is very popular.&quot;</span>&#125;)<span class="hljs-comment"># Retrieve relevant memories</span>relevant_memories = memory.load_memory_variables(    &#123;<span class="hljs-string">&quot;prompt&quot;</span>: <span class="hljs-string">&quot;What language do I like?&quot;</span>&#125;)</code></pre><p><strong>4. Entity Memory (Structured):</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationEntityMemory<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAIllm = ChatOpenAI(temperature=<span class="hljs-number">0</span>)memory = ConversationEntityMemory(llm=llm)memory.save_context(    &#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;John works at OpenAI and loves AI research&quot;</span>&#125;,    &#123;<span class="hljs-string">&quot;output&quot;</span>: <span class="hljs-string">&quot;That&#x27;s interesting about John!&quot;</span>&#125;)<span class="hljs-comment"># Extracts entities: John, OpenAI, AI research</span><span class="hljs-built_in">print</span>(memory.entity_store.store)</code></pre><hr><h3 id="LlamaIndex-Memory-Modules"><a href="#LlamaIndex-Memory-Modules" class="headerlink" title="LlamaIndex - Memory Modules"></a><strong>LlamaIndex - Memory Modules</strong></h3><p><strong>Chat Memory:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core.memory <span class="hljs-keyword">import</span> ChatMemoryBuffer<span class="hljs-comment"># Simple chat memory</span>memory = ChatMemoryBuffer.from_defaults(token_limit=<span class="hljs-number">3000</span>)<span class="hljs-comment"># Add messages</span>memory.put(ChatMessage(role=<span class="hljs-string">&quot;user&quot;</span>, content=<span class="hljs-string">&quot;Hello&quot;</span>))memory.put(ChatMessage(role=<span class="hljs-string">&quot;assistant&quot;</span>, content=<span class="hljs-string">&quot;Hi there!&quot;</span>))<span class="hljs-comment"># Get all messages</span>messages = memory.get_all()</code></pre><p><strong>Vector Memory:</strong></p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core.memory <span class="hljs-keyword">import</span> VectorMemory<span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> VectorStoreIndex<span class="hljs-comment"># Create vector-based memory</span>vector_memory = VectorMemory.from_defaults(    vector_store=vector_store,    embed_model=embed_model,)<span class="hljs-comment"># Store interaction</span>vector_memory.put(ChatMessage(role=<span class="hljs-string">&quot;user&quot;</span>, content=<span class="hljs-string">&quot;I like Python&quot;</span>))<span class="hljs-comment"># Retrieve relevant memories</span>relevant = vector_memory.get(query=<span class="hljs-string">&quot;programming languages&quot;</span>)</code></pre><hr><h2 id="4️⃣-Complete-Context-Engineering-Pipeline-Examples"><a href="#4️⃣-Complete-Context-Engineering-Pipeline-Examples" class="headerlink" title="4️⃣ Complete Context Engineering Pipeline Examples"></a>4️⃣ Complete Context Engineering Pipeline Examples</h2><h3 id="Full-RAG-Agent-Memory-System"><a href="#Full-RAG-Agent-Memory-System" class="headerlink" title="Full RAG + Agent + Memory System"></a><strong>Full RAG + Agent + Memory System</strong></h3><pre><code class="hljs python"><span class="hljs-keyword">from</span> langchain.agents <span class="hljs-keyword">import</span> AgentExecutor, create_openai_functions_agent<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAI, OpenAIEmbeddings<span class="hljs-keyword">from</span> langchain_community.vectorstores <span class="hljs-keyword">import</span> Chroma<span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationBufferMemory<span class="hljs-keyword">from</span> langchain.tools <span class="hljs-keyword">import</span> Tool<span class="hljs-keyword">from</span> langchain_core.prompts <span class="hljs-keyword">import</span> ChatPromptTemplate, MessagesPlaceholder<span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> RetrievalQA<span class="hljs-comment"># 1. KNOWLEDGE LAYER - RAG Setup</span>vectorstore = Chroma.from_documents(    documents=docs,    embedding=OpenAIEmbeddings(),    persist_directory=<span class="hljs-string">&quot;./knowledge_base&quot;</span>)<span class="hljs-comment"># Create retrieval tool</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">knowledge_search</span>(<span class="hljs-params">query: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:    <span class="hljs-string">&quot;&quot;&quot;Search the knowledge base for relevant information.&quot;&quot;&quot;</span>    retriever = vectorstore.as_retriever(search_kwargs=&#123;<span class="hljs-string">&quot;k&quot;</span>: <span class="hljs-number">3</span>&#125;)    qa_chain = RetrievalQA.from_chain_type(        llm=ChatOpenAI(temperature=<span class="hljs-number">0</span>),        retriever=retriever,        return_source_documents=<span class="hljs-literal">True</span>    )    result = qa_chain(&#123;<span class="hljs-string">&quot;query&quot;</span>: query&#125;)    <span class="hljs-keyword">return</span> result[<span class="hljs-string">&quot;result&quot;</span>]<span class="hljs-comment"># 2. TOOLS/ACTIONS LAYER</span>tools = [    Tool(        name=<span class="hljs-string">&quot;KnowledgeBase&quot;</span>,        func=knowledge_search,        description=<span class="hljs-string">&quot;Search the knowledge base for factual information. Always use this before answering questions.&quot;</span>    )]<span class="hljs-comment"># 3. INSTRUCTION LAYER - System Prompt</span>system_prompt = <span class="hljs-string">&quot;&quot;&quot;You are a precise AI assistant that follows these rules:</span><span class="hljs-string">1. ALWAYS search the knowledge base before answering</span><span class="hljs-string">2. Only use information from retrieved documents</span><span class="hljs-string">3. If information is not in the knowledge base, say &quot;I don&#x27;t have that information&quot;</span><span class="hljs-string">4. Cite your sources</span><span class="hljs-string">5. Keep answers concise and factual&quot;&quot;&quot;</span>prompt = ChatPromptTemplate.from_messages([    (<span class="hljs-string">&quot;system&quot;</span>, system_prompt),    MessagesPlaceholder(variable_name=<span class="hljs-string">&quot;chat_history&quot;</span>),    (<span class="hljs-string">&quot;human&quot;</span>, <span class="hljs-string">&quot;&#123;input&#125;&quot;</span>),    MessagesPlaceholder(variable_name=<span class="hljs-string">&quot;agent_scratchpad&quot;</span>),])<span class="hljs-comment"># 4. MEMORY LAYER</span>memory = ConversationBufferMemory(    memory_key=<span class="hljs-string">&quot;chat_history&quot;</span>,    return_messages=<span class="hljs-literal">True</span>,    output_key=<span class="hljs-string">&quot;output&quot;</span>)<span class="hljs-comment"># 5. AGENT ORCHESTRATION</span>llm = ChatOpenAI(model=<span class="hljs-string">&quot;gpt-4&quot;</span>, temperature=<span class="hljs-number">0</span>)agent = create_openai_functions_agent(llm, tools, prompt)agent_executor = AgentExecutor(    agent=agent,    tools=tools,    memory=memory,    verbose=<span class="hljs-literal">True</span>,    return_intermediate_steps=<span class="hljs-literal">True</span>)<span class="hljs-comment"># 6. VALIDATION LAYER</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">validate_response</span>(<span class="hljs-params">response: <span class="hljs-built_in">dict</span></span>) -&gt; <span class="hljs-built_in">dict</span>:    <span class="hljs-string">&quot;&quot;&quot;Validate agent response for hallucinations.&quot;&quot;&quot;</span>    output = response[<span class="hljs-string">&quot;output&quot;</span>]        <span class="hljs-comment"># Check if sources were used</span>    <span class="hljs-keyword">if</span> <span class="hljs-string">&quot;intermediate_steps&quot;</span> <span class="hljs-keyword">in</span> response:        <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> response[<span class="hljs-string">&quot;intermediate_steps&quot;</span>]:            output = <span class="hljs-string">&quot;⚠️ No sources consulted. &quot;</span> + output        <span class="hljs-comment"># Check for uncertainty markers</span>    <span class="hljs-keyword">if</span> <span class="hljs-string">&quot;I don&#x27;t know&quot;</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> output <span class="hljs-keyword">and</span> <span class="hljs-string">&quot;knowledge base&quot;</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> output.lower():        output = <span class="hljs-string">&quot;⚠️ Unverified: &quot;</span> + output        <span class="hljs-keyword">return</span> &#123;<span class="hljs-string">&quot;output&quot;</span>: output, <span class="hljs-string">&quot;validated&quot;</span>: <span class="hljs-literal">True</span>&#125;<span class="hljs-comment"># Usage</span>response = agent_executor.invoke(&#123;<span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-string">&quot;What is context engineering?&quot;</span>&#125;)validated = validate_response(response)<span class="hljs-built_in">print</span>(validated[<span class="hljs-string">&quot;output&quot;</span>])</code></pre><hr><h2 id="5️⃣-What’s-New-in-Mid-2026-Skills-Every-Developer-Should-Add-Now"><a href="#5️⃣-What’s-New-in-Mid-2026-Skills-Every-Developer-Should-Add-Now" class="headerlink" title="5️⃣ What’s New in Mid-2026: Skills Every Developer Should Add Now"></a>5️⃣ What’s New in Mid-2026: Skills Every Developer Should Add Now</h2><p>The fundamentals above are still the foundation. But the practitioner community has moved on to a second tier of skills that separate production-grade systems from demos. Here’s what to learn next.</p><hr><h3 id="Skill-1-Upgrade-Your-RAG-to-Contextual-Retrieval"><a href="#Skill-1-Upgrade-Your-RAG-to-Contextual-Retrieval" class="headerlink" title="Skill 1: Upgrade Your RAG to Contextual Retrieval"></a>Skill 1: Upgrade Your RAG to Contextual Retrieval</h3><p>Naive chunking strips context. A retrieved fragment that says “the decision was reversed” means nothing without knowing which decision, in which document, under what conditions. Embed that orphaned sentence and your retrieval is already compromised before the model sees it.</p><p>The fix is <strong>contextual retrieval</strong>: prepend each chunk with a generated summary of where it lives in the document before embedding. Anthropic’s own research shows contextual embeddings alone reduce retrieval failures by 35%. Combine them with BM25 hybrid search and that improves to 49%. Add a reranker on top and you reach 67%.</p><p>The other half is <strong>hybrid search</strong>: combining vector search with keyword search, then reranking by relevance to the actual query. Pure vector search misses exact-match queries. Pure keyword search misses semantic variation. You need both.</p><pre><code class="hljs python"><span class="hljs-comment"># Conceptual pattern: contextual chunk enrichment before embedding</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">enrich_chunk</span>(<span class="hljs-params">chunk: <span class="hljs-built_in">str</span>, doc_summary: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:    <span class="hljs-string">&quot;&quot;&quot;Prepend document-level context to each chunk before embedding.&quot;&quot;&quot;</span>    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;[Document context: <span class="hljs-subst">&#123;doc_summary&#125;</span>]\n\n<span class="hljs-subst">&#123;chunk&#125;</span>&quot;</span><span class="hljs-comment"># Then embed the enriched chunk, not the raw chunk</span>enriched = enrich_chunk(raw_chunk, generate_doc_summary(document))embedding = embed_model.get_text_embedding(enriched)</code></pre><hr><h3 id="Skill-2-Build-Agentic-RAG-—-Let-the-Agent-Decide-When-to-Retrieve"><a href="#Skill-2-Build-Agentic-RAG-—-Let-the-Agent-Decide-When-to-Retrieve" class="headerlink" title="Skill 2: Build Agentic RAG — Let the Agent Decide When to Retrieve"></a>Skill 2: Build Agentic RAG — Let the Agent Decide When to Retrieve</h3><p>The third generation of RAG doesn’t retrieve on every turn. The agent evaluates whether retrieval is needed, dynamically selects the right source (vector store, knowledge graph, web search), assesses the quality of what it gets back, and decides whether to re-retrieve before answering.</p><p>This is the difference between a passive retrieval pipeline and an active reasoning system.</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> llama_index.core.agent <span class="hljs-keyword">import</span> ReActAgent<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> QueryEngineTool<span class="hljs-comment"># Give the agent retrieval as a tool — let it decide when to use it</span>vector_tool = QueryEngineTool.from_defaults(    query_engine=index.as_query_engine(),    name=<span class="hljs-string">&quot;knowledge_base&quot;</span>,    description=<span class="hljs-string">&quot;Use this when you need factual information from company documents. Do not use for general knowledge questions.&quot;</span>)agent = ReActAgent.from_tools([vector_tool], llm=llm, verbose=<span class="hljs-literal">True</span>)<span class="hljs-comment"># The agent now chooses whether retrieval is warranted — it doesn&#x27;t blindly retrieve on every turn</span></code></pre><hr><h3 id="Skill-3-Write-Context-Configuration-Files-CLAUDE-md-x2F-cursorrules"><a href="#Skill-3-Write-Context-Configuration-Files-CLAUDE-md-x2F-cursorrules" class="headerlink" title="Skill 3: Write Context Configuration Files (CLAUDE.md &#x2F; .cursorrules)"></a>Skill 3: Write Context Configuration Files (CLAUDE.md &#x2F; .cursorrules)</h3><p>Every major AI coding tool in 2026 has its own context configuration system. Claude Code uses <code>CLAUDE.md</code>, Cursor uses <code>.mdc</code> project rules, GitHub Copilot uses <code>copilot-instructions.md</code>. These files are “Write” context engineering — you’re pre-loading project-specific knowledge into every model call.</p><p>The key insight: these files aren’t read sequentially like a human reads a README. AI tools retrieve the most relevant sections for the task at hand. Section titles matter — mirror the natural language of development tasks.</p><p>A well-structured <code>CLAUDE.md</code> for a production codebase might look like this:</p><pre><code class="hljs markdown"><span class="hljs-section"># Project Context</span><span class="hljs-section">## Architecture decisions</span><span class="hljs-bullet">-</span> All API routes are versioned under /api/v2<span class="hljs-bullet">-</span> We use PostgreSQL via Supabase; never use raw SQL for auth operations<span class="hljs-section">## API authentication patterns</span><span class="hljs-bullet">-</span> All protected routes use the validateSession middleware<span class="hljs-bullet">-</span> Never expose the service<span class="hljs-emphasis">_role key in client-side code</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">## Error handling for external services</span><span class="hljs-emphasis">- Wrap all third-party API calls in the withRetry utility</span><span class="hljs-emphasis">- Log errors to Sentry before re-throwing</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">## DO NOT</span><span class="hljs-emphasis">- Do not add new npm packages without updating package-lock.json</span><span class="hljs-emphasis">- Do not bypass TypeScript strict mode with @ts-ignore</span></code></pre><p>Keep it under 500 lines and review it quarterly. An AI agent is only as smart as the last time its context was reviewed.</p><hr><h3 id="Skill-4-Add-Checkpoint-Injection-to-Long-Agent-Runs"><a href="#Skill-4-Add-Checkpoint-Injection-to-Long-Agent-Runs" class="headerlink" title="Skill 4: Add Checkpoint Injection to Long Agent Runs"></a>Skill 4: Add Checkpoint Injection to Long Agent Runs</h3><p>For agents running more than five steps, add a checkpoint mechanism that re-anchors the agent to the original objective. This directly combats context distraction — the failure mode where accumulated history causes the agent to drift from the original goal.</p><pre><code class="hljs python">CHECKPOINT_INTERVAL = <span class="hljs-number">5</span>  <span class="hljs-comment"># Re-anchor every 5 actions</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">run_agent_with_checkpoints</span>(<span class="hljs-params">agent, task: <span class="hljs-built_in">str</span>, max_steps: <span class="hljs-built_in">int</span> = <span class="hljs-number">20</span></span>):    original_objective = task    step_count = <span class="hljs-number">0</span>        <span class="hljs-keyword">while</span> step_count &lt; max_steps:        <span class="hljs-comment"># Inject checkpoint every N steps</span>        <span class="hljs-keyword">if</span> step_count &gt; <span class="hljs-number">0</span> <span class="hljs-keyword">and</span> step_count % CHECKPOINT_INTERVAL == <span class="hljs-number">0</span>:            checkpoint_prompt = <span class="hljs-string">f&quot;&quot;&quot;</span><span class="hljs-string">            CHECKPOINT: Your original objective was: &quot;<span class="hljs-subst">&#123;original_objective&#125;</span>&quot;</span><span class="hljs-string">            Steps completed so far: <span class="hljs-subst">&#123;step_count&#125;</span></span><span class="hljs-string">            Verify you are still on track before continuing.</span><span class="hljs-string">            &quot;&quot;&quot;</span>            agent.memory.put(ChatMessage(role=<span class="hljs-string">&quot;system&quot;</span>, content=checkpoint_prompt))                result = agent.step()        step_count += <span class="hljs-number">1</span>                <span class="hljs-keyword">if</span> result.is_done:            <span class="hljs-keyword">break</span>        <span class="hljs-keyword">return</span> result</code></pre><hr><h3 id="Skill-5-Treat-System-Prompts-as-Versioned-Code"><a href="#Skill-5-Treat-System-Prompts-as-Versioned-Code" class="headerlink" title="Skill 5: Treat System Prompts as Versioned Code"></a>Skill 5: Treat System Prompts as Versioned Code</h3><p>Prompt engineering is table stakes. But treating prompts as throw-away text is how teams end up with undocumented, untestable, unmaintainable AI behaviour at scale.</p><p>In 2026, production teams version their system prompts the same way they version application code: committed to git, tagged at release, tested before deployment.</p><p>Tools like <strong>Promptfoo</strong> bring CI&#x2F;CD discipline to prompts — automated testing, regression checks, red teaming. It’s used by 300,000+ developers and 127 Fortune 500 companies (note: OpenAI acquired Promptfoo in March 2026; the core framework remains open-source). If your application code is tested before shipping, your prompts should be too.</p><pre><code class="hljs bash"><span class="hljs-comment"># promptfoo example: test your system prompt against expected outputs</span>npx promptfoo <span class="hljs-built_in">eval</span> --config promptfoo.yaml<span class="hljs-comment"># promptfoo.yaml</span>prompts:  - <span class="hljs-string">&quot;prompts/system_v2.txt&quot;</span>providers:  - openai:gpt-4tests:  - vars:      input: <span class="hljs-string">&quot;What is our refund policy?&quot;</span>    assert:      - <span class="hljs-built_in">type</span>: contains        value: <span class="hljs-string">&quot;30 days&quot;</span>      - <span class="hljs-built_in">type</span>: not-contains        value: <span class="hljs-string">&quot;I don&#x27;t know&quot;</span></code></pre><hr><h3 id="Skill-6-Audit-Your-MCP-Tool-Token-Cost"><a href="#Skill-6-Audit-Your-MCP-Tool-Token-Cost" class="headerlink" title="Skill 6: Audit Your MCP Tool Token Cost"></a>Skill 6: Audit Your MCP Tool Token Cost</h3><p>If your agents connect to MCP (Model Context Protocol) servers, audit how many tokens your tool schemas consume before any user interaction happens. The number is usually higher than expected — sometimes consuming a significant portion of your effective context budget before the first user message.</p><p>The discipline here is <strong>tool scoping</strong>: only load the tools appropriate to the current task phase. An agent in a “research” phase doesn’t need write tools. An agent in a “write” phase doesn’t need read-all tools.</p><pre><code class="hljs python"><span class="hljs-comment"># Instead of loading all tools at agent init:</span>all_tools = [read_tool, write_tool, search_tool, database_tool, email_tool]<span class="hljs-comment"># Scope tools to the current phase</span>PHASE_TOOLS = &#123;    <span class="hljs-string">&quot;research&quot;</span>: [search_tool, read_tool],    <span class="hljs-string">&quot;write&quot;</span>: [write_tool],    <span class="hljs-string">&quot;review&quot;</span>: [read_tool, database_tool],&#125;<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_agent_for_phase</span>(<span class="hljs-params">phase: <span class="hljs-built_in">str</span></span>):    <span class="hljs-keyword">return</span> ReActAgent.from_tools(PHASE_TOOLS[phase], llm=llm)</code></pre><hr><h3 id="Skill-7-Write-Evals-Not-Just-Vibes-Tests"><a href="#Skill-7-Write-Evals-Not-Just-Vibes-Tests" class="headerlink" title="Skill 7: Write Evals, Not Just Vibes Tests"></a>Skill 7: Write Evals, Not Just Vibes Tests</h3><p>As open-source models (Llama 3, DeepSeek, Qwen) become viable alternatives to proprietary APIs, the decision of which model to use for a given task is now an engineering decision — not just a preference. Making that decision defensibly requires systematic evaluation, not gut feel.</p><p>Being able to run structured evals — covering factual accuracy, completeness, and failure rate — is quickly becoming the skill that separates senior AI engineers from everyone else.</p><pre><code class="hljs python"><span class="hljs-comment"># Simple eval harness pattern</span><span class="hljs-keyword">import</span> json<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Callable</span><span class="hljs-keyword">def</span> <span class="hljs-title function_">run_eval</span>(<span class="hljs-params"></span><span class="hljs-params">    agent_fn: <span class="hljs-type">Callable</span>,</span><span class="hljs-params">    test_cases: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">dict</span>],</span><span class="hljs-params">    grader_fn: <span class="hljs-type">Callable</span></span><span class="hljs-params"></span>) -&gt; <span class="hljs-built_in">dict</span>:    results = []    <span class="hljs-keyword">for</span> <span class="hljs-keyword">case</span> <span class="hljs-keyword">in</span> test_cases:        output = agent_fn(<span class="hljs-keyword">case</span>[<span class="hljs-string">&quot;input&quot;</span>])        score = grader_fn(output, <span class="hljs-keyword">case</span>[<span class="hljs-string">&quot;expected&quot;</span>])        results.append(&#123;            <span class="hljs-string">&quot;input&quot;</span>: <span class="hljs-keyword">case</span>[<span class="hljs-string">&quot;input&quot;</span>],            <span class="hljs-string">&quot;output&quot;</span>: output,            <span class="hljs-string">&quot;expected&quot;</span>: <span class="hljs-keyword">case</span>[<span class="hljs-string">&quot;expected&quot;</span>],            <span class="hljs-string">&quot;score&quot;</span>: score,            <span class="hljs-string">&quot;passed&quot;</span>: score &gt;= <span class="hljs-number">0.8</span>        &#125;)        pass_rate = <span class="hljs-built_in">sum</span>(r[<span class="hljs-string">&quot;passed&quot;</span>] <span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> results) / <span class="hljs-built_in">len</span>(results)    <span class="hljs-keyword">return</span> &#123;<span class="hljs-string">&quot;pass_rate&quot;</span>: pass_rate, <span class="hljs-string">&quot;results&quot;</span>: results&#125;</code></pre><hr><h2 id="6️⃣-Additional-Resources-amp-Repositories"><a href="#6️⃣-Additional-Resources-amp-Repositories" class="headerlink" title="6️⃣ Additional Resources &amp; Repositories"></a>6️⃣ Additional Resources &amp; Repositories</h2><h3 id="Production-Ready-Examples"><a href="#Production-Ready-Examples" class="headerlink" title="Production-Ready Examples:"></a><strong>Production-Ready Examples:</strong></h3><ol><li><p><strong>Chat Your Data</strong> - <a href="https://github.com/hwchase17/chat-your-data">hwchase17&#x2F;chat-your-data</a></p><ul><li>Complete RAG application</li><li>Multiple data sources</li><li>Conversation memory</li></ul></li><li><p><strong>LlamaIndex Examples</strong> - <a href="https://github.com/run-llama/llama_index/tree/main/docs/docs/examples">Examples Directory</a></p><ul><li>100+ examples</li><li>Agent workflows</li><li>Memory patterns</li><li>Multi-modal RAG</li></ul></li><li><p><strong>LangChain Cookbook</strong> - <a href="https://github.com/langchain-ai/langchain/tree/master/cookbook">Cookbook</a></p><ul><li>Production patterns</li><li>Advanced memory techniques</li><li>Agent architectures</li></ul></li><li><p><strong>LangChain Templates</strong> - <a href="https://github.com/langchain-ai/langchain/tree/master/templates">Templates</a></p><ul><li>Ready-to-use templates</li><li>RAG variations</li><li>Agent patterns</li></ul></li><li><p><strong>Agent Skills for Context Engineering</strong> - <a href="https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering">muratcankoylan&#x2F;Agent-Skills-for-Context-Engineering</a></p><ul><li>Context compression patterns</li><li>Multi-agent coordination</li><li>Evaluation frameworks</li><li>Production-tested skill library</li></ul></li></ol><hr><h2 id="How-Developers-Can-Eliminate-Hallucinations"><a href="#How-Developers-Can-Eliminate-Hallucinations" class="headerlink" title="How Developers Can Eliminate Hallucinations"></a>How Developers Can Eliminate Hallucinations</h2><p>Hallucinations disappear when you:</p><ul><li>Restrict the model to provided sources</li><li>Use citations</li><li>Use deterministic output schemas</li><li>Validate responses</li><li>Ground everything in retrieval</li></ul><p>The goal is not to make the model smarter.</p><p>The goal is to <strong>make it obedient to context</strong>.</p><hr><h2 id="Agents-Are-Just-Context-Machines"><a href="#Agents-Are-Just-Context-Machines" class="headerlink" title="Agents Are Just Context Machines"></a>Agents Are Just Context Machines</h2><p>AI agents don’t “think”.</p><p>They:</p><ul><li>Read context</li><li>Choose tools</li><li>Update memory</li><li>Call the model</li><li>Repeat</li></ul><p>Every loop is driven by:</p><blockquote><p>Context in → Tokens out</p></blockquote><p>If your agents behave badly, your context design is wrong.</p><hr><h2 id="Why-Context-Engineering-Is-the-Most-Valuable-AI-Skill-in-2026"><a href="#Why-Context-Engineering-Is-the-Most-Valuable-AI-Skill-in-2026" class="headerlink" title="Why Context Engineering Is the Most Valuable AI Skill in 2026"></a>Why Context Engineering Is the Most Valuable AI Skill in 2026</h2><p>Everyone can prompt.</p><p>Few can:</p><ul><li>Design retrieval pipelines</li><li>Structure memory</li><li>Control tool invocation</li><li>Enforce schemas</li><li>Prevent hallucinations</li><li>Maintain long-running AI workflows</li></ul><p>These are <strong>engineering problems</strong>, not writing problems.</p><p>This is where real leverage is.</p><hr><h2 id="Final-Thought"><a href="#Final-Thought" class="headerlink" title="Final Thought"></a>Final Thought</h2><p>The future of AI development is not about clever prompts.</p><p>It is about building <strong>systems of memory, retrieval, and control</strong> around probabilistic models.</p><p>Context engineering is how we turn LLMs from:</p><blockquote><p>unreliable chatbots</p></blockquote><p>into:</p><blockquote><p>trustworthy software components.</p></blockquote><p>For developers in 2026, that is the real superpower. And unlike model weights you can’t control, context pipelines are yours to engineer.</p><p>That is the work. And increasingly, that is the advantage.</p><p>Hope you find all these incredibly enlightening.</p><p>Till next time, Happy coding and keep learning!</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_context_engineering_for_developers.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Google Gemini Nano Banana Generated AI image by Google Gemini Nano Banana&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Google Gemini Nano Banana&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Prompting is easy. Getting reliable behavior from an AI system is hard.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you’ve ever built or worked anything serious with LLMs, you’ve already discovered the truth:&lt;br&gt;&lt;strong&gt;hallucinations, drifting answers, and inconsistent behavior are not bugs — they are symptoms of bad context.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Here’s a number that should change how you think about this: developers in 2026 can fully delegate only 0–20% of tasks to AI agents — even though those agents are completing an average of 20 autonomous actions per run. The bottleneck isn’t model intelligence. It’s context quality.&lt;/p&gt;
&lt;p&gt;In 2026, the most important AI skill for developers is no longer prompt engineering.&lt;br&gt;It is &lt;strong&gt;context engineering&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This post explains what that really means, and how developers can build AI systems that are &lt;strong&gt;predictable, grounded, and production-grade&lt;/strong&gt;.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai-engineering, large-language-models, context-engineering, ai-agents, memory-management, claude, agentic-ai, developer-tools" scheme="http://awongcm.io/tags/ai-engineering-large-language-models-context-engineering-ai-agents-memory-management-claude-agentic-ai-developer-tools/"/>
    
  </entry>
  
  <entry>
    <title>Don&#39;t Let AI Dull Your Software Engineering Edge</title>
    <link href="http://awongcm.io/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/"/>
    <id>http://awongcm.io/blog/2026/04/25/don-t-let-ai-dull-your-software-engineering-edge/</id>
    <published>2026-04-25T08:23:40.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_dont_let_ai_dull_software_engineering_edge.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><blockquote><p>Practical prompts to stay cognitively sharp while using AI tools every day.</p></blockquote><hr><p>Earlier in the year, one of my personal breakthroughs working with AI is to help accelerating my learning and picking up new skills faster than I would spend hours and hours digesting tech documentation from engineering community blogs, manuals etc.  That’s what I love all things about AI. It’s essentially an enhanced Google search - but running on steroids that we all come to accustomed this new ways of software engineering learning mastery. </p><p>But as I use it more and more, I also start to notice that it’s not just a tool that helps me learn faster. It can also be a tool that helps me <em>learn less</em>.  When I reach for AI before forming my own hypothesis, accept generated code without tracing it, or skip the “why” and go straight to the fix — I’m not using AI as a tool. I’m outsourcing the thinking that makes me an engineer. Over time, debugging intuition, design judgment, and first-principles reasoning all quietly degrade.</p><p>So the lingering question beckons - are AI coding tools accelerating your learning and fulfilling your engineering curiosity? Or are they quietly replacing them altogher? The difference comes down to how you prompt.</p><span id="more"></span><blockquote><p><strong>Research:</strong> A 2025 peer-reviewed study of 666 participants (Gerlich, <em>Societies</em>) found a significant negative correlation between frequent AI tool usage and critical thinking ability, mediated by increased cognitive offloading. A separate MIT study (Kosmyna et al., 2025) used EEG to show that LLM users exhibited measurably lower cognitive engagement than those using search engines or no tools at all.</p></blockquote><p><em>The goal was always to learn faster — not to stop learning altogether.</em></p><hr><h2 id="What’s-Actually-Happening-in-the-Industry"><a href="#What’s-Actually-Happening-in-the-Industry" class="headerlink" title="What’s Actually Happening in the Industry"></a>What’s Actually Happening in the Industry</h2><p>This isn’t a hypothetical concern. Several patterns are already visible across the engineering community — and worth naming plainly.</p><p><strong>The “glorified editor” trap</strong><br>Developers increasingly describe their role as polishing AI output rather than authoring it — reviewing code they didn’t write and don’t fully understand. Convenience replaces comprehension, gradually.</p><p><strong>AI-induced technical debt</strong><br>Industry analysts note that AI-generated code often lacks contextual integration with the broader codebase — producing copy-paste style additions that accumulate into maintenance burdens few engineers feel equipped to untangle.</p><p><strong>Skills that don’t transfer</strong><br>Productivity with AI assistance and independent capability are diverging. Engineers who lean heavily on tools report feeling stuck or slow when working without them — a sign that the tool has become load-bearing rather than supplementary.</p><p><strong>The eroding learning ladder</strong><br>Entry-level roles — where engineers traditionally built foundational skills through repetitive, hands-on tasks — are shrinking. The “learning by doing” pipeline that produced experienced engineers is under real pressure.</p><p>None of this means AI tools are bad. It means they demand more deliberateness than we tend to give them. Craft doesn’t maintain itself — especially when the path of least resistance is a prompt away.</p><p>With all the problems named and risks found in this industry, they all shared one common theme - it’s new bad norm of AI age. It is called Skill Atrophy - the gradual loss of skills and knowledge due to over-reliance on AI tools. It’s a real phenomenon that many engineers are already experiencing, and it’s only going to get worse if we don’t take proactive steps to guard against it as well as the cognitive offloading that comes with it. </p><p>To counter this, we should come up with a set of prompts that we can use to keep our minds sharp while using AI tools. These prompts should encourage us to engage our own reasoning, challenge our assumptions, and reflect on what we’ve learned — rather than just accepting AI’s output at face value.</p><p><em>A tool that thinks for you is only as valuable as the judgment you bring to its output. Guard that judgment carefully.</em></p><hr><h2 id="Prompts-to-Keep-Your-Mind-Sharp"><a href="#Prompts-to-Keep-Your-Mind-Sharp" class="headerlink" title="Prompts to Keep Your Mind Sharp"></a>Prompts to Keep Your Mind Sharp</h2><p>The prompts below are designed for daily use. Each one keeps you in the driver’s seat: reasoning first, using AI to stress-test and deepen — not to bypass.</p><p><strong>Note: The following prompts are not by any means prescriptive or exhaustive. They’re meant to be a starting point — a toolkit you can adapt and expand as you find what works best for you. The key is to use them consistently and deliberately, especially when you’re tempted to take the easy route with AI.</strong></p><hr><h3 id="Understand-—-Build-Real-Mental-Models"><a href="#Understand-—-Build-Real-Mental-Models" class="headerlink" title="Understand — Build Real Mental Models"></a>Understand — Build Real Mental Models</h3><p><strong>Hypothesis first</strong></p><pre><code class="hljs plaintext">I think the issue is [your hypothesis]. Before giving me a fix, tell me if my mentalmodel is correct or where it breaks down. Then explain what is actually happening.</code></pre><p><em>Forces you to form a hypothesis before you get an answer — the core habit of strong debugging.</em></p><hr><p><strong>Trace the mechanism</strong></p><pre><code class="hljs plaintext">Walk me through what happens step by step when [operation] runs — at the level of[syscalls / the event loop / memory / etc.]. I want to understand the mechanism,not just the result.</code></pre><p><em>Builds the low-level intuition you need to reason about performance and failure modes independently.</em></p><hr><h3 id="Reason-—-Sharpen-Tradeoff-Thinking"><a href="#Reason-—-Sharpen-Tradeoff-Thinking" class="headerlink" title="Reason — Sharpen Tradeoff Thinking"></a>Reason — Sharpen Tradeoff Thinking</h3><p><strong>Steel-man alternatives</strong></p><pre><code class="hljs plaintext">Give me three genuinely different approaches to [problem]. Make the strongest casefor each. Do not recommend one yet — I want to evaluate them myself.</code></pre><p><em>Prevents the habit of taking the first reasonable-sounding answer. You exercise the judgment; AI supplies the options.</em></p><hr><p><strong>Name the assumptions</strong></p><pre><code class="hljs plaintext">Before answering, list every assumption this solution depends on — about scale, teamsize, latency tolerance, consistency requirements. I want to check whether thoseassumptions hold in my context.</code></pre><p><em>Trains you to always ask “under what conditions is this true?” — one of the most valuable engineering habits there is.</em></p><hr><h3 id="Design-—-Stay-in-the-Driver’s-Seat"><a href="#Design-—-Stay-in-the-Driver’s-Seat" class="headerlink" title="Design — Stay in the Driver’s Seat"></a>Design — Stay in the Driver’s Seat</h3><p><strong>Constraints before solutions</strong></p><pre><code class="hljs plaintext">I need to design [system/component]. Hard constraints: [list them]. Do not suggest asolution yet — help me identify what properties any good solution must have, so I canevaluate approaches myself.</code></pre><p><em>Keeps problem framing separate from solution generation — a discipline that’s easy to skip when answers appear instantly.</em></p><hr><p><strong>Map the failure modes</strong></p><pre><code class="hljs plaintext">Given this design [paste it]: what are the three most likely ways it fails inproduction? For each: what triggers it, how would I detect it, and what is the blastradius? No fixes yet.</code></pre><p><em>Builds the adversarial design thinking that comes from experience — and that’s easy to skip when your designs “pass review” too quickly.</em></p><hr><h3 id="Critique-—-Challenge-What-You’ve-Built"><a href="#Critique-—-Challenge-What-You’ve-Built" class="headerlink" title="Critique — Challenge What You’ve Built"></a>Critique — Challenge What You’ve Built</h3><p><strong>Adversarial review</strong></p><pre><code class="hljs plaintext">Here is my solution: [paste it]. Act as a skeptical senior engineer. Find every weakpoint — correctness, edge cases, performance, maintainability. Be harsh. I willdefend my choices.</code></pre><p><em>“I will defend my choices” keeps you active. Without it, you’ll accept every critique passively — which is just another form of outsourcing.</em></p><hr><h3 id="Reflect-—-Close-the-Learning-Loop"><a href="#Reflect-—-Close-the-Learning-Loop" class="headerlink" title="Reflect — Close the Learning Loop"></a>Reflect — Close the Learning Loop</h3><blockquote><p><strong>Research:</strong> The two prompts below are grounded in well-established cognitive science. The <em>generation effect</em> (Slamecka &amp; Graf, 1978) shows that information you actively produce is retained up to 40% better than information you passively read. The <em>testing effect</em> (Roediger &amp; Karpicke, 2006) demonstrates that articulating what you’ve learned — even once — substantially outperforms re-reading for long-term retention.</p></blockquote><p><strong>Extract the principle</strong></p><pre><code class="hljs plaintext">We just solved [problem]. Forget the specific fix. What general principle or mentalmodel should I carry forward so I can recognise and handle this class of problemmyself next time?</code></pre><p><em>Without this step, you solve the same class of problem repeatedly instead of building permanent capability. Use it at the end of every significant debugging or design session.</em></p><hr><p><strong>Diagnose your pattern</strong></p><pre><code class="hljs plaintext">I keep running into [type of problem]. What does my pattern of mistakes suggest abouta gap in my mental model? Be specific about what I seem to misunderstand — not justwhat I get wrong.</code></pre><p><em>Turns repeated struggles into deliberate diagnosis. Identifying the root-cause gap is far more valuable than accumulating solved instances of the same mistake.</em></p><hr><h3 id="Explore-—-Learn-from-First-Principles"><a href="#Explore-—-Learn-from-First-Principles" class="headerlink" title="Explore — Learn from First Principles"></a>Explore — Learn from First Principles</h3><blockquote><p><strong>Research:</strong> Both prompts apply the Socratic method — a pedagogy with strong empirical backing for developing critical thinking. Research on AI-assisted learning (Dai et al., 2023) found that Socratic-style AI tutoring — where the model asks guiding questions rather than supplying answers — produces significantly better learning outcomes and genuine reflection compared to standard Q&amp;A.</p></blockquote><p><strong>Socratic mode</strong></p><pre><code class="hljs plaintext">I want to understand [concept] deeply. Ask me questions that reveal where myunderstanding breaks down. Do not explain until I answer — then correct only the gaps.</code></pre><p><em>Flips the dynamic. Instead of receiving information, you generate it and get calibrated — the highest-leverage learning mode most engineers never use.</em></p><hr><p><strong>Reinvent from scratch</strong></p><pre><code class="hljs plaintext">Pretend [library/framework] does not exist. Walk me through the problems I would hitsolving [underlying problem] from scratch, and the reasoning that would lead athoughtful engineer to the key design decisions it made.</code></pre><p><em>Builds genuine understanding of why tools exist — the knowledge that lets you use them well, extend them intelligently, and replace them when they no longer fit.</em></p><hr><h2 id="The-Rule-of-Thumb"><a href="#The-Rule-of-Thumb" class="headerlink" title="The Rule of Thumb"></a>The Rule of Thumb</h2><p>Always engage your own reasoning before you engage the AI. Form a hypothesis. Draft a rough design. Take a position. Then use AI to stress-test it, fill gaps, and deepen understanding — not to generate the thinking you should be doing yourself.</p><p>Remember - you are not just an AI operator. You are an engineer. The work of staying a sharp one is still yours to do.</p><p>Till next time, Happy coding and stay sharp!</p><hr><h2 id="References"><a href="#References" class="headerlink" title="References"></a>References</h2><ol><li>Gerlich, M. (2025). AI tools in society: Impacts on cognitive offloading and the future of critical thinking. <em>Societies, 15</em>(1), 6. <a href="https://doi.org/10.3390/soc15010006">https://doi.org/10.3390/soc15010006</a></li><li>Kosmyna, N., et al. (2025). Your brain on ChatGPT: Accumulation of cognitive debt when using an AI assistant for essay writing task. <em>arXiv</em>. <a href="https://arxiv.org/abs/2506.08103">https://arxiv.org/abs/2506.08103</a></li><li>Slamecka, N. J., &amp; Graf, P. (1978). The generation effect: Delineation of a phenomenon. <em>Journal of Experimental Psychology: Human Learning and Memory, 4</em>(6), 592–604.</li><li>Roediger, H. L., &amp; Karpicke, J. D. (2006). Test-enhanced learning. <em>Psychological Science, 17</em>(3), 249–255.</li><li>Dai, W., et al. (2023). Can large language models provide feedback to students? <em>IEEE International Conference on Advanced Learning Technologies.</em></li><li>GitClear. (2024). Coding on copilot: 2023 data suggests AI shifting developer roles. <a href="https://devops.com/ai-in-software-development-productivity-at-the-cost-of-code-quality-2/">https://devops.com/ai-in-software-development-productivity-at-the-cost-of-code-quality-2/</a></li></ol>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_dont_let_ai_dull_software_engineering_edge.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;blockquote&gt;
&lt;p&gt;Practical prompts to stay cognitively sharp while using AI tools every day.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;Earlier in the year, one of my personal breakthroughs working with AI is to help accelerating my learning and picking up new skills faster than I would spend hours and hours digesting tech documentation from engineering community blogs, manuals etc.  That’s what I love all things about AI. It’s essentially an enhanced Google search - but running on steroids that we all come to accustomed this new ways of software engineering learning mastery. &lt;/p&gt;
&lt;p&gt;But as I use it more and more, I also start to notice that it’s not just a tool that helps me learn faster. It can also be a tool that helps me &lt;em&gt;learn less&lt;/em&gt;.  When I reach for AI before forming my own hypothesis, accept generated code without tracing it, or skip the “why” and go straight to the fix — I’m not using AI as a tool. I’m outsourcing the thinking that makes me an engineer. Over time, debugging intuition, design judgment, and first-principles reasoning all quietly degrade.&lt;/p&gt;
&lt;p&gt;So the lingering question beckons - are AI coding tools accelerating your learning and fulfilling your engineering curiosity? Or are they quietly replacing them altogher? The difference comes down to how you prompt.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai, large-language-models, sky-atrophy, prompt-engineering, ai-programming, software-development, tech-guide, software-engineering, developer-learning, software-craftsmanship" scheme="http://awongcm.io/tags/ai-large-language-models-sky-atrophy-prompt-engineering-ai-programming-software-development-tech-guide-software-engineering-developer-learning-software-craftsmanship/"/>
    
  </entry>
  
  <entry>
    <title>Maximizing GitHub Copilot CLI: A Senior Engineer&#39;s Guide to AI-Powered Development</title>
    <link href="http://awongcm.io/blog/2026/02/15/maximizing-github-copilot-cli-a-senior-engineer-s-guide-to-ai-powered-development/"/>
    <id>http://awongcm.io/blog/2026/02/15/maximizing-github-copilot-cli-a-senior-engineer-s-guide-to-ai-powered-development/</id>
    <published>2026-02-15T04:25:00.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_maximising_copilot_cli_senior_engineer_guide.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>As software engineers, we’re constantly seeking ways to streamline our workflows and boost productivity. GitHub Copilot CLI has emerged as a powerful tool that brings AI assistance directly into your terminal, transforming how we interact with code across different stacks. This comprehensive guide will walk you through setting up an effective AI-powered development workflow with GitHub Copilot CLI, whether you’re building front-end applications, back-end services, data pipelines, or cloud infrastructure.</p><blockquote><p><strong>Note</strong>: GitHub Copilot CLI is currently in <strong>public preview</strong> and features are subject to change. Always refer to the <a href="https://docs.github.com/en/copilot/how-tos/copilot-cli">official GitHub documentation</a> for the most up-to-date information.</p></blockquote><h2 id="What-Makes-Copilot-CLI-Different"><a href="#What-Makes-Copilot-CLI-Different" class="headerlink" title="What Makes Copilot CLI Different?"></a>What Makes Copilot CLI Different?</h2><p>Unlike traditional code assistants, Copilot CLI is <strong>terminal-native</strong> and <strong>agentic</strong>—it doesn’t just answer questions, it can act as your coding partner. You can delegate tasks, and Copilot will autonomously execute them while you maintain oversight through explicit approval mechanisms.</p><span id="more"></span><p><strong>Latest Update (February 2026):</strong> GitHub Copilot CLI now supports advanced AI models including Claude Opus 4.6, released on February 5, 2026. Claude Opus 4.6 features enhanced agentic capabilities, agent teams (multiple agents working in parallel), a 1M token context window (in beta), and record-breaking performance on coding benchmarks including 65.4% on Terminal-Bench 2.0.</p><h2 id="Part-1-Setting-Up-Your-AI-Development-Environment"><a href="#Part-1-Setting-Up-Your-AI-Development-Environment" class="headerlink" title="Part 1: Setting Up Your AI Development Environment"></a>Part 1: Setting Up Your AI Development Environment</h2><h3 id="1-1-Installation-and-Prerequisites"><a href="#1-1-Installation-and-Prerequisites" class="headerlink" title="1.1 Installation and Prerequisites"></a>1.1 Installation and Prerequisites</h3><p><strong>Requirements:</strong></p><ul><li>Node.js 22 or later</li><li>A GitHub account with Copilot access (Pro, Pro+, Business, or Enterprise)</li><li>Your organization must enable CLI preview features (for Business&#x2F;Enterprise users)</li></ul><p><strong>Installation:</strong></p><pre><code class="hljs bash">npm install -g @github/copilotcopilot</code></pre><p>On first launch, you’ll be prompted to authenticate:</p><pre><code class="hljs bash">/login</code></pre><p>Follow the on-screen instructions to authenticate with your GitHub account.</p><h3 id="1-2-Custom-Instructions-The-Foundation-of-Productivity"><a href="#1-2-Custom-Instructions-The-Foundation-of-Productivity" class="headerlink" title="1.2 Custom Instructions: The Foundation of Productivity"></a>1.2 Custom Instructions: The Foundation of Productivity</h3><p>Custom instructions teach Copilot about your team’s conventions, build processes, and coding standards. According to the official documentation, all custom instruction files now <strong>combine</strong> instead of using priority-based fallbacks.</p><p><strong>Instruction File Locations:</strong></p><table><thead><tr><th>Location</th><th>Scope</th><th>Use Case</th></tr></thead><tbody><tr><td><code>~/.copilot/copilot-instructions.md</code></td><td>Global (all sessions)</td><td>Personal preferences, common aliases</td></tr><tr><td><code>.github/copilot-instructions.md</code></td><td>Repository-wide</td><td>Team standards, build commands</td></tr></tbody></table><blockquote><p><strong>Important</strong>: The exact hierarchy and all supported file locations may vary. Check the <a href="https://docs.github.com/en/copilot/how-tos/copilot-cli">official documentation</a> for the current list of supported custom instruction files.</p></blockquote><h4 id="Example-Full-Stack-Application-Instructions"><a href="#Example-Full-Stack-Application-Instructions" class="headerlink" title="Example: Full-Stack Application Instructions"></a>Example: Full-Stack Application Instructions</h4><p>Here’s a production-ready <code>.github/copilot-instructions.md</code> for a TypeScript full-stack project:</p><pre><code class="hljs markdown"><span class="hljs-section">## Build &amp; Development Commands</span><span class="hljs-bullet">-</span> <span class="hljs-code">`npm run dev`</span> - Start development server (frontend + backend)<span class="hljs-bullet">-</span> <span class="hljs-code">`npm run build`</span> - Production build<span class="hljs-bullet">-</span> <span class="hljs-code">`npm run test`</span> - Run all tests with coverage<span class="hljs-bullet">-</span> <span class="hljs-code">`npm run test:watch`</span> - Run tests in watch mode<span class="hljs-bullet">-</span> <span class="hljs-code">`npm run lint:fix`</span> - Auto-fix linting issues<span class="hljs-bullet">-</span> <span class="hljs-code">`npm run type-check`</span> - TypeScript type checking<span class="hljs-section">## Code Style &amp; Architecture</span><span class="hljs-bullet">-</span> Use TypeScript strict mode across all files<span class="hljs-bullet">-</span> Frontend: Prefer functional React components with hooks<span class="hljs-bullet">-</span> Backend: Use dependency injection pattern for services<span class="hljs-bullet">-</span> Always add JSDoc comments for public APIs<span class="hljs-bullet">-</span> Follow Repository Pattern for data access<span class="hljs-bullet">-</span> Use async/await over promises chains<span class="hljs-section">## Testing Requirements</span><span class="hljs-bullet">-</span> Unit test coverage must exceed 80%<span class="hljs-bullet">-</span> Integration tests for all API endpoints<span class="hljs-bullet">-</span> Use Jest for unit tests, Playwright for E2E<span class="hljs-bullet">-</span> Mock external services in tests<span class="hljs-section">## Git Workflow</span><span class="hljs-bullet">-</span> Branch naming: <span class="hljs-code">`feature/`</span>, <span class="hljs-code">`bugfix/`</span>, <span class="hljs-code">`hotfix/`</span><span class="hljs-bullet">-</span> Commit format: Conventional Commits (feat, fix, docs, etc.)<span class="hljs-bullet">-</span> Run <span class="hljs-code">`npm run lint:fix &amp;&amp; npm test`</span> before commits<span class="hljs-bullet">-</span> Create feature branches from <span class="hljs-code">`develop`</span><span class="hljs-section">## Stack-Specific Guidelines</span><span class="hljs-section">### Frontend (React + TypeScript)</span><span class="hljs-bullet">-</span> Use CSS Modules or styled-components<span class="hljs-bullet">-</span> Implement proper error boundaries<span class="hljs-bullet">-</span> Lazy load routes with React.lazy()<span class="hljs-bullet">-</span> Follow accessibility standards (WCAG 2.1)<span class="hljs-section">### Backend (Node.js + Express)</span><span class="hljs-bullet">-</span> All routes must have proper error handling<span class="hljs-bullet">-</span> Use middleware for cross-cutting concerns<span class="hljs-bullet">-</span> Validate all inputs with Zod schemas<span class="hljs-bullet">-</span> Implement rate limiting on public endpoints<span class="hljs-section">### Database (PostgreSQL)</span><span class="hljs-bullet">-</span> Use migrations for all schema changes<span class="hljs-bullet">-</span> Never use raw SQL in application code<span class="hljs-bullet">-</span> Implement proper indexing strategies<span class="hljs-bullet">-</span> Use transactions for multi-step operations</code></pre><h4 id="Stack-Specific-Instruction-Templates"><a href="#Stack-Specific-Instruction-Templates" class="headerlink" title="Stack-Specific Instruction Templates"></a>Stack-Specific Instruction Templates</h4><p><strong>Data Stack (Python + Spark + Airflow):</strong></p><pre><code class="hljs markdown"><span class="hljs-section">## Data Engineering Standards</span><span class="hljs-bullet">-</span> Python 3.11+ with type hints mandatory<span class="hljs-bullet">-</span> All DAGs must include data quality checks<span class="hljs-bullet">-</span> Use PySpark for distributed processing<span class="hljs-bullet">-</span> Schema evolution handled via Delta Lake<span class="hljs-section">## Workflow</span><span class="hljs-bullet">-</span> <span class="hljs-code">`poetry run pytest`</span> - Run data pipeline tests<span class="hljs-bullet">-</span> <span class="hljs-code">`poetry run black . &amp;&amp; poetry run ruff check --fix`</span> - Format &amp; lint<span class="hljs-bullet">-</span> All transformations must be idempotent<span class="hljs-bullet">-</span> Implement proper data lineage tracking</code></pre><p><strong>Cloud Infrastructure (Terraform + AWS):</strong></p><pre><code class="hljs markdown"><span class="hljs-section">## Infrastructure as Code Standards</span><span class="hljs-bullet">-</span> Use Terraform 1.6+ with proper state locking<span class="hljs-bullet">-</span> All resources must have proper tags<span class="hljs-bullet">-</span> Implement least privilege IAM policies<span class="hljs-bullet">-</span> Use AWS CDK for complex constructs<span class="hljs-section">## Commands</span><span class="hljs-bullet">-</span> <span class="hljs-code">`terraform fmt &amp;&amp; terraform validate`</span> - Format &amp; validate<span class="hljs-bullet">-</span> <span class="hljs-code">`terraform plan -out=plan.tfplan`</span> - Generate plan<span class="hljs-bullet">-</span> Always review plans before apply<span class="hljs-bullet">-</span> Use workspaces for environment separation</code></pre><h3 id="1-3-Tool-Permissions-Security-Meets-Productivity"><a href="#1-3-Tool-Permissions-Security-Meets-Productivity" class="headerlink" title="1.3 Tool Permissions: Security Meets Productivity"></a>1.3 Tool Permissions: Security Meets Productivity</h3><p>Copilot CLI requires explicit permission for potentially destructive operations. During a session, Copilot will request permission when it wants to use a tool.</p><p><strong>Permission Options:</strong></p><p>When Copilot wants to use a tool (like <code>chmod</code>, <code>git</code>, or <code>npm</code>), you’ll be prompted with:</p><ol><li><strong>Allow</strong> - Allow this one time</li><li><strong>Yes, and approve TOOL for the rest of the session</strong> - Auto-approve this tool for the current session</li><li><strong>No, and tell Copilot what to do differently (Esc)</strong> - Reject and provide alternative guidance</li></ol><p><strong>Command-line Permission Flags:</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># Allow all tools (use with caution)</span>copilot --allow-all-tools<span class="hljs-comment"># Allow all paths</span>copilot --allow-all-paths</code></pre><blockquote><p><strong>Security Note</strong>: Using <code>--allow-all-tools</code> gives Copilot the same access as you have to files and commands. Only use in trusted environments.</p></blockquote><h3 id="1-4-Model-Selection-Choosing-the-Right-AI-for-the-Job"><a href="#1-4-Model-Selection-Choosing-the-Right-AI-for-the-Job" class="headerlink" title="1.4 Model Selection: Choosing the Right AI for the Job"></a>1.4 Model Selection: Choosing the Right AI for the Job</h3><p>GitHub Copilot CLI’s default model is <strong>Claude Sonnet 4.5</strong>. You can switch models using the <code>/model</code> command within an interactive session.</p><p><strong>Available Models</strong> (as of February 2026):</p><p>Use <code>/model</code> within a CLI session to see the complete list of available models. According to GitHub’s official repository, available models include:</p><ul><li>Claude Sonnet 4.5 (default)</li><li>Claude Sonnet 4</li><li>Claude Opus 4.6 (latest, added in CLI version 0.0.406 on Feb 7, 2026)</li><li>GPT-5</li></ul><blockquote><p><strong>Note</strong>: The exact list of available models may vary based on your subscription and region. Use the <code>/model</code> command to see what’s available in your environment.</p></blockquote><p><strong>What’s New in Claude Opus 4.6:</strong></p><p>Claude Opus 4.6, released by Anthropic on February 5, 2026, represents a significant advancement:</p><ul><li><strong>Agent Teams</strong>: Multiple AI agents can work in parallel on different components of complex tasks</li><li><strong>1M Token Context Window</strong> (in beta): Work with massive codebases—roughly 750,000 words or about 3,000 pages of code</li><li><strong>Enhanced Agentic Capabilities</strong>: 65.4% on Terminal-Bench 2.0, highest score for agentic coding systems</li><li><strong>Improved Code Review</strong>: Can detect and correct its own mistakes during implementation</li><li><strong>128K Output Tokens</strong>: Doubled from the previous 64K limit</li><li><strong>Adaptive Thinking</strong>: Dynamically adjusts reasoning depth based on task complexity</li></ul><p><strong>Switching Models:</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># Within CLI session</span>/model<span class="hljs-comment"># Follow the prompts to select your desired model</span></code></pre><p><strong>Strategic Considerations:</strong></p><ul><li>Use the <strong>default model (Sonnet 4.5)</strong> for most day-to-day coding tasks</li><li>Switch to <strong>Opus 4.6</strong> for complex architectural decisions, difficult debugging, or agentic tasks</li><li>Different models may consume different amounts of your monthly premium request quota</li></ul><h2 id="Part-2-Mastering-Plan-Driven-Development"><a href="#Part-2-Mastering-Plan-Driven-Development" class="headerlink" title="Part 2: Mastering Plan-Driven Development"></a>Part 2: Mastering Plan-Driven Development</h2><h3 id="2-1-Why-Planning-Matters"><a href="#2-1-Why-Planning-Matters" class="headerlink" title="2.1 Why Planning Matters"></a>2.1 Why Planning Matters</h3><p>Plan mode transforms vague requests into concrete, reviewable implementation roadmaps. It helps catch misunderstandings before any code is written.</p><p><strong>Activation:</strong></p><ul><li>Press <code>Shift + Tab</code> to cycle between modes (interactive → plan → autopilot)</li><li>Or use <code>/plan</code> command in interactive mode</li></ul><p><strong>The Planning Workflow:</strong></p><ol><li><strong>You provide the goal</strong></li><li><strong>Copilot asks clarifying questions</strong> (architecture decisions, edge cases, constraints)</li><li><strong>Copilot generates a structured plan</strong> with checkboxes and detailed steps</li><li><strong>You review and modify</strong> the plan</li><li><strong>Copilot implements</strong> the approved plan</li></ol><h3 id="2-2-Real-World-Planning-Examples"><a href="#2-2-Real-World-Planning-Examples" class="headerlink" title="2.2 Real-World Planning Examples"></a>2.2 Real-World Planning Examples</h3><h4 id="Example-1-Adding-OAuth2-Authentication"><a href="#Example-1-Adding-OAuth2-Authentication" class="headerlink" title="Example 1: Adding OAuth2 Authentication"></a>Example 1: Adding OAuth2 Authentication</h4><p><strong>Prompt:</strong></p><pre><code class="hljs plaintext">/plan Add OAuth2 authentication with Google and GitHub providers</code></pre><p><strong>Copilot’s Clarifying Questions:</strong></p><ul><li>Should users be able to link multiple OAuth providers to one account?</li><li>Do you want to support traditional email&#x2F;password alongside OAuth?</li><li>What’s your preference for session management - JWT or server-side sessions?</li><li>Any specific libraries you’re already using for auth?</li></ul><p><strong>Generated Plan:</strong></p><pre><code class="hljs markdown"><span class="hljs-section"># Implementation Plan: OAuth2 Authentication</span><span class="hljs-section">## Overview</span>Implement social authentication using OAuth2 with Google and GitHub providers,supporting multiple provider linking and JWT-based session management.<span class="hljs-section">## Dependencies</span><span class="hljs-bullet">-</span> [ ] Install passport (^0.7.0)<span class="hljs-bullet">-</span> [ ] Install passport-google-oauth20 (^2.0.0)<span class="hljs-bullet">-</span> [ ] Install passport-github2 (^0.1.12)<span class="hljs-bullet">-</span> [ ] Install jsonwebtoken (^9.0.0)<span class="hljs-section">## Infrastructure Changes</span><span class="hljs-bullet">-</span> [ ] Add OAuth credentials to environment variables<span class="hljs-bullet">  -</span> GOOGLE<span class="hljs-emphasis">_CLIENT_</span>ID, GOOGLE<span class="hljs-emphasis">_CLIENT_</span>SECRET<span class="hljs-bullet">  -</span> GITHUB<span class="hljs-emphasis">_CLIENT_</span>ID, GITHUB<span class="hljs-emphasis">_CLIENT_</span>SECRET<span class="hljs-bullet">  -</span> JWT<span class="hljs-emphasis">_SECRET</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">## Database Migrations</span><span class="hljs-emphasis">- [ ] Create `oauth_</span>providers` table<span class="hljs-bullet">  -</span> user<span class="hljs-emphasis">_id (FK to users)</span><span class="hljs-emphasis">  - provider (enum: google, github)</span><span class="hljs-emphasis">  - provider_</span>user<span class="hljs-emphasis">_id</span><span class="hljs-emphasis">  - access_</span>token (encrypted)<span class="hljs-bullet">  -</span> refresh<span class="hljs-emphasis">_token (encrypted)</span><span class="hljs-emphasis">  - unique constraint on (user_</span>id, provider)<span class="hljs-section">## Backend Implementation</span><span class="hljs-bullet">-</span> [ ] Create <span class="hljs-code">`/api/auth`</span> routes module<span class="hljs-bullet">  -</span> POST /auth/google (initiate Google OAuth)<span class="hljs-bullet">  -</span> GET /auth/google/callback<span class="hljs-bullet">  -</span> POST /auth/github (initiate GitHub OAuth)<span class="hljs-bullet">  -</span> GET /auth/github/callback<span class="hljs-bullet">  -</span> POST /auth/link/:provider (link additional provider)  <span class="hljs-bullet">-</span> [ ] Implement Passport strategies<span class="hljs-bullet">  -</span> GoogleStrategy with profile data mapping<span class="hljs-bullet">  -</span> GitHubStrategy with profile data mapping<span class="hljs-bullet">  -</span> Error handling for provider failures  <span class="hljs-bullet">-</span> [ ] Create authentication service<span class="hljs-bullet">  -</span> findOrCreateUserFromOAuth()<span class="hljs-bullet">  -</span> linkProviderToUser()<span class="hljs-bullet">  -</span> generateJWTToken()<span class="hljs-bullet">  -</span> Token refresh logic<span class="hljs-section">## Frontend Implementation</span><span class="hljs-bullet">-</span> [ ] Create OAuth login buttons component<span class="hljs-bullet">-</span> [ ] Add provider linking UI in settings<span class="hljs-bullet">-</span> [ ] Implement OAuth redirect handling<span class="hljs-bullet">-</span> [ ] Add loading states during auth flow<span class="hljs-bullet">-</span> [ ] Error messaging for auth failures<span class="hljs-section">## Security Considerations</span><span class="hljs-bullet">-</span> [ ] Implement CSRF protection for OAuth state parameter<span class="hljs-bullet">-</span> [ ] Encrypt stored OAuth tokens<span class="hljs-bullet">-</span> [ ] Add rate limiting to auth endpoints<span class="hljs-bullet">-</span> [ ] Implement token rotation policy<span class="hljs-section">## Testing</span><span class="hljs-bullet">-</span> [ ] Unit tests for strategies and auth service<span class="hljs-bullet">-</span> [ ] Integration tests for OAuth flows<span class="hljs-bullet">-</span> [ ] E2E tests for complete login process<span class="hljs-bullet">-</span> [ ] Test account linking scenarios<span class="hljs-section">## Documentation</span><span class="hljs-bullet">-</span> [ ] Update API documentation<span class="hljs-bullet">-</span> [ ] Add OAuth setup guide for developers<span class="hljs-bullet">-</span> [ ] Document environment variable requirements</code></pre><p><strong>Implementation:</strong></p><pre><code class="hljs plaintext">Proceed with the plan. Start with database migrations.</code></pre><h4 id="Example-2-Refactoring-for-Microservices"><a href="#Example-2-Refactoring-for-Microservices" class="headerlink" title="Example 2: Refactoring for Microservices"></a>Example 2: Refactoring for Microservices</h4><p><strong>Prompt:</strong></p><pre><code class="hljs plaintext">/plan Refactor the monolithic user service into separate microservices for authentication, profile management, and notifications</code></pre><p>This complex architectural change benefits from planning because Copilot will:</p><ul><li>Identify all coupling points</li><li>Propose API contracts between services</li><li>Plan database separation strategy</li><li>Address data consistency concerns</li><li>Suggest deployment sequencing</li></ul><h3 id="2-3-When-to-Use-Plan-Mode"><a href="#2-3-When-to-Use-Plan-Mode" class="headerlink" title="2.3 When to Use Plan Mode"></a>2.3 When to Use Plan Mode</h3><table><thead><tr><th>Scenario</th><th>Use Plan Mode?</th><th>Reasoning</th></tr></thead><tbody><tr><td>Adding a major feature</td><td>✅ Yes</td><td>Complex, multi-file, needs architecture decisions</td></tr><tr><td>Refactoring core business logic</td><td>✅ Yes</td><td>High risk, requires careful sequencing</td></tr><tr><td>Fixing a typo</td><td>❌ No</td><td>Simple, single-file change</td></tr><tr><td>Quick bug fix</td><td>❌ No</td><td>Usually isolated, fast iteration better</td></tr><tr><td>Database schema migration</td><td>✅ Yes</td><td>Needs careful planning of rollback strategy</td></tr><tr><td>Adding a new API endpoint</td><td>⚠️ Depends</td><td>Simple CRUD? No. Complex with validation? Yes</td></tr></tbody></table><h3 id="2-4-Recommended-Workflow-Explore-→-Plan-→-Review-→-Implement-→-Verify"><a href="#2-4-Recommended-Workflow-Explore-→-Plan-→-Review-→-Implement-→-Verify" class="headerlink" title="2.4 Recommended Workflow: Explore → Plan → Review → Implement → Verify"></a>2.4 Recommended Workflow: Explore → Plan → Review → Implement → Verify</h3><p>This five-phase workflow maximizes success rates:</p><p><strong>Phase 1: Explore</strong></p><pre><code class="hljs plaintext">Read the authentication system but don&#x27;t write code yet. Explain the current architecture and identify potential bottlenecks.</code></pre><p><strong>Phase 2: Plan</strong></p><pre><code class="hljs plaintext">/plan Implement password reset flow with email verification and rate limiting</code></pre><p><strong>Phase 3: Review &amp; Iterate</strong><br>Review the generated plan. Ask for modifications:</p><pre><code class="hljs plaintext">Add a step to implement magic link authentication as an alternative to password reset</code></pre><p><strong>Phase 4: Implement</strong></p><pre><code class="hljs plaintext">Proceed with the updated plan. Implement the password reset first.</code></pre><p><strong>Phase 5: Verify</strong></p><pre><code class="hljs plaintext">Run all authentication tests and fix any failures. Then run the linter.</code></pre><h2 id="Part-3-Advanced-Workflows-for-Different-Stacks"><a href="#Part-3-Advanced-Workflows-for-Different-Stacks" class="headerlink" title="Part 3: Advanced Workflows for Different Stacks"></a>Part 3: Advanced Workflows for Different Stacks</h2><h3 id="3-1-Front-End-Development-React-x2F-Vue-x2F-Angular"><a href="#3-1-Front-End-Development-React-x2F-Vue-x2F-Angular" class="headerlink" title="3.1 Front-End Development (React&#x2F;Vue&#x2F;Angular)"></a>3.1 Front-End Development (React&#x2F;Vue&#x2F;Angular)</h3><p><strong>Component Generation with Design Systems:</strong></p><pre><code class="hljs plaintext">Create a reusable DataTable component following our design systemRequirements:- Support sorting, filtering, and pagination- Responsive design with mobile-first approach- Accessibility compliant (WCAG 2.1 AA)- Include loading and error states- TypeScript with proper prop types</code></pre><p><strong>Visual Design Implementation:</strong></p><blockquote><p><strong>Note</strong>: Check current documentation for image upload capabilities, as features are evolving.</p></blockquote><p><strong>State Management Integration:</strong></p><pre><code class="hljs plaintext">Refactor the shopping cart to use Zustand for state managementMigrate from Redux while maintaining the same API for componentsAdd persistence to localStorageInclude tests for all state transitions</code></pre><h3 id="3-2-Back-End-Development-Node-js-x2F-Python-x2F-Go"><a href="#3-2-Back-End-Development-Node-js-x2F-Python-x2F-Go" class="headerlink" title="3.2 Back-End Development (Node.js&#x2F;Python&#x2F;Go)"></a>3.2 Back-End Development (Node.js&#x2F;Python&#x2F;Go)</h3><p><strong>API Development:</strong></p><pre><code class="hljs plaintext">/plan Create a RESTful API for product management with the following endpoints:- GET /api/products (list with pagination, filtering, sorting)- GET /api/products/:id (single product)- POST /api/products (create, admin only)- PUT /api/products/:id (update, admin only)- DELETE /api/products/:id (soft delete, admin only)Requirements:- OpenAPI/Swagger documentation- Request validation with Zod- Proper error handling with standard error codes- Rate limiting (100 req/min for authenticated users)- Include integration tests</code></pre><p><strong>Database Optimization:</strong></p><pre><code class="hljs plaintext">Analyze query patterns in the products table and propose indexing strategiesConsider:- Current query patterns in @/services/product-service.ts- Write vs read ratio (70% reads, 30% writes)- Don&#x27;t over-index, as it impacts write performance</code></pre><p><strong>Microservices Communication:</strong></p><pre><code class="hljs plaintext">Implement an event-driven communication pattern between the order service and inventory service- Use RabbitMQ for message broker- Implement retry logic with exponential backoff- Add dead letter queue for failed messages- Ensure idempotency for inventory updates- Include monitoring and alerting</code></pre><h3 id="3-3-Data-Engineering-Python-x2F-Spark-x2F-Airflow"><a href="#3-3-Data-Engineering-Python-x2F-Spark-x2F-Airflow" class="headerlink" title="3.3 Data Engineering (Python&#x2F;Spark&#x2F;Airflow)"></a>3.3 Data Engineering (Python&#x2F;Spark&#x2F;Airflow)</h3><p><strong>ETL Pipeline Development:</strong></p><pre><code class="hljs plaintext">/plan Create an Airflow DAG for customer analytics ETL pipelineSource: PostgreSQL customer databaseTransformations:- Clean and normalize customer data- Calculate customer lifetime value- Segment customers by behavior patterns- Aggregate purchase historyDestination: Snowflake data warehouseRequirements:- Incremental loading (process only new/changed records)- Data quality checks at each stage- Proper error handling and alerting- Idempotent operations- Include unit tests for transformation logic</code></pre><p><strong>Data Quality Implementation:</strong></p><pre><code class="hljs plaintext">Add comprehensive data quality checks to the customer pipelineChecks needed:- Schema validation (expected columns and types)- Null value checks for required fields- Range checks for numeric fields (age, purchase amounts)- Format validation (email, phone numbers)- Cross-field validation (end_date &gt; start_date)- Statistical anomaly detectionOn failure: quarantine bad records, alert data team, continue processing good records</code></pre><h3 id="3-4-Cloud-Infrastructure-Terraform-x2F-CloudFormation"><a href="#3-4-Cloud-Infrastructure-Terraform-x2F-CloudFormation" class="headerlink" title="3.4 Cloud Infrastructure (Terraform&#x2F;CloudFormation)"></a>3.4 Cloud Infrastructure (Terraform&#x2F;CloudFormation)</h3><p><strong>Infrastructure as Code:</strong></p><pre><code class="hljs plaintext">/plan Create Terraform configuration for a production-grade EKS cluster on AWSRequirements:- Multi-AZ deployment for high availability- Auto-scaling node groups (min 3, max 10 nodes)- Separate node groups for system and application workloads- VPC with public and private subnets- Proper security groups and NACLs- IAM roles following least privilege- Enable cluster autoscaler- Integration with AWS Load Balancer Controller- Monitoring with CloudWatch Container Insights- Secrets management with AWS Secrets Manager</code></pre><p><strong>Security Hardening:</strong></p><pre><code class="hljs plaintext">Review our Terraform configurations for security issues:- Overly permissive IAM policies- Unencrypted resources- Public exposure of sensitive services- Missing backup configurations- Inadequate logging and monitoring- Missing resource tagsGenerate a report with findings and proposed fixes</code></pre><h3 id="3-5-DevOps-amp-CI-x2F-CD"><a href="#3-5-DevOps-amp-CI-x2F-CD" class="headerlink" title="3.5 DevOps &amp; CI&#x2F;CD"></a>3.5 DevOps &amp; CI&#x2F;CD</h3><p><strong>GitHub Actions Workflow:</strong></p><pre><code class="hljs plaintext">Create a comprehensive GitHub Actions workflow for our Node.js applicationPipeline stages:1. Lint and format checking2. Unit tests with coverage (fail if &lt; 80%)3. Integration tests against test database4. Security scanning (npm audit, Snyk)5. Build Docker image6. Push to ECR7. Deploy to staging (auto)8. E2E tests on staging9. Deploy to production (manual approval)Include:- Caching for dependencies and build artifacts- Parallel job execution where possible- Slack notifications for failures- Deployment status updates to PR</code></pre><p><strong>Kubernetes Deployment:</strong></p><pre><code class="hljs plaintext">Create production-ready Kubernetes manifests for our microservicesServices: api-gateway, auth-service, product-service, notification-serviceRequirements:- Use Deployments with rolling update strategy- Configure resource requests and limits- Health checks (liveness and readiness probes)- Horizontal Pod Autoscaling based on CPU/memory- ConfigMaps for configuration- Secrets for sensitive data- Network policies for inter-service communication- Ingress with TLS termination- Include monitoring with Prometheus metrics</code></pre><h2 id="Part-4-Session-Management-and-Context"><a href="#Part-4-Session-Management-and-Context" class="headerlink" title="Part 4: Session Management and Context"></a>Part 4: Session Management and Context</h2><h3 id="4-1-Understanding-Session-Context"><a href="#4-1-Understanding-Session-Context" class="headerlink" title="4.1 Understanding Session Context"></a>4.1 Understanding Session Context</h3><p>Copilot CLI features <strong>automatic context compaction</strong> to enable long-running sessions. When your conversation approaches 95% of the token limit, Copilot automatically compresses your history in the background.</p><p><strong>How it works:</strong></p><ol><li>Older conversation history is summarized</li><li>Critical information and decisions are preserved</li><li>Recent context remains in full detail</li><li>The process happens automatically without interrupting your workflow</li></ol><h3 id="4-2-Session-Management-Commands"><a href="#4-2-Session-Management-Commands" class="headerlink" title="4.2 Session Management Commands"></a>4.2 Session Management Commands</h3><p><strong>View current session info:</strong></p><pre><code class="hljs bash">/session</code></pre><p><strong>View context usage:</strong></p><pre><code class="hljs bash">/context</code></pre><p>This shows a breakdown of how your context window is being used.</p><p><strong>Manual compaction (rarely needed):</strong></p><pre><code class="hljs bash">/compact</code></pre><p>Press Escape to cancel if you change your mind.</p><h3 id="4-3-Best-Practices-for-Sessions"><a href="#4-3-Best-Practices-for-Sessions" class="headerlink" title="4.3 Best Practices for Sessions"></a>4.3 Best Practices for Sessions</h3><p><strong>Start fresh between unrelated tasks:</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># After completing authentication feature</span>/new<span class="hljs-comment"># Start fresh for payment integration</span>&gt; Implement Stripe payment integration</code></pre><p><strong>Clear context when switching focus:</strong></p><p>Think of <code>/new</code> like ending a meeting and starting a new one - context is reset, but you can always reference previous work:</p><pre><code class="hljs bash"><span class="hljs-comment"># In a new session</span>&gt; Review the authentication implementation patterns we used previously and apply similar approaches <span class="hljs-keyword">for</span> payment authorization</code></pre><h2 id="Part-5-Delegation-Capabilities"><a href="#Part-5-Delegation-Capabilities" class="headerlink" title="Part 5: Delegation Capabilities"></a>Part 5: Delegation Capabilities</h2><h3 id="5-1-The-delegate-Command"><a href="#5-1-The-delegate-Command" class="headerlink" title="5.1 The /delegate Command"></a>5.1 The <code>/delegate</code> Command</h3><blockquote><p><strong>Important</strong>: Verify the current capabilities of the <code>/delegate</code> command in the <a href="https://docs.github.com/en/copilot/how-tos/copilot-cli">official documentation</a>, as this feature may work differently than described below or may be available through different mechanisms.</p></blockquote><p>Delegation allows you to offload work to Copilot coding agent. According to GitHub’s documentation, you can delegate tasks in scenarios including:</p><ul><li>Codebase maintenance (security fixes, dependency upgrades, refactoring)</li><li>Documentation updates</li><li>Feature development</li><li>Improving test coverage</li><li>Prototyping new projects</li></ul><p><strong>Example usage:</strong></p><pre><code class="hljs bash">/delegate Add comprehensive API documentation using OpenAPI 3.0 spec</code></pre><h3 id="5-2-When-to-Delegate-vs-Work-Locally"><a href="#5-2-When-to-Delegate-vs-Work-Locally" class="headerlink" title="5.2 When to Delegate vs. Work Locally"></a>5.2 When to Delegate vs. Work Locally</h3><table><thead><tr><th>Delegate to Agent</th><th>Work Locally</th></tr></thead><tbody><tr><td>Documentation updates</td><td>Core features on the critical path</td></tr><tr><td>Test coverage improvements</td><td>Active debugging sessions</td></tr><tr><td>Dependency updates</td><td>Interactive exploration of codebase</td></tr><tr><td>Non-blocking refactoring</td><td>Performance optimization requiring testing</td></tr></tbody></table><h2 id="Part-6-Multi-Repository-Workflows"><a href="#Part-6-Multi-Repository-Workflows" class="headerlink" title="Part 6: Multi-Repository Workflows"></a>Part 6: Multi-Repository Workflows</h2><h3 id="6-1-Working-Across-Multiple-Codebases"><a href="#6-1-Working-Across-Multiple-Codebases" class="headerlink" title="6.1 Working Across Multiple Codebases"></a>6.1 Working Across Multiple Codebases</h3><p>Copilot CLI can work with multiple repositories simultaneously.</p><p><strong>Option 1: Start from Parent Directory</strong></p><pre><code class="hljs bash"><span class="hljs-built_in">cd</span> ~/projects/my-microservicescopilot</code></pre><p>Copilot now has access to all child repositories:</p><pre><code class="hljs plaintext">~/projects/my-microservices/├── api-gateway/├── auth-service/├── product-service/├── notification-service/└── shared-libraries/</code></pre><p><strong>Option 2: Add Directories Dynamically</strong></p><blockquote><p><strong>Note</strong>: The exact command syntax for adding directories may vary. Refer to the official documentation for current commands.</p></blockquote><h3 id="6-2-Real-World-Multi-Repo-Scenarios"><a href="#6-2-Real-World-Multi-Repo-Scenarios" class="headerlink" title="6.2 Real-World Multi-Repo Scenarios"></a>6.2 Real-World Multi-Repo Scenarios</h3><p><strong>Scenario 1: Coordinated API Changes</strong></p><pre><code class="hljs plaintext">I need to update our user authentication API. Changes span multiple repositories:- api-gateway (update routing)- auth-service (implement new logic)- mobile-app (update client SDK)- docs (update API documentation)Start by showing me the current authentication flow across all repos.Then create a plan for migrating to OAuth 2.1 with PKCE.</code></pre><p><strong>Scenario 2: Shared Library Refactoring</strong></p><pre><code class="hljs plaintext">The logger module in our shared libraries is being used inconsistently.Search all microservices for logger usage patterns.Propose a standardized interface.Update the logger implementation.Then update all microservices to use the new interface.</code></pre><h2 id="Part-7-Productivity-Patterns-for-Common-Tasks"><a href="#Part-7-Productivity-Patterns-for-Common-Tasks" class="headerlink" title="Part 7: Productivity Patterns for Common Tasks"></a>Part 7: Productivity Patterns for Common Tasks</h2><h3 id="7-1-Codebase-Onboarding"><a href="#7-1-Codebase-Onboarding" class="headerlink" title="7.1 Codebase Onboarding"></a>7.1 Codebase Onboarding</h3><p>When joining a new project:</p><pre><code class="hljs plaintext">I&#x27;m new to this codebase. Help me understand:1. Overall architecture and design patterns2. How authentication/authorization works3. Database schema and ORM patterns4. Build and deployment process5. Testing strategy and conventions</code></pre><h3 id="7-2-Test-Driven-Development"><a href="#7-2-Test-Driven-Development" class="headerlink" title="7.2 Test-Driven Development"></a>7.2 Test-Driven Development</h3><pre><code class="hljs plaintext">I want to implement user registration with email verification.First, write comprehensive failing tests covering:- Happy path (successful registration)- Duplicate email handling- Invalid email format- Weak password rejection- Email verification flow- Expired verification tokensUse Jest and follow our testing patterns</code></pre><p>After reviewing and approving the tests:</p><pre><code class="hljs plaintext">Now implement the minimum code to make all tests pass.</code></pre><h3 id="7-3-Code-Review-Assistance"><a href="#7-3-Code-Review-Assistance" class="headerlink" title="7.3 Code Review Assistance"></a>7.3 Code Review Assistance</h3><pre><code class="hljs plaintext">Review the changes in my current branch.Focus on:- Potential bugs and edge cases- Security vulnerabilities- Performance concerns- Code style consistency- Missing tests- Documentation gapsProvide a detailed report with specific suggestions.</code></pre><h3 id="7-4-Bug-Investigation"><a href="#7-4-Bug-Investigation" class="headerlink" title="7.4 Bug Investigation"></a>7.4 Bug Investigation</h3><pre><code class="hljs plaintext">The /api/products endpoint returns 500 errors intermittently (about 5% of requests).Investigation steps:1. Search application logs for related errors2. Check database query performance3. Look for race conditions in concurrent requests4. Review error handling in the products controller5. Check for memory leaks or resource exhaustionAnalyze the evidence and identify the root cause.</code></pre><h3 id="7-5-Performance-Optimization"><a href="#7-5-Performance-Optimization" class="headerlink" title="7.5 Performance Optimization"></a>7.5 Performance Optimization</h3><pre><code class="hljs plaintext">Analyze the performance of our product search featureCurrent metrics:- Average response time: 850ms- P95: 1.2s- P99: 2.5sTarget: Average &lt; 200ms, P95 &lt; 400msIdentify bottlenecks and propose optimizations:- Database query optimization- Caching strategies (Redis)- Index improvements- Pagination efficiency- API response payload size</code></pre><h3 id="7-6-Security-Auditing"><a href="#7-6-Security-Auditing" class="headerlink" title="7.6 Security Auditing"></a>7.6 Security Auditing</h3><pre><code class="hljs plaintext">Conduct a security audit of our authentication system:Check for:- SQL injection vulnerabilities- XSS attack vectors- CSRF protection- Weak password policies- Insecure session management- Missing rate limiting- Exposed sensitive data in logs- Insufficient input validationGenerate a security report with severity ratings and remediation steps.</code></pre><h2 id="Part-8-Team-Collaboration-and-Standards"><a href="#Part-8-Team-Collaboration-and-Standards" class="headerlink" title="Part 8: Team Collaboration and Standards"></a>Part 8: Team Collaboration and Standards</h2><h3 id="8-1-Establishing-Team-Conventions"><a href="#8-1-Establishing-Team-Conventions" class="headerlink" title="8.1 Establishing Team Conventions"></a>8.1 Establishing Team Conventions</h3><p>Create a team-wide <code>.github/copilot-instructions.md</code>:</p><pre><code class="hljs markdown"><span class="hljs-section"># Team Development Standards</span><span class="hljs-section">## When to Use Copilot CLI Features</span><span class="hljs-section">### Plan Mode (`/plan` or Shift+Tab)</span><span class="hljs-strong">**ALWAYS use for:**</span><span class="hljs-bullet">-</span> New features touching &gt; 3 files<span class="hljs-bullet">-</span> Database schema changes<span class="hljs-bullet">-</span> API contract modifications<span class="hljs-bullet">-</span> Refactoring affecting multiple modules<span class="hljs-bullet">-</span> Security-sensitive changes<span class="hljs-strong">**SKIP for:**</span><span class="hljs-bullet">-</span> Bug fixes in single file<span class="hljs-bullet">-</span> Documentation updates<span class="hljs-bullet">-</span> Code formatting<span class="hljs-bullet">-</span> Dependency updates<span class="hljs-section">## Code Review Requirements</span>All code (human or AI-generated) must:<span class="hljs-bullet">-</span> Pass CI/CD pipeline (tests, linting, security scans)<span class="hljs-bullet">-</span> Be reviewed by at least one team member<span class="hljs-bullet">-</span> Include tests with &gt;80% coverage<span class="hljs-bullet">-</span> Update relevant documentation<span class="hljs-bullet">-</span> Follow conventional commit format<span class="hljs-section">## Model Selection Guidance</span><span class="hljs-bullet">-</span> <span class="hljs-strong">**Default to Sonnet 4.5**</span> for most work<span class="hljs-bullet">-</span> <span class="hljs-strong">**Use Opus 4.6**</span> for architectural decisions, complex bugs, agentic tasks<span class="hljs-bullet">-</span> Consider premium request quota when choosing models</code></pre><h3 id="8-2-Shared-Repository-Instructions"><a href="#8-2-Shared-Repository-Instructions" class="headerlink" title="8.2 Shared Repository Instructions"></a>8.2 Shared Repository Instructions</h3><p>For a full-stack e-commerce application:</p><pre><code class="hljs markdown"><span class="hljs-section"># E-Commerce Platform Development Guide</span><span class="hljs-section">## Architecture Overview</span><span class="hljs-bullet">-</span> Frontend: Next.js 14 (App Router) + TypeScript<span class="hljs-bullet">-</span> Backend: NestJS + PostgreSQL + Redis<span class="hljs-bullet">-</span> Infrastructure: AWS ECS + RDS + ElastiCache<span class="hljs-bullet">-</span> CI/CD: GitHub Actions → ECR → ECS<span class="hljs-section">## Key Patterns</span><span class="hljs-section">### Frontend</span><span class="hljs-bullet">-</span> Server Components by default, Client Components only when needed<span class="hljs-bullet">-</span> Data fetching in Server Components, not API routes<span class="hljs-bullet">-</span> Use React Server Actions for mutations<span class="hljs-bullet">-</span> Global state: Zustand (client-side only)<span class="hljs-bullet">-</span> Forms: React Hook Form + Zod validation<span class="hljs-section">### Backend</span><span class="hljs-bullet">-</span> CQRS pattern for complex domains (orders, inventory)<span class="hljs-bullet">-</span> Repository pattern for data access<span class="hljs-bullet">-</span> Event-driven architecture for cross-service communication<span class="hljs-bullet">-</span> Queue processing with Bull for async tasks<span class="hljs-section">### Database</span><span class="hljs-bullet">-</span> Prisma ORM for type-safe queries<span class="hljs-bullet">-</span> Migrations in <span class="hljs-code">`prisma/migrations/`</span><span class="hljs-bullet">-</span> Never use raw SQL in application code<span class="hljs-bullet">-</span> Always use transactions for multi-table operations<span class="hljs-section">## Testing Strategy</span><span class="hljs-bullet">-</span> Unit: Jest (&gt;80% coverage required)<span class="hljs-bullet">-</span> Integration: Supertest for API tests<span class="hljs-bullet">-</span> E2E: Playwright for critical user journeys<span class="hljs-bullet">-</span> Load: k6 for performance testing<span class="hljs-section">## Deployment</span><span class="hljs-bullet">-</span> Main branch → Auto-deploy to staging<span class="hljs-bullet">-</span> Release branches → Manual deploy to production<span class="hljs-bullet">-</span> Rollback procedure documented in RUNBOOK.md</code></pre><h2 id="Part-9-Troubleshooting-and-Getting-Help"><a href="#Part-9-Troubleshooting-and-Getting-Help" class="headerlink" title="Part 9: Troubleshooting and Getting Help"></a>Part 9: Troubleshooting and Getting Help</h2><h3 id="9-1-Common-Issues-and-Solutions"><a href="#9-1-Common-Issues-and-Solutions" class="headerlink" title="9.1 Common Issues and Solutions"></a>9.1 Common Issues and Solutions</h3><p><strong>Issue: Copilot doesn’t see recent file changes</strong></p><p>Try the session refresh approach or restart the CLI session.</p><p><strong>Issue: Responses seem inconsistent with project conventions</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># Review your custom instructions</span><span class="hljs-built_in">cat</span> .github/copilot-instructions.md<span class="hljs-comment"># Ensure they&#x27;re being loaded properly</span></code></pre><p><strong>Issue: Permission denied errors</strong></p><p>Make sure you’ve granted appropriate tool permissions when prompted, or use permission flags when starting Copilot CLI.</p><h3 id="9-2-Built-in-Help-System"><a href="#9-2-Built-in-Help-System" class="headerlink" title="9.2 Built-in Help System"></a>9.2 Built-in Help System</h3><p><strong>View general help:</strong></p><pre><code class="hljs bash">copilot -h</code></pre><p><strong>Within CLI session:</strong></p><pre><code class="hljs bash">/help</code></pre><p>This shows all available slash commands.</p><h3 id="9-3-Getting-Support"><a href="#9-3-Getting-Support" class="headerlink" title="9.3 Getting Support"></a>9.3 Getting Support</h3><p><strong>Official resources:</strong></p><ol><li><strong>Documentation</strong>: <a href="https://docs.github.com/en/copilot/how-tos/copilot-cli">GitHub Copilot CLI Docs</a></li><li><strong>GitHub Community</strong>: Community Discussions</li><li><strong>Feedback</strong>: Use <code>/feedback</code> within CLI for bug reports or feature requests</li><li><strong>Support</strong>: GitHub Support for enterprise customers</li></ol><h2 id="Part-10-Best-Practices-and-Recommendations"><a href="#Part-10-Best-Practices-and-Recommendations" class="headerlink" title="Part 10: Best Practices and Recommendations"></a>Part 10: Best Practices and Recommendations</h2><h3 id="10-1-Stay-Updated"><a href="#10-1-Stay-Updated" class="headerlink" title="10.1 Stay Updated"></a>10.1 Stay Updated</h3><p>GitHub Copilot CLI is in active development and evolving rapidly.</p><p><strong>Regular checks:</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># Check for CLI updates</span>npm update -g @github/copilot<span class="hljs-comment"># Check current version</span>copilot --version</code></pre><p><strong>Stay informed:</strong></p><ul><li>Watch the <a href="https://github.com/github/copilot-cli">GitHub Copilot CLI repository</a> for releases</li><li>Follow GitHub Blog for major announcements</li><li>Review release notes regularly</li></ul><h3 id="10-2-Evolving-Your-Custom-Instructions"><a href="#10-2-Evolving-Your-Custom-Instructions" class="headerlink" title="10.2 Evolving Your Custom Instructions"></a>10.2 Evolving Your Custom Instructions</h3><p>Your custom instructions should evolve with your team:</p><p><strong>Quarterly review process:</strong></p><ol><li>What patterns is Copilot frequently getting wrong? → Add explicit guidance</li><li>What questions do we repeatedly ask? → Add to instructions</li><li>Have our tools or practices changed? → Update commands and tech stack</li><li>Are there new team members’ pain points? → Improve onboarding instructions</li><li>What works well? → Document and reinforce</li></ol><p><strong>Version control your instructions:</strong></p><pre><code class="hljs bash"><span class="hljs-comment"># Treat .github/copilot-instructions.md like production code</span>git <span class="hljs-built_in">log</span> .github/copilot-instructions.md<span class="hljs-comment"># Review changes in PRs</span>git diff main HEAD -- .github/copilot-instructions.md</code></pre><h3 id="10-3-Responsible-AI-Use"><a href="#10-3-Responsible-AI-Use" class="headerlink" title="10.3 Responsible AI Use"></a>10.3 Responsible AI Use</h3><p><strong>Remember:</strong></p><ol><li><strong>Always review AI-generated code</strong> - Copilot is a tool, not a replacement for human judgment</li><li><strong>Security first</strong> - Review generated code for security vulnerabilities</li><li><strong>Test thoroughly</strong> - All generated code should have appropriate test coverage</li><li><strong>Understand what you commit</strong> - Don’t commit code you don’t understand</li><li><strong>IP considerations</strong> - Follow your organization’s policies on AI-generated code</li></ol><h3 id="10-4-Building-an-AI-Assisted-Culture"><a href="#10-4-Building-an-AI-Assisted-Culture" class="headerlink" title="10.4 Building an AI-Assisted Culture"></a>10.4 Building an AI-Assisted Culture</h3><p><strong>Team practices:</strong></p><ol><li><strong>Share wins and learnings</strong> - Regular demos of effective Copilot usage</li><li><strong>Contribute to shared instructions</strong> - Treat them like production code</li><li><strong>Measure impact</strong> - Track metrics before and after adoption</li><li><strong>Continuous learning</strong> - Allocate time for experimentation</li><li><strong>Celebrate improvements</strong> - Recognize productivity gains</li></ol><h2 id="Conclusion-Embracing-AI-Assisted-Development"><a href="#Conclusion-Embracing-AI-Assisted-Development" class="headerlink" title="Conclusion: Embracing AI-Assisted Development"></a>Conclusion: Embracing AI-Assisted Development</h2><p>GitHub Copilot CLI represents a significant evolution in developer tooling. With the recent release of advanced AI models like Claude Opus 4.6 (February 5, 2026), the capabilities continue to expand, offering features like agent teams and extended context windows.</p><p><strong>Key takeaways:</strong></p><ol><li><strong>Invest in custom instructions</strong> - They’re the foundation of consistent results</li><li><strong>Use plan mode for complex tasks</strong> - Structured planning improves outcomes</li><li><strong>Choose appropriate models</strong> - Balance capability with quota management</li><li><strong>Establish team standards</strong> - Shared conventions maximize productivity</li><li><strong>Always review and validate</strong> - AI is a powerful assistant, but you remain responsible</li><li><strong>Stay current</strong> - The tool is evolving; keep up with new features</li><li><strong>Measure and iterate</strong> - Track what works and continuously improve</li></ol><p>The developers who thrive will be those who effectively integrate these tools into their workflow while maintaining strong engineering practices.</p><p><strong>Getting Started:</strong></p><ol><li>Install GitHub Copilot CLI: <code>npm install -g @github/copilot</code></li><li>Authenticate: <code>copilot</code> then <code>/login</code></li><li>Create your first <code>.github/copilot-instructions.md</code></li><li>Try a simple <code>/plan</code> workflow</li><li>Share your experience with your team</li><li>Iterate and improve</li></ol><hr><p><strong>Disclaimer</strong>: This guide is based on the state of GitHub Copilot CLI as of February 2026. Features, commands, and capabilities are subject to change as the tool is in public preview. Always consult the <a href="https://docs.github.com/en/copilot/how-tos/copilot-cli">official GitHub documentation</a> for the most current and accurate information. Finally, this guide is not only for senior engineers but can be adapted for developers at all levels to maximize their productivity with AI-assisted development. </p><p>Till next time, Happy coding! 🚀</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_maximising_copilot_cli_senior_engineer_guide.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;As software engineers, we’re constantly seeking ways to streamline our workflows and boost productivity. GitHub Copilot CLI has emerged as a powerful tool that brings AI assistance directly into your terminal, transforming how we interact with code across different stacks. This comprehensive guide will walk you through setting up an effective AI-powered development workflow with GitHub Copilot CLI, whether you’re building front-end applications, back-end services, data pipelines, or cloud infrastructure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: GitHub Copilot CLI is currently in &lt;strong&gt;public preview&lt;/strong&gt; and features are subject to change. Always refer to the &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli&quot;&gt;official GitHub documentation&lt;/a&gt; for the most up-to-date information.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;What-Makes-Copilot-CLI-Different&quot;&gt;&lt;a href=&quot;#What-Makes-Copilot-CLI-Different&quot; class=&quot;headerlink&quot; title=&quot;What Makes Copilot CLI Different?&quot;&gt;&lt;/a&gt;What Makes Copilot CLI Different?&lt;/h2&gt;&lt;p&gt;Unlike traditional code assistants, Copilot CLI is &lt;strong&gt;terminal-native&lt;/strong&gt; and &lt;strong&gt;agentic&lt;/strong&gt;—it doesn’t just answer questions, it can act as your coding partner. You can delegate tasks, and Copilot will autonomously execute them while you maintain oversight through explicit approval mechanisms.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai, github-copilot, cli, developer-productivity, software-development, best-practices, coding-assistant, ai-agents, software-engineering, full-stack-development, data-engineering, cloud-infrastructure, agentic-ai, plan-driven-development, multi-repo-workflows" scheme="http://awongcm.io/tags/ai-github-copilot-cli-developer-productivity-software-development-best-practices-coding-assistant-ai-agents-software-engineering-full-stack-development-data-engineering-cloud-infrastructure-agentic-ai-plan-driven-development-multi-repo-workflows/"/>
    
  </entry>
  
  <entry>
    <title>GitHub Copilot AI Models: A Developer&#39;s Guide to Choosing the Right Model</title>
    <link href="http://awongcm.io/blog/2026/01/24/github-copilot-ai-models-a-developer-s-guide-to-choosing-the-right-model/"/>
    <id>http://awongcm.io/blog/2026/01/24/github-copilot-ai-models-a-developer-s-guide-to-choosing-the-right-model/</id>
    <published>2026-01-24T04:19:44.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_github_copilot_models_developers_guide.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>GitHub Copilot now supports multiple AI models from leading providers including OpenAI, Anthropic, Google, and xAI, giving developers unprecedented flexibility to choose the right tool for their specific coding scenarios. Understanding the strengths and trade-offs of each model can significantly improve your productivity and code quality. This guide breaks down when to use each model and provides practical tips for getting the most out of GitHub Copilot in 2026.</p><span id="more"></span><h2 id="Available-Models-Overview"><a href="#Available-Models-Overview" class="headerlink" title="Available Models Overview"></a>Available Models Overview</h2><p>As of January 2026, GitHub Copilot offers access to an extensive range of AI models:</p><p><strong>OpenAI Models:</strong></p><ol><li>GPT-4o - Latest GPT-4 optimized model</li><li>GPT-4 Turbo - Fast GPT-4 variant</li><li>GPT-5 (1x) - Latest GPT-5 model</li><li>GPT-5-Codex (Preview, 1x) - GPT-5 optimized for coding</li><li>GPT-5.1 (1x) - Enhanced GPT-5 version</li><li>GPT-5.1-Codex (1x) - GPT-5.1 optimized for coding</li><li>GPT-5.1-Codex-Max (1x) - Maximum performance coding model</li><li>GPT-5.1-Codex-Mini (Preview, 0.33x) - Lightweight coding model</li><li>GPT-5.2 (1x) - Latest GPT-5.2 model</li><li>GPT-5.2-Codex (1x) - GPT-5.2 optimized for coding</li><li>o1-preview - Advanced reasoning model</li><li>o1-mini - Faster reasoning model</li></ol><p><strong>Anthropic Models:</strong></p><ol><li>Claude Sonnet 4 (1x) - Claude 4 balanced model</li><li>Claude Sonnet 4.5 (1x) - Latest Claude Sonnet version</li><li>Claude Opus 4.5 (3x) - Most capable Claude 4 model</li><li>Claude Haiku 4.5 (0.33x) - Fast, efficient Claude 4 model</li></ol><p><strong>Google Models:</strong></p><ol><li>Gemini 2.5 Pro (1x) - Advanced Gemini model</li><li>Gemini 3 Pro (Preview, 1x) - Latest Gemini Pro version</li><li>Gemini 3 Flash (Preview, 0.33x) - Fast Gemini variant</li></ol><p><strong>xAI Models:</strong></p><ol><li>Grok Code Fast 1 (0x) - xAI’s coding-focused model</li></ol><p><strong>Other Models:</strong></p><ol><li>Raptor mini (Preview, 0x) - Lightweight preview model</li></ol><h2 id="Model-Comparison-amp-Best-Use-Cases"><a href="#Model-Comparison-amp-Best-Use-Cases" class="headerlink" title="Model Comparison &amp; Best Use Cases"></a>Model Comparison &amp; Best Use Cases</h2><h3 id="GPT-4o-The-Optimized-Flagship"><a href="#GPT-4o-The-Optimized-Flagship" class="headerlink" title="GPT-4o: The Optimized Flagship"></a>GPT-4o: The Optimized Flagship</h3><p><strong>Best for:</strong></p><ul><li>Balanced performance and speed</li><li>General-purpose development tasks</li><li>Multi-modal interactions</li><li>Real-time code assistance</li><li>Production-grade applications</li></ul><p><strong>When to use:</strong></p><ul><li>Need reliable, fast responses</li><li>Working on standard to moderately complex tasks</li><li>Require consistent quality across various coding scenarios</li><li>Building customer-facing features</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier varies by implementation</li><li>May not match GPT-5 series for cutting-edge capabilities</li><li>Optimized for speed over maximum reasoning depth</li></ul><p><strong>Pro tip:</strong> GPT-4o strikes an excellent balance between speed and capability, making it ideal for daily production work.</p><h3 id="GPT-4-Turbo-The-Speed-Specialist"><a href="#GPT-4-Turbo-The-Speed-Specialist" class="headerlink" title="GPT-4 Turbo: The Speed Specialist"></a>GPT-4 Turbo: The Speed Specialist</h3><p><strong>Best for:</strong></p><ul><li>Rapid code completion</li><li>Quick iterations during development</li><li>Real-time suggestions</li><li>High-throughput scenarios</li><li>Time-sensitive projects</li></ul><p><strong>When to use:</strong></p><ul><li>Need fastest possible responses</li><li>Working under tight deadlines</li><li>Require immediate feedback during coding</li><li>Building prototypes quickly</li></ul><p><strong>Trade-offs:</strong></p><ul><li>May sacrifice some reasoning depth for speed</li><li>Better for well-defined problems than complex reasoning</li><li>Not ideal for architectural decisions</li></ul><p><strong>Pro tip:</strong> Use GPT-4 Turbo when velocity matters more than maximum sophistication.</p><h3 id="GPT-5-1x-The-Next-Generation-Model"><a href="#GPT-5-1x-The-Next-Generation-Model" class="headerlink" title="GPT-5 (1x): The Next-Generation Model"></a>GPT-5 (1x): The Next-Generation Model</h3><p><strong>Best for:</strong></p><ul><li>Advanced reasoning tasks</li><li>Complex code generation</li><li>Multi-step problem solving</li><li>Sophisticated algorithm implementation</li><li>Novel problem approaches</li></ul><p><strong>When to use:</strong></p><ul><li>Tackling new or unusual challenges</li><li>Need cutting-edge AI capabilities</li><li>Working on innovative solutions</li><li>Require deep contextual understanding</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>May be slower than GPT-4 variants</li><li>Newer model with evolving capabilities</li></ul><p><strong>Pro tip:</strong> GPT-5 represents the next generation of AI capabilities—use it when you need the latest advancements.</p><h3 id="GPT-5-Codex-Preview-1x-The-Code-First-Innovator"><a href="#GPT-5-Codex-Preview-1x-The-Code-First-Innovator" class="headerlink" title="GPT-5-Codex (Preview, 1x): The Code-First Innovator"></a>GPT-5-Codex (Preview, 1x): The Code-First Innovator</h3><p><strong>Best for:</strong></p><ul><li>Cutting-edge code generation</li><li>Complex programming patterns</li><li>Advanced code optimization</li><li>Novel algorithm development</li><li>Experimental coding approaches</li></ul><p><strong>When to use:</strong></p><ul><li>Need latest code-specific capabilities</li><li>Working on innovative coding solutions</li><li>Exploring new programming paradigms</li><li>Require advanced code understanding</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Preview status (may have limitations)</li><li>Evolving capabilities</li></ul><p><strong>Pro tip:</strong> GPT-5-Codex is ideal for developers who want to leverage the latest code-specific AI advancements.</p><h3 id="GPT-5-1-1x-The-Enhanced-Model"><a href="#GPT-5-1-1x-The-Enhanced-Model" class="headerlink" title="GPT-5.1 (1x): The Enhanced Model"></a>GPT-5.1 (1x): The Enhanced Model</h3><p><strong>Best for:</strong></p><ul><li>Improved reasoning over GPT-5</li><li>Complex code generation</li><li>Multi-file refactoring</li><li>Advanced problem-solving</li><li>Production-ready code</li></ul><p><strong>When to use:</strong></p><ul><li>Need enhanced capabilities over GPT-5</li><li>Working on sophisticated features</li><li>Require reliable, high-quality output</li><li>Building complex systems</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Balanced speed and quality</li><li>Standard computational cost</li></ul><p><strong>Pro tip:</strong> GPT-5.1 offers improvements over GPT-5 while maintaining the same cost structure.</p><h3 id="GPT-5-1-Codex-1x-The-Advanced-Code-Specialist"><a href="#GPT-5-1-Codex-1x-The-Advanced-Code-Specialist" class="headerlink" title="GPT-5.1-Codex (1x): The Advanced Code Specialist"></a>GPT-5.1-Codex (1x): The Advanced Code Specialist</h3><p><strong>Best for:</strong></p><ul><li>Advanced code-specific tasks</li><li>Complex algorithm implementation</li><li>Code optimization and refactoring</li><li>Technical debt reduction</li><li>Performance-critical code</li></ul><p><strong>When to use:</strong></p><ul><li>Need specialized code understanding</li><li>Working on complex algorithms</li><li>Implementing performance optimizations</li><li>Refactoring legacy code</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Specialized for code tasks</li><li>May be overkill for simple questions</li></ul><p><strong>Pro tip:</strong> Use GPT-5.1-Codex when you need advanced code-specific capabilities with enhanced reasoning.</p><h3 id="GPT-5-1-Codex-Max-1x-The-Maximum-Performance-Model"><a href="#GPT-5-1-Codex-Max-1x-The-Maximum-Performance-Model" class="headerlink" title="GPT-5.1-Codex-Max (1x): The Maximum Performance Model"></a>GPT-5.1-Codex-Max (1x): The Maximum Performance Model</h3><p><strong>Best for:</strong></p><ul><li>Maximum code generation quality</li><li>Extremely complex algorithms</li><li>Critical performance optimization</li><li>Advanced architectural patterns</li><li>Mission-critical code</li></ul><p><strong>When to use:</strong></p><ul><li>Need absolute best code quality</li><li>Working on performance-critical systems</li><li>Implementing complex design patterns</li><li>Solving the toughest coding challenges</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>May be slower than lighter models</li><li>Best reserved for complex tasks</li></ul><p><strong>Pro tip:</strong> GPT-5.1-Codex-Max is your go-to for the most demanding code generation tasks.</p><h3 id="GPT-5-1-Codex-Mini-Preview-0-33x-The-Efficient-Code-Assistant"><a href="#GPT-5-1-Codex-Mini-Preview-0-33x-The-Efficient-Code-Assistant" class="headerlink" title="GPT-5.1-Codex-Mini (Preview, 0.33x): The Efficient Code Assistant"></a>GPT-5.1-Codex-Mini (Preview, 0.33x): The Efficient Code Assistant</h3><p><strong>Best for:</strong></p><ul><li>Lightweight code generation</li><li>Quick code completions</li><li>Standard coding patterns</li><li>High-volume coding tasks</li><li>Cost-effective development</li></ul><p><strong>When to use:</strong></p><ul><li>Need efficient code assistance</li><li>Working on standard implementations</li><li>Require fast responses</li><li>Budget-conscious development</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 0.33x (very efficient!)</li><li>Preview status</li><li>Less sophisticated than full Codex models</li></ul><p><strong>Pro tip:</strong> With its low multiplier, GPT-5.1-Codex-Mini is perfect for high-volume coding without premium cost concerns.</p><h3 id="GPT-5-2-1x-The-Latest-Flagship"><a href="#GPT-5-2-1x-The-Latest-Flagship" class="headerlink" title="GPT-5.2 (1x): The Latest Flagship"></a>GPT-5.2 (1x): The Latest Flagship</h3><p><strong>Best for:</strong></p><ul><li>Complex code generation requiring deep context understanding</li><li>Multi-file refactoring tasks</li><li>Architectural decisions and design patterns</li><li>Advanced reasoning and problem-solving</li><li>Critical production code</li></ul><p><strong>When to use:</strong></p><ul><li>Working on mission-critical systems</li><li>Need highest accuracy for complex algorithms</li><li>Dealing with legacy codebases requiring careful analysis</li><li>Solving challenging technical problems</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Slower than lightweight models</li><li>Higher computational cost</li></ul><p><strong>Pro tip:</strong> GPT-5.2 represents the cutting edge of OpenAI’s capabilities. Use it when quality and accuracy are paramount.</p><h3 id="GPT-5-2-Codex-1x-The-Ultimate-Code-Specialist"><a href="#GPT-5-2-Codex-1x-The-Ultimate-Code-Specialist" class="headerlink" title="GPT-5.2-Codex (1x): The Ultimate Code Specialist"></a>GPT-5.2-Codex (1x): The Ultimate Code Specialist</h3><p><strong>Best for:</strong></p><ul><li>Code-specific tasks and optimizations</li><li>Understanding complex code patterns</li><li>Advanced code generation</li><li>Technical debt reduction</li><li>Performance optimization</li></ul><p><strong>When to use:</strong></p><ul><li>Need specialized code understanding</li><li>Working on performance-critical code</li><li>Implementing complex algorithms</li><li>Code optimization tasks</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Specialized for code, may be overkill for general questions</li><li>Best-in-class for code tasks</li></ul><p><strong>Pro tip:</strong> GPT-5.2-Codex is the most advanced code-specific model available—use it for your toughest coding challenges.</p><h3 id="o1-preview-The-Advanced-Reasoning-Specialist"><a href="#o1-preview-The-Advanced-Reasoning-Specialist" class="headerlink" title="o1-preview: The Advanced Reasoning Specialist"></a>o1-preview: The Advanced Reasoning Specialist</h3><p><strong>Best for:</strong></p><ul><li>Complex logical reasoning</li><li>Mathematical problem solving</li><li>Algorithm design and analysis</li><li>Multi-step reasoning tasks</li><li>Formal verification approaches</li><li>Deep analytical thinking</li></ul><p><strong>When to use:</strong></p><ul><li>Need deep analytical thinking</li><li>Working on algorithmically complex problems</li><li>Require formal reasoning capabilities</li><li>Solving mathematical or logical challenges</li><li>Complex system design requiring step-by-step analysis</li></ul><p><strong>Trade-offs:</strong></p><ul><li>May be slower due to reasoning depth</li><li>Optimized for reasoning over speed</li><li>Best for specific analytical tasks</li><li>Premium request multiplier varies</li></ul><p><strong>Pro tip:</strong> o1-preview excels at problems requiring step-by-step logical reasoning and mathematical analysis. Use it when you need to think through complex problems systematically.</p><h3 id="o1-mini-The-Efficient-Reasoner"><a href="#o1-mini-The-Efficient-Reasoner" class="headerlink" title="o1-mini: The Efficient Reasoner"></a>o1-mini: The Efficient Reasoner</h3><p><strong>Best for:</strong></p><ul><li>Fast reasoning tasks</li><li>Moderate complexity problems</li><li>Quick analytical solutions</li><li>Balanced reasoning and speed</li><li>Cost-effective reasoning</li></ul><p><strong>When to use:</strong></p><ul><li>Need reasoning capabilities with faster responses</li><li>Working on moderately complex logical tasks</li><li>Require efficient resource usage</li><li>Balancing quality and speed</li><li>Standard algorithm design</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Less depth than o1-preview</li><li>Better for focused problems than broad analysis</li><li>Optimized for efficiency</li><li>Faster but less comprehensive reasoning</li></ul><p><strong>Pro tip:</strong> o1-mini provides reasoning capabilities at a more accessible speed and cost point—perfect for everyday reasoning tasks.</p><h3 id="Claude-Sonnet-4-1x-The-Balanced-Claude"><a href="#Claude-Sonnet-4-1x-The-Balanced-Claude" class="headerlink" title="Claude Sonnet 4 (1x): The Balanced Claude"></a>Claude Sonnet 4 (1x): The Balanced Claude</h3><p><strong>Best for:</strong></p><ul><li>Balanced code generation</li><li>Standard development tasks</li><li>Quality-focused implementations</li><li>Thoughtful code suggestions</li><li>General-purpose development</li></ul><p><strong>When to use:</strong></p><ul><li>Need reliable Claude performance</li><li>Working on standard features</li><li>Require good balance of speed and quality</li><li>Building production applications</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Solid all-around performance</li><li>May not match Sonnet 4.5 for cutting-edge quality</li></ul><p><strong>Pro tip:</strong> Claude Sonnet 4 provides excellent balanced performance for most development tasks.</p><h3 id="Claude-Sonnet-4-5-1x-The-Quality-Champion"><a href="#Claude-Sonnet-4-5-1x-The-Quality-Champion" class="headerlink" title="Claude Sonnet 4.5 (1x): The Quality Champion"></a>Claude Sonnet 4.5 (1x): The Quality Champion</h3><p><strong>Best for:</strong></p><ul><li>Code reviews and quality improvements</li><li>Security-conscious code generation</li><li>Detailed explanations and documentation</li><li>Refactoring with emphasis on best practices</li><li>Maintainable, production-ready code</li></ul><p><strong>When to use:</strong></p><ul><li>Need thorough, thoughtful code suggestions</li><li>Working on security-sensitive features</li><li>Want detailed reasoning behind suggestions</li><li>Require strong adherence to coding standards</li><li>Complex logic requiring careful reasoning</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Can be more verbose in explanations</li><li>Slightly slower than lightweight models</li></ul><p><strong>Pro tip:</strong> Claude Sonnet 4.5 excels at writing clean, maintainable code with strong attention to best practices and security.</p><h3 id="Claude-Opus-4-5-3x-The-Premium-Powerhouse"><a href="#Claude-Opus-4-5-3x-The-Premium-Powerhouse" class="headerlink" title="Claude Opus 4.5 (3x): The Premium Powerhouse"></a>Claude Opus 4.5 (3x): The Premium Powerhouse</h3><p><strong>Best for:</strong></p><ul><li>Extremely complex reasoning tasks</li><li>Mission-critical code requiring highest quality</li><li>Comprehensive code analysis</li><li>Advanced architectural decisions</li><li>Complex multi-step problem solving</li></ul><p><strong>When to use:</strong></p><ul><li>Working on the most challenging problems</li><li>Need the absolute best quality output</li><li>Complex system design</li><li>Critical security implementations</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 3x (use strategically!)</li><li>Slower response times</li><li>Best reserved for truly complex tasks</li></ul><p><strong>Pro tip:</strong> Claude Opus 4.5 is your “big gun”—use it sparingly for the toughest challenges where quality is non-negotiable.</p><h3 id="Claude-Haiku-4-5-0-33x-The-Speed-Champion"><a href="#Claude-Haiku-4-5-0-33x-The-Speed-Champion" class="headerlink" title="Claude Haiku 4.5 (0.33x): The Speed Champion"></a>Claude Haiku 4.5 (0.33x): The Speed Champion</h3><p><strong>Best for:</strong></p><ul><li>Real-time code completion</li><li>Quick syntax fixes</li><li>Boilerplate code generation</li><li>Rapid prototyping</li><li>Repetitive coding tasks</li><li>Standard CRUD operations</li></ul><p><strong>When to use:</strong></p><ul><li>Need instant feedback while typing</li><li>Working on repetitive tasks</li><li>Generating standard code patterns</li><li>Time-sensitive development sprints</li><li>Writing scaffolding code</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 0.33x (very efficient!)</li><li>Less sophisticated reasoning for complex problems</li><li>Not suitable for architectural decisions</li></ul><p><strong>Pro tip:</strong> With its low multiplier and fast responses, Claude Haiku 4.5 is perfect for high-velocity coding sessions.</p><h3 id="Gemini-2-5-Pro-1x-The-Advanced-Google-Model"><a href="#Gemini-2-5-Pro-1x-The-Advanced-Google-Model" class="headerlink" title="Gemini 2.5 Pro (1x): The Advanced Google Model"></a>Gemini 2.5 Pro (1x): The Advanced Google Model</h3><p><strong>Best for:</strong></p><ul><li>Complex reasoning with Google’s approach</li><li>Multimodal code generation</li><li>Advanced problem solving</li><li>Alternative to GPT&#x2F;Claude models</li></ul><p><strong>When to use:</strong></p><ul><li>Need Google’s advanced capabilities</li><li>Working with multimodal tasks</li><li>Want alternative AI perspective</li><li>Exploring different approaches</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Mature, established model</li><li>Strong multimodal capabilities</li></ul><p><strong>Pro tip:</strong> Gemini 2.5 Pro offers a powerful alternative perspective to OpenAI and Anthropic models.</p><h3 id="Gemini-3-Pro-Preview-1x-The-Google-Flagship"><a href="#Gemini-3-Pro-Preview-1x-The-Google-Flagship" class="headerlink" title="Gemini 3 Pro (Preview, 1x): The Google Flagship"></a>Gemini 3 Pro (Preview, 1x): The Google Flagship</h3><p><strong>Best for:</strong></p><ul><li>Complex reasoning with Google’s latest approach</li><li>Multimodal code generation</li><li>Advanced problem solving</li><li>Alternative to GPT&#x2F;Claude models</li></ul><p><strong>When to use:</strong></p><ul><li>Want to try Google’s latest flagship</li><li>Need different perspective on problems</li><li>Working with images and code together</li><li>Exploring alternative AI approaches</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 1x</li><li>Public preview status</li><li>Availability may vary</li></ul><p><strong>Pro tip:</strong> Gemini 3 Pro represents Google’s latest AI advancements—experiment with it for fresh perspectives.</p><h3 id="Gemini-3-Flash-Preview-0-33x-The-Google-Speedster"><a href="#Gemini-3-Flash-Preview-0-33x-The-Google-Speedster" class="headerlink" title="Gemini 3 Flash (Preview, 0.33x): The Google Speedster"></a>Gemini 3 Flash (Preview, 0.33x): The Google Speedster</h3><p><strong>Best for:</strong></p><ul><li>Fast iterations</li><li>Multimodal tasks (code + images)</li><li>Quick prototyping</li><li>Standard coding patterns</li></ul><p><strong>When to use:</strong></p><ul><li>Need Google’s latest technology</li><li>Working with visual elements</li><li>Rapid development cycles</li><li>Experimenting with new approaches</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 0.33x</li><li>Public preview (may have limitations)</li><li>Less mature than established models</li></ul><p><strong>Pro tip:</strong> Gemini 3 Flash combines speed with multimodal capabilities at an efficient price point.</p><h3 id="Grok-Code-Fast-1-0x-The-Unlimited-Alternative"><a href="#Grok-Code-Fast-1-0x-The-Unlimited-Alternative" class="headerlink" title="Grok Code Fast 1 (0x): The Unlimited Alternative"></a>Grok Code Fast 1 (0x): The Unlimited Alternative</h3><p><strong>Best for:</strong></p><ul><li>High-volume code generation</li><li>Alternative coding perspectives</li><li>Fast iterations</li><li>Unlimited usage scenarios</li><li>Experimental approaches</li></ul><p><strong>When to use:</strong></p><ul><li>Want to try xAI’s approach</li><li>Need unlimited usage without premium costs</li><li>Looking for different coding styles</li><li>Exploring alternative AI perspectives</li><li>High-frequency coding tasks</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 0x (unlimited!)</li><li>Newer model with evolving capabilities</li><li>Different approach than established models</li></ul><p><strong>Pro tip:</strong> With 0x multiplier, Grok Code Fast 1 is perfect for high-volume experimentation and unlimited daily coding without consuming premium requests.</p><h3 id="Raptor-mini-Preview-0x-The-Unlimited-Specialist"><a href="#Raptor-mini-Preview-0x-The-Unlimited-Specialist" class="headerlink" title="Raptor mini (Preview, 0x): The Unlimited Specialist"></a>Raptor mini (Preview, 0x): The Unlimited Specialist</h3><p><strong>Best for:</strong></p><ul><li>GitHub-specific workflows</li><li>High-frequency coding tasks</li><li>Standard development patterns</li><li>Unlimited daily usage</li><li>Cost-conscious development</li></ul><p><strong>When to use:</strong></p><ul><li>Need unlimited model access</li><li>Working on typical GitHub workflows</li><li>Require efficient, focused responses</li><li>Budget is a primary concern</li><li>Standard development tasks</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Premium request multiplier: 0x (unlimited!)</li><li>Preview status with potential limitations</li><li>Optimized for specific use cases</li><li>Fine-tuned for GitHub workflows</li></ul><p><strong>Pro tip:</strong> Raptor mini is ideal for developers who need unlimited access for standard coding tasks without any premium request concerns.</p><h2 id="Practical-Tips-amp-Tricks"><a href="#Practical-Tips-amp-Tricks" class="headerlink" title="Practical Tips &amp; Tricks"></a>Practical Tips &amp; Tricks</h2><h3 id="1-Match-Model-to-Task-Complexity"><a href="#1-Match-Model-to-Task-Complexity" class="headerlink" title="1. Match Model to Task Complexity"></a>1. Match Model to Task Complexity</h3><p><strong>Simple tasks</strong> (syntax, boilerplate, formatting):<br>→ Use <strong>Claude Haiku 4.5</strong>, <strong>Grok Code Fast 1</strong>, <strong>Raptor mini</strong>, or <strong>GPT-4 Turbo</strong></p><p><strong>Medium complexity</strong> (feature implementation, standard algorithms):<br>→ Use <strong>GPT-4o</strong>, <strong>Claude Sonnet 4</strong>, <strong>Gemini 3 Flash</strong>, or <strong>o1-mini</strong></p><p><strong>High complexity</strong> (architecture, complex algorithms, critical systems):<br>→ Use <strong>GPT-5.2</strong>, <strong>Claude Sonnet 4.5</strong>, <strong>GPT-5</strong>, or <strong>o1-preview</strong></p><p><strong>Maximum quality</strong> (mission-critical, highest stakes):<br>→ Use <strong>Claude Opus 4.5</strong>, <strong>GPT-5.2</strong>, or <strong>o1-preview</strong></p><p><strong>Code-specific optimization</strong>:<br>→ Use <strong>GPT-5.2-Codex</strong>, <strong>GPT-5.1-Codex-Max</strong>, or <strong>GPT-5-Codex</strong></p><p><strong>Advanced reasoning</strong>:<br>→ Use <strong>o1-preview</strong> or <strong>o1-mini</strong></p><h3 id="2-Optimize-for-Premium-Request-Usage"><a href="#2-Optimize-for-Premium-Request-Usage" class="headerlink" title="2. Optimize for Premium Request Usage"></a>2. Optimize for Premium Request Usage</h3><p><strong>Models with 0x multiplier</strong> (unlimited usage):</p><ul><li>Grok Code Fast 1</li><li>Raptor mini</li></ul><p><strong>Most efficient models</strong> (low multipliers):</p><ul><li>Claude Haiku 4.5 (0.33x)</li><li>Gemini 3 Flash (0.33x)</li><li>GPT-5.1-Codex-Mini (0.33x)</li></ul><p><strong>Standard models</strong> (1x multiplier):</p><ul><li>Claude Sonnet 4&#x2F;4.5</li><li>GPT-5, GPT-5.1, GPT-5.2</li><li>GPT-4o</li><li>GPT-5-Codex, GPT-5.1-Codex, GPT-5.1-Codex-Max, GPT-5.2-Codex</li><li>Gemini 2.5 Pro, Gemini 3 Pro</li></ul><p><strong>Premium models</strong> (use strategically):</p><ul><li>Claude Opus 4.5 (3x)</li></ul><p><strong>Pro tip:</strong> Start with 0x multiplier models (Grok, Raptor mini) for unlimited daily work, use 0.33x models for efficient high-volume tasks, and reserve 3x models for critical challenges.</p><h3 id="3-Speed-vs-Quality-Trade-off-Strategy"><a href="#3-Speed-vs-Quality-Trade-off-Strategy" class="headerlink" title="3. Speed vs. Quality Trade-off Strategy"></a>3. Speed vs. Quality Trade-off Strategy</h3><p><strong>Prototyping phase:</strong></p><ul><li>Primary: Claude Haiku 4.5, Grok Code Fast 1, or GPT-4 Turbo</li><li>Alternative: Raptor mini or Gemini 3 Flash</li></ul><p><strong>Implementation phase:</strong></p><ul><li>Primary: GPT-4o or Claude Sonnet 4</li><li>Alternative: GPT-5.1-Codex or GPT-5</li></ul><p><strong>Refinement phase:</strong></p><ul><li>Primary: Claude Sonnet 4.5 or GPT-5.2</li><li>Alternative: GPT-5.2-Codex or o1-mini</li></ul><p><strong>Review phase:</strong></p><ul><li>Primary: Claude Sonnet 4.5 or GPT-4o</li><li>Alternative: GPT-5.2 or o1-preview</li></ul><p><strong>Reasoning phase:</strong></p><ul><li>Primary: o1-preview</li><li>Alternative: o1-mini or GPT-5.2</li></ul><h3 id="4-Language-and-Framework-Recommendations"><a href="#4-Language-and-Framework-Recommendations" class="headerlink" title="4. Language and Framework Recommendations"></a>4. Language and Framework Recommendations</h3><p><strong>Python&#x2F;JavaScript&#x2F;TypeScript:</strong></p><ul><li>Any model works well</li><li>Use GPT-4o or Grok Code Fast 1 for daily work</li><li>Use Claude Sonnet 4.5 for quality-critical code</li></ul><p><strong>Rust&#x2F;Go&#x2F;Modern languages:</strong></p><ul><li>GPT-5.2 or Claude Sonnet 4.5 for advanced features</li><li>Claude Haiku 4.5 for standard patterns</li><li>o1-preview for complex algorithms</li></ul><p><strong>Legacy or niche languages:</strong></p><ul><li>GPT-5.2 or Claude Opus 4.5 for best understanding</li><li>Claude Sonnet 4.5 for careful, conservative suggestions</li></ul><p><strong>Code-heavy tasks:</strong></p><ul><li>GPT-5.2-Codex for optimization</li><li>GPT-5.1-Codex-Max for complex code generation</li><li>GPT-5-Codex for cutting-edge approaches</li></ul><p><strong>Mathematical&#x2F;algorithmic tasks:</strong></p><ul><li>o1-preview for complex reasoning</li><li>o1-mini for efficient problem-solving</li></ul><h3 id="5-Model-Updates-amp-New-Additions"><a href="#5-Model-Updates-amp-New-Additions" class="headerlink" title="5. Model Updates &amp; New Additions"></a>5. Model Updates &amp; New Additions</h3><p><strong>New Models to Explore:</strong></p><ul><li><strong>GPT-4o</strong> - Optimized GPT-4 for balanced performance</li><li><strong>GPT-4 Turbo</strong> - Speed-focused GPT-4 variant</li><li><strong>GPT-5 series</strong> - Next-generation capabilities</li><li><strong>o1-preview &amp; o1-mini</strong> - Advanced reasoning models</li><li><strong>Grok Code Fast 1</strong> - xAI’s unlimited usage alternative</li></ul><p><strong>Key Changes:</strong></p><ul><li>GPT-4o and GPT-4 Turbo provide optimized GPT-4 experiences</li><li>GPT-5 series offers cutting-edge capabilities</li><li>o1 models bring specialized reasoning abilities</li><li>Grok provides unlimited usage alternative</li><li>Expanded Codex variants for code-specific tasks</li></ul><p><strong>Pro tip:</strong> Experiment with new models in non-critical work to understand their strengths before using them in production.</p><h3 id="6-Cost-Optimization-Workflow"><a href="#6-Cost-Optimization-Workflow" class="headerlink" title="6. Cost Optimization Workflow"></a>6. Cost Optimization Workflow</h3><p><strong>Daily development routine:</strong></p><ol><li><strong>Active typing</strong>: Claude Haiku 4.5 (0.33x) or Grok Code Fast 1 (0x)</li><li><strong>Feature implementation</strong>: GPT-4o or Grok Code Fast 1 (0x)</li><li><strong>Complex logic</strong>: Claude Sonnet 4.5 (1x) or o1-mini</li><li><strong>Code review</strong>: Claude Sonnet 4.5 (1x) or GPT-4o</li><li><strong>Critical issues</strong>: Claude Opus 4.5 (3x) or o1-preview - use sparingly</li></ol><p><strong>Budget-conscious approach:</strong></p><ul><li>Use 0x models (Grok Code Fast 1, Raptor mini) as default</li><li>Use low-multiplier models (Haiku, Gemini Flash, Codex-Mini) for high-volume tasks</li><li>Reserve 1x+ models for important work</li><li>Use 3x models only for critical challenges</li></ul><p><strong>Pro tip:</strong> With Grok Code Fast 1 and Raptor mini at 0x, you can do unlimited coding without any premium request concerns.</p><h3 id="7-Multimodal-Capabilities"><a href="#7-Multimodal-Capabilities" class="headerlink" title="7. Multimodal Capabilities"></a>7. Multimodal Capabilities</h3><p><strong>Models supporting images:</strong></p><ul><li>Gemini 3 Flash</li><li>Gemini 3 Pro</li><li>Gemini 2.5 Pro</li><li>GPT-4o (check documentation)</li><li>Select other models (check documentation)</li></ul><p><strong>Use cases:</strong></p><ul><li>Screenshot of UI mockups → Generate HTML&#x2F;CSS</li><li>Error message screenshots → Debug issues</li><li>Diagram images → Explain architecture</li><li>Code screenshots → Analyze and improve</li><li>Design mockups → Implement interfaces</li></ul><p><strong>Pro tip:</strong> Leverage multimodal capabilities when working with visual elements—it can significantly speed up UI development and debugging.</p><h3 id="8-Team-Collaboration-Guidelines"><a href="#8-Team-Collaboration-Guidelines" class="headerlink" title="8. Team Collaboration Guidelines"></a>8. Team Collaboration Guidelines</h3><p><strong>Establish team standards:</strong></p><pre><code class="hljs plaintext">Decision Tree for Model Selection:Is it a security-critical feature?  → Yes: Claude Sonnet 4.5 or Claude Opus 4.5  → No: Continue...Is it a complex reasoning/algorithmic task?  → Yes: o1-preview or o1-mini  → No: Continue...Is it a complex architectural decision?  → Yes: GPT-5.2, Claude Opus 4.5, or o1-preview  → No: Continue...Is it code-specific optimization?  → Yes: GPT-5.2-Codex, GPT-5.1-Codex-Max, or GPT-5-Codex  → No: Continue...Is it boilerplate or repetitive?  → Yes: Claude Haiku 4.5, Grok Code Fast 1, or Raptor mini  → No: Continue...Is budget/usage a concern?  → Yes: Grok Code Fast 1 or Raptor mini (0x)  → No: GPT-4o or Claude Sonnet 4Default: Grok Code Fast 1 or GPT-4o</code></pre><h3 id="9-IDE-Specific-Considerations"><a href="#9-IDE-Specific-Considerations" class="headerlink" title="9. IDE-Specific Considerations"></a>9. IDE-Specific Considerations</h3><p><strong>Visual Studio Code:</strong></p><ul><li>All models available</li><li>Use “Auto” mode for intelligent selection</li><li>Can add custom models via AI Toolkit</li><li>Great support for all model families</li></ul><p><strong>JetBrains IDEs:</strong></p><ul><li>Full model support</li><li>Requires Copilot plugin 1.5.61+ for latest Codex models</li><li>Excellent integration with reasoning models</li></ul><p><strong>Visual Studio:</strong></p><ul><li>Comprehensive model support</li><li>Great for .NET development with any model</li><li>Strong support for GPT and Claude models</li></ul><p><strong>Xcode:</strong></p><ul><li>All models supported</li><li>Requires plugin 0.45.0+ for latest features</li><li>Good for Swift&#x2F;iOS development</li></ul><p><strong>Eclipse:</strong></p><ul><li>Full support available</li><li>Requires plugin 0.13.0+ for latest models</li><li>Works well with all model families</li></ul><h3 id="10-Prompt-Engineering-by-Model-Family"><a href="#10-Prompt-Engineering-by-Model-Family" class="headerlink" title="10. Prompt Engineering by Model Family"></a>10. Prompt Engineering by Model Family</h3><p><strong>For Claude models:</strong></p><ul><li>Be explicit about requirements and constraints</li><li>Ask for explanations when needed (especially Sonnet&#x2F;Opus)</li><li>Request “best practices” or “secure implementation”</li><li>Works well with structured, detailed prompts</li><li>Emphasize code quality and maintainability</li></ul><p><strong>For GPT models:</strong></p><ul><li>More conversational prompts work well</li><li>Good at inferring intent from context</li><li>Effective with iterative refinement</li><li>Handles ambiguous requests better</li><li>GPT-4o excels at balanced tasks</li></ul><p><strong>For o1 models:</strong></p><ul><li>Frame problems as reasoning tasks</li><li>Break down complex problems into steps</li><li>Ask for analytical thinking</li><li>Request mathematical or logical explanations</li><li>Best for step-by-step problem solving</li></ul><p><strong>For Gemini models:</strong></p><ul><li>Leverage multimodal capabilities</li><li>Provide visual context when available</li><li>Good for creative problem-solving</li><li>Works well with images and code together</li></ul><p><strong>For Grok:</strong></p><ul><li>Direct, straightforward prompts</li><li>Focus on efficiency</li><li>Good for quick iterations</li><li>Works well with high-volume requests</li></ul><h2 id="Real-World-Scenarios"><a href="#Real-World-Scenarios" class="headerlink" title="Real-World Scenarios"></a>Real-World Scenarios</h2><h3 id="Scenario-1-Building-a-New-REST-API"><a href="#Scenario-1-Building-a-New-REST-API" class="headerlink" title="Scenario 1: Building a New REST API"></a>Scenario 1: Building a New REST API</h3><ol><li><strong>Architecture planning</strong>: GPT-5.2, o1-preview, or Claude Sonnet 4.5</li><li><strong>Route scaffolding</strong>: Claude Haiku 4.5, Grok Code Fast 1, or GPT-4 Turbo</li><li><strong>Business logic</strong>: Claude Sonnet 4.5, GPT-4o, or GPT-5.1-Codex</li><li><strong>Input validation &amp; security</strong>: Claude Sonnet 4.5 or Claude Opus 4.5</li><li><strong>Tests</strong>: GPT-4o or Grok Code Fast 1</li><li><strong>Documentation</strong>: Claude Sonnet 4.5 or GPT-4o</li><li><strong>Performance optimization</strong>: GPT-5.2-Codex or GPT-5.1-Codex-Max</li></ol><p><strong>Estimated premium usage:</strong> ~8-12 requests (mix of 0x and 1x models)</p><h3 id="Scenario-2-Debugging-Production-Issue"><a href="#Scenario-2-Debugging-Production-Issue" class="headerlink" title="Scenario 2: Debugging Production Issue"></a>Scenario 2: Debugging Production Issue</h3><ol><li><strong>Initial investigation</strong>: GPT-5.2, GPT-4o, or Claude Sonnet 4.5</li><li><strong>Understanding stack traces</strong>: GPT-5.2 or o1-mini</li><li><strong>Quick fixes</strong>: GPT-4o, Grok Code Fast 1, or Claude Haiku 4.5</li><li><strong>Root cause analysis</strong>: Claude Sonnet 4.5, o1-preview, or Claude Opus 4.5</li><li><strong>Verification</strong>: Claude Sonnet 4.5 or GPT-4o</li></ol><p><strong>Estimated premium usage:</strong> ~4-7 requests (mix of 0x and 1x)</p><h3 id="Scenario-3-Rapid-Prototyping"><a href="#Scenario-3-Rapid-Prototyping" class="headerlink" title="Scenario 3: Rapid Prototyping"></a>Scenario 3: Rapid Prototyping</h3><ol><li><strong>Quick iterations</strong>: Claude Haiku 4.5, Grok Code Fast 1, or GPT-4 Turbo</li><li><strong>Core functionality</strong>: GPT-4o or Grok Code Fast 1</li><li><strong>Edge cases</strong>: Claude Sonnet 4 or o1-mini</li><li><strong>Polish</strong>: Claude Sonnet 4.5 or GPT-4o</li></ol><p><strong>Estimated premium usage:</strong> ~2-4 requests (mostly 0x and low multipliers)</p><h3 id="Scenario-4-Legacy-Code-Refactoring"><a href="#Scenario-4-Legacy-Code-Refactoring" class="headerlink" title="Scenario 4: Legacy Code Refactoring"></a>Scenario 4: Legacy Code Refactoring</h3><ol><li><strong>Understanding existing code</strong>: GPT-5.2, o1-preview, or Claude Opus 4.5</li><li><strong>Identifying improvements</strong>: Claude Sonnet 4.5 or o1-mini</li><li><strong>Implementing changes</strong>: Claude Sonnet 4.5, GPT-4o, or GPT-5.1-Codex</li><li><strong>Ensuring compatibility</strong>: Claude Sonnet 4.5 or GPT-5.2</li><li><strong>Migration tests</strong>: GPT-4o or Grok Code Fast 1</li></ol><p><strong>Estimated premium usage:</strong> ~7-11 requests (higher quality models)</p><h3 id="Scenario-5-High-Volume-Feature-Development"><a href="#Scenario-5-High-Volume-Feature-Development" class="headerlink" title="Scenario 5: High-Volume Feature Development"></a>Scenario 5: High-Volume Feature Development</h3><ol><li><strong>Boilerplate generation</strong>: Grok Code Fast 1 (0x) or Raptor mini (0x)</li><li><strong>Standard implementations</strong>: GPT-4o or Grok Code Fast 1 (0x)</li><li><strong>Complex components</strong>: Claude Sonnet 4 (1x) or GPT-5.1-Codex (1x)</li><li><strong>Code review</strong>: Claude Sonnet 4.5 (1x) or GPT-4o</li></ol><p><strong>Estimated premium usage:</strong> ~3-6 requests (optimized for volume with 0x models)</p><h3 id="Scenario-6-Algorithm-Design-amp-Optimization"><a href="#Scenario-6-Algorithm-Design-amp-Optimization" class="headerlink" title="Scenario 6: Algorithm Design &amp; Optimization"></a>Scenario 6: Algorithm Design &amp; Optimization</h3><ol><li><strong>Problem analysis</strong>: o1-preview or o1-mini</li><li><strong>Algorithm design</strong>: o1-preview or GPT-5.2</li><li><strong>Implementation</strong>: GPT-5.2-Codex or GPT-5.1-Codex-Max</li><li><strong>Optimization</strong>: GPT-5.2-Codex or o1-mini</li><li><strong>Testing</strong>: GPT-4o or Grok Code Fast 1</li></ol><p><strong>Estimated premium usage:</strong> ~6-10 requests (reasoning and code-specific models)</p><h2 id="Performance-Matrix"><a href="#Performance-Matrix" class="headerlink" title="Performance Matrix"></a>Performance Matrix</h2><table><thead><tr><th>Task Type</th><th>Speed</th><th>Quality</th><th>Efficiency</th><th>Recommended Models</th></tr></thead><tbody><tr><td>Boilerplate</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>Haiku 4.5, Grok, Raptor mini, GPT-4 Turbo</td></tr><tr><td>Feature Dev</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>GPT-4o, Sonnet 4, o1-mini</td></tr><tr><td>Complex Logic</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>Sonnet 4.5, GPT-5.2, o1-preview</td></tr><tr><td>Code Review</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>Sonnet 4.5, GPT-4o</td></tr><tr><td>Debugging</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>GPT-5.2, Sonnet 4.5, GPT-4o</td></tr><tr><td>Security</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>Sonnet 4.5, Opus 4.5</td></tr><tr><td>Documentation</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>Sonnet 4.5, GPT-4o</td></tr><tr><td>Prototyping</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>Haiku 4.5, Grok, GPT-4 Turbo</td></tr><tr><td>Reasoning</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>o1-preview, o1-mini, GPT-5</td></tr><tr><td>Code Optimization</td><td>⭐⭐⭐</td><td>⭐⭐⭐⭐⭐</td><td>⭐⭐⭐</td><td>GPT-5.2-Codex, GPT-5.1-Codex-Max</td></tr><tr><td>Multimodal</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>⭐⭐⭐⭐</td><td>Gemini 3 Flash, Gemini 3 Pro, GPT-4o</td></tr></tbody></table><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>The expanded model selection in GitHub Copilot for 2026 gives developers unprecedented control over their AI-assisted development workflow. With models ranging from unlimited usage (Grok at 0x, Raptor mini at 0x) to premium powerhouses (Claude Opus 4.5 at 3x), and specialized reasoning models (o1-preview, o1-mini), you can optimize for speed, quality, cost, or reasoning depth based on your specific needs.</p><h3 id="Quick-Reference-Guide"><a href="#Quick-Reference-Guide" class="headerlink" title="Quick Reference Guide:"></a>Quick Reference Guide:</h3><ul><li><strong>Need speed?</strong> → GPT-4 Turbo, Claude Haiku 4.5, or Grok Code Fast 1</li><li><strong>Daily coding?</strong> → Grok Code Fast 1 or Raptor mini (0x multiplier—unlimited!)</li><li><strong>Need quality?</strong> → Claude Sonnet 4.5 or GPT-4o</li><li><strong>Complex problems?</strong> → GPT-5.2, o1-preview, or Claude Opus 4.5</li><li><strong>Advanced reasoning?</strong> → o1-preview or o1-mini</li><li><strong>Security-critical?</strong> → Claude Sonnet 4.5 or Claude Opus 4.5</li><li><strong>Code optimization?</strong> → GPT-5.2-Codex or GPT-5.1-Codex-Max</li><li><strong>Budget-conscious?</strong> → Grok Code Fast 1 or Raptor mini (unlimited!)</li><li><strong>Prototyping?</strong> → GPT-4 Turbo, Claude Haiku 4.5, or Grok Code Fast 1</li><li><strong>Production code?</strong> → GPT-4o, Claude Sonnet 4.5, or GPT-5.2</li><li><strong>Balanced performance?</strong> → GPT-4o or Claude Sonnet 4</li><li><strong>Multimodal tasks?</strong> → Gemini 3 Flash, Gemini 3 Pro, or GPT-4o</li></ul><h3 id="Key-Takeaways"><a href="#Key-Takeaways" class="headerlink" title="Key Takeaways:"></a>Key Takeaways:</h3><ol><li><strong>Use 0x multiplier models as your default</strong> (Grok Code Fast 1, Raptor mini) for unlimited usage</li><li><strong>GPT-4o provides excellent balance</strong> for production development</li><li><strong>o1 models excel at reasoning</strong> tasks requiring deep analysis</li><li><strong>Low multiplier models</strong> (Haiku, Gemini Flash, Codex-Mini) are perfect for high-volume work</li><li><strong>Reserve premium models</strong> (Opus 4.5) for truly critical challenges</li><li><strong>GPT-5 series offers cutting-edge</strong> capabilities for innovative work</li><li><strong>Switch models mid-task</strong> based on complexity—don’t stick to one default</li><li><strong>Leverage specialized models</strong>—use Codex variants for code-heavy tasks, o1 for reasoning</li><li><strong>Consider multimodal capabilities</strong>—Gemini models support images</li><li><strong>Monitor your usage</strong>—understand multipliers to optimize premium request consumption</li></ol><h3 id="Action-Items"><a href="#Action-Items" class="headerlink" title="Action Items:"></a>Action Items:</h3><ol><li>Explore GPT-4o as your balanced production model</li><li>Try o1-preview for complex reasoning tasks</li><li>Set Grok Code Fast 1 or Raptor mini as default for unlimited usage</li><li>Set up quick-access shortcuts for your top 5-6 models</li><li>Document team preferences and decision criteria</li><li>Experiment with GPT-5 series for cutting-edge capabilities</li><li>Use o1-mini for efficient reasoning tasks</li><li>Track your premium usage patterns to optimize model selection</li><li>Test GPT-4 Turbo for high-velocity development</li><li>Leverage code-specific Codex variants for optimization work</li></ol><p>The key to success is flexibility: match the model to the task, not the other way around. Start with unlimited models (Grok, Raptor mini) for daily work, use efficient models (Haiku, Gemini Flash) for high-volume tasks, leverage reasoning models (o1-preview, o1-mini) for complex analysis, escalate to premium models when quality matters, and always be ready to switch based on the challenge at hand.</p><p>To see actual code samples for all these latest Copilot models, you can check out my Github repo <a href="https://github.com/awongCM/copilot-models-testing/tree/main/results">here</a>.  You can check out all the present models with their corresponding observations notes I have prepared them for so you can take note of their differences.</p><p>Hope these will be helpful for you.</p><p>Till next time, Happy Coding!</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_github_copilot_models_developers_guide.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;GitHub Copilot now supports multiple AI models from leading providers including OpenAI, Anthropic, Google, and xAI, giving developers unprecedented flexibility to choose the right tool for their specific coding scenarios. Understanding the strengths and trade-offs of each model can significantly improve your productivity and code quality. This guide breaks down when to use each model and provides practical tips for getting the most out of GitHub Copilot in 2026.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai, gihtub-copilot, large-language-models, productivity, developer-tools, ai-programming, software-development, tech-guide, software-engineering, developer-resources" scheme="http://awongcm.io/tags/ai-gihtub-copilot-large-language-models-productivity-developer-tools-ai-programming-software-development-tech-guide-software-engineering-developer-resources/"/>
    
  </entry>
  
  <entry>
    <title>Building Modern CI/CD Pipelines with GitHub Actions: A Complete Guide to Docker, LocalStack, and AWS Glue Testing</title>
    <link href="http://awongcm.io/blog/2026/01/17/building-modern-ci-cd-pipelines-with-github-actions-a-complete-guide-to-docker-localstack-and-aws-glue-testing/"/>
    <id>http://awongcm.io/blog/2026/01/17/building-modern-ci-cd-pipelines-with-github-actions-a-complete-guide-to-docker-localstack-and-aws-glue-testing/</id>
    <published>2026-01-17T00:46:10.000Z</published>
    <updated>2026-11-15T01:30:57.671Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_building_github_actions_localstack_unit_tests.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>Since my last post on setting local AWS Glue using Docker, one of the potential extensions I mentioned is to setup Github Actions CI&#x2F;CD pipeline for it. In modern data engineering, testing cloud-native applications locally before deployment is very crucial for rapid iteration and cost efficiency. Thus, as part of this exploratory exercise, I want my CI&#x2F;CD pipeline to achieve the following outcomes(in scope):</p><ul><li>Automate testing of AWS Glue jobs in a local environment</li><li>Use Docker to containerize the Glue runtime</li><li>Leverage LocalStack to simulate AWS services locally</li><li>Integrate with GitHub Actions for continuous integration and delivery</li><li>Ensure code quality with SonarCloud and Codecov</li></ul><p>Not in scope for this pipeline:</p><ul><li>Terraform or infrastructure-as-code testing</li><li>Deployment to actual AWS environments</li><li>Advanced security hardening for enterprise compliance</li></ul><p>This guide walks you through building very robust (if not production-ready) CI&#x2F;CD pipeline using GitHub Actions that integrates Docker containerization, LocalStack for AWS service emulation, and comprehensive testing for AWS Glue jobs.</p><span id="more"></span><p>This proof-of-concept end-to-end solution was conducted by trial and error using my Copilot and Claude Sonnets to help me along the learning journey. I’m pretty satisfied with its findings and I hope you find it useful too.</p><p>By the end of this post, you’ll understand how to leverage GitHub’s ecosystem to create automated pipelines that test your data engineering workloads without incurring cloud costs during development.</p><h2 id="Why-This-Matters"><a href="#Why-This-Matters" class="headerlink" title="Why This Matters"></a>Why This Matters</h2><p>Traditional cloud development workflows often require:</p><ul><li>Deploying to actual AWS environments for testing</li><li>Incurring costs for every test run</li><li>Waiting for cloud resource provisioning</li><li>Managing multiple AWS accounts for dev&#x2F;test&#x2F;prod</li></ul><p><strong>The solution?</strong> A fully containerized CI&#x2F;CD pipeline that:</p><ul><li>Tests AWS Glue jobs locally using Docker</li><li>Simulates AWS services with LocalStack</li><li>Runs automated tests on every commit</li><li>Publishes Docker images to GitHub Container Registry</li><li>Integrates code quality checks with SonarCloud and Codecov</li></ul><h2 id="Architecture-Overview"><a href="#Architecture-Overview" class="headerlink" title="Architecture Overview"></a>Architecture Overview</h2><p>The pipeline implements a multi-stage workflow:</p><ol><li><strong>Build Stage</strong>: Creates Docker images with AWS Glue runtime</li><li><strong>Test Stage</strong>: Spins up LocalStack services and runs unit&#x2F;integration tests</li><li><strong>Quality Stage</strong>: Analyzes code coverage and quality metrics</li><li><strong>Publish Stage</strong>: Pushes validated images to GitHub Container Registry</li></ol><h2 id="The-Complete-GitHub-Actions-Workflow"><a href="#The-Complete-GitHub-Actions-Workflow" class="headerlink" title="The Complete GitHub Actions Workflow"></a>The Complete GitHub Actions Workflow</h2><p>Let’s break down the workflow file (<code>ci-pipeline.yml</code>) into digestible components.</p><h3 id="1-Workflow-Triggers-and-Permissions"><a href="#1-Workflow-Triggers-and-Permissions" class="headerlink" title="1. Workflow Triggers and Permissions"></a>1. Workflow Triggers and Permissions</h3><pre><code class="hljs yaml"><span class="hljs-attr">name:</span> <span class="hljs-string">Run</span> <span class="hljs-string">Tests</span> <span class="hljs-string">with</span> <span class="hljs-string">LocalStack,</span> <span class="hljs-string">Build</span> <span class="hljs-string">Docker</span> <span class="hljs-string">Image,</span> <span class="hljs-string">and</span> <span class="hljs-string">Upload</span> <span class="hljs-string">Coverage</span> <span class="hljs-string">to</span> <span class="hljs-string">SonarCloud</span> <span class="hljs-string">&amp;</span> <span class="hljs-string">Codecov</span><span class="hljs-attr">on:</span>  <span class="hljs-attr">push:</span>    <span class="hljs-attr">branches:</span> [<span class="hljs-string">main</span>, <span class="hljs-string">develop</span>]  <span class="hljs-attr">pull_request:</span>    <span class="hljs-attr">branches:</span> [<span class="hljs-string">main</span>, <span class="hljs-string">develop</span>]<span class="hljs-attr">permissions:</span>  <span class="hljs-attr">contents:</span> <span class="hljs-string">read</span>  <span class="hljs-attr">packages:</span> <span class="hljs-string">write</span></code></pre><p><strong>Key Points:</strong></p><ul><li>Triggers on pushes and PRs to <code>main</code> and <code>develop</code> branches</li><li><code>packages: write</code> permission enables pushing to GitHub Container Registry (GHCR)</li><li><code>contents: read</code> allows checkout access</li></ul><h3 id="2-LocalStack-Service-Configuration"><a href="#2-LocalStack-Service-Configuration" class="headerlink" title="2. LocalStack Service Configuration"></a>2. LocalStack Service Configuration</h3><pre><code class="hljs yaml"><span class="hljs-attr">services:</span>  <span class="hljs-attr">localstack:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">localstack/localstack:latest</span>    <span class="hljs-attr">env:</span>      <span class="hljs-attr">SERVICES:</span> <span class="hljs-string">dynamodb,s3,cloudwatch,logs,iam,sts</span>      <span class="hljs-attr">DEFAULT_REGION:</span> <span class="hljs-string">us-east-1</span>      <span class="hljs-attr">AWS_ACCESS_KEY_ID:</span> <span class="hljs-string">test</span>      <span class="hljs-attr">AWS_SECRET_ACCESS_KEY:</span> <span class="hljs-string">test</span>      <span class="hljs-attr">DEBUG:</span> <span class="hljs-number">1</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">4566</span><span class="hljs-string">:4566</span>    <span class="hljs-attr">options:</span> <span class="hljs-string">&gt;-</span><span class="hljs-string">      --health-cmd &quot;curl -f http://localhost:4566/_localstack/health || exit 1&quot;</span><span class="hljs-string">      --health-interval 10s</span><span class="hljs-string">      --health-timeout 5s</span><span class="hljs-string">      --health-retries 10</span></code></pre><p><strong>Why LocalStack?</strong></p><ul><li>Emulates AWS services locally without cloud costs</li><li>Provides S3, DynamoDB, CloudWatch, and IAM functionality</li><li>Health checks ensure services are ready before tests run</li><li>Port 4566 is LocalStack’s unified endpoint</li></ul><p><strong>Pro Tip:</strong> The health check configuration prevents race conditions where tests start before LocalStack is fully initialized.</p><h3 id="3-Disk-Space-Optimization"><a href="#3-Disk-Space-Optimization" class="headerlink" title="3. Disk Space Optimization"></a>3. Disk Space Optimization</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Free</span> <span class="hljs-string">up</span> <span class="hljs-string">disk</span> <span class="hljs-string">space</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    # Remove unnecessary tools and SDKs</span><span class="hljs-string">    sudo rm -rf /usr/share/dotnet</span><span class="hljs-string">    sudo rm -rf /opt/ghc</span><span class="hljs-string">    sudo rm -rf /usr/local/share/boost</span><span class="hljs-string">    sudo rm -rf &quot;$AGENT_TOOLSDIRECTORY&quot;</span><span class="hljs-string"></span>    <span class="hljs-comment"># Clean apt package manager</span>    <span class="hljs-string">sudo</span> <span class="hljs-string">apt-get</span> <span class="hljs-string">clean</span>    <span class="hljs-string">sudo</span> <span class="hljs-string">apt-get</span> <span class="hljs-string">autoclean</span>    <span class="hljs-string">sudo</span> <span class="hljs-string">apt-get</span> <span class="hljs-string">autoremove</span> <span class="hljs-string">-y</span>    <span class="hljs-comment"># Aggressive Docker cleanup</span>    <span class="hljs-string">docker</span> <span class="hljs-string">system</span> <span class="hljs-string">prune</span> <span class="hljs-string">-af</span> <span class="hljs-string">--volumes</span>    <span class="hljs-string">docker</span> <span class="hljs-string">builder</span> <span class="hljs-string">prune</span> <span class="hljs-string">-af</span></code></pre><p><strong>Why This Matters:</strong></p><ul><li>GitHub Actions runners have limited disk space (~14GB free)</li><li>Docker images for Glue environments can be 2-3GB+</li><li>Build caches and intermediate layers consume additional space</li><li>Cleanup can free up 10-15GB, preventing build failures</li></ul><p><strong>Real-World Impact:</strong> Without this step, builds often fail with “no space left on device” errors.</p><h3 id="4-Docker-Build-and-Push-with-Caching"><a href="#4-Docker-Build-and-Push-with-Caching" class="headerlink" title="4. Docker Build and Push with Caching"></a>4. Docker Build and Push with Caching</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Set</span> <span class="hljs-string">up</span> <span class="hljs-string">Docker</span> <span class="hljs-string">Buildx</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">docker/setup-buildx-action@v3</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Convert</span> <span class="hljs-string">repository</span> <span class="hljs-string">owner</span> <span class="hljs-string">to</span> <span class="hljs-string">lowercase</span>  <span class="hljs-attr">id:</span> <span class="hljs-string">repo</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    REPO_OWNER_LOWER=$(echo &quot;$&#123;&#123; github.repository_owner &#125;&#125;&quot; | tr &#x27;[:upper:]&#x27; &#x27;[:lower:]&#x27;)</span><span class="hljs-string">    REPO_NAME_LOWER=$(echo &quot;$&#123;&#123; github.event.repository.name &#125;&#125;&quot; | tr &#x27;[:upper:]&#x27; &#x27;[:lower:]&#x27;)</span><span class="hljs-string">    echo &quot;owner=$REPO_OWNER_LOWER&quot; &gt;&gt; $GITHUB_OUTPUT</span><span class="hljs-string">    echo &quot;name=$REPO_NAME_LOWER&quot; &gt;&gt; $GITHUB_OUTPUT</span><span class="hljs-string"></span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Log</span> <span class="hljs-string">in</span> <span class="hljs-string">to</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Container</span> <span class="hljs-string">Registry</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">docker/login-action@v3</span>  <span class="hljs-attr">with:</span>    <span class="hljs-attr">registry:</span> <span class="hljs-string">ghcr.io</span>    <span class="hljs-attr">username:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">github.actor</span> <span class="hljs-string">&#125;&#125;</span>    <span class="hljs-attr">password:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">secrets.GITHUB_TOKEN</span> <span class="hljs-string">&#125;&#125;</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Build</span> <span class="hljs-string">and</span> <span class="hljs-string">push</span> <span class="hljs-string">Glue</span> <span class="hljs-string">PySpark</span> <span class="hljs-string">Docker</span> <span class="hljs-string">image</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">docker/build-push-action@v5</span>  <span class="hljs-attr">with:</span>    <span class="hljs-attr">context:</span> <span class="hljs-string">.</span>    <span class="hljs-attr">file:</span> <span class="hljs-string">./Dockerfile</span>    <span class="hljs-attr">push:</span> <span class="hljs-literal">true</span>    <span class="hljs-attr">tags:</span> <span class="hljs-string">ghcr.io/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.owner</span> <span class="hljs-string">&#125;&#125;/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.name</span> <span class="hljs-string">&#125;&#125;/glue-pyspark:latest</span>    <span class="hljs-attr">cache-from:</span> <span class="hljs-string">type=registry,ref=ghcr.io/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.owner</span> <span class="hljs-string">&#125;&#125;/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.name</span> <span class="hljs-string">&#125;&#125;/glue-pyspark:buildcache</span>    <span class="hljs-attr">cache-to:</span> <span class="hljs-string">type=registry,ref=ghcr.io/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.owner</span> <span class="hljs-string">&#125;&#125;/$&#123;&#123;</span> <span class="hljs-string">steps.repo.outputs.name</span> <span class="hljs-string">&#125;&#125;/glue-pyspark:buildcache,mode=max</span></code></pre><p><strong>Advanced Techniques:</strong></p><ol><li><strong>Docker Buildx</strong>: Enables advanced build features and multi-platform support</li><li><strong>Lowercase Conversion</strong>: GHCR requires lowercase repository names (GitHub allows mixed case)</li><li><strong>Registry Caching</strong>: Dramatically speeds up builds by reusing layers from previous runs</li><li><strong>Automatic Authentication</strong>: Uses <code>GITHUB_TOKEN</code> for seamless GHCR access</li></ol><p><strong>Performance Impact:</strong> Registry caching can reduce build times from 15+ minutes to 2-3 minutes on subsequent runs.</p><h3 id="5-LocalStack-Health-Check-and-Initialization"><a href="#5-LocalStack-Health-Check-and-Initialization" class="headerlink" title="5. LocalStack Health Check and Initialization"></a>5. LocalStack Health Check and Initialization</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Wait</span> <span class="hljs-string">for</span> <span class="hljs-string">LocalStack</span> <span class="hljs-string">to</span> <span class="hljs-string">be</span> <span class="hljs-string">ready</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    echo &quot;Waiting for LocalStack to be ready...&quot;</span><span class="hljs-string">    max_attempts=60</span><span class="hljs-string">    attempt=0</span><span class="hljs-string">    until curl -f -s http://localhost:4566/_localstack/health | grep -q &#x27;&quot;s3&quot;&#x27; || [ $attempt -eq $max_attempts ]; do</span><span class="hljs-string">      echo &quot;Attempt $((++attempt))/$max_attempts: Waiting for LocalStack...&quot;</span><span class="hljs-string">      if [ $((attempt % 10)) -eq 0 ]; then</span><span class="hljs-string">        echo &quot;Health check response:&quot;</span><span class="hljs-string">        curl -s http://localhost:4566/_localstack/health || echo &quot;No response&quot;</span><span class="hljs-string">      fi</span><span class="hljs-string">      sleep 2</span><span class="hljs-string">    done</span></code></pre><p><strong>Robust Error Handling:</strong></p><ul><li>Polls LocalStack health endpoint up to 60 times (2 minutes)</li><li>Provides diagnostic output every 10 attempts</li><li>Fails fast with detailed logs if LocalStack doesn’t start</li><li>Checks for specific service availability (S3 in this case)</li></ul><h3 id="6-AWS-Resource-Provisioning-in-LocalStack"><a href="#6-AWS-Resource-Provisioning-in-LocalStack" class="headerlink" title="6. AWS Resource Provisioning in LocalStack"></a>6. AWS Resource Provisioning in LocalStack</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Configure</span> <span class="hljs-string">AWS</span> <span class="hljs-string">resources</span> <span class="hljs-string">in</span> <span class="hljs-string">LocalStack</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    docker run --rm \</span><span class="hljs-string">      --network host \</span><span class="hljs-string">      -e AWS_ACCESS_KEY_ID=test \</span><span class="hljs-string">      -e AWS_SECRET_ACCESS_KEY=test \</span><span class="hljs-string">      -e AWS_REGION=us-east-1 \</span><span class="hljs-string">      amazon/aws-cli:latest \</span><span class="hljs-string">      --endpoint-url=http://localhost:4566 s3 mb s3://bronze-bucket || true</span><span class="hljs-string"></span>    <span class="hljs-string">docker</span> <span class="hljs-string">run</span> <span class="hljs-string">--rm</span> <span class="hljs-string">\</span>      <span class="hljs-string">--network</span> <span class="hljs-string">host</span> <span class="hljs-string">\</span>      <span class="hljs-string">-e</span> <span class="hljs-string">AWS_ACCESS_KEY_ID=test</span> <span class="hljs-string">\</span>      <span class="hljs-string">-e</span> <span class="hljs-string">AWS_SECRET_ACCESS_KEY=test</span> <span class="hljs-string">\</span>      <span class="hljs-string">-e</span> <span class="hljs-string">AWS_REGION=us-east-1</span> <span class="hljs-string">\</span>      <span class="hljs-string">amazon/aws-cli:latest</span> <span class="hljs-string">\</span>      <span class="hljs-string">--endpoint-url=http://localhost:4566</span> <span class="hljs-string">dynamodb</span> <span class="hljs-string">create-table</span> <span class="hljs-string">\</span>      <span class="hljs-string">--table-name</span> <span class="hljs-string">gold_table_plain</span> <span class="hljs-string">\</span>      <span class="hljs-string">--attribute-definitions</span> <span class="hljs-string">AttributeName=id,AttributeType=N</span> <span class="hljs-string">\</span>      <span class="hljs-string">--key-schema</span> <span class="hljs-string">AttributeName=id,KeyType=HASH</span> <span class="hljs-string">\</span>      <span class="hljs-string">--provisioned-throughput</span> <span class="hljs-string">ReadCapacityUnits=5,WriteCapacityUnits=5</span> <span class="hljs-string">||</span> <span class="hljs-literal">true</span></code></pre><p><strong>Infrastructure as Code in CI:</strong></p><ul><li>Creates S3 buckets for data lake layers (bronze, iceberg)</li><li>Provisions DynamoDB tables for gold layer aggregations</li><li>Sets up CloudWatch log groups for Glue job monitoring</li><li>Uses <code>|| true</code> to handle idempotent operations gracefully</li></ul><p><strong>Design Pattern:</strong> This mirrors production infrastructure setup, ensuring test environments match production.</p><h3 id="7-Running-Tests-in-the-Glue-Container"><a href="#7-Running-Tests-in-the-Glue-Container" class="headerlink" title="7. Running Tests in the Glue Container"></a>7. Running Tests in the Glue Container</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Run</span> <span class="hljs-string">tests</span> <span class="hljs-string">inside</span> <span class="hljs-string">Glue</span> <span class="hljs-string">container</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    docker run --rm \</span><span class="hljs-string">      --network host \</span><span class="hljs-string">      -v $&#123;&#123; github.workspace &#125;&#125;/plain:/app/plain \</span><span class="hljs-string">      -v $&#123;&#123; github.workspace &#125;&#125;/purchase_order:/app/purchase_order \</span><span class="hljs-string">      -v $&#123;&#123; github.workspace &#125;&#125;/tests:/app/tests \</span><span class="hljs-string">      -v $&#123;&#123; github.workspace &#125;&#125;/pytest.ini:/app/pytest.ini \</span><span class="hljs-string">      -v $&#123;&#123; github.workspace &#125;&#125;:/output \</span><span class="hljs-string">      -e AWS_ACCESS_KEY_ID=test \</span><span class="hljs-string">      -e AWS_SECRET_ACCESS_KEY=test \</span><span class="hljs-string">      -e AWS_REGION=us-east-1 \</span><span class="hljs-string">      my-glue-pyspark:latest \</span><span class="hljs-string">      &quot;poetry run pytest tests/ --cov=plain --cov=purchase_order --cov-report=term-missing --cov-report=xml:/output/coverage.xml --cov-report=html:/output/htmlcov -v&quot;</span></code></pre><p><strong>Container Testing Strategy:</strong></p><ol><li><strong>Volume Mounts</strong>: Source code and tests are mounted into the container</li><li><strong>Network Mode</strong>: <code>--network host</code> allows container to access LocalStack on localhost</li><li><strong>Output Persistence</strong>: Coverage reports are written back to GitHub workspace</li><li><strong>Poetry Integration</strong>: Uses Poetry for dependency management and test execution</li><li><strong>Multiple Coverage Formats</strong>: XML for SonarCloud&#x2F;Codecov, HTML for artifact viewing</li></ol><p><strong>Why This Works:</strong></p><ul><li>Tests run in the exact same environment as production Glue jobs</li><li>No “works on my machine” issues</li><li>Consistent Python version, dependencies, and Spark configuration</li></ul><h3 id="8-Code-Quality-Integration"><a href="#8-Code-Quality-Integration" class="headerlink" title="8. Code Quality Integration"></a>8. Code Quality Integration</h3><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">SonarCloud</span> <span class="hljs-string">Scan</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">SonarSource/sonarcloud-github-action@master</span>  <span class="hljs-attr">env:</span>    <span class="hljs-attr">GITHUB_TOKEN:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">secrets.GITHUB_TOKEN</span> <span class="hljs-string">&#125;&#125;</span>    <span class="hljs-attr">SONAR_TOKEN:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">secrets.SONAR_TOKEN</span> <span class="hljs-string">&#125;&#125;</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Upload</span> <span class="hljs-string">coverage</span> <span class="hljs-string">reports</span> <span class="hljs-string">to</span> <span class="hljs-string">Codecov</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">codecov/codecov-action@v4</span>  <span class="hljs-attr">if:</span> <span class="hljs-string">always()</span>  <span class="hljs-attr">with:</span>    <span class="hljs-attr">files:</span> <span class="hljs-string">./coverage.xml</span>    <span class="hljs-attr">flags:</span> <span class="hljs-string">unittests</span>    <span class="hljs-attr">name:</span> <span class="hljs-string">codecov-umbrella</span>    <span class="hljs-attr">fail_ci_if_error:</span> <span class="hljs-literal">false</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Upload</span> <span class="hljs-string">coverage</span> <span class="hljs-string">HTML</span> <span class="hljs-string">report</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/upload-artifact@v4</span>  <span class="hljs-attr">if:</span> <span class="hljs-string">always()</span>  <span class="hljs-attr">with:</span>    <span class="hljs-attr">name:</span> <span class="hljs-string">coverage-report</span>    <span class="hljs-attr">path:</span> <span class="hljs-string">htmlcov/</span>    <span class="hljs-attr">retention-days:</span> <span class="hljs-number">7</span></code></pre><p><strong>Multi-Tool Quality Assurance:</strong></p><ol><li><strong>SonarCloud</strong>: Static code analysis, security vulnerabilities, code smells</li><li><strong>Codecov</strong>: Coverage tracking with historical trends and PR comments</li><li><strong>GitHub Artifacts</strong>: Downloadable HTML reports for detailed inspection</li></ol><p><strong>Pro Tip:</strong> <code>if: always()</code> ensures quality reports are uploaded even if tests fail, providing debugging information.</p><hr><h2 id="Workflow-Pipeline-Execution"><a href="#Workflow-Pipeline-Execution" class="headerlink" title="Workflow Pipeline Execution"></a>Workflow Pipeline Execution</h2><p>Once you’re done setting up the workflow pipeline above, you can commit and push it to your repository. GitHub Actions will automatically trigger the pipeline on pushes or pull requests to the specified branches. In this case, for mine, <code>main</code> and <code>develop</code>.</p><p>You can monitor the progress of each job in the “Actions” tab of your GitHub repository. Each stage will show logs, status, and any errors encountered during execution.</p><p>With this <code>ci-pipeline.yml</code> workflow, you will see only one job running all the steps sequentially and you can view its steps log in <a href="https://github.com/awongCM/docker_glue_pyspark_demo/actions/runs/21084727991">detail</a>.  But by good general practice, you should use the <code>ci-sequential.yml</code> workflow if you want to see each stage as separate jobs for better visibility and parallel execution - see it <a href="https://github.com/awongCM/docker_glue_pyspark_demo/actions/runs/21085490168">here</a>.</p><hr><h2 id="Enterprise-Considerations-Security-Compliance-and-Risk-Management"><a href="#Enterprise-Considerations-Security-Compliance-and-Risk-Management" class="headerlink" title="Enterprise Considerations: Security, Compliance, and Risk Management"></a>Enterprise Considerations: Security, Compliance, and Risk Management</h2><h3 id="The-Open-Source-vs-Corporate-Reality"><a href="#The-Open-Source-vs-Corporate-Reality" class="headerlink" title="The Open-Source vs. Corporate Reality"></a>The Open-Source vs. Corporate Reality</h3><p>While everything what I discovered and achieved here so far has been great exprience so far and this guide demonstrates a powerful open-source DevOps stack, <strong>enterprise adoption, however, requires careful evaluation</strong> of organizational constraints. What works seamlessly in exploratory projects may face significant hurdles in regulated corporate environments. Thus that leaves you plenty of critical questions and notes to ponder before adopting this stack wholesome.</p><h3 id="Critical-Evaluation-Framework"><a href="#Critical-Evaluation-Framework" class="headerlink" title="Critical Evaluation Framework"></a>Critical Evaluation Framework</h3><h4 id="1-GitHub-Actions-and-Third-Party-Runners"><a href="#1-GitHub-Actions-and-Third-Party-Runners" class="headerlink" title="1. GitHub Actions and Third-Party Runners"></a>1. <strong>GitHub Actions and Third-Party Runners</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Uses GitHub-hosted runners (shared infrastructure)</li><li>Free for public repositories</li><li>Minimal setup required</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Risk Factor</th><th>Consideration</th><th>Mitigation Options</th></tr></thead><tbody><tr><td><strong>Data Residency</strong></td><td>Code and artifacts processed on GitHub’s infrastructure</td><td>Self-hosted runners in your VPC&#x2F;data center</td></tr><tr><td><strong>Compliance</strong></td><td>May violate SOC2, HIPAA, PCI-DSS requirements</td><td>GitHub Enterprise Server (on-premises)</td></tr><tr><td><strong>Network Security</strong></td><td>Runners access public internet</td><td>Private networking with GitHub Enterprise Cloud</td></tr><tr><td><strong>Audit Trails</strong></td><td>Limited visibility into runner environment</td><td>Enhanced audit logging with Enterprise features</td></tr></tbody></table><p><strong>Questions to Ask Your Security Team:</strong></p><ul><li>Can our source code leave our network perimeter?</li><li>What data classification levels are we handling?</li><li>Do we need SOC2 Type II compliance for our CI&#x2F;CD?</li><li>Are GitHub’s data centers in approved geographic regions?</li></ul><h4 id="2-LocalStack-Licensing-and-Support"><a href="#2-LocalStack-Licensing-and-Support" class="headerlink" title="2. LocalStack Licensing and Support"></a>2. <strong>LocalStack Licensing and Support</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Uses LocalStack Community Edition (free, limited features)</li><li>No official support or SLAs</li><li>Community-driven bug fixes</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Aspect</th><th>Community Edition</th><th>Enterprise Considerations</th></tr></thead><tbody><tr><td><strong>License</strong></td><td>Apache 2.0 (permissive)</td><td>Legal review required for commercial use</td></tr><tr><td><strong>Features</strong></td><td>Basic AWS service emulation</td><td>Advanced services require Pro license ($50-500&#x2F;dev&#x2F;month)</td></tr><tr><td><strong>Support</strong></td><td>GitHub issues only</td><td>Enterprise support with SLAs may be mandated</td></tr><tr><td><strong>Security Updates</strong></td><td>Community-driven timeline</td><td>Compliance may require guaranteed patch schedules</td></tr><tr><td><strong>Accuracy</strong></td><td>Best-effort AWS parity</td><td>Production validation required for critical workloads</td></tr></tbody></table><p><strong>Red Flags for Enterprise:</strong></p><ul><li>Financial services: LocalStack may not meet regulatory testing requirements</li><li>Healthcare: PHI data cannot touch LocalStack without BAA (not available)</li><li>Government: FedRAMP&#x2F;IL5 compliance impossible with LocalStack</li></ul><p><strong>Alternative Approaches:</strong></p><ol><li><strong>AWS-native testing</strong>: Use dedicated AWS accounts with cost controls</li><li><strong>Moto library</strong>: Python-only AWS mocking (more limited but officially maintained)</li><li><strong>Hybrid approach</strong>: LocalStack for dev, real AWS for pre-production CI</li></ol><h4 id="3-Docker-and-Container-Registry-Security"><a href="#3-Docker-and-Container-Registry-Security" class="headerlink" title="3. Docker and Container Registry Security"></a>3. <strong>Docker and Container Registry Security</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Pulls base images from Docker Hub</li><li>Pushes to GitHub Container Registry (public or private)</li><li>Minimal image scanning</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Security Concern</th><th>Risk Level</th><th>Enterprise Solution</th></tr></thead><tbody><tr><td><strong>Supply Chain Attacks</strong></td><td>HIGH</td><td>Private registries with approved base images only</td></tr><tr><td><strong>Image Vulnerabilities</strong></td><td>HIGH</td><td>Mandatory scanning (Trivy, Snyk, Prisma Cloud)</td></tr><tr><td><strong>Secrets in Images</strong></td><td>CRITICAL</td><td>Secret scanning + admission controllers</td></tr><tr><td><strong>Registry Access</strong></td><td>MEDIUM</td><td>SSO integration, RBAC, audit logging</td></tr><tr><td><strong>Image Provenance</strong></td><td>MEDIUM</td><td>Image signing with Sigstore&#x2F;Notary</td></tr></tbody></table><p><strong>Corporate Policies That May Block This Approach:</strong></p><ul><li><strong>No Docker Hub access</strong>: Many enterprises block external registries</li><li><strong>Approved base images only</strong>: Must use hardened, patched internal images</li><li><strong>Image signing required</strong>: Unsigned images cannot be deployed</li><li><strong>SBOM requirements</strong>: Software Bill of Materials for compliance</li></ul><p><strong>Adaptation Strategy:</strong></p><pre><code class="hljs yaml"><span class="hljs-comment"># Enterprise-compliant Docker build</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Build</span> <span class="hljs-string">with</span> <span class="hljs-string">approved</span> <span class="hljs-string">base</span> <span class="hljs-string">image</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    # Use internal registry with approved images</span><span class="hljs-string">    docker build \</span><span class="hljs-string">      --build-arg BASE_IMAGE=registry.company.com/approved/python:3.9-slim \</span><span class="hljs-string">      --label &quot;git.commit=$&#123;&#123; github.sha &#125;&#125;&quot; \</span><span class="hljs-string">      --label &quot;build.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)&quot; \</span><span class="hljs-string">      -t registry.company.com/data-eng/glue-pyspark:$&#123;&#123; github.sha &#125;&#125; .</span><span class="hljs-string"></span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Scan</span> <span class="hljs-string">image</span> <span class="hljs-string">for</span> <span class="hljs-string">vulnerabilities</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    trivy image --severity HIGH,CRITICAL \</span><span class="hljs-string">      --exit-code 1 \</span><span class="hljs-string">      registry.company.com/data-eng/glue-pyspark:$&#123;&#123; github.sha &#125;&#125;</span><span class="hljs-string"></span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Sign</span> <span class="hljs-string">image</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    cosign sign --key cosign.key \</span><span class="hljs-string">      registry.company.com/data-eng/glue-pyspark:$&#123;&#123; github.sha &#125;&#125;</span></code></pre><h4 id="4-Third-Party-GitHub-Actions-and-Supply-Chain-Risk"><a href="#4-Third-Party-GitHub-Actions-and-Supply-Chain-Risk" class="headerlink" title="4. Third-Party GitHub Actions and Supply Chain Risk"></a>4. <strong>Third-Party GitHub Actions and Supply Chain Risk</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Uses community actions (<code>actions/checkout@v4</code>, <code>docker/build-push-action@v5</code>)</li><li>Trusts action maintainers implicitly</li><li>Auto-updates to latest versions</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Risk</th><th>Impact</th><th>Mitigation</th></tr></thead><tbody><tr><td><strong>Malicious Actions</strong></td><td>Code injection, credential theft</td><td>Pin to commit SHAs, not tags</td></tr><tr><td><strong>Abandoned Actions</strong></td><td>Security vulnerabilities unpatched</td><td>Fork and maintain internally</td></tr><tr><td><strong>Compliance</strong></td><td>Actions not vetted by security team</td><td>Approved action registry</td></tr><tr><td><strong>Audit Requirements</strong></td><td>Cannot trace action provenance</td><td>SBOM for actions, vendoring</td></tr></tbody></table><p><strong>Secure Action Usage Pattern:</strong></p><pre><code class="hljs yaml"><span class="hljs-comment"># ❌ INSECURE: Uses mutable tag</span><span class="hljs-bullet">-</span> <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/checkout@v4</span><span class="hljs-comment"># ✅ SECURE: Pinned to immutable commit SHA</span><span class="hljs-bullet">-</span> <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11</span> <span class="hljs-comment"># v4.1.1</span>  <span class="hljs-comment"># Comment includes version for human readability</span></code></pre><p><strong>Corporate Alternatives:</strong></p><ul><li><strong>Self-hosted action runners</strong>: Host approved actions in internal registry</li><li><strong>Action vendoring</strong>: Copy actions into your repository</li><li><strong>Restricted marketplace</strong>: Only allow pre-approved actions</li></ul><h4 id="5-SonarCloud-and-Codecov-Data-Exfiltration-Concerns"><a href="#5-SonarCloud-and-Codecov-Data-Exfiltration-Concerns" class="headerlink" title="5. SonarCloud and Codecov: Data Exfiltration Concerns"></a>5. <strong>SonarCloud and Codecov: Data Exfiltration Concerns</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Sends source code to SonarCloud (third-party SaaS)</li><li>Uploads coverage data to Codecov (third-party SaaS)</li><li>Convenient integrations with GitHub</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Service</th><th>Data Shared</th><th>Compliance Risk</th><th>Enterprise Alternative</th></tr></thead><tbody><tr><td><strong>SonarCloud</strong></td><td>Full source code, secrets (if leaked)</td><td>HIGH - IP theft, compliance violations</td><td>SonarQube self-hosted</td></tr><tr><td><strong>Codecov</strong></td><td>Coverage reports, file paths, metadata</td><td>MEDIUM - Reveals architecture</td><td>Self-hosted coverage tools</td></tr></tbody></table><p><strong>Real-World Incident:</strong></p><ul><li><strong>Codecov breach (2021)</strong>: Supply chain attack exposed customer credentials for months</li><li><strong>Impact</strong>: Many enterprises banned Codecov permanently</li></ul><p><strong>Secure Alternatives:</strong></p><pre><code class="hljs yaml"><span class="hljs-comment"># Self-hosted SonarQube</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">SonarQube</span> <span class="hljs-string">Scan</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    sonar-scanner \</span><span class="hljs-string">      -Dsonar.host.url=https://sonarqube.company.com \</span><span class="hljs-string">      -Dsonar.login=$&#123;&#123; secrets.SONAR_TOKEN_INTERNAL &#125;&#125;</span><span class="hljs-string"></span><span class="hljs-comment"># Internal coverage dashboard</span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Upload</span> <span class="hljs-string">coverage</span> <span class="hljs-string">to</span> <span class="hljs-string">internal</span> <span class="hljs-string">system</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    curl -X POST https://coverage.company.com/api/upload \</span><span class="hljs-string">      -H &quot;Authorization: Bearer $&#123;&#123; secrets.COVERAGE_TOKEN &#125;&#125;&quot; \</span><span class="hljs-string">      -F &quot;coverage=@coverage.xml&quot; \</span><span class="hljs-string">      -F &quot;project=$&#123;&#123; github.repository &#125;&#125;&quot; \</span><span class="hljs-string">      -F &quot;commit=$&#123;&#123; github.sha &#125;&#125;&quot;</span></code></pre><h4 id="6-Secrets-Management-and-Credential-Exposure"><a href="#6-Secrets-Management-and-Credential-Exposure" class="headerlink" title="6. Secrets Management and Credential Exposure"></a>6. <strong>Secrets Management and Credential Exposure</strong></h4><p><strong>Open-Source Approach:</strong></p><ul><li>Uses GitHub Secrets (encrypted at rest)</li><li>Secrets accessible to all workflows</li><li>Limited rotation capabilities</li></ul><p><strong>Enterprise Constraints:</strong></p><table><thead><tr><th>Requirement</th><th>GitHub Secrets</th><th>Enterprise Solution</th></tr></thead><tbody><tr><td><strong>Secrets Rotation</strong></td><td>Manual only</td><td>HashiCorp Vault, AWS Secrets Manager</td></tr><tr><td><strong>Audit Logging</strong></td><td>Limited</td><td>Comprehensive audit trails required</td></tr><tr><td><strong>Access Control</strong></td><td>Repository-level</td><td>Fine-grained RBAC per secret</td></tr><tr><td><strong>Compliance</strong></td><td>May not meet standards</td><td>FIPS 140-2 validated HSMs</td></tr><tr><td><strong>Just-in-Time Access</strong></td><td>Not supported</td><td>Dynamic credential generation</td></tr></tbody></table><p><strong>Enterprise Pattern:</strong></p><pre><code class="hljs yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Retrieve</span> <span class="hljs-string">secrets</span> <span class="hljs-string">from</span> <span class="hljs-string">Vault</span>  <span class="hljs-attr">id:</span> <span class="hljs-string">vault</span>  <span class="hljs-attr">uses:</span> <span class="hljs-string">hashicorp/vault-action@v2</span>  <span class="hljs-attr">with:</span>    <span class="hljs-attr">url:</span> <span class="hljs-string">https://vault.company.com</span>    <span class="hljs-attr">method:</span> <span class="hljs-string">jwt</span>    <span class="hljs-attr">role:</span> <span class="hljs-string">github-actions-role</span>    <span class="hljs-attr">secrets:</span> <span class="hljs-string">|</span><span class="hljs-string">      secret/data/aws/credentials access_key | AWS_ACCESS_KEY_ID ;</span><span class="hljs-string">      secret/data/aws/credentials secret_key | AWS_SECRET_ACCESS_KEY</span><span class="hljs-string"></span><span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Use</span> <span class="hljs-string">short-lived</span> <span class="hljs-string">credentials</span>  <span class="hljs-attr">run:</span> <span class="hljs-string">|</span><span class="hljs-string">    # Credentials automatically expire after job completion</span><span class="hljs-string">    aws s3 ls</span><span class="hljs-string"></span>  <span class="hljs-attr">env:</span>    <span class="hljs-attr">AWS_ACCESS_KEY_ID:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">steps.vault.outputs.AWS_ACCESS_KEY_ID</span> <span class="hljs-string">&#125;&#125;</span>    <span class="hljs-attr">AWS_SECRET_ACCESS_KEY:</span> <span class="hljs-string">$&#123;&#123;</span> <span class="hljs-string">steps.vault.outputs.AWS_SECRET_ACCESS_KEY</span> <span class="hljs-string">&#125;&#125;</span></code></pre><h3 id="Decision-Matrix-Can-Your-Organization-Use-This-Stack"><a href="#Decision-Matrix-Can-Your-Organization-Use-This-Stack" class="headerlink" title="Decision Matrix: Can Your Organization Use This Stack?"></a>Decision Matrix: Can Your Organization Use This Stack?</h3><p>Use this matrix to assess feasibility:</p><table><thead><tr><th>Factor</th><th>Green Light ✅</th><th>Yellow Light ⚠️</th><th>Red Light 🛑</th></tr></thead><tbody><tr><td><strong>Industry</strong></td><td>Tech startups, SaaS</td><td>Professional services</td><td>Finance, Healthcare, Government</td></tr><tr><td><strong>Data Classification</strong></td><td>Public, Internal</td><td>Confidential</td><td>Restricted, PHI, PCI, PII</td></tr><tr><td><strong>Compliance</strong></td><td>None, ISO 27001</td><td>SOC2, GDPR</td><td>HIPAA, PCI-DSS, FedRAMP</td></tr><tr><td><strong>Security Posture</strong></td><td>Risk-tolerant</td><td>Risk-aware</td><td>Risk-averse</td></tr><tr><td><strong>Budget</strong></td><td>Limited</td><td>Moderate</td><td>Enterprise</td></tr><tr><td><strong>Team Size</strong></td><td>&lt;50 engineers</td><td>50-500 engineers</td><td>500+ engineers</td></tr></tbody></table><p><strong>Interpretation:</strong></p><ul><li><strong>All Green</strong>: Adopt this stack with minimal modifications</li><li><strong>Some Yellow</strong>: Requires adaptations (self-hosted runners, private registries)</li><li><strong>Any Red</strong>: Significant re-architecture needed or complete alternative approach</li></ul><h3 id="Hybrid-Approach-Balancing-Innovation-and-Compliance"><a href="#Hybrid-Approach-Balancing-Innovation-and-Compliance" class="headerlink" title="Hybrid Approach: Balancing Innovation and Compliance"></a>Hybrid Approach: Balancing Innovation and Compliance</h3><p>Most enterprises land somewhere in the middle. Consider this graduated adoption strategy:</p><h4 id="Phase-1-Proof-of-Concept-Open-Source-Stack"><a href="#Phase-1-Proof-of-Concept-Open-Source-Stack" class="headerlink" title="Phase 1: Proof of Concept (Open-Source Stack)"></a>Phase 1: Proof of Concept (Open-Source Stack)</h4><ul><li>Use for non-production, non-sensitive projects</li><li>Validate technical feasibility</li><li>Build team expertise</li><li><strong>Duration</strong>: 1-3 months</li></ul><h4 id="Phase-2-Security-Hardening-Hybrid"><a href="#Phase-2-Security-Hardening-Hybrid" class="headerlink" title="Phase 2: Security Hardening (Hybrid)"></a>Phase 2: Security Hardening (Hybrid)</h4><ul><li>Migrate to self-hosted GitHub Actions runners</li><li>Replace LocalStack with AWS dev accounts</li><li>Implement image scanning and signing</li><li>Use internal SonarQube instead of SonarCloud</li><li><strong>Duration</strong>: 3-6 months</li></ul><h4 id="Phase-3-Enterprise-Integration-Fully-Compliant"><a href="#Phase-3-Enterprise-Integration-Fully-Compliant" class="headerlink" title="Phase 3: Enterprise Integration (Fully Compliant)"></a>Phase 3: Enterprise Integration (Fully Compliant)</h4><ul><li>Integrate with corporate Vault&#x2F;secrets management</li><li>Implement RBAC and audit logging</li><li>Add compliance gates (policy-as-code with OPA)</li><li>Establish SLAs and support processes</li><li><strong>Duration</strong>: 6-12 months</li></ul><h3 id="Questions-to-Ask-Before-Adopting"><a href="#Questions-to-Ask-Before-Adopting" class="headerlink" title="Questions to Ask Before Adopting"></a>Questions to Ask Before Adopting</h3><p><strong>For Engineering Leadership:</strong></p><ol><li>What is our organization’s risk appetite for CI&#x2F;CD tooling?</li><li>Do we have budget for enterprise licenses (GitHub Enterprise, LocalStack Pro)?</li><li>Can we dedicate resources to maintain self-hosted infrastructure?</li><li>What is our timeline for compliance certification (SOC2, ISO, etc.)?</li></ol><p><strong>For Security Teams:</strong></p><ol><li>Can source code be processed outside our network perimeter?</li><li>What are our requirements for secrets management and rotation?</li><li>Do we need FIPS 140-2 validated cryptography?</li><li>What audit logging and retention requirements apply?</li></ol><p><strong>For Compliance Teams:</strong></p><ol><li>What data classification levels will this pipeline handle?</li><li>Are there geographic restrictions on data processing?</li><li>Do we need vendor security assessments (VSAs) for all third parties?</li><li>What is our incident response process for supply chain compromises?</li></ol><h3 id="The-Bottom-Line"><a href="#The-Bottom-Line" class="headerlink" title="The Bottom Line"></a>The Bottom Line</h3><p><strong>This open-source stack is ideal for:</strong></p><ul><li>Startups and scale-ups with minimal compliance requirements</li><li>Public open-source projects</li><li>Internal tools handling non-sensitive data</li><li>Proof-of-concept and learning environments</li><li>Teams with high risk tolerance and technical sophistication</li></ul><p><strong>This stack requires significant modification for:</strong></p><ul><li>Regulated industries (finance, healthcare, government)</li><li>Enterprises with strict data residency requirements</li><li>Organizations handling PII, PHI, or PCI data</li><li>Companies requiring SOC2 Type II or ISO 27001 certification</li><li>Risk-averse security cultures</li></ul><p><strong>The key insight</strong>: Open-source DevOps tools provide incredible velocity and developer experience, but <strong>enterprise adoption is not a copy-paste exercise</strong>. Successful implementation requires understanding your organization’s specific constraints and adapting accordingly.</p><hr><h2 id="Key-Takeaways-and-Best-Practices"><a href="#Key-Takeaways-and-Best-Practices" class="headerlink" title="Key Takeaways and Best Practices"></a>Key Takeaways and Best Practices</h2><h3 id="1-Use-Service-Containers-for-Dependencies"><a href="#1-Use-Service-Containers-for-Dependencies" class="headerlink" title="1. Use Service Containers for Dependencies"></a>1. <strong>Use Service Containers for Dependencies</strong></h3><p>GitHub Actions service containers provide isolated, ephemeral infrastructure perfect for testing AWS services with LocalStack.</p><h3 id="2-Implement-Robust-Health-Checks"><a href="#2-Implement-Robust-Health-Checks" class="headerlink" title="2. Implement Robust Health Checks"></a>2. <strong>Implement Robust Health Checks</strong></h3><p>Never assume services are ready immediately. Implement polling with timeouts and diagnostic logging.</p><h3 id="3-Optimize-Disk-Space-Proactively"><a href="#3-Optimize-Disk-Space-Proactively" class="headerlink" title="3. Optimize Disk Space Proactively"></a>3. <strong>Optimize Disk Space Proactively</strong></h3><p>Large Docker images require aggressive cleanup on GitHub runners. Monitor disk usage and clean early.</p><h3 id="4-Leverage-Registry-Caching"><a href="#4-Leverage-Registry-Caching" class="headerlink" title="4. Leverage Registry Caching"></a>4. <strong>Leverage Registry Caching</strong></h3><p>Docker layer caching can reduce build times by 80-90%. Always configure <code>cache-from</code> and <code>cache-to</code>.</p><h3 id="5-Test-in-Production-Like-Environments"><a href="#5-Test-in-Production-Like-Environments" class="headerlink" title="5. Test in Production-Like Environments"></a>5. <strong>Test in Production-Like Environments</strong></h3><p>Running tests inside the actual Glue container eliminates environment discrepancies.</p><h3 id="6-Integrate-Multiple-Quality-Tools"><a href="#6-Integrate-Multiple-Quality-Tools" class="headerlink" title="6. Integrate Multiple Quality Tools"></a>6. <strong>Integrate Multiple Quality Tools</strong></h3><p>Combine SonarCloud, Codecov, and GitHub Artifacts for comprehensive quality visibility.</p><h3 id="7-Make-Workflows-Idempotent"><a href="#7-Make-Workflows-Idempotent" class="headerlink" title="7. Make Workflows Idempotent"></a>7. <strong>Make Workflows Idempotent</strong></h3><p>Use <code>|| true</code> for resource creation commands that might already exist (especially in LocalStack).</p><h3 id="8-Separate-Concerns-with-Volume-Mounts"><a href="#8-Separate-Concerns-with-Volume-Mounts" class="headerlink" title="8. Separate Concerns with Volume Mounts"></a>8. <strong>Separate Concerns with Volume Mounts</strong></h3><p>Mount only necessary directories into containers to maintain clean separation and faster builds.</p><h3 id="9-Assess-Organizational-Constraints-Early"><a href="#9-Assess-Organizational-Constraints-Early" class="headerlink" title="9. Assess Organizational Constraints Early"></a>9. <strong>Assess Organizational Constraints Early</strong></h3><p>Evaluate security, compliance, and risk requirements before committing to open-source tooling.</p><h3 id="10-Plan-for-Graduated-Adoption"><a href="#10-Plan-for-Graduated-Adoption" class="headerlink" title="10. Plan for Graduated Adoption"></a>10. <strong>Plan for Graduated Adoption</strong></h3><p>Start with POCs, then progressively harden for enterprise requirements.</p><h2 id="Real-World-Benefits"><a href="#Real-World-Benefits" class="headerlink" title="Real-World Benefits"></a>Real-World Benefits</h2><p>Teams using this approach report:</p><ul><li><strong>90% reduction</strong> in AWS testing costs</li><li><strong>5x faster</strong> feedback loops (minutes vs. hours)</li><li><strong>Zero production incidents</strong> from environment mismatches</li><li><strong>Improved developer experience</strong> with local-first workflows</li></ul><p><strong>However</strong>, enterprise teams also report:</p><ul><li><strong>3-6 months</strong> to adapt for compliance requirements</li><li><strong>Significant investment</strong> in self-hosted infrastructure</li><li><strong>Ongoing maintenance</strong> burden for custom solutions</li></ul><h2 id="Advanced-Extensions"><a href="#Advanced-Extensions" class="headerlink" title="Advanced Extensions"></a>Advanced Extensions</h2><p>Consider these enhancements for production use:</p><ol><li><strong>Matrix Testing</strong>: Test against multiple Python&#x2F;Spark versions</li><li><strong>Parallel Execution</strong>: Split tests across multiple jobs</li><li><strong>Deployment Gates</strong>: Require quality thresholds before merging</li><li><strong>Terraform Integration</strong>: Validate infrastructure code in CI</li><li><strong>Performance Benchmarking</strong>: Track job execution times over commits</li><li><strong>Multi-Architecture Builds</strong>: Support ARM64 for Apple Silicon developers</li><li><strong>Policy-as-Code</strong>: Implement OPA for compliance enforcement</li><li><strong>SBOM Generation</strong>: Create Software Bill of Materials for supply chain security</li></ol><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>Modern CI&#x2F;CD pipelines should be fast, reliable, and cost-effective. By combining GitHub Actions, Docker, and LocalStack, you can build sophisticated testing workflows that rival enterprise CI systems—all within GitHub’s free tier for public repositories.</p><p><strong>The critical caveat</strong>: This open-source stack is a starting point, not a universal solution. <strong>Successful enterprise adoption requires understanding your organization’s security posture, compliance obligations, and risk tolerance.</strong> What works for a startup may be completely inappropriate for a regulated financial institution.</p><p>The workflows I demonstrated here provides a foundation for data engineering teams to iterate quickly, catch issues early, and deploy with confidence. Whether you’re building AWS Glue jobs, Lambda functions, or any cloud-native application, these patterns apply universally—<strong>but always through the lens of your organizational constraints</strong>.</p><p><strong>Remember</strong>: The best DevOps pipeline is one that balances developer velocity with organizational risk management. Don’t let perfect security become the enemy of good engineering, but equally, don’t let engineering convenience compromise critical compliance requirements.</p><p>In my next post, I will explore the items not in scope for this guide, including Terraform testing, deployment strategies, and advanced security hardening for enterprise compliance. One of them is about configuration of OIDC with GitHub Actions for secure, token-based authentication to AWS resources without long-lived credentials. This is important because enterprises are increasingly adopting OIDC to enhance security posture and reduce risk of credential leakage since short-lived tokens are used instead of static secrets.</p><p>Thanks for reading. Till then, Happy Coding!</p><p>For more information on my CI&#x2F;CD setup guide, please refer to the links below.</p><h2 id="Resources"><a href="#Resources" class="headerlink" title="Resources"></a>Resources</h2><ul><li><strong>Repository</strong>: <a href="https://github.com/awongCM/docker_glue_pyspark_demo">docker_glue_pyspark_demo</a></li><li><strong>Workflow File</strong>: <a href="https://github.com/awongCM/docker_glue_pyspark_demo/blob/main/.github/workflows/ci-pipeline.yml">ci-pipeline.yml</a></li><li><strong>Workflow File</strong>: <a href="https://github.com/awongCM/docker_glue_pyspark_demo/blob/main/.github/workflows/ci-sequential.yml">ci-sequential.yml</a></li><li><strong>LocalStack Documentation</strong>: <a href="https://docs.localstack.cloud/">docs.localstack.cloud</a></li><li><strong>GitHub Actions</strong>: <a href="https://docs.github.com/actions">docs.github.com&#x2F;actions</a></li><li><strong>Docker Buildx</strong>: <a href="https://docs.docker.com/reference/cli/docker/buildx/">docs.docker.com&#x2F;buildx</a></li><li><strong>GitHub Security Best Practices</strong>: <a href="https://docs.github.com/actions/security-guides">docs.github.com&#x2F;actions&#x2F;security-guides</a></li><li><strong>OWASP CI&#x2F;CD Security</strong>: <a href="https://owasp.org/www-project-devsecops-guideline">owasp.org&#x2F;www-project-devsecops-guideline</a></li></ul><hr><p><strong>Disclaimer</strong>: Again, I stressed this is only an exploratory exercise and proof-of-concept for learning purposes as well as sharing the knowledge with the community. It’s not by far the best and only approach to build CI&#x2F;CD pipelines for AWS Glue jobs. Always evaluate your organization’s specific needs and constraints before adopting new technologies. This guide reflects technical patterns and does not constitute legal or compliance advice. Always consult your organization’s security, legal, and compliance teams before adopting new tooling.</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_building_github_actions_localstack_unit_tests.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;Since my last post on setting local AWS Glue using Docker, one of the potential extensions I mentioned is to setup Github Actions CI&amp;#x2F;CD pipeline for it. In modern data engineering, testing cloud-native applications locally before deployment is very crucial for rapid iteration and cost efficiency. Thus, as part of this exploratory exercise, I want my CI&amp;#x2F;CD pipeline to achieve the following outcomes(in scope):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automate testing of AWS Glue jobs in a local environment&lt;/li&gt;
&lt;li&gt;Use Docker to containerize the Glue runtime&lt;/li&gt;
&lt;li&gt;Leverage LocalStack to simulate AWS services locally&lt;/li&gt;
&lt;li&gt;Integrate with GitHub Actions for continuous integration and delivery&lt;/li&gt;
&lt;li&gt;Ensure code quality with SonarCloud and Codecov&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not in scope for this pipeline:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Terraform or infrastructure-as-code testing&lt;/li&gt;
&lt;li&gt;Deployment to actual AWS environments&lt;/li&gt;
&lt;li&gt;Advanced security hardening for enterprise compliance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This guide walks you through building very robust (if not production-ready) CI&amp;#x2F;CD pipeline using GitHub Actions that integrates Docker containerization, LocalStack for AWS service emulation, and comprehensive testing for AWS Glue jobs.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ci-cd, github-actions, continuous-integration, continuous-delivery, aws, localstack, aws-glue, docker, integration-testing, unit-testing, sonarquloud" scheme="http://awongcm.io/tags/ci-cd-github-actions-continuous-integration-continuous-delivery-aws-localstack-aws-glue-docker-integration-testing-unit-testing-sonarquloud/"/>
    
  </entry>
  
  <entry>
    <title>The Future of the AI Era for Developers: What 2026 Really Means for Software Builders</title>
    <link href="http://awongcm.io/blog/2026/01/04/the-future-of-the-ai-era-for-developers-what-2026-really-means-for-software-builders/"/>
    <id>http://awongcm.io/blog/2026/01/04/the-future-of-the-ai-era-for-developers-what-2026-really-means-for-software-builders/</id>
    <published>2026-01-04T02:01:51.000Z</published>
    <updated>2026-11-15T01:30:57.670Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_the_furture_of_ai_era_for_developers.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>First off.</p><p>Happy New Year to all! Every engineer of various specialisations (ie front-end, back-end, data, devops, cloud, mobile, etc) would come to realise by now how much AI has heavily shaped and redefined our ways of engineering practices since ChatGPT made major headlines back in late 2022.</p><p>More than 3 years on with plethora of evolving AI tools at engineers’ disposals , I arrive with this conclusion.</p><blockquote><p><em>“AI didn’t replace my love for software engineering — it gave it back to me.”</em></p></blockquote><p>In 2016 (and beyond), being a software developer or engineer no longer means fighting every line of code alone.</p><p>It means having an intelligent collaborator that helps you think, build, refactor, document, test, and ship — faster and with more confidence than ever before.</p><p>For me personally, this shift became real the moment I subscribed to <strong>GitHub Copilot Pro</strong> for my own pet projects.</p><p>I reopened application repositories that I hadn’t touched in years, especially starting off with this one as an <a href="https://github.com/awongCM/spaceinvadersdemo">example</a>. It’s a classic space invaders game written purely in Vanilla JS.</p><p>When looking into this repo for the first time, it came with my immediate reactions.</p><ul><li>Old ideas.</li><li>Half-finished tools.</li><li>Abandoned experiments.</li></ul><p>And suddenly.</p><p>Using AI — instead of feeling overwhelmed — I felt <strong>energized</strong>.</p><span id="more"></span><p>With AI assisting me, I wasn’t crawling through feature development anymore.<br>I was moving at <strong>100× or even 1000× the velocity</strong> I had before.</p><p>That feeling — breaking through the wall of hesitation, complexity, and unfinished code — is what the AI era truly brings to developers.</p><p>This article is about <strong>what AI really means for software builders</strong>: not a replacement, but rather a renaissance.</p><hr><h2 id="The-Old-World-Software-Development-Was-Becoming-Emotionally-Expensive"><a href="#The-Old-World-Software-Development-Was-Becoming-Emotionally-Expensive" class="headerlink" title="The Old World: Software Development Was Becoming Emotionally Expensive"></a>The Old World: Software Development Was Becoming Emotionally Expensive</h2><p>Before AI copilots, writing software wasn’t just technically hard — it was <strong>emotionally heavy</strong>.</p><p>You probably know the feeling:</p><ul><li>You open a repo you wrote two or XXX years ago</li><li>You don’t remember the design</li><li>The frameworks have changed</li><li>The tests are broken</li><li>The motivation is gone</li></ul><p>Starting again feels like climbing a mountain with no trail.</p><p>So projects stayed abandoned.<br>Ideas stayed unfinished.<br>And a lot of creative engineering energy was wasted.</p><p>AI changes that.</p><hr><h2 id="The-New-World-Developers-Now-Have-Cognitive-Exoskeletons"><a href="#The-New-World-Developers-Now-Have-Cognitive-Exoskeletons" class="headerlink" title="The New World: Developers Now Have Cognitive Exoskeletons"></a>The New World: Developers Now Have Cognitive Exoskeletons</h2><p>In 2026, developers don’t just write code — they <strong>co-create</strong> with AI.</p><p>Tools like:</p><ul><li>GitHub Copilot</li><li>Cursor</li><li>WindSurf</li><li>TabbyML</li><li>ChatGPT</li><li>Claude</li><li>Local LLMs</li></ul><p>act like <strong>cognitive exoskeletons</strong>.</p><p>They don’t replace your brain — they amplify it.</p><p>They:</p><ul><li>Remind you of syntax</li><li>Generate boilerplate</li><li>Infer missing logic</li><li>Suggest architectures</li><li>Explain legacy code</li><li>Write tests</li><li>Generate documentation</li></ul><p>Suddenly, you spend more time <strong>thinking</strong> and less time <strong>fighting tools</strong>.</p><p>That’s exactly what I experienced when revisiting my personal projects.</p><p>I could focus on:</p><blockquote><p>“What should this app become?”</p></blockquote><p>instead of</p><blockquote><p>“How do I wire this stupid API again?”</p></blockquote><hr><h2 id="Why-This-Changes-Everything-in-2026"><a href="#Why-This-Changes-Everything-in-2026" class="headerlink" title="Why This Changes Everything in 2026"></a>Why This Changes Everything in 2026</h2><p>The biggest change in 2026 is not just faster coding.</p><p>It is <strong>lower emotional friction</strong>.</p><p>Developers are now willing to:</p><ul><li>Revive old projects</li><li>Learn new languages</li><li>Try new frameworks</li><li>Build ambitious ideas</li></ul><p>Because AI removes the “activation energy” required to start.</p><p>Just like electric motors replaced hand cranks,<br>AI replaces the painful first 80% of development.</p><hr><h2 id="AI-Is-Not-Replacing-Developers-—-It-Is-Upgrading-Them"><a href="#AI-Is-Not-Replacing-Developers-—-It-Is-Upgrading-Them" class="headerlink" title="AI Is Not Replacing Developers — It Is Upgrading Them"></a>AI Is Not Replacing Developers — It Is Upgrading Them</h2><p>The biggest myth is that AI will replace programmers.</p><p>What it really replaces is:</p><ul><li>Typing boilerplate</li><li>Searching StackOverflow</li><li>Copy-pasting docs</li><li>Debugging trivial mistakes</li></ul><p>What remains is:</p><ul><li>System design</li><li>Architecture</li><li>Business logic</li><li>Data modeling</li><li>Security</li><li>Performance</li><li>Ethics</li><li>Product thinking</li></ul><p>AI is not making developers irrelevant.<br>It is making <strong>great developers unstoppable</strong>.</p><p>This is applicable for all regardless of their tenure in the game of software development,include junior developers, which I explain more in later</p><hr><h2 id="From-Code-Writers-to-System-Designers"><a href="#From-Code-Writers-to-System-Designers" class="headerlink" title="From Code Writers to System Designers"></a>From Code Writers to System Designers</h2><p>In 2026, the job of a developer looks more like:</p><blockquote><p>Designing, guiding, and orchestrating intelligent systems</p></blockquote><p>rather than:</p><blockquote><p>Manually typing every line</p></blockquote><p>We are becoming:</p><ul><li>Architects</li><li>Curators</li><li>Reviewers</li><li>System thinkers</li></ul><p>AI produces code.<br>Developers decide <strong>what code should exist</strong>.</p><hr><h2 id="Why-This-Feels-So-Motivating"><a href="#Why-This-Feels-So-Motivating" class="headerlink" title="Why This Feels So Motivating"></a>Why This Feels So Motivating</h2><p>This is why my Copilot experience was so powerful.</p><p>It removed:</p><ul><li>The guilt of unfinished projects</li><li>The fear of restarting</li><li>The pain of remembering old code</li></ul><p>And replaced it with:</p><ul><li>Momentum</li><li>Flow</li><li>Curiosity</li><li>Creative joy</li></ul><p>That feeling — <strong>wanting to build again</strong> — is the real revolution.</p><p>Not automation.<br>Not speed.<br>But <strong>renewed love for engineering</strong>.</p><hr><h2 id="The-Developers-Who-Will-Thrive-in-2026"><a href="#The-Developers-Who-Will-Thrive-in-2026" class="headerlink" title="The Developers Who Will Thrive in 2026"></a>The Developers Who Will Thrive in 2026</h2><p>The winners of the AI era won’t be the ones who type fastest.</p><p>They will be the ones who:</p><ul><li>Ask better questions</li><li>Design better systems</li><li>Understand data</li><li>Know how to structure problems</li><li>Can evaluate AI output critically</li></ul><p>AI raises the floor.<br>But it also raises the ceiling.</p><hr><h2 id="For-the-Aspiring-Junior-Developers-in-the-AI-Era"><a href="#For-the-Aspiring-Junior-Developers-in-the-AI-Era" class="headerlink" title="For the Aspiring Junior Developers in the AI Era"></a>For the Aspiring Junior Developers in the AI Era</h2><p>If you’re just starting your software development journey in 2026, you’re not at risk of being replaced.</p><p>You’re at the <strong>greatest advantage in the history of programming</strong>.</p><p>Here’s why:</p><p>The old guard learned to code the hard way — grinding through syntax errors, manually reading documentation, spending hours debugging obscure issues, and building everything from scratch.</p><p>They earned their 10,000 hours through <strong>sheer friction</strong>.</p><p>You get to earn yours through <strong>deliberate practice at 100× speed</strong>.</p><hr><h3 id="AI-Amplifies-Learning-Not-Just-Coding"><a href="#AI-Amplifies-Learning-Not-Just-Coding" class="headerlink" title="AI Amplifies Learning, Not Just Coding"></a>AI Amplifies Learning, Not Just Coding</h3><p>When you’re learning with AI as your copilot, you’re not just writing code faster.</p><p>You’re:</p><ul><li>Getting instant feedback on your mistakes</li><li>Seeing multiple approaches to the same problem</li><li>Understanding patterns in real-time</li><li>Building more projects in less time</li><li>Experimenting without fear of getting stuck</li></ul><p>Every iteration you complete with AI is a <strong>high-quality learning loop</strong>.</p><p>The seniors spent weeks building their first CRUD app.<br>You can build five in a weekend — and actually understand what you’re doing.</p><hr><h3 id="Quality-Over-Grinding"><a href="#Quality-Over-Grinding" class="headerlink" title="Quality Over Grinding"></a>Quality Over Grinding</h3><p>The 10,000-hour rule still applies.</p><p>But in the AI era, those hours are <strong>more intentional, more focused, and more productive</strong> than ever before.</p><p>You’re not wasting time on:</p><ul><li>Typos</li><li>Missing semicolons</li><li>Forgotten imports</li><li>Boilerplate setup</li></ul><p>You’re spending time on:</p><ul><li>System design</li><li>Problem-solving</li><li>Architecture decisions</li><li>Code quality</li><li>Real-world patterns</li></ul><p>That’s the kind of practice the old guard never had access to.</p><hr><h3 id="You’re-Not-Cheating-—-You’re-Learning-Smarter"><a href="#You’re-Not-Cheating-—-You’re-Learning-Smarter" class="headerlink" title="You’re Not Cheating — You’re Learning Smarter"></a>You’re Not Cheating — You’re Learning Smarter</h3><p>Some will say using AI is “cheating” or that you won’t learn the fundamentals.</p><p>Ignore them.</p><p>Instead opt to have an open and growth mindset.</p><p>Using AI to learn is like using a calculator to learn math.<br>It doesn’t replace understanding — it <strong>accelerates it</strong>.</p><p>You still need to know:</p><ul><li>Why the code works</li><li>When to use which pattern</li><li>How to debug when AI gets it wrong</li><li>What good architecture looks like</li></ul><p>But you get to those insights <strong>faster and with more confidence</strong>.</p><hr><h3 id="The-Junior-Developer-Advantage"><a href="#The-Junior-Developer-Advantage" class="headerlink" title="The Junior Developer Advantage"></a>The Junior Developer Advantage</h3><p>Here’s the truth that experienced developers won’t tell you:</p><p><strong>You have less to unlearn.</strong></p><p>You don’t have muscle memory fighting against AI suggestions.<br>You don’t have ego tied to “doing it the hard way.”<br>You don’t have decades of habits built in a pre-AI world.</p><p>You get to build your entire development practice <strong>natively with AI</strong>.</p><p>That’s not a disadvantage.<br>That’s a <strong>superpower</strong>.</p><hr><h3 id="Embrace-It-Fully"><a href="#Embrace-It-Fully" class="headerlink" title="Embrace It Fully"></a>Embrace It Fully</h3><p>If you’re a junior developer in 2026:</p><ol><li><strong>Use AI without guilt</strong> — it’s a tool, not a crutch</li><li><strong>Build relentlessly</strong> — ship more projects than any previous generation could</li><li><strong>Ask better questions</strong> — AI rewards curiosity and precision</li><li><strong>Learn fundamentals faster</strong> — use AI to explore concepts deeply, not just copy code</li><li><strong>Stay hungry</strong> — the ceiling is higher than ever before</li></ol><p>The developers who started in 2026 with AI will be <strong>unstoppable by 2030</strong>.</p><p>Not because they skipped the hard work.</p><p>But because they did <strong>higher-quality work, faster, with more creativity</strong> than any generation before them.</p><p>That’s the real future of software development that lies ahead for them.</p><p>But.</p><p>What about the senior developers?</p><hr><h2 id="For-Senior-Developers-Your-Experience-Just-Became-Your-Superpower"><a href="#For-Senior-Developers-Your-Experience-Just-Became-Your-Superpower" class="headerlink" title="For Senior Developers: Your Experience Just Became Your Superpower"></a>For Senior Developers: Your Experience Just Became Your Superpower</h2><p>If you’ve been building software for 10, 15, or 20+ years, AI doesn’t diminish your expertise.</p><p>It <strong>multiplies it exponentially</strong>.</p><p>Here’s what changes for you in 2026:</p><hr><h3 id="You-Finally-Have-Leverage"><a href="#You-Finally-Have-Leverage" class="headerlink" title="You Finally Have Leverage"></a>You Finally Have Leverage</h3><p>You’ve spent years accumulating knowledge:</p><ul><li>Design patterns</li><li>System architecture</li><li>Performance optimization</li><li>Security best practices</li><li>Team dynamics</li><li>Technical debt management</li></ul><p>But until now, that knowledge was bottlenecked by <strong>your typing speed and available hours</strong>.</p><p>AI removes that bottleneck.</p><p>Now your expertise can flow directly into:</p><ul><li>Multiple codebases simultaneously</li><li>Rapid prototyping of complex systems</li><li>Exploring architectural alternatives in minutes</li><li>Refactoring legacy systems you’ve been dreading</li></ul><p>You’re no longer constrained by implementation time.<br>You’re <strong>only constrained by your vision</strong>.</p><hr><h3 id="From-Implementer-to-Architect-at-Scale"><a href="#From-Implementer-to-Architect-at-Scale" class="headerlink" title="From Implementer to Architect-at-Scale"></a>From Implementer to Architect-at-Scale</h3><p>As a senior developer, you know <strong>what good looks like</strong>.</p><p>You can:</p><ul><li>Spot code smells instantly</li><li>Recognize anti-patterns</li><li>Predict where systems will break</li><li>Design for scale, security, and maintainability</li></ul><p>AI can generate code.<br>But it can’t replace <strong>20 years of battle scars and wisdom</strong>.</p><p>Your role becomes:</p><ul><li>Setting the architectural direction</li><li>Reviewing and refining AI output</li><li>Making high-level design decisions</li><li>Mentoring teams on best practices</li><li>Ensuring quality and consistency</li></ul><p>You’re not writing every line anymore.<br>You’re <strong>orchestrating systems at a level that was previously impossible</strong>.</p><hr><h3 id="The-Side-Projects-You-Never-Had-Time-For"><a href="#The-Side-Projects-You-Never-Had-Time-For" class="headerlink" title="The Side Projects You Never Had Time For"></a>The Side Projects You Never Had Time For</h3><p>Remember all those ideas you shelved because you didn’t have time?</p><p>The open-source library you wanted to build.<br>The SaaS product you sketched on a napkin.<br>The framework you knew the world needed.</p><p>AI gives you back that time.</p><p>As a senior developer with AI:</p><ul><li>You can build in weekends what used to take months</li><li>You can maintain multiple projects without burning out</li><li>You can explore new languages and frameworks fearlessly</li><li>You can finally ship the ideas that have been waiting in your head</li></ul><p>Your constraint is no longer <strong>time or energy</strong>.<br>It’s <strong>choosing which ideas to pursue</strong>.</p><hr><h3 id="Learning-New-Stacks-Without-Starting-Over"><a href="#Learning-New-Stacks-Without-Starting-Over" class="headerlink" title="Learning New Stacks Without Starting Over"></a>Learning New Stacks Without Starting Over</h3><p>You’ve mastered your stack.</p><p>But what about:</p><ul><li>That new framework everyone’s talking about?</li><li>The language you’ve been curious about?</li><li>The cloud platform you haven’t touched?</li></ul><p>In the old world, learning meant:</p><ul><li>Reading docs for hours</li><li>Fighting setup issues</li><li>Writing hello-world apps</li><li>Slowly building muscle memory</li></ul><p>With AI, you can:</p><ul><li>Jump into a new ecosystem immediately</li><li>Leverage your existing knowledge while AI handles syntax</li><li>Build real projects from day one</li><li>Focus on concepts, not memorization</li></ul><p>Your <strong>transferable knowledge</strong> becomes even more valuable.<br>AI handles the surface-level differences.</p><hr><h3 id="Mentorship-at-Scale"><a href="#Mentorship-at-Scale" class="headerlink" title="Mentorship at Scale"></a>Mentorship at Scale</h3><p>As a senior developer, you’ve probably mentored juniors.</p><p>But you could only help:</p><ul><li>One person at a time</li><li>During work hours</li><li>On problems you directly encountered</li></ul><p>With AI, your mentorship scales:</p><ul><li>Document your architectural decisions — AI helps juniors understand them</li><li>Write high-level specs — AI helps teams implement them</li><li>Create templates and patterns — AI propagates them across codebases</li><li>Review code faster — AI flags issues, you provide wisdom</li></ul><p>You’re not just teaching individuals.<br>You’re <strong>encoding your expertise into systems</strong>.</p><hr><h3 id="The-Competitive-Edge"><a href="#The-Competitive-Edge" class="headerlink" title="The Competitive Edge"></a>The Competitive Edge</h3><p>Here’s the reality:</p><p>A senior developer with AI is <strong>10× more productive</strong> than a senior developer without it.</p><p>And a senior developer with AI is <strong>100× more valuable</strong> than a junior with AI.</p><p>Because:</p><ul><li>Juniors know how to use the tool</li><li>Seniors know <strong>what to build and why</strong></li></ul><p>Your years of experience in:</p><ul><li>Navigating organizational complexity</li><li>Making trade-off decisions</li><li>Understanding business context</li><li>Debugging production disasters</li><li>Leading technical initiatives</li></ul><p>are <strong>irreplaceable</strong>.</p><p>AI amplifies your judgment.<br>It doesn’t replace it.</p><hr><h3 id="Don’t-Fight-It-—-Lead-With-It"><a href="#Don’t-Fight-It-—-Lead-With-It" class="headerlink" title="Don’t Fight It — Lead With It"></a>Don’t Fight It — Lead With It</h3><p>Some senior developers resist AI because:</p><ul><li>“I already know how to code”</li><li>“I don’t need help”</li><li>“This feels like cheating”</li></ul><p>But the developers who embrace AI in 2026 will:</p><ul><li>Ship more ambitious projects</li><li>Solve harder problems</li><li>Have more creative freedom</li><li>Stay relevant and energized</li></ul><p>The choice is simple:</p><p>Be a senior developer who types fast.<br>Or be a senior developer who <strong>builds the future</strong>.</p><hr><h3 id="Your-Best-Work-Is-Still-Ahead"><a href="#Your-Best-Work-Is-Still-Ahead" class="headerlink" title="Your Best Work Is Still Ahead"></a>Your Best Work Is Still Ahead</h3><p>If you’re a senior developer in 2026, this is your moment.</p><p>You have:</p><ul><li>The experience to know what matters</li><li>The judgment to evaluate AI output</li><li>The vision to design great systems</li><li>The tools to finally build at the speed of thought</li></ul><p>AI doesn’t make you obsolete.</p><p>It makes you <strong>unstoppable</strong>.</p><hr><h3 id="Before-We-Wrap-Up"><a href="#Before-We-Wrap-Up" class="headerlink" title="Before We Wrap Up"></a>Before We Wrap Up</h3><p>Remember what I said earlier about my space invaders project in this post?</p><p>I asked Copilot to revitalize it with modern tooling.</p><p>Here’ what it gave me in minutes:</p><p>From a legacy Vanilla JS app:</p><img src="/images/legacy-space-invaders.png" class="center" width="500" height="500" title="Legacy Vanilla JS Space Invaders Legacy Vanilla JS Space Invaders"><p><em><p style="text-align: center;">Legacy Vanilla JS Space Invaders</p></em></p><p>to a Vite + Typescript + TailwindCSS app:</p><img src="/images/modern-space-invaders.png" class="center" width="500" height="500" title="Vite + Typescript + TailwindCSS Space Invaders Vite + Typescript + TailwindCSS Space Invaders"><p><em><p style="text-align: center;">Vite + Typescript + TailwindCSS Space Invaders</p></em></p><p>Can’t spot the difference?</p><p>On the surface, it looks the same. But under the hood, you can see the implementation detail has been modernized with best sofware practices (thanks to Copilot) via my Github repo. One for <a href="https://github.com/awongCM/spaceinvadersdemo/tree/main/legacy">legacy</a>, and the other for <a href="https://github.com/awongCM/spaceinvadersdemo/tree/main/modern">modern</a>.</p><p>You can even check the actual working demo of two versions running side by side <a href="https://space-invaders-demo.onrender.com/">here</a>. It is also showcased on my portfolio page of this blog site <a href="https://www.awongcm.io/portfolio">here</a>.</p><p>For your curiosity, on my entire space invaders repo, you can check out on my <a href="https://github.com/awongCM/spaceinvadersdemo">GitHub repo here</a></p><p>With that, I can hardly wait to see what I can accomplish next with AI on my other 60 plus personal projects that I have shelved away for years. (Yes, I have that many side projects lying around… 😅)</p><hr><h2 id="Final-Thought"><a href="#Final-Thought" class="headerlink" title="Final Thought"></a>Final Thought</h2><p>The future of AI for developers is not about replacing us.</p><p>It’s about finally giving us the freedom to:</p><ul><li>Build what we imagine</li><li>Explore without fear</li><li>And fall back in love with software engineering</li></ul><p>2026 is not the end of coding.</p><p>It is the <strong>golden age of builders</strong>.</p><hr><p>Till then, I wish you a great start of Happy New Year of Coding ahead.</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_the_furture_of_ai_era_for_developers.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;First off.&lt;/p&gt;
&lt;p&gt;Happy New Year to all! Every engineer of various specialisations (ie front-end, back-end, data, devops, cloud, mobile, etc) would come to realise by now how much AI has heavily shaped and redefined our ways of engineering practices since ChatGPT made major headlines back in late 2022.&lt;/p&gt;
&lt;p&gt;More than 3 years on with plethora of evolving AI tools at engineers’ disposals , I arrive with this conclusion.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“AI didn’t replace my love for software engineering — it gave it back to me.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In 2016 (and beyond), being a software developer or engineer no longer means fighting every line of code alone.&lt;/p&gt;
&lt;p&gt;It means having an intelligent collaborator that helps you think, build, refactor, document, test, and ship — faster and with more confidence than ever before.&lt;/p&gt;
&lt;p&gt;For me personally, this shift became real the moment I subscribed to &lt;strong&gt;GitHub Copilot Pro&lt;/strong&gt; for my own pet projects.&lt;/p&gt;
&lt;p&gt;I reopened application repositories that I hadn’t touched in years, especially starting off with this one as an &lt;a href=&quot;https://github.com/awongCM/spaceinvadersdemo&quot;&gt;example&lt;/a&gt;. It’s a classic space invaders game written purely in Vanilla JS.&lt;/p&gt;
&lt;p&gt;When looking into this repo for the first time, it came with my immediate reactions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Old ideas.&lt;/li&gt;
&lt;li&gt;Half-finished tools.&lt;/li&gt;
&lt;li&gt;Abandoned experiments.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And suddenly.&lt;/p&gt;
&lt;p&gt;Using AI — instead of feeling overwhelmed — I felt &lt;strong&gt;energized&lt;/strong&gt;.&lt;/p&gt;</summary>
    
    
    
    
    <category term="ai, software development, developers, future tech, programming, copilot, github copilot" scheme="http://awongcm.io/tags/ai-software-development-developers-future-tech-programming-copilot-github-copilot/"/>
    
  </entry>
  
  <entry>
    <title>Beyond Prompt Engineering: From Code Coverage to Code Confidence, Master Unit Tests with GitHub Copilot Agent</title>
    <link href="http://awongcm.io/blog/2025/12/16/beyond-prompt-engineering-from-code-coverage-to-code-confidence-master-unit-tests-with-github-copilot-agent/"/>
    <id>http://awongcm.io/blog/2025/12/16/beyond-prompt-engineering-from-code-coverage-to-code-confidence-master-unit-tests-with-github-copilot-agent/</id>
    <published>2025-12-16T10:14:54.000Z</published>
    <updated>2026-11-15T01:30:57.670Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_copilot_unit_test_coverage_code_confidence.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>As we bring 2025 to a close, software engineers like myself find themselves immersed in all things AI from every direction—left, right, and dead center: Medium blogs, AI forums like Rundown AI, AI meetups, etc.—all in a constant state of flux. The message couldn’t be clearer: ignoring AI is no longer an option. Those who resist embracing these tools risk falling drastically behind in an industry moving at lightning speed. The greatest folly isn’t experimenting with AI and making mistakes — it’s refusing to adapt at all.</p><p>But here’s the critical insight most engineers miss: <strong>it’s not about using AI; it’s about using AI systematically.</strong></p><span id="more"></span><p>Using one example, in my last post, writing comprehensive unit tests for data‑engineering pipelines isn’t just about achieving high coverage numbers—it’s about building confidence that your transformations work correctly under all conditions. GitHub Copilot Agent transforms this challenge from a tedious manual process into a systematic, AI‑assisted workflow that drives both coverage and quality.</p><h2 id="The-Challenge-Testing-AWS-Glue-Pipelines"><a href="#The-Challenge-Testing-AWS-Glue-Pipelines" class="headerlink" title="The Challenge: Testing AWS Glue Pipelines"></a>The Challenge: Testing AWS Glue Pipelines</h2><ol><li><strong>Environment Dependencies</strong> – Tests require <code>awsglue</code> modules only available in specific Docker containers.</li><li><strong>Complex Data Transformations</strong> – Bronze, Silver, and Gold layer pipelines contain intricate business logic.</li><li><strong>Integration Points</strong> – S3 interactions, DynamicFrames, Spark sessions, and AWS service mocking.</li><li><strong>Scale</strong> – Multiple pipelines (Plain and Purchase Order) across three transformation layers.</li></ol><p>Traditional approaches often result in inconsistent test quality, missing edge cases, poor coverage of critical paths, and unreliable refactoring.</p><h2 id="The-Solution-Structured-Copilot-Agent-Methodology"><a href="#The-Solution-Structured-Copilot-Agent-Methodology" class="headerlink" title="The Solution: Structured Copilot Agent Methodology"></a>The Solution: Structured Copilot Agent Methodology</h2><h3 id="1-Create-a-Reusable-Prompt-Template"><a href="#1-Create-a-Reusable-Prompt-Template" class="headerlink" title="1. Create a Reusable Prompt Template"></a>1. Create a Reusable Prompt Template</h3><p>Store this file as <strong><code>.github/prompts/unit-tester.prompt.md</code></strong>:</p><pre><code class="hljs markdown"><span class="hljs-section"># Unit Test Generation Guidelines (Python)</span>You are a unit test generator assistant for Python code.  Strictly follow these rules when generating tests:<span class="hljs-section">## Test Structure</span>Use the AAA (Arrange‑Act‑Assert) pattern for structuring tests:<span class="hljs-bullet">1.</span> <span class="hljs-strong">**Arrange**</span> – Set up test data, fixtures, and preconditions.<span class="hljs-bullet">2.</span> <span class="hljs-strong">**Act**</span> – Execute the function/method under test.<span class="hljs-bullet">3.</span> <span class="hljs-strong">**Assert**</span> – Verify results and side effects.<span class="hljs-section">## Naming Convention</span><span class="hljs-bullet">-</span> Name tests as <span class="hljs-code">`should_expected_behavior_when_state_under_test`</span>.<span class="hljs-bullet">-</span> Use clear, descriptive names that document the test&#x27;s purpose.<span class="hljs-bullet">-</span> For pytest, use snake<span class="hljs-emphasis">_case function names.</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">## Best Practices</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">1. Test one behavior per test.</span><span class="hljs-emphasis">2. Use meaningful, representative test data.</span><span class="hljs-emphasis">3. Handle expected exceptions using `pytest.raises`.</span><span class="hljs-emphasis">4. Add comments and a docstring per test.</span><span class="hljs-emphasis">5. Include negative tests and edge cases (empty strings, None, large values).</span><span class="hljs-emphasis">6. Prefer pure functions and deterministic outcomes for unit tests.</span><span class="hljs-emphasis">7. Use fixtures (`@pytest.fixture`) for shared setup instead of global state.</span><span class="hljs-emphasis">8. Mock external systems (I/O, network, AWS) using `pytest-mock`.</span><span class="hljs-emphasis">9. Add docstrings to test functions.</span><span class="hljs-emphasis">10. Add negative tests</span><span class="hljs-emphasis">11. Add integration tests for critical paths</span><span class="hljs-emphasis">12. Add edge cases</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">## Additional Rules</span><span class="hljs-emphasis"></span><span class="hljs-emphasis">1. Revalidate and think step‑by‑step.</span><span class="hljs-emphasis">2. Always follow the AAA pattern.</span><span class="hljs-emphasis">3. Keep assertions focused and specific.</span><span class="hljs-emphasis">4. Isolate unit tests from environment and external services.</span><span class="hljs-emphasis">5. When testing PySpark/Glue code, prefer isolating transformation logic into small functions that can be tested without cluster dependencies; use a local SparkSession only when necessary.</span></code></pre><h3 id="2-Establish-Test-Infrastructure"><a href="#2-Establish-Test-Infrastructure" class="headerlink" title="2. Establish Test Infrastructure"></a>2. Establish Test Infrastructure</h3><p><strong>Docker Configuration (<code>docker-compose.yaml</code>)</strong></p><pre><code class="hljs yaml"><span class="hljs-attr">volumes:</span>  <span class="hljs-bullet">-</span> <span class="hljs-string">./tests:/app/tests</span>  <span class="hljs-bullet">-</span> <span class="hljs-string">./scripts:/app/scripts</span>  <span class="hljs-bullet">-</span> <span class="hljs-string">./pytest.ini:/app/pytest.ini</span>  <span class="hljs-bullet">-</span> <span class="hljs-string">./pyproject.toml:/app/pyproject.toml</span>  <span class="hljs-bullet">-</span> <span class="hljs-string">./poetry.lock:/app/poetry.lock</span></code></pre><p><strong>Test Runner Script (<code>scripts/run-tests-docker.bash</code>)</strong></p><pre><code class="hljs bash"><span class="hljs-meta">#!/usr/bin/env bash</span><span class="hljs-comment"># Usage: ./scripts/run-tests-docker.bash &lt;command&gt;</span><span class="hljs-comment"># Commands: all, plain, po, bronze, silver, gold, fast, coverage, shell, clean</span><span class="hljs-built_in">set</span> -eCMD=<span class="hljs-variable">$1</span><span class="hljs-keyword">case</span> <span class="hljs-variable">$CMD</span> <span class="hljs-keyword">in</span>  all)      poetry run pytest -v --cov=. --cov-report=html ;;  plain)    poetry run pytest -v tests/plain ;;  po)       poetry run pytest -v tests/purchase_order ;;  bronze)   poetry run pytest -v tests/*/test_bronze_job.py ;;  silver)   poetry run pytest -v tests/*/test_silver_job.py ;;  gold)     poetry run pytest -v tests/*/test_gold_job.py ;;  fast)     poetry run pytest -v --maxfail=1 ;;  coverage) poetry run pytest -v --cov=. --cov-report=html ;;  shell)    /bin/bash ;;  clean)    <span class="hljs-built_in">rm</span> -rf .pytest_cache htmlcov .coverage ;;  *) <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;Unknown command: <span class="hljs-variable">$CMD</span>&quot;</span> &amp;&amp; <span class="hljs-built_in">exit</span> 1 ;;<span class="hljs-keyword">esac</span></code></pre><p><strong>Pytest Configuration (<code>pytest.ini</code>)</strong></p><pre><code class="hljs ini"><span class="hljs-section">[pytest]</span><span class="hljs-attr">testpaths</span> = tests<span class="hljs-attr">python_files</span> = test_*.py<span class="hljs-attr">python_classes</span> = Test*<span class="hljs-attr">python_functions</span> = test_*<span class="hljs-attr">addopts</span> = -v --cov=. --cov-report=html --cov-report=term</code></pre><h3 id="3-Use-Copilot-Agent-with-Context"><a href="#3-Use-Copilot-Agent-with-Context" class="headerlink" title="3. Use Copilot Agent with Context"></a>3. Use Copilot Agent with Context</h3><p>When generating tests, provide Copilot Agent with:</p><ul><li><strong>Your Prompt Template</strong> (<code>@.github/prompts/unit-tester.prompt.md</code>)</li><li><strong>The Code to Test</strong> (e.g., <code>plain/bronze_job.py</code>, <code>purchase_order/bronze_job.py</code> etc)</li><li><strong>Shared Fixtures</strong> (<code>tests/conftest.py</code>)</li></ul><p><strong>Example Prompt</strong></p><pre><code class="hljs plaintext">@unit-tester.prompt.md Generate comprehensive unit tests for plain/bronze_job.pyfocusing on:- Data ingestion from S3- Schema validation- Error handling for malformed data- Logging functionality- Integration with GlueContext</code></pre><h3 id="4-Organize-Tests-by-Layer-and-Concern"><a href="#4-Organize-Tests-by-Layer-and-Concern" class="headerlink" title="4. Organize Tests by Layer and Concern"></a>4. Organize Tests by Layer and Concern</h3><pre><code class="hljs plaintext">tests/├── conftest.py                    # Shared fixtures├── plain/│   ├── test_bronze_job.py         # 4 test classes, ~12 tests│   ├── test_silver_job.py         # 4 test classes, ~15 tests│   └── test_gold_job.py           # 4 test classes, ~14 tests└── purchase_order/    ├── test_bronze_job.py         # 4 test classes, ~10 tests    ├── test_silver_job.py         # 4 test classes, ~17 tests    └── test_gold_job.py           # Similar structure</code></pre><h3 id="5-Example-AI‑Generated-Test-Class"><a href="#5-Example-AI‑Generated-Test-Class" class="headerlink" title="5. Example AI‑Generated Test Class"></a>5. Example AI‑Generated Test Class</h3><pre><code class="hljs python"><span class="hljs-keyword">class</span> <span class="hljs-title class_">TestBronzeJobDataIngestion</span>:    <span class="hljs-string">&quot;&quot;&quot;Test data ingestion functionality for bronze layer.&quot;&quot;&quot;</span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">test_should_read_data_from_s3_when_valid_path_provided</span>(<span class="hljs-params"></span><span class="hljs-params">        self, spark_session, mocker</span><span class="hljs-params">    </span>):        <span class="hljs-string">&quot;&quot;&quot;Arrange‑Act‑Assert: Valid S3 path should successfully read data.&quot;&quot;&quot;</span>        <span class="hljs-comment"># Arrange</span>        mock_glue_context = mocker.Mock()        s3_path = <span class="hljs-string">&quot;s3://bucket/data/&quot;</span>        expected_count = <span class="hljs-number">100</span>        <span class="hljs-comment"># Mock the DynamicFrame creation</span>        mock_dynamic_frame = mocker.Mock()        mock_dynamic_frame.count.return_value = expected_count        mock_glue_context.create_dynamic_frame.from_options.return_value = (            mock_dynamic_frame        )        <span class="hljs-comment"># Act</span>        result = read_bronze_data(mock_glue_context, s3_path)        <span class="hljs-comment"># Assert</span>        <span class="hljs-keyword">assert</span> result.count() == expected_count        mock_glue_context.create_dynamic_frame.from_options.assert_called_once()    <span class="hljs-keyword">def</span> <span class="hljs-title function_">test_should_raise_error_when_s3_path_is_empty</span>(<span class="hljs-params">self, mocker</span>):        <span class="hljs-string">&quot;&quot;&quot;Arrange‑Act‑Assert: Empty S3 path should raise ValueError.&quot;&quot;&quot;</span>        <span class="hljs-comment"># Arrange</span>        mock_glue_context = mocker.Mock()        invalid_path = <span class="hljs-string">&quot;&quot;</span>        <span class="hljs-comment"># Act &amp; Assert</span>        <span class="hljs-keyword">with</span> pytest.raises(ValueError, <span class="hljs-keyword">match</span>=<span class="hljs-string">&quot;S3 path cannot be empty&quot;</span>):            read_bronze_data(mock_glue_context, invalid_path)    <span class="hljs-keyword">def</span> <span class="hljs-title function_">test_should_handle_missing_files_when_path_not_found</span>(<span class="hljs-params"></span><span class="hljs-params">        self, spark_session, mocker</span><span class="hljs-params">    </span>):        <span class="hljs-string">&quot;&quot;&quot;Arrange‑Act‑Assert: Missing S3 path should raise FileNotFoundError.&quot;&quot;&quot;</span>        <span class="hljs-comment"># Arrange</span>        mock_glue_context = mocker.Mock()        mock_glue_context.create_dynamic_frame.from_options.side_effect = (            FileNotFoundError(<span class="hljs-string">&quot;Path not found&quot;</span>)        )        s3_path = <span class="hljs-string">&quot;s3://bucket/nonexistent/&quot;</span>        <span class="hljs-comment"># Act &amp; Assert</span>        <span class="hljs-keyword">with</span> pytest.raises(FileNotFoundError):            read_bronze_data(mock_glue_context, s3_path)</code></pre><h2 id="Real-Results-Coverage-and-Quality-Metrics"><a href="#Real-Results-Coverage-and-Quality-Metrics" class="headerlink" title="Real Results: Coverage and Quality Metrics"></a>Real Results: Coverage and Quality Metrics</h2><h3 id="Coverage-Achieved"><a href="#Coverage-Achieved" class="headerlink" title="Coverage Achieved"></a>Coverage Achieved</h3><table><thead><tr><th>Name</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr></thead><tbody><tr><td>plain&#x2F;bronze_job.py</td><td>45</td><td>6</td><td>95%</td><td>105‑114, 135</td></tr><tr><td>plain&#x2F;silver_job.py</td><td>36</td><td>1</td><td>97%</td><td>105</td></tr><tr><td>plain&#x2F;gold_job.py</td><td>47</td><td>1</td><td>98%</td><td>165</td></tr><tr><td>purchase_order&#x2F;bronze_job.py</td><td>42</td><td>6</td><td>86%</td><td>149-158, 175</td></tr><tr><td>purchase_order&#x2F;silver_job.py</td><td>42</td><td>1</td><td>98%</td><td>166</td></tr><tr><td>purchase_order&#x2F;gold_job.py</td><td>44</td><td>1</td><td>98%</td><td>152</td></tr><tr><td><strong>TOTAL</strong></td><td>252</td><td>16</td><td>94%</td><td></td></tr></tbody></table><h3 id="Test-Suite-Statistics"><a href="#Test-Suite-Statistics" class="headerlink" title="Test Suite Statistics"></a>Test Suite Statistics</h3><ol><li><strong>Plain Pipeline</strong> – 41 tests across 3 layers</li><li><strong>Purchase Order Pipeline</strong> – 44 tests across 3 layers</li><li><strong>Total</strong> – 85+ unit tests (plus integration suite)</li><li><strong>Execution Time</strong> – under 30 seconds for the full suite</li></ol><h3 id="Quality-Improvements"><a href="#Quality-Improvements" class="headerlink" title="Quality Improvements"></a>Quality Improvements</h3><ul><li>Consistent AAA structure across all tests</li><li>Clear, descriptive naming (<code>should_*_when_*</code>)</li><li>Comprehensive edge‑case coverage (null values, empty data, malformed input)</li><li>Full mocking of external dependencies (S3, AWS services)</li><li>Detailed docstrings for every test</li></ul><h2 id="Key-Strategies-That-Worked"><a href="#Key-Strategies-That-Worked" class="headerlink" title="Key Strategies That Worked"></a>Key Strategies That Worked</h2><ol><li><strong>Prompt Engineering as Code</strong> – Storing the prompt template in version control guarantees uniform standards.</li><li><strong>Iterative Refinement</strong> – Initial generations are generic; refined prompts yield high‑quality tests.</li><li><strong>Context‑Aware Generation</strong> – Supplying fixtures, naming conventions, and business rules guides Copilot to produce relevant tests.</li><li><strong>Docker‑First Testing</strong> – Guarantees a reproducible environment where <code>awsglue</code> modules are available.</li><li><strong>Layered Test Strategy</strong> – Bronze focuses on ingestion, Silver on transformations, Gold on aggregations; integration tests validate end‑to‑end flow.</li></ol><h2 id="Practical-Workflow"><a href="#Practical-Workflow" class="headerlink" title="Practical Workflow"></a>Practical Workflow</h2><ol><li><strong>Define Your Standards</strong> – Create <code>.github/prompts/unit-tester.prompt.md</code>.</li><li><strong>Set Up Infrastructure</strong> – Docker volumes, pytest config, shared fixtures (<code>conftest.py</code>).</li><li><strong>Generate Tests with Copilot</strong> – Use the prompt template and explicit requirements.</li><li><strong>Review and Refine</strong> – Run tests, examine coverage, ask Copilot to fill gaps.</li><li><strong>Iterate on Uncovered Code</strong> – Target specific uncovered lines with new prompts.</li></ol><h2 id="Lessons-Learned"><a href="#Lessons-Learned" class="headerlink" title="Lessons Learned"></a>Lessons Learned</h2><ul><li>Structured prompts dramatically improve test consistency.</li><li>Docker eliminates environment‑related failures.</li><li>Incremental, layer‑by‑layer testing is more manageable than tackling the whole project at once.</li><li>Coverage reports guide focused test generation.</li></ul><h2 id="Advanced-Techniques"><a href="#Advanced-Techniques" class="headerlink" title="Advanced Techniques"></a>Advanced Techniques</h2><ol><li><strong>Parametrized Test Generation</strong> – Produce data‑driven tests with <code>@pytest.mark.parametrize</code>.</li><li><strong>Property‑Based Testing</strong> – Use <code>hypothesis</code> to validate invariants across arbitrary inputs.</li><li><strong>Integration Test Generation</strong> – Write end‑to‑end tests that run the full Bronze→Silver→Gold pipeline inside Docker.</li></ol><h2 id="Measuring-Success"><a href="#Measuring-Success" class="headerlink" title="Measuring Success"></a>Measuring Success</h2><table><thead><tr><th>Metric</th><th>Before Copilot</th><th>After Copilot</th></tr></thead><tbody><tr><td>Test Coverage</td><td>35 %</td><td>95 %</td></tr><tr><td>Time to Write Tests (per module)</td><td>2‑3 h</td><td>30‑45 min</td></tr><tr><td>Bugs Detected Pre‑Production</td><td>0 (undetected)</td><td>12 (caught)</td></tr><tr><td>Team Confidence</td><td>Low</td><td>High</td></tr><tr><td>ROI (time saved)</td><td>–</td><td>~60 % reduction</td></tr></tbody></table><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>GitHub Copilot Agent isn’t merely a code‑completion tool—it’s a disciplined partner that turns unit‑test generation into a repeatable, high‑quality process. By combining a clear prompt template, Docker‑first infrastructure, and systematic coverage analysis, you achieve real <strong>code confidence</strong>, not just high coverage numbers. The workflow scales from a single module to an entire data‑engineering codebase, delivering faster development cycles, fewer production bugs, and a stronger testing culture.</p><p>For more information about my actual copilot-driven unit and integration tests implementation, you can find it from my commits <a href="https://github.com/awongCM/docker_glue_pyspark_demo/commit/4c3f970955bba88c5e2705d05c70665730e46682">here</a>, or you can read more from my <a href="https://github.com/awongCM/docker_glue_pyspark_demo/blob/main/TEST_QUICK_REFERENCE.md">testing readme</a> doc as well.</p><hr><p><em>Till next time, Happy Coding, and wish you a happy and safe Xmas Holidays ahead🎄🎅🤶🧑‍🎄!</em></p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_copilot_unit_test_coverage_code_confidence.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;As we bring 2025 to a close, software engineers like myself find themselves immersed in all things AI from every direction—left, right, and dead center: Medium blogs, AI forums like Rundown AI, AI meetups, etc.—all in a constant state of flux. The message couldn’t be clearer: ignoring AI is no longer an option. Those who resist embracing these tools risk falling drastically behind in an industry moving at lightning speed. The greatest folly isn’t experimenting with AI and making mistakes — it’s refusing to adapt at all.&lt;/p&gt;
&lt;p&gt;But here’s the critical insight most engineers miss: &lt;strong&gt;it’s not about using AI; it’s about using AI systematically.&lt;/strong&gt;&lt;/p&gt;</summary>
    
    
    
    
    <category term="python pyspark unit-test code-coverage github copilot code-confidence" scheme="http://awongcm.io/tags/python-pyspark-unit-test-code-coverage-github-copilot-code-confidence/"/>
    
  </entry>
  
  <entry>
    <title>Setting up Local AWS Glue Development Environment with Docker</title>
    <link href="http://awongcm.io/blog/2025/11/22/setting-up-local-aws-glue-development-environment-with-docker/"/>
    <id>http://awongcm.io/blog/2025/11/22/setting-up-local-aws-glue-development-environment-with-docker/</id>
    <published>2025-11-22T02:09:38.000Z</published>
    <updated>2026-11-15T01:30:57.670Z</updated>
    
    <content type="html"><![CDATA[<img src="/images/ai_generated_data_engineering_local_setup_development.jpeg" class="center" width="500" height="500" title="Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator"><p><em><p style="text-align: center;">Generated AI image by Microsoft Bing Image Creator</p></em></p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>If you’re like me, you’ve probably experienced the frustration of developing any AWS applications in the cloud especially such as lambda, cloudfront, S3, etc using tools like SAM, CloudFormation etc.. Now that I’ve been delving into the world of data engineering, AWS Glue jobs is one of the main AWS data engineering tooling offerings, the frustrations in having to push Glue jobs directly in the cloud—waiting for job runs, nitty gritty AWS Glue binaries setup, dealing with slow feedback loops, and watching your AWS bill creep up with every test iteration. I’ve been there, and it’s not fun.</p><p>That’s why I built this local development environment. After experimenting with different approaches, I’ve put together a Docker-based setup that lets me develop and test Glue jobs on my laptop before deploying to AWS. The best part? It includes all the real-world components I actually use in actual cloud envs: Kafka for streaming data, Iceberg for my data lake tables, and LocalStack to simulate AWS services.</p><span id="more"></span><p>In this guide, I’ll walk you through my setup step-by-step. Whether you’re working on batch ETL jobs or real-time streaming pipelines, this environment will save you time, money, and a lot of headaches.</p><h2 id="What-We’re-Building"><a href="#What-We’re-Building" class="headerlink" title="What We’re Building"></a>What We’re Building</h2><p>Here’s what I’ve included in my local stack:</p><ol><li><strong>AWS Glue 4.0</strong> - The core ETL engine, just like in production</li><li><strong>JupyterLab</strong> - For interactive development and quick experiments</li><li><strong>Confluent Kafka</strong> - Because most of my pipelines involve streaming data</li><li><strong>Apache Iceberg</strong> - My go-to table format for ACID guarantees and time travel</li><li><strong>LocalStack</strong> - To mock S3 and DynamoDB without touching AWS</li></ol><h2 id="Before-You-Start"><a href="#Before-You-Start" class="headerlink" title="Before You Start"></a>Before You Start</h2><p>Make sure you have these installed on your machine:</p><ol><li>Docker Desktop (20.10+) with at least 8GB RAM allocated</li><li>Docker Compose v2.0+</li><li>Basic familiarity with AWS Glue and Spark</li></ol><h2 id="My-Project-Structure"><a href="#My-Project-Structure" class="headerlink" title="My Project Structure"></a>My Project Structure</h2><p>Here’s how I organize my demo projects:</p><pre><code class="hljs plaintext">docker-glue-pyspark-demo/├── docker-compose.yml├── Dockerfile├── .env├── scripts/│   ├── start-containers.sh│   └── shutdown-cointainers.sh├── plain/│   ├── bronze_job.py│   ├── silver_job.py│   └── gold_job.py├── terraform│   ├── main.tf│   └── providers.tf├── poetry.lock├── pyproject.toml│└── notebooks/</code></pre><h2 id="Step-1-Docker-Compose-Setup"><a href="#Step-1-Docker-Compose-Setup" class="headerlink" title="Step 1: Docker Compose Setup"></a>Step 1: Docker Compose Setup</h2><p>Create <code>docker-compose.yml</code>:</p><pre><code class="hljs yaml"><span class="hljs-attr">services:</span>  <span class="hljs-attr">glue-pyspark:</span>    <span class="hljs-attr">build:</span>      <span class="hljs-attr">context:</span> <span class="hljs-string">.</span>      <span class="hljs-attr">dockerfile:</span> <span class="hljs-string">Dockerfile</span>    <span class="hljs-attr">container_name:</span> <span class="hljs-string">glue-pyspark-poc</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">my-glue-pyspark</span>    <span class="hljs-attr">volumes:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">./plain:/app/plain</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">./purchase_order:/app/purchase_order</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">&quot;18080:18080&quot;</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-attr">AWS_ACCESS_KEY_ID:</span> <span class="hljs-string">&quot;test&quot;</span>      <span class="hljs-attr">AWS_SECRET_ACCESS_KEY:</span> <span class="hljs-string">&quot;test&quot;</span>      <span class="hljs-attr">AWS_REGION:</span> <span class="hljs-string">&quot;us-east-1&quot;</span>    <span class="hljs-attr">stdin_open:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># Keep STDIN open</span>    <span class="hljs-attr">tty:</span> <span class="hljs-literal">true</span>    <span class="hljs-attr">depends_on:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">iceberg</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">localstack</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">localstack</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka-net</span>  <span class="hljs-attr">jupyterlab:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">my-glue-pyspark</span>    <span class="hljs-attr">container_name:</span> <span class="hljs-string">jupterlab-poc</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-attr">AWS_ACCESS_KEY_ID:</span> <span class="hljs-string">&quot;test&quot;</span>      <span class="hljs-attr">AWS_SECRET_ACCESS_KEY:</span> <span class="hljs-string">&quot;test&quot;</span>      <span class="hljs-attr">AWS_REGION:</span> <span class="hljs-string">&quot;us-east-1&quot;</span>      <span class="hljs-attr">DISABLE_SSL:</span> <span class="hljs-literal">true</span>    <span class="hljs-attr">command:</span>      [        <span class="hljs-string">&quot;/home/glue_user/jupyter/jupyter_start.sh&quot;</span>,        <span class="hljs-string">&quot;--ip=0.0.0.0&quot;</span>,        <span class="hljs-string">&quot;--no-browser&quot;</span>,        <span class="hljs-string">&quot;--allow-root&quot;</span>,        <span class="hljs-string">&quot;--NotebookApp.token=test&quot;</span>,        <span class="hljs-string">&quot;--NotebookApp.allow_origin=*&quot;</span>,        <span class="hljs-string">&quot;--NotebookApp.base_url=http://localhost:8888&quot;</span>,        <span class="hljs-string">&quot;--NotebookApp.token_expire_in=36&quot;</span>,      ]    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">8888</span><span class="hljs-string">:8888</span>    <span class="hljs-attr">depends_on:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">glue-pyspark</span>    <span class="hljs-attr">volumes_from:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">glue-pyspark</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">localstack</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka-net</span>  <span class="hljs-attr">localstack:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">localstack/localstack</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">SERVICES=dynamodb,s3,iam</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">DEFAULT_REGION=us-east-1</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">AWS_ACCESS_KEY_ID=test</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">AWS_SECRET_ACCESS_KEY=test</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">DEBUG=1</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">&quot;4566:4566&quot;</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">&quot;4510-4559:4510-4559&quot;</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">localstack</span>  <span class="hljs-attr">kafka:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">confluentinc/cp-kafka:7.4.0</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">29092</span><span class="hljs-string">:29092</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">9092</span><span class="hljs-string">:9092</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-attr">KAFKA_BROKER_ID:</span> <span class="hljs-number">1</span>      <span class="hljs-attr">KAFKA_ZOOKEEPER_CONNECT:</span> <span class="hljs-string">zookeeper:2181</span>      <span class="hljs-attr">KAFKA_ADVERTISED_LISTENERS:</span> <span class="hljs-string">PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092</span>      <span class="hljs-attr">KAFKA_LISTENER_SECURITY_PROTOCOL_MAP:</span> <span class="hljs-string">PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT</span>      <span class="hljs-attr">KAFKA_INTER_BROKER_LISTENER_NAME:</span> <span class="hljs-string">PLAINTEXT</span>      <span class="hljs-attr">KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR:</span> <span class="hljs-number">1</span>      <span class="hljs-attr">KAFKA_LISTENERS:</span> <span class="hljs-string">PLAINTEXT://0.0.0.0:29092,PLAINTEXT_HOST://0.0.0.0:9092</span>    <span class="hljs-attr">depends_on:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">zookeeper</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka-net</span>  <span class="hljs-attr">zookeeper:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">confluentinc/cp-zookeeper:latest</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">2181</span><span class="hljs-string">:2181</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-attr">ZOOKEEPER_CLIENT_PORT:</span> <span class="hljs-number">2181</span>      <span class="hljs-attr">ZOOKEEPER_TICK_TIME:</span> <span class="hljs-number">2000</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka-net</span>  <span class="hljs-attr">iceberg:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">tabulario/spark-iceberg:latest</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">kafka-net</span><span class="hljs-attr">networks:</span>  <span class="hljs-attr">localstack:</span>    <span class="hljs-attr">driver:</span> <span class="hljs-string">bridge</span>  <span class="hljs-attr">kafka-net:</span></code></pre><h2 id="Step-3-Custom-Glue-Dockerfile"><a href="#Step-3-Custom-Glue-Dockerfile" class="headerlink" title="Step 3: Custom Glue Dockerfile"></a>Step 3: Custom Glue Dockerfile</h2><p>Create <code>Dockerfile</code>:</p><pre><code class="hljs dockerfile"><span class="hljs-comment"># https://stackoverflow.com/a/74598849</span><span class="hljs-keyword">RUN</span><span class="language-bash"> <span class="hljs-built_in">rm</span> /home/glue_user/spark/conf/hive-site.xml</span><span class="hljs-comment"># Removed as they conflict with structured streaming jars below</span><span class="hljs-keyword">RUN</span><span class="language-bash"> <span class="hljs-built_in">rm</span> /home/glue_user/spark/jars/org.apache.commons_commons-pool2-2.6.2.jar</span><span class="hljs-keyword">RUN</span><span class="language-bash"> <span class="hljs-built_in">rm</span> /home/glue_user/spark/jars/org.apache.kafka_kafka-clients-2.6.0.jar</span><span class="hljs-keyword">RUN</span><span class="language-bash"> <span class="hljs-built_in">rm</span> /home/glue_user/spark/jars/org.spark-project.spark_unused-1.0.0.jar</span>.........<span class="hljs-comment"># Install additional dependencies</span><span class="hljs-comment"># Upgrade pip to the latest version</span><span class="hljs-keyword">RUN</span><span class="language-bash"> pip3 install --upgrade pip</span><span class="hljs-comment"># Install Jupyterlab</span><span class="hljs-keyword">RUN</span><span class="language-bash"> pip3 install jupyterlab</span><span class="hljs-comment"># Expose Jupyter port</span><span class="hljs-keyword">EXPOSE</span> <span class="hljs-number">8888</span><span class="hljs-comment"># Install Poetry for dependency management</span><span class="hljs-keyword">RUN</span><span class="language-bash"> pip3 install poetry==1.8.5</span><span class="hljs-keyword">COPY</span><span class="language-bash"> pyproject.toml poetry.lock* /app/</span><span class="hljs-keyword">COPY</span><span class="language-bash"> plain /app/plain</span><span class="hljs-comment"># Disable Poetry&#x27;s virtual environment creation, install project dependencies via poetry</span><span class="hljs-keyword">RUN</span><span class="language-bash"> poetry install</span><span class="hljs-comment"># Run the container - non-interactive</span><span class="hljs-keyword">ENTRYPOINT</span><span class="language-bash"> [ <span class="hljs-string">&quot;/bin/bash&quot;</span>, <span class="hljs-string">&quot;-l&quot;</span>, <span class="hljs-string">&quot;-c&quot;</span> ]</span><span class="hljs-keyword">CMD</span><span class="language-bash"> [<span class="hljs-string">&quot;/bin/bash&quot;</span>]</span></code></pre><h2 id="Step-4-Initialize-LocalStack-Resources"><a href="#Step-4-Initialize-LocalStack-Resources" class="headerlink" title="Step 4: Initialize LocalStack Resources"></a>Step 4: Initialize LocalStack Resources</h2><p>Navigate to terraform and run <code>tflocal apply --auto-approve</code>:</p><p>You notice the following locally emulated AWS services below:</p><pre><code class="hljs tf">resource &quot;aws_s3_bucket&quot; &quot;bronze-bucket&quot; &#123;  bucket = &quot;bronze-bucket&quot;  acl    = &quot;private&quot;&#125;resource &quot;aws_s3_bucket&quot; &quot;iceberg&quot; &#123;  bucket = &quot;iceberg&quot;  acl    = &quot;private&quot;&#125;resource &quot;aws_dynamodb_table&quot; &quot;dynamo_db_table_gold_table_plain&quot; &#123;  name         = &quot;gold_table_plain&quot;  billing_mode = &quot;PAY_PER_REQUEST&quot;  hash_key     = &quot;id&quot;  attribute &#123;    name = &quot;id&quot;    type = &quot;N&quot;  &#125;&#125;</code></pre><h2 id="Step-5-Generated-Kafka-Topics-Events-for-Data-ingestion"><a href="#Step-5-Generated-Kafka-Topics-Events-for-Data-ingestion" class="headerlink" title="Step 5: Generated Kafka Topics Events for Data ingestion"></a>Step 5: Generated Kafka Topics Events for Data ingestion</h2><p>Create <code>scripts/generate_plain_events.bash</code>:</p><pre><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><span class="hljs-built_in">set</span> -ex  <span class="hljs-comment"># Exit on error, print commands</span><span class="hljs-comment"># Kafka settings</span>TOPIC=<span class="hljs-string">&quot;plain-topic&quot;</span>BOOTSTRAP_SERVERS=<span class="hljs-string">&quot;kafka:9092&quot;</span>CONTAINER_NAME=<span class="hljs-string">&quot;docker_glue_pyspark_demo-kafka-1&quot;</span>  <span class="hljs-comment"># Replace with your actual container name</span><span class="hljs-comment"># Function to generate a random JSON event</span><span class="hljs-function"><span class="hljs-title">generate_event</span></span>() &#123;  <span class="hljs-built_in">id</span>=$((RANDOM % <span class="hljs-number">100</span> + <span class="hljs-number">1</span>))  name=$(<span class="hljs-built_in">cat</span> /usr/share/dict/words | <span class="hljs-built_in">shuf</span> -n 1 | awk <span class="hljs-string">&#x27;&#123;print toupper(substr($0,1,1)) tolower(substr($0,2))&#125;&#x27;</span>)  amount=$((RANDOM % <span class="hljs-number">201</span>))  <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;&#123;\&quot;id\&quot;: <span class="hljs-variable">$id</span>, \&quot;name\&quot;: \&quot;<span class="hljs-variable">$name</span>\&quot;, \&quot;amount\&quot;: <span class="hljs-variable">$amount</span>&#125;&quot;</span>&#125;......<span class="hljs-comment"># Generate and send events for the specified number of iterations</span><span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> $(<span class="hljs-built_in">seq</span> 1 <span class="hljs-variable">$iterations</span>); <span class="hljs-keyword">do</span>  event_data=$(generate_event)  <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;Sending event: <span class="hljs-variable">$event_data</span>&quot;</span>  <span class="hljs-comment"># Execute the kafka-console-producer command inside the Docker container</span>  docker <span class="hljs-built_in">exec</span> -i <span class="hljs-string">&quot;<span class="hljs-variable">$CONTAINER_NAME</span>&quot;</span> \    kafka-console-producer --topic <span class="hljs-string">&quot;<span class="hljs-variable">$TOPIC</span>&quot;</span> --bootstrap-server <span class="hljs-string">&quot;<span class="hljs-variable">$BOOTSTRAP_SERVERS</span>&quot;</span> \    &lt;&lt;&lt; <span class="hljs-string">&quot;<span class="hljs-variable">$event_data</span>&quot;</span>  <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;Event sent (exit code: $?)&quot;</span>  <span class="hljs-built_in">sleep</span> 1  <span class="hljs-comment"># Adjust the sleep interval as needed</span><span class="hljs-keyword">done</span></code></pre><h2 id="Step-6-Kafka-Streaming-Job-Bronze-Layer"><a href="#Step-6-Kafka-Streaming-Job-Bronze-Layer" class="headerlink" title="Step 6: Kafka Streaming Job (Bronze Layer)"></a>Step 6: Kafka Streaming Job (Bronze Layer)</h2><p>Create <code>plain/bronze_job.py</code>:</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> pyspark.sql <span class="hljs-keyword">import</span> SparkSession<span class="hljs-keyword">from</span> pyspark.sql.functions <span class="hljs-keyword">import</span> from_json, col<span class="hljs-keyword">from</span> pyspark.sql.types <span class="hljs-keyword">import</span> StructType, StructField, StringType, IntegerType<span class="hljs-keyword">import</span> boto3<span class="hljs-keyword">import</span> time<span class="hljs-keyword">import</span> jsonspark = SparkSession.builder \        .appName(<span class="hljs-string">&quot;Bronze Layer Job&quot;</span>) \        .master(<span class="hljs-string">&quot;local[*]&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.endpoint&quot;</span>, <span class="hljs-string">&quot;http://localstack:4566&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.access.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.secret.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.impl&quot;</span>, <span class="hljs-string">&quot;org.apache.hadoop.fs.s3a.S3AFileSystem&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.path.style.access&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.multiobjectdelete.enable&quot;</span>, <span class="hljs-string">&quot;false&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.fast.upload&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.fast.upload.buffer&quot;</span>, <span class="hljs-string">&quot;disk&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.endpoint.region&quot;</span>, <span class="hljs-string">&quot;us-east-1&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.aws.credentials.provider&quot;</span>, <span class="hljs-string">&quot;org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider&quot;</span>) \        .getOrCreate()<span class="hljs-comment"># # Set S3 endpoint to point to LocalStack</span>s3_endpoint_url = <span class="hljs-string">&quot;http://localstack:4566&quot;</span><span class="hljs-comment"># Kafka broker address and topic</span>kafka_bootstrap_servers = <span class="hljs-string">&quot;kafka:29092&quot;</span>kafka_topic = <span class="hljs-string">&quot;plain-topic&quot;</span>bucket_name = <span class="hljs-string">&quot;bronze-bucket&quot;</span>output_s3_bucket = <span class="hljs-string">f&#x27;s3a://<span class="hljs-subst">&#123;bucket_name&#125;</span>/plain&#x27;</span><span class="hljs-comment"># Read from Kafka</span>df = spark \    .readStream \    .<span class="hljs-built_in">format</span>(<span class="hljs-string">&quot;kafka&quot;</span>) \    .option(<span class="hljs-string">&quot;kafka.bootstrap.servers&quot;</span>, kafka_bootstrap_servers) \    .option(<span class="hljs-string">&quot;subscribe&quot;</span>, kafka_topic) \    .option(<span class="hljs-string">&quot;startingOffsets&quot;</span>, <span class="hljs-string">&quot;earliest&quot;</span>) \    .load()<span class="hljs-comment"># Extract the value and parse the JSON</span>parsed_df = df.selectExpr(<span class="hljs-string">&quot;CAST(value AS STRING) as value&quot;</span>) \    .select(from_json(col(<span class="hljs-string">&quot;value&quot;</span>), schema).alias(<span class="hljs-string">&quot;data&quot;</span>)) \    .select(<span class="hljs-string">&quot;data.*&quot;</span>)query = parsed_df.writeStream \        .foreachBatch(process_batch) \        .<span class="hljs-built_in">format</span>(<span class="hljs-string">&quot;parquet&quot;</span>) \        .option(<span class="hljs-string">&quot;path&quot;</span>,output_s3_bucket) \        .option(<span class="hljs-string">&quot;checkpointLocation&quot;</span>, <span class="hljs-string">&quot;/tmp/spark_checkpoints/bronze_layer/plain&quot;</span>) \        .trigger(processingTime=<span class="hljs-string">&quot;500 milliseconds&quot;</span>) \        .outputMode(<span class="hljs-string">&quot;append&quot;</span>) \        .start()query.awaitTermination()</code></pre><h2 id="Step-7-Batch-ETL-Job-Kafka-to-Icerberg-Silver-Layer"><a href="#Step-7-Batch-ETL-Job-Kafka-to-Icerberg-Silver-Layer" class="headerlink" title="Step 7: Batch ETL Job - Kafka to Icerberg (Silver Layer)"></a>Step 7: Batch ETL Job - Kafka to Icerberg (Silver Layer)</h2><p>Create <code>plain/silver_job.py</code>:</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> pyspark.sql <span class="hljs-keyword">import</span> SparkSessionbucket_name = <span class="hljs-string">&quot;bronze-bucket&quot;</span>output_s3_bucket = <span class="hljs-string">f&#x27;s3a://<span class="hljs-subst">&#123;bucket_name&#125;</span>/plain&#x27;</span>s3_endpoint_url = <span class="hljs-string">&quot;http://localstack:4566&quot;</span>namespace_catalog = <span class="hljs-string">&quot;local_catalog&quot;</span>catalog_name = <span class="hljs-string">&quot;local_catalog_plain&quot;</span>table_name = <span class="hljs-string">&quot;silver_table&quot;</span>full_table_name = <span class="hljs-string">f&quot;`<span class="hljs-subst">&#123;namespace_catalog&#125;</span>`.`<span class="hljs-subst">&#123;catalog_name&#125;</span>`.`<span class="hljs-subst">&#123;table_name&#125;</span>`&quot;</span>spark = SparkSession.builder \        .appName(<span class="hljs-string">&quot;Silver Layer Job&quot;</span>) \        .master(<span class="hljs-string">&quot;local[*]&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.extensions&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.SparkCatalog&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.type&quot;</span>, <span class="hljs-string">&quot;hadoop&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.warehouse&quot;</span>, <span class="hljs-string">&quot;s3a://iceberg/warehouse&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.endpoint&quot;</span>, <span class="hljs-string">&quot;http://localstack:4566&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.access.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.secret.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.connection.ssl.enabled&quot;</span>, <span class="hljs-string">&quot;false&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.path.style.access&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \ <span class="hljs-comment"># Create the database if it doesn&#x27;t exist using PySpark SQL</span>create_database_if_not_exists(spark, catalog_name)<span class="hljs-comment"># Create the table if it doesn&#x27;t exist using PySpark SQL</span>create_table_if_not_exists(spark, namespace_catalog, catalog_name, table_name) <span class="hljs-comment"># Read from S3 (Bronze)</span>bronze_path = output_s3_bucketdf = spark.read.<span class="hljs-built_in">format</span>(<span class="hljs-string">&quot;parquet&quot;</span>).load(bronze_path)<span class="hljs-comment"># Perform data cleaning and enrichment</span>cleaned_df = df.<span class="hljs-built_in">filter</span>(<span class="hljs-string">&quot;amount &lt; 100&quot;</span>)<span class="hljs-comment"># Write to Iceberg (Silver)</span>cleaned_df.writeTo(full_table_name).append()<span class="hljs-comment"># Show the Silver Iceberg table records</span>message = spark.table(full_table_name).show()spark.stop()</code></pre><h2 id="Step-8-Batch-ETL-Job-Iceberg-to-Dynamo-Gold-Layer"><a href="#Step-8-Batch-ETL-Job-Iceberg-to-Dynamo-Gold-Layer" class="headerlink" title="Step 8: Batch ETL Job - Iceberg to Dynamo (Gold Layer)"></a>Step 8: Batch ETL Job - Iceberg to Dynamo (Gold Layer)</h2><p>Create <code>plain/gold_job.py</code>:</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> pyspark.sql <span class="hljs-keyword">import</span> SparkSession<span class="hljs-keyword">from</span> botocore.exceptions <span class="hljs-keyword">import</span> ClientError<span class="hljs-keyword">import</span> time<span class="hljs-keyword">import</span> json<span class="hljs-comment"># # Set S3 endpoint to point to LocalStack</span>s3_endpoint_url = <span class="hljs-string">&quot;http://localstack:4566&quot;</span>namespace_catalog = <span class="hljs-string">&quot;local_catalog&quot;</span>catalog_name = <span class="hljs-string">&quot;local_catalog_plain&quot;</span>table_name = <span class="hljs-string">&quot;silver_table&quot;</span>full_table_name = <span class="hljs-string">f&quot;`<span class="hljs-subst">&#123;namespace_catalog&#125;</span>`.`<span class="hljs-subst">&#123;catalog_name&#125;</span>`.`<span class="hljs-subst">&#123;table_name&#125;</span>`&quot;</span><span class="hljs-comment"># Initialize Spark session</span>spark = SparkSession.builder \    .appName(<span class="hljs-string">&quot;Gold Layer Job&quot;</span>) \    .master(<span class="hljs-string">&quot;local[*]&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.extensions&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.SparkCatalog&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.type&quot;</span>, <span class="hljs-string">&quot;hadoop&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.warehouse&quot;</span>, <span class="hljs-string">&quot;s3a://iceberg/warehouse&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.endpoint&quot;</span>, <span class="hljs-string">&quot;http://localstack:4566&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.access.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.secret.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.connection.ssl.enabled&quot;</span>, <span class="hljs-string">&quot;false&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.path.style.access&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.endpoint&quot;</span>, <span class="hljs-string">&quot;http://localstack:4566&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.access.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.secret.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.impl&quot;</span>, <span class="hljs-string">&quot;org.apache.hadoop.fs.s3a.S3AFileSystem&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.multiobjectdelete.enable&quot;</span>, <span class="hljs-string">&quot;false&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.fast.upload&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.fast.upload.buffer&quot;</span>, <span class="hljs-string">&quot;disk&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.endpoint.region&quot;</span>, <span class="hljs-string">&quot;us-east-1&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.path.style.access&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \    .config(<span class="hljs-string">&quot;spark.hadoop.fs.s3a.aws.credentials.provider&quot;</span>, <span class="hljs-string">&quot;org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider&quot;</span>) \    .getOrCreate()<span class="hljs-comment"># Read from Iceberg (Silver)</span>df = spark.read.<span class="hljs-built_in">format</span>(<span class="hljs-string">&quot;iceberg&quot;</span>).load(full_table_name)<span class="hljs-comment"># Define the table name</span>dynamo_table_name = <span class="hljs-string">&quot;gold_table_plain&quot;</span>dynamodb = boto3.client(<span class="hljs-string">&quot;dynamodb&quot;</span>, endpoint_url=s3_endpoint_url,region_name=<span class="hljs-string">&quot;us-east-1&quot;</span>)data = df.collect()<span class="hljs-keyword">for</span> row <span class="hljs-keyword">in</span> data:    item = &#123;        <span class="hljs-string">&#x27;id&#x27;</span>: &#123;<span class="hljs-string">&#x27;N&#x27;</span>: <span class="hljs-built_in">str</span>(row[<span class="hljs-string">&#x27;id&#x27;</span>])&#125;,        <span class="hljs-string">&#x27;name&#x27;</span>: &#123;<span class="hljs-string">&#x27;S&#x27;</span>: row[<span class="hljs-string">&#x27;name&#x27;</span>]&#125;,        <span class="hljs-string">&#x27;amount&#x27;</span>: &#123;<span class="hljs-string">&#x27;N&#x27;</span>: <span class="hljs-built_in">str</span>(row[<span class="hljs-string">&#x27;amount&#x27;</span>])&#125;    &#125;    dynamodb.put_item(TableName=dynamo_table_name, Item=item)    log_logging_events(<span class="hljs-string">f&quot;Inserted <span class="hljs-subst">&#123;json.dumps(item)&#125;</span> items into <span class="hljs-subst">&#123;dynamo_table_name&#125;</span>.&quot;</span>, logs_client)    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Inserted <span class="hljs-subst">&#123;<span class="hljs-built_in">len</span>(data)&#125;</span> items into <span class="hljs-subst">&#123;dynamo_table_name&#125;</span>.&quot;</span>)spark.stop()</code></pre><h2 id="Step-9-Launch-the-Environment"><a href="#Step-9-Launch-the-Environment" class="headerlink" title="Step 9: Launch the Environment"></a>Step 9: Launch the Environment</h2><p>Start all services:</p><p>Run <code>scripts/start-containers.bash</code></p><pre><code class="hljs bash">docker-compose up --build -d</code></pre><p>Stop all resources when done:</p><p>Run <code>scripts/shutdown-containers.bash</code></p><pre><code class="hljs bash">docker-compose down</code></pre><h2 id="Step-9-Access-JupyterLab"><a href="#Step-9-Access-JupyterLab" class="headerlink" title="Step 9: Access JupyterLab"></a>Step 9: Access JupyterLab</h2><p>Navigate to <code>http://localhost:8888</code> and you will see the Jupyter Notebook interface there.</p><h2 id="Step-10-Verify-the-complete-Setup"><a href="#Step-10-Verify-the-complete-Setup" class="headerlink" title="Step 10: Verify the complete Setup"></a>Step 10: Verify the complete Setup</h2><h3 id="Verify-Localstack-S3-and-DynamoDB-resources"><a href="#Verify-Localstack-S3-and-DynamoDB-resources" class="headerlink" title="Verify Localstack S3 and DynamoDB resources"></a>Verify Localstack S3 and DynamoDB resources</h3><p>Localstack comes with UI Desktop version for devs to navigate and confirm data is available locally and visually once their etl applications finished running.</p><p>You will see something like this</p><img src="/images/localstack_s3_resources.png" class="center" width="800" height="600" title="LocalStack S3 Resources"><p><em><p style="text-align: center;">LocalStack S3 Resources</p></em></p><img src="/images/localstack_dynamo_resources.png" class="center" width="800" height="600" title="LocalStack Dynamo Resources"><p><em><p style="text-align: center;">LocalStack Dynamo Resources</p></em></p><p>You can download them <a href="https://docs.localstack.cloud/aws/capabilities/web-app/localstack-desktop/">here</a></p><h3 id="Query-Iceberg-table"><a href="#Query-Iceberg-table" class="headerlink" title="Query Iceberg table"></a>Query Iceberg table</h3><p>In JupyterLab:</p><p>Write some jupyter notebook code to inspect the iceberg table data. They will be saved under <code>notebooks</code> folder.</p><pre><code class="hljs python"><span class="hljs-keyword">from</span> pyspark.sql <span class="hljs-keyword">import</span> SparkSession<span class="hljs-comment"># Initialize Spark session</span>spark = SparkSession.builder \        .appName(<span class="hljs-string">&quot;Silver Layer Job&quot;</span>) \        .master(<span class="hljs-string">&quot;local[*]&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.extensions&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog&quot;</span>, <span class="hljs-string">&quot;org.apache.iceberg.spark.SparkCatalog&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.type&quot;</span>, <span class="hljs-string">&quot;hadoop&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.warehouse&quot;</span>, <span class="hljs-string">&quot;s3a://iceberg/warehouse&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.endpoint&quot;</span>, <span class="hljs-string">&quot;http://localstack:4566&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.access.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.secret.key&quot;</span>, <span class="hljs-string">&quot;test&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.connection.ssl.enabled&quot;</span>, <span class="hljs-string">&quot;false&quot;</span>) \        .config(<span class="hljs-string">&quot;spark.sql.catalog.local_catalog.hadoop.fs.s3a.path.style.access&quot;</span>, <span class="hljs-string">&quot;true&quot;</span>) \        .getOrCreate()df  = spark.read.<span class="hljs-built_in">format</span>(<span class="hljs-string">&quot;iceberg&quot;</span>).load(<span class="hljs-string">&quot;local_catalog.local_catalog_plain.silver_table&quot;</span>)df.show(truncate=<span class="hljs-literal">False</span>)<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Number of rows in the table: <span class="hljs-subst">&#123;df.count()&#125;</span>&quot;</span>)</code></pre><h2 id="Pro-Tips"><a href="#Pro-Tips" class="headerlink" title="Pro Tips"></a>Pro Tips</h2><h3 id="1-Increase-Performance"><a href="#1-Increase-Performance" class="headerlink" title="1. Increase Performance"></a>1. Increase Performance</h3><p>Add to <code>docker-compose.yml</code>:</p><pre><code class="hljs yaml"><span class="hljs-attr">glue:</span>  <span class="hljs-attr">environment:</span>    <span class="hljs-bullet">-</span> <span class="hljs-string">SPARK_DRIVER_MEMORY=4g</span>    <span class="hljs-bullet">-</span> <span class="hljs-string">SPARK_EXECUTOR_MEMORY=4g</span></code></pre><h3 id="2-Debug-Spark-Jobs"><a href="#2-Debug-Spark-Jobs" class="headerlink" title="2. Debug Spark Jobs"></a>2. Debug Spark Jobs</h3><p>Access Spark UI at <code>http://localhost:4040</code> while jobs are running.</p><h2 id="Common-Issues"><a href="#Common-Issues" class="headerlink" title="Common Issues"></a>Common Issues</h2><p><strong>LocalStack connection fails</strong>: Use service names (<code>localstack</code>, <code>kafka</code>) not <code>localhost</code> in container code.</p><p><strong>Kafka not ready</strong>: Wait 30-60 seconds after <code>docker-compose up</code> before creating topics.</p><p><strong>Memory errors</strong>: Increase Docker memory allocation to 8GB+ in settings.</p><h2 id="Wrapping-Up"><a href="#Wrapping-Up" class="headerlink" title="Wrapping Up"></a>Wrapping Up</h2><p>This setup has transformed my development workflow. I can now:</p><ol><li>✅ Test Glue jobs locally in seconds</li><li>✅ Debug streaming pipelines without AWS costs</li><li>✅ Experiment with Iceberg features safely</li><li>✅ Catch bugs before production deployment</li></ol><p>The complete code is available in my <a href="https://github.com/awongCM/docker_glue_pyspark_demo">docker_glue_pyspark_demo</a> repository.</p><h2 id="What’s-Next"><a href="#What’s-Next" class="headerlink" title="What’s Next?"></a>What’s Next?</h2><p>Here are some potential enhancements this local setup can be extended:</p><ol><li>Add data quality checks with dbt&#x2F;Great Expectations.</li><li>Implement unit tests and extend tests coverage for these.</li><li>Set up CI&#x2F;CD pipelines using Github Actions for job deployment, unit test, peformance etc.</li><li>Explore Iceberg’s time travel capabilities, etc</li></ol><p>Feel free to fork the repo and adapt it to your needs.</p><p>Till next time, Happy coding!</p>]]></content>
    
    
    <summary type="html">&lt;img src=&quot;/images/ai_generated_data_engineering_local_setup_development.jpeg&quot; class=&quot;center&quot; width=&quot;500&quot; height=&quot;500&quot; title=&quot;Generated AI image by Microsoft Bing Image Creator Generated AI image by Microsoft Bing Image Creator&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;p style=&quot;text-align: center;&quot;&gt;Generated AI image by Microsoft Bing Image Creator&lt;/p&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;If you’re like me, you’ve probably experienced the frustration of developing any AWS applications in the cloud especially such as lambda, cloudfront, S3, etc using tools like SAM, CloudFormation etc.. Now that I’ve been delving into the world of data engineering, AWS Glue jobs is one of the main AWS data engineering tooling offerings, the frustrations in having to push Glue jobs directly in the cloud—waiting for job runs, nitty gritty AWS Glue binaries setup, dealing with slow feedback loops, and watching your AWS bill creep up with every test iteration. I’ve been there, and it’s not fun.&lt;/p&gt;
&lt;p&gt;That’s why I built this local development environment. After experimenting with different approaches, I’ve put together a Docker-based setup that lets me develop and test Glue jobs on my laptop before deploying to AWS. The best part? It includes all the real-world components I actually use in actual cloud envs: Kafka for streaming data, Iceberg for my data lake tables, and LocalStack to simulate AWS services.&lt;/p&gt;</summary>
    
    
    
    
    <category term="python pyspark aws cloud localstack apache-iceberg apache-kafka" scheme="http://awongcm.io/tags/python-pyspark-aws-cloud-localstack-apache-iceberg-apache-kafka/"/>
    
  </entry>
  
</feed>
