<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michael Seemann on Medium]]></title>
        <description><![CDATA[Stories by Michael Seemann on Medium]]></description>
        <link>https://medium.com/@mseemann.io?source=rss-e98ee43541c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*z2mIpnZObnGn5NtL4-pV_Q.jpeg</url>
            <title>Stories by Michael Seemann on Medium</title>
            <link>https://medium.com/@mseemann.io?source=rss-e98ee43541c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 20:23:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mseemann.io/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MCP Is a Control Channel, Not a Data Channel: Publishing WordPress Content from Chat — and Why…]]></title>
            <link>https://medium.com/@mseemann.io/mcp-is-a-control-channel-not-a-data-channel-publishing-wordpress-content-from-chat-and-why-634a1f7296a3?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/634a1f7296a3</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 18:15:55 GMT</pubDate>
            <atom:updated>2026-07-21T18:15:55.788Z</atom:updated>
            <content:encoded><![CDATA[<h3>MCP Is a Control Channel, Not a Data Channel: Publishing WordPress Content from Chat — and Why Image Uploads Fail</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOcNay9J5Nhif5ZME9rqsQ.png" /></figure><p><em>A post with its image, published straight from a chat, without touching a single backend form. Building it took an afternoon. The interesting boundary only showed up with the first photo.</em></p><p>A press release needs to go on the website as a post, with an image and a correct photo credit. Always the same motions: paste the text, find the image, download it, upload it again, type in the credit — exactly the kind of work that makes you wonder why you are still doing it yourself.</p><p>Since WordPress 6.9 there is an answer: the <a href="https://developer.wordpress.org/apis/abilities/">Abilities API</a>, and on top of it the <a href="https://github.com/WordPress/mcp-adapter">MCP Adapter</a> from the Core AI initiative. Together they let you expose functions of your own installation as MCP tools that an AI client calls directly. This article describes what actually works — and where the design of the protocol draws a line you cannot configure your way around.</p><p><em>I’m Michael Seemann, a senior full-stack developer. This article is a small by-product: the website of a theatre support association, which turned out to be a good place to try MCP under real conditions.</em></p><h3>What the adapter gives you — and what it doesn’t</h3><p>An <strong>ability</strong> is a function with a contract: a unique name, typed input and output schemas, a permission_callback for authorisation, and an execute_callback doing the actual work. Once registered, it is callable from PHP, from JavaScript, and over the REST API. The MCP Adapter then translates such abilities into MCP tools.</p><p>In PHP it looks like this — trimmed to the essentials:</p><pre>wp_register_ability( &#39;editorial/create-post&#39;, [<br>    &#39;label&#39;        =&gt; &#39;Create post&#39;,<br>    &#39;description&#39;  =&gt; &#39;Creates a post and publishes it.&#39;,<br>    &#39;input_schema&#39; =&gt; [<br>        &#39;type&#39;       =&gt; &#39;object&#39;,<br>        &#39;properties&#39; =&gt; [<br>            &#39;title&#39;             =&gt; [ &#39;type&#39; =&gt; &#39;string&#39; ],<br>            &#39;content&#39;           =&gt; [ &#39;type&#39; =&gt; &#39;string&#39; ],<br>            &#39;featured_image_id&#39; =&gt; [ &#39;type&#39; =&gt; &#39;integer&#39; ],<br>        ],<br>        &#39;required&#39;   =&gt; [ &#39;title&#39;, &#39;content&#39; ],<br>    ],<br>    &#39;permission_callback&#39; =&gt; static function () {<br>        return current_user_can( &#39;publish_posts&#39; );<br>    },<br>    &#39;execute_callback&#39; =&gt; static function ( array $input ) {<br>        if ( $existing_id = post_with_same_title_today( $input[&#39;title&#39;] ) ) {<br>            return new WP_Error( &#39;duplicate&#39;, &#39;Already exists.&#39;, [ &#39;post_id&#39; =&gt; $existing_id ] );<br>        }<br>        $post_id = wp_insert_post( [<br>            &#39;post_type&#39;    =&gt; &#39;post&#39;,<br>            &#39;post_status&#39;  =&gt; &#39;publish&#39;,<br>            &#39;post_title&#39;   =&gt; $input[&#39;title&#39;],<br>            &#39;post_content&#39; =&gt; $input[&#39;content&#39;],<br>        ], true );<br>        if ( is_wp_error( $post_id ) ) {<br>            return $post_id;<br>        }<br>        if ( ! empty( $input[&#39;featured_image_id&#39;] ) ) {<br>            set_post_thumbnail( $post_id, (int) $input[&#39;featured_image_id&#39;] );<br>        }<br>        return [<br>            &#39;post_id&#39;   =&gt; $post_id,<br>            &#39;permalink&#39; =&gt; get_permalink( $post_id ),<br>            &#39;status&#39;    =&gt; &#39;publish&#39;,<br>            &#39;site_url&#39;  =&gt; home_url(https://medium.com/&#39;/&#39;),<br>        ];<br>    },<br>] );</pre><p>That’s all there is to it. The duplicate check, setting the featured image, the terse return value — all of it runs in PHP, on the server, with the permissions of the authenticated user. What the AI client ever sees is the input schema and the result.</p><p>The adapter itself is a plugin you install like any other — except you don’t get it from the official directory but from the project’s <a href="https://github.com/WordPress/mcp-adapter/releases">GitHub releases</a>. Two consequences worth knowing up front: it does not update itself, and it currently sits at version 0.5.0, well short of a stable release.</p><p>The first call after installing returned exactly this:</p><pre>{&quot;abilities&quot;:[]}</pre><p>That is the right answer. The adapter brings the protocol plumbing — transport, server registration, three generic meta tools — and no domain logic whatsoever. WordPress itself ships three abilities, all read-only, and by default they aren’t even visible over MCP. If you want to offer something, you write it yourself.</p><p>For editorial work that came down to a handful of tools on a dedicated MCP server that exposes this list and nothing else:</p><pre>create-post · update-post<br>create-media · update-media · get-media · list-media</pre><p>What’s missing from the list matters just as much: <strong>no delete tool.</strong> An agent allowed to publish does not also need to be allowed to remove.</p><h3>How the client reaches the server</h3><p>Between client and installation sits a proxy: @automattic/mcp-wordpress-remote, started locally via npx. It authenticates with an <strong>application password</strong> — a revocable access token WordPress issues per user, which you can withdraw individually without changing anyone&#39;s password. In the common MCP clients the entry looks the same:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;my-site-production&quot;: {<br>      &quot;command&quot;: &quot;npx&quot;,<br>      &quot;args&quot;: [&quot;-y&quot;, &quot;@automattic/mcp-wordpress-remote@latest&quot;],<br>      &quot;env&quot;: {<br>        &quot;WP_API_URL&quot;: &quot;https://example.org/wp-json/editorial/my-server&quot;,<br>        &quot;WP_API_USERNAME&quot;: &quot;editorial-mcp&quot;,<br>        &quot;WP_API_PASSWORD&quot;: &quot;xxxx xxxx xxxx xxxx xxxx xxxx&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Two notes on that. The user behind it should be a <strong>dedicated one with as few capabilities as possible</strong> — not the administrator account you work with yourself; the permission_callback in every ability checks precisely that user&#39;s rights. And each stage gets its <strong>own entry</strong>. There is no stage parameter in the abilities: an ability always runs in the instance it is installed in. Which is exactly why the target address shows up in the return value later on.</p><h3>Why write your own abilities instead of using the REST API</h3><p>You might object that WordPress has had a write interface for years — and for posts and media, that’s true. Three reasons still argue for your own abilities.</p><p><strong>Scope.</strong> The REST API is a general-purpose interface: every post type, every user, every setting. A dedicated server offers six tools and nothing else. What doesn’t exist can’t be called by accident.</p><p><strong>Rules.</strong> The execute_callback runs server-side and may do more than store. It normalises values, checks for duplicates, derives computed fields. That logic belongs where the domain already lives — not in the caller, and certainly not in a language model.</p><p><strong>The return value.</strong> Instead of a full object with forty fields, you get back exactly what’s needed next:</p><pre>{<br>  &quot;post_id&quot;: 471,<br>  &quot;permalink&quot;: &quot;https://…/blog/…/&quot;,<br>  &quot;status&quot;: &quot;publish&quot;,<br>  &quot;site_url&quot;: &quot;https://…&quot;<br>}</pre><p>That site_url is not dead weight. Anyone running a local, a staging and a production instance side by side will eventually publish to the wrong one. Since the tools publish immediately and there is no delete tool, the target instance is the single most important piece of the response. The same call chain returned the staging domain once and the production domain the next time — demonstrable, not merely hoped for.</p><p>A second point from the same corner: a repeated call with an identical title and date does not create a second post, it returns the existing ID. An agent that sees an error likes to try again. Without duplicate protection, the post ends up on the site twice.</p><h3>Media: sideload instead of upload</h3><p>Up to here everything is text, and text fits through the MCP channel. With the first photo that changes.</p><p>The obvious design was to pass an image as Base64 in the call. That’s what articles about multi-modal MCP servers suggest too, with the caveat that it suits files under a megabyte. The caveat is right; the reasoning behind it is not. Those articles are worried about network overhead and the server’s memory.</p><p>The real problem sits elsewhere. <strong>Every tool call passes through the model’s context</strong> — and everything the model sends, it must first generate, character by character. A real featured image, 1086 × 1448 pixels, 2.4 MB, comes to roughly 3.2 million characters as Base64. Scaling down doesn’t save you:</p><p>Size File Base<br>641200 px203 KB~278,000 characters<br>800 px119 KB~163,000 characters<br>500 px52 KB~72,000 characters</p><p>Even the 500-pixel version would be a call with 72,000 characters — for a featured image the size of a postage stamp. And the commonly recommended fix, splitting the image into chunks, solves a different problem: it relieves the server’s memory, not the model’s context. Twenty calls move the same total volume, with session handling on top. I like to call that token burning: you’re paying a language model to retype an image.</p><p>What does work is the <strong>reference</strong>. create-media takes a URL, and the server fetches the file itself — bypassing the model entirely:</p><pre>create-media<br>  url:          https://…/press/venue-exterior-2023.jpg<br>  alt:          The opera house seen from the square<br>  caption:      Opera house, main entrance<br>  photo_credit: Jane Doe</pre><p>Sixty characters instead of three million, and the bytes never touch the control channel.</p><h3>The use case that justifies it</h3><p>That makes create-media narrower than planned — and more valuable than the mere transport suggests. Because the value isn&#39;t in moving the file, it&#39;s in the <strong>credits</strong>.</p><p>Press pages offer photos for download, and the photographer’s name sits somewhere: in the filename, in the caption, in the fine print. Anyone doing this by hand downloads, uploads again, and reliably forgets the credit line. For anyone publishing someone else’s press photos, that is not a cosmetic flaw.</p><p>Over MCP it’s a single instruction: read the press page, extract image URLs and credits, one create-media per image with alt text, caption and photo credit. Complete metadata, no manual work — and the alt text comes along for free, which otherwise nobody ever fills in either.</p><p>One warning: press originals are large. A high-resolution photo pushed the sideload into a timeout on a small instance, because WordPress computes all intermediate sizes after downloading. If you build a size limit into such an ability, measure it against your weakest environment.</p><h3>What about images on your own machine</h3><p>That leaves the case with no URL: the photo on your phone. I have not found a satisfying answer for it, and I’ve come to think that’s correct.</p><p>A colleague ran into the same wall a project earlier with Canva. Local file uploads fail there too; there too the documented path is to upload through the interface and reference the result by ID afterwards. Arriving at the same place twice, independently, says less about a shortcoming of either interface than about a property of the design.</p><p>What helps is a read tool. list-media returns the most recently uploaded images with ID, filename and metadata. The human does the visual part in a familiar window — pick a file, upload it — and the agent finds the result and builds the post around it. Nobody has to copy an attachment ID.</p><p>For completeness: this is not a tool for occasional editors. Anyone able to set up an MCP connection can also find the backend. The gain sits with whoever does the maintenance anyway and wants to turn a press release into a finished post with an image in one go.</p><h3>My takeaway</h3><p>The most useful rule from the project is also the shortest: <strong>tool calls carry references, not content.</strong> A URL instead of the bytes, an attachment ID instead of the image, post_id and permalink instead of the whole post. If a parameter <em>can</em> grow large, put a pointer in it.</p><p>That sounds like a detail of image handling, but it is the construction rule of the protocol itself. MCP controls, it does not transport. Accept that, and you get a remarkably clean interface for everything that consists of text anyway — and you save yourself the afternoon spent trying to squeeze a photo through a pipe built for instructions.</p><p>The post from that press release is on the site by now, image and credit included. From the first line of code to the published entry took a day — and not a single form.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of experience in software development. He currently focuses on AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=634a1f7296a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Human Oversight as a Side Effect: How a Three-Way Router Satisfies EU AI Act Art.]]></title>
            <link>https://medium.com/@mseemann.io/human-oversight-as-a-side-effect-how-a-three-way-router-satisfies-eu-ai-act-art-dd528b677884?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd528b677884</guid>
            <category><![CDATA[eu-ai-act]]></category>
            <category><![CDATA[ai-observability]]></category>
            <category><![CDATA[human-oversight]]></category>
            <category><![CDATA[langchain4j]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 06:16:00 GMT</pubDate>
            <atom:updated>2026-07-03T06:16:00.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>Human Oversight as a Side Effect: How a Three-Way Router Satisfies EU AI Act Art. 14 Without Being Built for It</h3><p><em>An architectural principle built against a completely different risk solved the human oversight duty’s rubber-stamp problem as a side effect — without ever being built for it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8wyqnGTQ7ohufn5ZnipGew.png" /></figure><p>The previous article in this series put six human oversight signals on /lc4j/order-status — five of them deterministic, one a second model call acting as judge. What remained at the end was a limit that can&#39;t be monitored away: an LLM&#39;s solution space is infinite, and every word list and every judge call only ever covers a finite slice of it. What actually reached the customer stayed unfiltered model free text the whole time — no template, no guard, nothing between the model and the customer. Against prompt injection — a deliberate attempt to manipulate the model into a statement it should never make — that same free-text path was additionally completely unprotected.</p><p>More signals don’t solve that — they’d only lengthen the list of patterns checked against, without shrinking the solution space itself. Anyone who wants to fix this for good has to change the chatbot’s architecture itself, not its observation — a consequence that doesn’t just apply to /lc4j/order-status, but to any AI solution that communicates with end users without a leash. This article therefore introduces a three-way router that makes a breakout into free model text impossible.</p><p><em>I’m Michael Seemann, a senior full-stack developer. This article series shows how AI observability and EU AI Act compliance for enterprise Java stacks can be implemented systematically.</em></p><p><strong>Code to follow along:</strong> The full example is on GitHub: <a href="https://github.com/mseemann/otel-langchain4j-human-oversight">otel-langchain4j-human-oversight</a>. To run it yourself you’ll need Java 21, Maven, Docker Compose, and an <a href="https://console.anthropic.com/">Anthropic API key</a> — the demo calls the real Claude Haiku model, a test run costs a few cents.</p><h3>Six Signals Are Not Proof of Critical Review</h3><p>Art. 14 requires that responsible persons be technically enabled to detect anomalies, counteract automation bias, and decide in individual cases not to use the system or to disregard its output — an enablement of the human, not a fully automated substitute for one. The original plan for that: deterministic alerting on latency spikes, an unexpected tool-call order, and uncertain or incomplete answers — via a fixed word list, supplemented by a second model call acting as judge for exactly the cases a word list misses, despite the downsides already discussed several times in this series: not deterministic, not reproducible, error-prone in its own right. On top of that, an end-user flag letting the customer mark their own request for review independent of any automatic signal, and an intervention that lands as its own span on the same trace.</p><p>The problem only shows up in production: if the same anomaly alert fires two hundred times a day for harmless deviations, a reviewer quickly learns to click “confirmed” without reading. The span attributes then prove that a human <em>technically had the opportunity</em> to intervene — exactly what Art. 14 requires, but only on paper. Whether they actually judged the output or just rubber-stamped it isn’t something any trace can say. Art. 14 itself names this exact reflexive rubber-stamping: automation bias — a behavior the regulation explicitly aims to prevent, not just tolerate.</p><h3>A Router Built for a Different Problem</h3><p>The three-way router wasn’t built for this problem. As already hinted at the end of the previous article, the trigger was two real incidents: Air Canada had to honor a refund its own chatbot had simply invented, after a court ruled the chatbot was part of the website and the company was liable for what it said. A Chevrolet dealership got prompt-injected into offering a vehicle for one dollar as a “legally binding offer.” Both cases share one thing: the damage happened because a model was able to deliver directly model-formulated free text straight to the customer.</p><p>A full taxonomy of such attacks and their defenses — instruction hierarchies, input/output sanitization, strict separation of system and user prompt — is the subject of its own article in this series and deliberately not the focus here. For this article it’s enough to note that the bug and the attack caused damage for the same reason: a model was allowed to deliver unfiltered free text to the customer — and that lesson isn’t specific to a shipping chatbot, it holds for any AI solution that communicates directly with end users.</p><p>The consequence for /lc4j/order-status: instead of an agentic loop with two tools the model plans itself in whatever order it likes, exactly one forced model call now classifies the request into one of three routes. toolChoice(ToolChoice.REQUIRED) makes a free-text answer unreachable for this call in the first place — the model must call one of the three tools, there is no fourth option:</p><pre>ChatRequest routerRequest = ChatRequest.builder()<br>        .messages(messages)<br>        .toolSpecifications(routerTools)<br>        .toolChoice(ToolChoice.REQUIRED)<br>        .build();<br>ChatResponse routerResponse = chatModel.chat(routerRequest);<br>List&lt;ToolExecutionRequest&gt; toolCalls = routerResponse.aiMessage().toolExecutionRequests();<br>if (toolCalls == null || toolCalls.size() != 1) {<br>    route = ROUTE_ESCALATE_SUPPORT;<br>    answer = ESCALATION_FALLBACK_ANSWER;<br>    routingFailed = true;<br>} else {<br>    route = toolCalls.get(0).name();<br>    answer = switch (route) {<br>        case ROUTE_STATUS_INQUIRY -&gt; handleStatusInquiry(orderNumber, toolCall);<br>        case ROUTE_GOODWILL_GESTURE -&gt; handleGoodwillGesture(orderNumber, toolCall);<br>        case ROUTE_ESCALATE_SUPPORT -&gt; handleEscalateToSupport(orderNumber, toolCall);<br>        default -&gt; ESCALATION_FALLBACK_ANSWER;<br>    };<br>}</pre><p>Each of the three routes returns a fixed Java template: route_status_inquiry a plain tracking lookup with no model involvement in the text, propose_goodwill_gesture a pending_review proposal with a fixed voucher amount that never takes effect without human sign-off, escalate_to_support always the same safe catch-all answer. The only thing taken from the model is the choice of route — a binary fact checkable in code, not an interpretation of model text.</p><p>That doesn’t make the model redundant. Classifying an unstructured customer note into one of three categories remains a classification task with no practical rule-based substitute — an LLM is still the only way to do anything meaningful with real free-text input at all. What changed is only how far the model is still allowed a say beyond that one decision.</p><h3>Why Three Routes Solve the Rubber-Stamp Problem</h3><p>This exact construction solves the problem from above, without needing a single one of the original anomaly signals. The needs_review logic falls directly out of the chosen route:</p><pre>boolean routeAlwaysNeedsReview = !ROUTE_STATUS_INQUIRY.equals(route);<br>boolean needsReview = routeAlwaysNeedsReview || possibleMisroute || routingFailed<br>        || outputGuardResult.blocked() || userFlagged;</pre><p>The plain status lookup needs no review by default — that’s the harmless normal case that doesn’t cause reviewer fatigue at two hundred requests a day. Each of the other two routes ALWAYS needs review, and not as an after-the-fact confirmation of an action already taken, but as a precondition for anything to happen at all: the voucher proposal is pending_review as long as no human has signed off; the escalation is an unresolved case from the start. There&#39;s nothing to rubber-stamp, because nothing has been decided yet — the reviewer makes the actual decision instead of confirming one that&#39;s already been made. That&#39;s the difference between escalation and rubber-stamping, enforced technically rather than just hoped for.</p><p>The status lookup still isn’t blindly dependent on the model’s own judgment: possible_misroute checks the raw customer note against a list of compensation signals, independent of the model&#39;s decision. If the model chose route_status_inquiry even though the note points to a compensation case, the trace still lands in the review queue — a second signal, independent of the model, for exactly the one path that doesn&#39;t force review by default.</p><h3>What Became of the Old Signals</h3><p>Five of the original six signals aren’t just redundant, they’re structurally moot: a tool-sequence anomaly can no longer occur, because there’s no sequence left — the router makes exactly one decision per request. Uncertainty and status-keyword detection drop out because they analyzed model free text that no longer exists in the customer answer — for the same reason the judge call drops out too (judge_low_confidence/judge_failed): without a model-formulated free-text answer, there&#39;s nothing left whose confidence a second model call could even score. The fallback after too many tool steps drops out because there&#39;s no loop left that could exhaust a step counter — its successor, routing_failed, covers a categorically rarer case: an API or transport error, not a missing model decision. What&#39;s left are the end-user self-flag and an output guard that&#39;s still wired onto the final answer unchanged, but whose role has shifted: since none of the three routes still produces free text, a hit is no longer a normal operating case but a regression alarm.</p><h3>What You’ll See in Jaeger</h3><p>Every call to /order-status produces one chat span — the routing decision — followed by exactly one route_* span, depending on which of the three routes the model chose. The root span carries the full human_oversight.* attribute set: route_chosen, possible_misroute, routing_failed, output_guard_triggered, output_guard_matched_pattern, user_flagged, user_comment, needs_review, plus pii_guard.tokens_substituted from the PII layer, which already kicks in before the model call.</p><p>A later intervention attaches to the very same trace it reviews via POST /lc4j/human-intervention — through SpanContext.createFromRemoteParent using the trace/span ID the reviewer copies from Jaeger or the review-queue file. The reviewer name is SHA-256 hashed before being written; there&#39;s no separate audit log that would need reconciling against the trace.</p><h3>What You’ll See in Prometheus &amp; Alertmanager</h3><p>Five alerts in the human-oversight group, all fed from the spanmetrics connector:</p><ul><li>PossibleMisrouteDetected — possible_misroute=true, warning, no delay</li><li>RoutingFailed — routing_failed=true, warning, no delay</li><li>OutputGuardTriggered — output_guard_triggered=true, critical, no delay</li><li>GoodwillGestureRouted — route_chosen=&quot;propose_goodwill_gesture&quot;, warning, no delay</li><li>HumanReviewQueueGrowing — sustained inflow of needs_review=true over 30 minutes, warning</li></ul><p>The first four fire with no for: delay, because each individual occurrence is already the relevant event itself, not a pattern that first needs confirming over a time window. HumanReviewQueueGrowing, by contrast, only measures a sustained inflow, not a provably growing queue depth — there&#39;s no second counter for completed reviews to net it against. Alertmanager routes severity: critical and domain: human-oversight into faster-grouped sub-routes; locally, everything still lands in the same logging-only receiver — but the routing itself already shows how a real production rollout would separate a compliance signal from a general ops channel.</p><h3>My Takeaway</h3><p>The architectural rule meant to prevent the Air Canada and Chevy cases — a binding value or text must never come directly from the model — solved something as a side effect that it wasn’t built for: it changes WHAT reaches a human in the first place, instead of just logging THAT they looked at it. Automation bias doesn’t become a solved problem in human behavior because of this — that remains training and process work, not an observability topic. But the architecture makes sure a reviewer no longer dismisses the same harmless alert two hundred times a day, and instead only ever gets shown real, not-yet-executed decisions. That’s not a second guardrail bolted on top — it’s the same rule, just thought through consistently to its end.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of software development experience. He’s currently deep into AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd528b677884" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Six Signals, No Brake: Human Oversight Under EU AI Act Art.]]></title>
            <link>https://medium.com/@mseemann.io/six-signals-no-brake-human-oversight-under-eu-ai-act-art-06fb82f14566?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/06fb82f14566</guid>
            <category><![CDATA[human-oversight]]></category>
            <category><![CDATA[ai-observability]]></category>
            <category><![CDATA[eu-ai-act]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[langchain4j]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 06:31:01 GMT</pubDate>
            <atom:updated>2026-06-29T06:31:01.041Z</atom:updated>
            <content:encoded><![CDATA[<h3>Six Signals, No Brake: Human Oversight Under EU AI Act Art. 14, Without Making the Chatbot Any Safer</h3><p><em>Tool-sequence anomaly, uncertainty markers, missing status words, fallback, user flag, judge confidence — six signals, five of them deterministic, cleanly logged. And the answer the customer actually reads stays completely untouched by any of it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbF994gd7uxEeh4FTQy1aQ.png" /></figure><p>The previous article turned the REST endpoint /lc4j/order-status into a real tool chain and showed what it costs: every step now shows up as its own span in Jaeger, every chat call has a price in Langfuse. After every run, you can reconstruct exactly what happened — and what it cost.</p><p>But that only answers a backward-looking question. The trace and the cost figure say what happened, after it happened. They say nothing about whether the chatbot is doing what it’s supposed to do right now: whether it’s deviating from the one tool order that makes sense, whether it’s starting to state uncertainty as fact, or simply talking nonsense. That’s exactly what Art. 14 EU AI Act requires for high-risk AI systems: responsible persons must be technically enabled to detect anomalies and intervene in individual cases — a capability <em>while</em> the system runs, not a report <em>after</em> it has run.</p><p>This article implements exactly that capability on the /lc4j/order-status endpoint, in the order the questions actually come up: first, WHICH categories of anomaly are even relevant here, then HOW you turn the available data into a signal.</p><p><em>I’m Michael Seemann, a senior full-stack developer. This article series shows how AI observability and EU AI Act compliance for enterprise Java stacks can be implemented systematically.</em></p><p><strong>Code to follow along:</strong> The full example is on GitHub: <a href="https://github.com/mseemann/otel-langchain4j-oversight-alerts">otel-langchain4j-oversight-alerts</a>. To run it yourself you’ll need Java 21, Maven, Docker Compose, and an <a href="https://console.anthropic.com/">Anthropic API key</a> — the demo calls the real Claude Haiku model, a test run costs a few cents.</p><h3>Four categories before the first code block</h3><p>Before deciding HOW to detect an anomaly, it’s worth asking WHAT should even count as one. There are clearly more candidate categories than fit into a single article — technical quality, content quality, compliance adherence, and depending on the concrete requirements, probably a few more. For /lc4j/order-status we pick out four of them and look at each more closely:</p><ul><li><strong>Workflow correctness:</strong> Did the system follow the one sequence of steps that actually makes sense here — lookup_order first, then get_tracking_status — or did it deviate?</li><li><strong>Answer quality:</strong> Does the finished answer sound uncertain? Is it missing something a complete answer should actually contain?</li><li><strong>A reached system limit:</strong> Did the tool loop hit its own ceiling without ever producing a final answer?</li><li><strong>A human self-report:</strong> Does the end user themselves say, independent of any automatic signal, “this is wrong”?</li></ul><p>Each of these four categories needs different raw data and a different detection mechanism — which is why the result is six separate signals, not one big “is everything okay?” check. The following four sections work through the list in exactly this order: for each category, which signal we use for it and how we get at its value.</p><h3>Workflow correctness: a list comparison</h3><p>This category is mechanically unambiguous: there’s exactly one tool order for /lc4j/order-status that makes sense — get_tracking_status needs the tracking ID that only lookup_order produces. So the signal simply compares the sequence actually executed against that one expected sequence:</p><pre>private static final List&lt;String&gt; CANONICAL_TOOL_SEQUENCE =<br>        List.of(&quot;lookup_order&quot;, &quot;get_tracking_status&quot;);<br>boolean sequenceAnomaly = !executedToolSequence.equals(CANONICAL_TOOL_SEQUENCE);</pre><p>tool_sequence_anomaly is true the moment the model deviates from this order — skipping a step, swapping it, or repeating it. No model call, no heuristic, no trade-off to discuss.</p><h3>Answer quality: three approaches, two of them in use</h3><p>This is where it gets interesting, because answering “does this sound uncertain, is something missing” from pure model free text can be done in more than one way — and in this repo, two of the three approaches actually run in parallel, not just one.</p><p><strong>Fixed matching / word lists.</strong> A list of hedging phrases (“presumably”, “could not determine”), a list of expected status terms (“on its way”, “delivered”, “distribution center”), each checked with a substring search. No model call, no training, every match traceable directly in the code.</p><p><strong>An ML classifier</strong>, trained on past, already-labeled answers. Not built in this project — that would first require enough labeled training data, which a fresh demo project naturally doesn’t have. For a system with real production history, this would be a serious fourth approach.</p><p><strong>A second model call acting as judge (LLM-as-judge).</strong> A second chatModel call scores the finished answer on a scale from 0 to 100:</p><pre>private int judgeConfidence(String orderNumber, String finalAnswer) {<br>    ChatRequest judgeRequest = ChatRequest.builder()<br>            .messages(List.of(<br>                    SystemMessage.from(<br>                            &quot;Rate the quality of an automatically generated answer on a scale &quot;<br>                            + &quot;from 0 (very uncertain/likely wrong) to 100 (very &quot;<br>                            + &quot;confident/correct). Reply with ONLY the number.&quot;),<br>                    UserMessage.from(<br>                            &quot;Order number: &quot; + orderNumber + &quot;\n&quot;<br>                            + &quot;Generated answer: &quot; + finalAnswer + &quot;\n\n&quot;<br>                            + &quot;How confident are you that this answer is correct and &quot;<br>                            + &quot;complete? Reply with only the number 0-100.&quot;)))<br>            .build();<br>    String raw = chatModel.chat(judgeRequest).aiMessage().text();<br>    return parseScoreOrThrow(raw);<br>}<br><br>private static int parseScoreOrThrow(String raw) {<br>    Matcher matcher = SCORE_PATTERN.matcher(raw);<br>    if (!matcher.find()) {<br>        throw new IllegalStateException(&quot;Judge did not return a parseable number: &quot; + raw);<br>    }<br>    return Math.max(0, Math.min(100, Integer.parseInt(matcher.group())));<br>}</pre><p>The interesting part isn’t the judge call itself, but what happens when it fails:</p><pre>private static final int CONFIDENCE_REVIEW_THRESHOLD = 70;   // deliberately conservative, not empirically derived<br>boolean judgeFailed = false;<br>boolean lowConfidence = false;<br>int confidenceScore = -1;<br>if (!fallbackTriggered) {<br>    try {<br>        confidenceScore = judgeConfidence(orderNumber, finalAnswer);<br>        lowConfidence = confidenceScore &lt; CONFIDENCE_REVIEW_THRESHOLD;<br>    } catch (Exception e) {<br>        judgeFailed = true;   // fail-open for the customer answer, fail-closed for the review flag<br>    }<br>}</pre><p>If the judge call itself fails, that changes nothing about the answer path already taken — the customer’s answer stays untouched (fail-open) — but the trace still gets conservatively flagged for review (fail-closed for the flag itself). The logic behind it: a trace reviewed unnecessarily is cheaper than one that gets missed. On the fallback path, the judge never even runs: a fixed fallback answer like “Could not determine the delivery status” has no “confidence” to score.</p><p>The judge approach has a real advantage: it correctly recognizes an answer that talks about a “sorting facility” instead of a “distribution center” as complete — a word list would flag it incorrectly. The downside shows up elsewhere: a model scoring its own answer is itself non-deterministic and non-reproducible — two runs with identical input can produce different scores. Chat completions also don’t expose a native confidence or logprob signal; the score is an estimate, not a measurement. And every judge call is a full, separately billed model call — the previous article in this series showed exactly what that costs.</p><p>These downsides don’t cancel out the word lists’ advantages — they sit on a different dimension. That’s why the judge stays in this repo, but as an additional, sixth signal alongside the two word lists, not as their replacement: anyone who only wants the cheap, deterministic check can ignore judge_low_confidence/judge_failed. Anyone who wants the more expensive, semantically deeper check as well has it right next to it.</p><p>For this category, two approaches therefore run in parallel — the fixed word lists for the first two signals:</p><pre>private static final List&lt;String&gt; UNCERTAINTY_MARKERS = List.of(<br>        &quot;not sure&quot;, &quot;uncertain&quot;, &quot;presumably&quot;, &quot;possibly&quot;, &quot;perhaps&quot;,<br>        &quot;probably&quot;, &quot;could not&quot;, &quot;cannot determine&quot;, &quot;no information&quot;,<br>        &quot;unfortunately&quot;, &quot;unclear&quot;, &quot;don&#39;t know&quot;, &quot;hard to say&quot;);<br>private static final List&lt;String&gt; STATUS_KEYWORDS = List.of(<br>        &quot;on its way&quot;, &quot;delivered&quot;, &quot;in_transit&quot;, &quot;transit&quot;, &quot;distribution center&quot;,<br>        &quot;shipped&quot;, &quot;delivery&quot;, &quot;shipment&quot;, &quot;tracking&quot;);<br>boolean uncertaintyDetected = containsAny(finalAnswer, UNCERTAINTY_MARKERS);<br>boolean statusKeywordMissing = !containsAny(finalAnswer, STATUS_KEYWORDS);</pre><p>uncertainty_detected and status_keyword_missing are pure substring search, no NLP, with a deliberate trade-off: an answer that talks about a &quot;sorting facility&quot; instead of a &quot;distribution center&quot; gets incorrectly flagged as incomplete — a false positive. That&#39;s accepted, because for Human Oversight a missed real problem (a false negative) is the much more expensive failure mode.</p><h3>Hitting a system limit: a counter in the tool loop</h3><p>fallback_triggered doesn&#39;t come from text analysis at all, but directly from the call site: the tool loop in orderStatus() counts its own iterations and explicitly passes true once MAX_TOOL_STEPS is reached, before the model ever produces a final answer.</p><pre>private static final int MAX_TOOL_STEPS = 4;<br>for (int step = 0; step &lt; MAX_TOOL_STEPS; step++) {<br>    // ... chat call, tool execution ...<br>    if (response.finishReason() != FinishReason.TOOL_EXECUTION) {<br>        String finalAnswer = response.aiMessage().text();<br>        tagHumanOversightSignals(orderNumber, executedToolSequence, finalAnswer, false, flagForReview, userComment);<br>        return finalAnswer;<br>    }<br>}<br>String fallbackAnswer = &quot;Could not determine the delivery status (too many tool calls).&quot;;<br>tagHumanOversightSignals(orderNumber, executedToolSequence, fallbackAnswer, true, flagForReview, userComment);<br>return fallbackAnswer;</pre><p>The true in the final call to tagHumanOversightSignals(...) is the signal itself: at this point in the code, the loop knows for certain that MAX_TOOL_STEPS was exceeded — deriving that after the fact from the tool sequence would be unnecessary here.</p><h3>A human self-report: a request parameter</h3><p>user_flagged comes from the customer themselves, via the flagForReview request parameter — independent of all five other signals, because a customer notices things (&quot;this is definitely the wrong order&quot;) that a text heuristic can&#39;t detect, and vice versa.</p><pre>@GetMapping(&quot;/order-status&quot;)<br>public String orderStatus(<br>        @RequestParam(defaultValue = &quot;ORD-4711&quot;) String orderNumber,<br>        @RequestParam(defaultValue = &quot;false&quot;) boolean flagForReview,<br>        @RequestParam(defaultValue = &quot;&quot;) String userComment) {<br>    // ...<br>}</pre><p>Not a detection mechanism in the strict sense: the signal is already in the request before any analysis even starts.</p><h3>All six together: needsReview</h3><pre>boolean needsReview = sequenceAnomaly || uncertaintyDetected || statusKeywordMissing<br>        || fallbackTriggered || userFlagged || lowConfidence || judgeFailed;</pre><p>needsReview is the OR of all six. Any single one is enough, and each is explainable on its own — no reviewer has to guess why a trace got flagged.</p><h3>What stands between the model and the customer: nothing</h3><p>The six signals reliably answer the question “is something off about this trace?” They don’t answer the question “is the answer that’s currently reaching the customer okay?” — the two questions sound similar but are something different. A needsReview=true flag only gets evaluated minutes or hours later, in the review queue or as a Prometheus alert. By then, the answer itself has long since reached the customer — return finalAnswer; happens <em>before</em> anyone reads the flag. Observability here is entirely downstream, not upstream.</p><h3>What you’ll see in Jaeger</h3><p>After docker compose up -d and mvn spring-boot:run:</p><pre>curl &quot;http://localhost:8080/lc4j/order-status?orderNumber=ORD-4711&quot;</pre><p>In the Jaeger UI (<a href="http://localhost:16686/">http://localhost:16686</a>), service otel-langchain4j-demo, &quot;Find Traces&quot;: the familiar chat and execute_tool spans from the previous article — on the success path now with one additional chat span for the judge call — plus the full human_oversight.* set on the root span: tool_sequence_actual, tool_sequence_anomaly, uncertainty_detected, status_keyword_missing, fallback_triggered, user_flagged, user_comment, judge_confidence_score, judge_low_confidence, judge_failed, needs_review. A call with flagForReview=true sets user_flagged deterministically; the other five signals depend on what the model actually does and writes in this specific run — and for the judge, additionally on what a second model call makes of that answer. None of that can be forced through a request parameter, only observed.</p><h3>What you’ll see in Prometheus &amp; Alertmanager</h3><p>Jaeger displays every trace reliably — but only if someone actively looks, opening the specific trace that’s worth a second look. For Art. 14, that alone isn’t enough: the regulation requires that a responsible person actually gets notified, not just that they theoretically could go searching themselves. That’s why every human_oversight.* attribute additionally flows through the OpenTelemetry spanmetrics connector into a Prometheus metric. Fed from that, two alerts run in the human-oversight group:</p><ul><li>UnexpectedToolSequenceDetected — tool_sequence_anomaly=true, warning, no delay</li><li>HumanReviewQueueGrowing — sustained inflow of needs_review=true over 30 minutes, warning</li></ul><p>UnexpectedToolSequenceDetected fires with no for: delay, because a deviating tool order is already the relevant event by itself — nothing that needs confirming over a time window first. HumanReviewQueueGrowing, by contrast, only measures a sustained inflow, not a provably growing queue depth: there&#39;s no second counter for completed reviews to net the inflow against. Both alerts say something about the <em>frequency</em> of anomalies — neither says anything about the <em>quality</em> of the individual answer the customer is reading right now.</p><h3>My Takeaway</h3><p>Each of the six signals now covers one of the four categories from above, every reviewer sees immediately which one fired, and both alerts fire reliably the moment any signal applies. That’s solid observability work, and it isn’t worthless.</p><p>But this is exactly where the limit shows up: UNCERTAINTY_MARKERS and STATUS_KEYWORDS are two finite lists. The space of possible model answers isn&#39;t. Any phrasing that doesn&#39;t match a known hedging phrase and still doesn&#39;t name an expected status word slips through — and that&#39;s not just a word-list problem. A judge LLM, too, only evaluates against the finite number of cases it was prompted or trained on, set against a fundamentally unbounded space of possible outputs. Observability, in any of the three variants shown above, can at best sample that space — never cover it completely.</p><p>Anyone who actually wants to bound the blast radius of a single model answer — not just look more often, but prevent a certain class of answer from ever being produced in the first place — runs into a point where pure observability stops and only the architecture itself can take over. That’s not a theoretical problem: in 2024, Air Canada actually had to honor a refund policy its own chatbot had simply invented, and a Chevrolet dealership in Watsonville got prompt-injected into a “legally binding” one-dollar offer. That’s exactly the gap the next article closes — not with another signal, but with a router that blocks a free-text answer from ever reaching the customer in the first place.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of software development experience. He’s currently deep into AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06fb82f14566" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What a Tool Call Really Costs: Rebuilding AI Observability Locally with Spring Boot, LangChain4j…]]></title>
            <link>https://medium.com/@mseemann.io/what-a-tool-call-really-costs-rebuilding-ai-observability-locally-with-spring-boot-langchain4j-6ca0bb6f4044?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ca0bb6f4044</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[langfuse]]></category>
            <category><![CDATA[llm-cost-tracking]]></category>
            <category><![CDATA[langchain4j]]></category>
            <category><![CDATA[ai-observability]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 14:31:47 GMT</pubDate>
            <atom:updated>2026-06-26T14:31:47.964Z</atom:updated>
            <content:encoded><![CDATA[<h3>What a Tool Call Really Costs: Rebuilding AI Observability Locally with Spring Boot, LangChain4j, and Langfuse</h3><p><em>Four building blocks, one Docker Compose — and a price for every tool call</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXJF5QIAfupTusH_qrcpww.png" /></figure><p>The last two articles dealt with a single tool call: the model checks whether it needs the weather tool, calls it once, answers. Manually instrumented in Spring Boot, automatically in Quarkus — but in both cases just one tool, one call, one decision. Most real agent workflows look different: one tool’s result decides whether and which tool is needed next. With a shipping-status lookup, for example, you don’t know the tracking ID until you’ve already looked up the order — the second tool call can’t be planned in advance.</p><p>This article takes the Spring Boot variant from article five and builds exactly that in: a tool <em>chain</em> instead of a single tool call. And because every additional tool call also means an additional, separately billed model call, a second question comes up this time that Jaeger simply can’t answer: what did this trace actually cost? That’s what Langfuse gets added to the stack for — fully local, reproducible, without a single cent going to a SaaS provider for pure observability infrastructure.</p><p>I’m Michael Seemann, a senior full-stack developer. This article series shows how AI observability and EU AI Act compliance for enterprise Java stacks can be implemented systematically.</p><p><strong>Code to follow along:</strong> The full example is on GitHub: <a href="https://github.com/mseemann/otel-langchain4j-toolchain-costs">otel-langchain4j-toolchain-costs</a>. To run it yourself you’ll need an <a href="https://console.anthropic.com/">Anthropic API key</a> — the demo calls the real Claude Haiku model, a test run costs a few cents. For the cost part you’ll also need a local <a href="https://langfuse.com/self-hosting">Langfuse</a> instance; the Jaeger part works fully without it.</p><h3>Why two tool calls are something different from one</h3><p>The /lc4j/order-status endpoint gets two tools: lookup_order (order number → tracking ID) and get_tracking_status (tracking ID → shipping status). The /agent endpoint from article five had a fixed three-step sequence: planning call, one tool, final call. That doesn&#39;t work here anymore, because get_tracking_status can only be called once lookup_order has already come back — the model can&#39;t plan this second step in advance, it can only execute it once the first tool call has come back.</p><p>The fix is a generic loop instead of the fixed sequence:</p><pre>for (int step = 0; step &lt; MAX_TOOL_STEPS; step++) {<br>    ChatResponse response = chatModel.chat(ChatRequest.builder()<br>            .messages(messages)<br>            .toolSpecifications(tools)<br>            .build());<br>    messages.add(response.aiMessage());<br>    if (response.finishReason() != FinishReason.TOOL_EXECUTION) {<br>        return response.aiMessage().text();<br>    }<br>    for (ToolExecutionRequest toolCall : response.aiMessage().toolExecutionRequests()) {<br>        messages.add(ToolExecutionResultMessage.from(toolCall, executeTool(toolCall)));<br>    }<br>}</pre><p>MAX_TOOL_STEPS only caps the loop as a safety net, in case the model gets stuck re-requesting tools. Everything else is the model&#39;s own decision: how many tool calls it needs and in what order. LangChain4j again only supplies the building blocks (ToolSpecification, ToolExecutionResultMessage) — the loop and the two tool spans (execute_tool lookup_order, execute_tool get_tracking_status) are, just like in article five, handwritten.</p><h3>The stack: four building blocks, one Docker Compose</h3><p>Four pieces work together here: the Spring Boot app, the OTel Collector, Jaeger for the operational view, Langfuse for cost and evaluation. The Spring Boot app, the collector, and Jaeger start together with one docker compose up -d in this repo. Langfuse deliberately does <em>not</em> run alongside them — the official self-host stack is six containers (web, worker, Postgres, ClickHouse, Redis, MinIO), and it makes more sense to keep that running across multiple demo projects than to rebuild it on every docker compose down. The collector reaches the separate Langfuse instance via host.docker.internal. The official compose file for it still lives in this repo, though, under langfuse/docker-compose.yml — start it separately with docker compose -f langfuse/docker-compose.yml up -d.</p><p>So that both backends get the same traces, but Langfuse still produces trustworthy numbers, the collector exports through two separate pipelines:</p><pre>traces:<br>  receivers: [otlp]<br>  processors: [batch]<br>  exporters: [otlp/jaeger, debug]<br>traces/langfuse:<br>  receivers: [otlp]<br>  processors: [batch]<br>  exporters: [otlphttp/langfuse]</pre><p>This is the first time in the series where the actual OTel advantage becomes visible: a trace, produced exactly once in the code, can be fanned out arbitrarily at the collector — fanout instead of hardwiring. From the Spring Boot app’s point of view, Jaeger and Langfuse don’t even exist; it just sends OTLP to localhost:4318 and its job is done. Whether that turns into one, two, or five backends is decided entirely by the collector configuration, without touching a single line of application code.</p><p>Neither pipeline has sampling in this repo — under production traffic that would change: as soon as you add a tail_sampling stage to the Jaeger pipeline to cut volume, the traces/langfuse pipeline has to stay untouched. Langfuse computes the price per trace from real token counts; sample that pipeline and you only see a fraction of what you&#39;re actually spending — which is exactly the point where this article&#39;s title cashes in.</p><h3>What you’ll see in Jaeger</h3><p>After docker compose up -d and mvn spring-boot:run:</p><pre>curl &quot;http://localhost:8080/lc4j/order-status?orderNumber=ORD-4711&quot;</pre><p>In the Jaeger UI (<a href="http://localhost:16686/">http://localhost:16686</a>), service otel-langchain4j-demo, &quot;Find Traces&quot;:</p><ul><li>chat — step 1: model requests lookup_order</li><li>execute_tool lookup_order — returns the tracking ID</li><li>chat — step 2: model requests get_tracking_status</li><li>execute_tool get_tracking_status — returns the shipping status</li><li>chat — step 3: final answer using both tool results</li></ul><p>Five spans, three of them billable model calls. Just like in article five, every chat span carries the GenAI attributes, including gen_ai.usage.input_tokens and gen_ai.usage.output_tokens — Jaeger just displays these numbers as attributes without doing anything with them. Those exact two numbers are what turns into a price in the next section.</p><h3>What you’ll see in Langfuse — and what it costs</h3><p>The same trace also lands in Langfuse via the second pipeline. There, the three chat spans don&#39;t show up as anonymous spans but as &quot;generations&quot; — each with its own input/output token count and a price computed from it, multiplied by Claude Haiku&#39;s listed price ($1 per million input tokens, $5 per million output tokens). The trace as a whole shows the sum across all three generations.</p><p>Here’s what a real test run looked like (numbers vary slightly from call to call, depending on prompt length and model response):</p><ul><li>Planning call: 697 input / 61 output tokens, 1.38s, $0.001002</li><li>Second call after lookup_order: 782 input / 75 output tokens, 1.48s, $0.001157</li><li>Final call after get_tracking_status: 904 input / 84 output tokens, 1.21s, $0.001324</li><li>Total: 2,383 input / 220 output tokens, 4.08s overall → $0.003483 for the whole trace</li></ul><p>For context: the first chat call alone — essentially a regular single-tool call like in the earlier articles — costs $0.001002. The full tool chain with two dependent calls comes to $0.003483, roughly 3.5x that. Not because the extra calls are individually more expensive, but because each additional step means another full model call with a growing context — the previous steps&#39; tool results ride along as context in every subsequent call. That&#39;s the number Jaeger doesn&#39;t show and isn&#39;t trying to — Jaeger has no concept of price, only latency and attributes. Only the combination of the GenAI token attributes and a pricing model turns that into a cost figure. And that figure is only trustworthy because the traces/langfuse pipeline stays unsampled (see above).</p><h3>My Takeaway</h3><p>The difference between a single tool call and a tool chain is small architecturally — a loop instead of a fixed sequence — but noticeable in cost, because every additional step is a full, separately billed model call. Without Langfuse, that stays invisible: Jaeger shows five spans and a few token counts as attributes, but no price. Only with a second, deliberately unsampled export path and a backend that turns the GenAI token attributes into real money does the architectural decision “one more tool call” become a concrete number on the bill — verifiable locally, without having to take a dashboard’s word for it.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of software development experience. He’s currently deep into AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ca0bb6f4044" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LangChain4j + OTel in Quarkus: Where the Missing Module Suddenly Exists]]></title>
            <link>https://medium.com/@mseemann.io/langchain4j-otel-in-quarkus-where-the-missing-module-suddenly-exists-b069a4de3473?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b069a4de3473</guid>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 06:11:00 GMT</pubDate>
            <atom:updated>2026-06-24T06:11:00.921Z</atom:updated>
            <content:encoded><![CDATA[<p>What’s left to write when an extension does most of the work for you</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQYHHgfiSFFj6Q0TqPizeg.png" /></figure><p>The previous article covered the downside of LangChain4j: no official OpenTelemetry module, everything rebuilt by hand via ChatModelListener — span lifecycle, GenAI attributes, the tool-call loop, all handwritten. The reason is a GitHub issue that&#39;s been open for over a year (<a href="https://github.com/langchain4j/langchain4j/issues/2331">langchain4j/langchain4j#2331</a>), still unresolved for Spring Boot.</p><p>That doesn’t hold for Quarkus. The quarkus-langchain4j-anthropic extension takes care of model configuration, tool registration, the entire tool-call loop — and the OpenTelemetry instrumentation along with it. This article walks through the same use case as the previous one — chat, system prompt, tool-calling agent — except here, almost all the code from that last article simply disappears.</p><p>I’m Michael Seemann, a senior full-stack developer. This article series shows how AI observability and EU AI Act compliance for enterprise Java stacks can be implemented systematically.</p><p><strong>Code to follow along:</strong> The full example is on GitHub: <a href="https://github.com/mseemann/otel-langchain4j-quarkus">otel-langchain4j-quarkus</a>. To run it yourself you’ll need an <a href="https://console.anthropic.com/">Anthropic API key</a> — the demo calls the real Claude Haiku model, a test run costs a few cents.</p><h3>The agent as an interface</h3><p>Where the Spring Boot variant needed a controller, a listener, and a config class, the entire “agent” in Quarkus is one interface:</p><pre>@RegisterAiService(tools = WeatherTools.class)<br>public interface WeatherAiService {<br>    String chat(String userMessage);<br>    <br>    @SystemMessage(&quot;You are a precise technical assistant. Answer in at most 2 sentences.&quot;)<br>    String chatWithSystem(String userMessage);<br>    <br>    @UserMessage(&quot;What&#39;s the weather in {city}? Use the weather tool for current data.&quot;)<br>    String getWeatherForCity(String city);<br>}</pre><p>@RegisterAiService has the extension generate a complete implementation at build time: it wires the Anthropic chat model, registers the WeatherTools class, derives the JSON schema for the tool parameters from the method signature, and builds the entire tool-call loop. None of that is visible in the source — and none of it has to be written by hand.</p><h3>Tools as annotated methods</h3><p>The tool implementation itself looks like ordinary Java code:</p><pre>@ApplicationScoped<br>public class WeatherTools {<br>    @Tool(&quot;Looks up the current weather for a city&quot;)<br>    public String getCurrentWeather(@P(&quot;The name of the city&quot;) String city) {<br>        return String.format(<br>                &quot;{\&quot;city\&quot;:\&quot;%s\&quot;,\&quot;temp_celsius\&quot;:18,\&quot;condition\&quot;:\&quot;partly cloudy\&quot;}&quot;, city);<br>    }<br>}</pre><p>The extension derives the JSON schema sent to the model on its own — including required-field markers and the parameter description from the @P annotation. In the Spring Boot variant, that schema had to be built by hand as a JsonObjectSchema. Here, a method signature is enough.</p><h3>The controller: three one-liners</h3><pre>@Path(&quot;/lc4j&quot;)<br>public class ChatResource {<br>    @Inject<br>    WeatherAiService aiService;<br>    <br>    @GET<br>    @Path(&quot;/chat&quot;)<br>    public String chat(@QueryParam(&quot;prompt&quot;) @DefaultValue(&quot;...&quot;) String prompt) {<br>        return aiService.chat(prompt);<br>    }<br>    <br>    @GET<br>    @Path(&quot;/agent&quot;)<br>    public String agent(@QueryParam(&quot;city&quot;) @DefaultValue(&quot;Berlin&quot;) String city) {<br>        return aiService.getWeatherForCity(city);<br>    }<br>}</pre><p>No tracer, no manually built span, no three-step planning-execute-final loop. The extension handles the model call, tool detection, tool execution, and assembling the final answer — including the corresponding OTel spans following <a href="https://github.com/open-telemetry/semantic-conventions-genai">GenAI Semantic Conventions</a>, fully automatically.</p><h3>What actually still has to be written</h3><p>There’s one thing the extension deliberately leaves out: prompt and response content as span events. That’s not an oversight, it’s by design — content capture can contain sensitive data and shouldn’t land in every trace unasked. A lightweight listener covers it:</p><pre>@ApplicationScoped<br>public class ContentCaptureListener implements ChatModelListener {<br>    @Override<br>    public void onRequest(ChatModelRequestContext ctx) {<br>        Span span = Span.current();<br>        if (!span.isRecording()) return;<br>        for (ChatMessage msg : ctx.chatRequest().messages()) {<br>            // determine event name per role, extract content, attach as span event<br>        }<br>    }<br>}</pre><p>The key difference from the Spring Boot variant: there’s no scope-timing problem here at all. By the time onRequest() fires, the LLM span has already been created by the extension and set as &quot;current&quot; — Span.current() simply returns the right span. No attributes() map, no manual makeCurrent(), no scope to close. This class does exactly one job: attach content. Everything else — span creation, GenAI attributes, lifecycle — is already handled by the extension.</p><h3>What you’ll see in Jaeger</h3><p>After docker compose up -d and mvn quarkus:dev, a single call is enough to produce the first trace:</p><pre>curl &quot;http://localhost:8080/lc4j/chat?prompt=What+is+OpenTelemetry&quot;</pre><p>And for the agent endpoint with a tool call:</p><pre>curl &quot;http://localhost:8080/lc4j/agent?city=Berlin&quot;</pre><p>Then open the Jaeger UI (<a href="http://localhost:16686/">http://localhost:16686</a>), pick the otel-langchain4j-demo service, and click &quot;Find Traces&quot;:</p><ul><li>/lc4j/chat automatically produces a span chat claude-haiku-4-5-20251001 — with zero instrumentation code of your own</li><li>/lc4j/agent a span chain of planning call → execute_tool getCurrentWeather → final call, also created automatically</li><li>Adding @WithSpan on the tool method optionally creates a nested span for the tool execution itself — not required for the GenAI-compliant baseline trace</li><li>Prompt and response content show up as events because ContentCaptureListener adds them</li></ul><h3>My Takeaway</h3><p>The difference between these two articles isn’t a difference in concepts — GenAI Semantic Conventions, span lifecycle, and the tool-call loop are identical across both frameworks. The difference is who does that work. In Spring Boot, the developer, by hand, every time. In Quarkus, the extension, once, for every user of the library. Having read both articles doesn’t leave you with “Spring Boot is worse” — it leaves you with a concrete basis for deciding, for your own project, whether the implementation effort of one path justifies switching to the other.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of software development experience. He’s currently deep into AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b069a4de3473" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LangChain4j + OTel in Spring Boot: The Missing Module]]></title>
            <link>https://medium.com/@mseemann.io/langchain4j-otel-in-spring-boot-the-missing-module-b41d6871b974?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b41d6871b974</guid>
            <category><![CDATA[langchain4j]]></category>
            <category><![CDATA[ai-observability]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 06:11:00 GMT</pubDate>
            <atom:updated>2026-06-23T06:11:00.843Z</atom:updated>
            <content:encoded><![CDATA[<p>How to build GenAI-compliant traces for a library that doesn’t ship any</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2-TKkGgOlez659mOgZAGQ.png" /></figure><p>LangChain4j is to Java what LangChain is to Python: the standard library for orchestrating LLM calls, prompts, and tool calls. What’s missing is an official OpenTelemetry module. If you’re on Spring Boot, you currently get zero traces for your LLM calls out of the box — the gap is documented as an open GitHub issue (<a href="https://github.com/langchain4j/langchain4j/issues/2331">langchain4j/langchain4j#2331</a>) and has been unanswered for over a year.</p><p>The previous article in this series covered the basics of OpenTelemetry in Java — automatic spans via servlet-filter instrumentation, manual spans for custom logic, error spans for postmortem analysis. This article builds on that and shows what it costs to get the same cleanliness for a library with no official instrumentation.</p><p>I’m Michael Seemann, a senior full-stack developer. This article series shows how AI observability and EU AI Act compliance for enterprise Java stacks can be implemented systematically.</p><p><strong>Code to follow along:</strong> The full example is on GitHub: <a href="https://github.com/mseemann/otel-langchain4j-springboot">otel-langchain4j-springboot</a>. To run it yourself you’ll need an <a href="https://console.anthropic.com/">Anthropic API key</a> — the demo calls the real Claude Haiku model, a test run costs a few cents.</p><h3>The problem: one extension point, nothing else</h3><p>LangChain4j offers exactly one place to hook into the lifecycle of an LLM call: ChatModelListener, with three callbacks — onRequest, onResponse, onError. No span, no attribute, no event gets created automatically. Everything you&#39;d expect from decent LLM instrumentation has to be built by hand:</p><ul><li>Span creation on request, span termination on response or error</li><li>GenAI Semantic Conventions attributes (gen_ai.system, gen_ai.operation.name, gen_ai.request.model, token usage, finish reason)</li><li>Prompt and response content as span events</li><li>For tool calls: the entire planning-execute-final loop, including its own span for the tool call</li></ul><p>The result is LangChain4jOtelListener — a class just under 150 lines whose sole purpose is rebuilding what an official instrumentation would give you for free.</p><h3>Managing span and scope across two callbacks</h3><p>The biggest gotcha: onRequest() and onResponse() (or onError()) are separate method calls. The span created on request has to stay alive until the response arrives — and stay visible as &quot;current&quot; so that any nested span (say, a tool call) attaches to it correctly.</p><p>The fix: ChatModelRequestContext and ChatModelResponseContext share an attributes() map. That&#39;s exactly what it&#39;s for — a key-value store that survives across the whole request lifecycle:</p><pre>private static final String SPAN_KEY  = &quot;otel.span&quot;;<br>private static final String SCOPE_KEY = &quot;otel.scope&quot;;<br><br>@Override<br>public void onRequest(ChatModelRequestContext requestContext) {<br>    Span span = tracer.spanBuilder(&quot;chat &quot; + model)<br>            .setAttribute(GEN_AI_SYSTEM,        &quot;anthropic&quot;)<br>            .setAttribute(GEN_AI_OPERATION,     &quot;chat&quot;)<br>            .setAttribute(GEN_AI_REQUEST_MODEL, model)<br>            .startSpan();<br>    Scope scope = span.makeCurrent();<br>    requestContext.attributes().put(SPAN_KEY,  span);<br>    requestContext.attributes().put(SCOPE_KEY, scope);<br>    // ...<br>}</pre><p>What matters here isn’t just <em>that</em> you set attributes, but <em>which</em> ones. gen_ai.system, gen_ai.operation.name, and gen_ai.request.model aren&#39;t names someone made up — they&#39;re part of OpenTelemetry&#39;s <a href="https://github.com/open-telemetry/semantic-conventions-genai">GenAI Semantic Conventions</a>, a vendor-neutral vocabulary built specifically for LLM spans. The payoff: any backend that understands the convention (Jaeger extensions, Langfuse, Datadog APM, Honeycomb) recognizes the span as an LLM call right away and can act on it — aggregating token cost, filtering by model, building per-provider latency dashboards. Invent your own attribute names instead, and the traces stay technically correct but unreadable to any tool outside your own code.</p><p>onResponse() retrieves the span and scope from that same map, adds the response attributes, closes the scope, and ends the span. onError() does the same but marks the span as failed. Forget to close the scope and the trace context stays &quot;current&quot; on that thread — a subtle bug that only shows up once the next request on the same thread mysteriously lands in the wrong trace.</p><h3>Prompt and response content as events</h3><p>GenAI Semantic Conventions specify that prompt and response content should travel as span events, not attributes — for good reason: attributes hit length limits in many backends, events don’t. One event per message type:</p><pre>request.messages().forEach(message -&gt; {<br>    String role = message.type().name().toLowerCase();<br>    String text = extractText(message);<br>    if (text != null) {<br>        span.addEvent(&quot;gen_ai.&quot; + role + &quot;.message&quot;,<br>                Attributes.of(CONTENT_KEY, text));<br>    }<br>});</pre><p>extractText() has to distinguish between UserMessage, SystemMessage, and AiMessage itself — LangChain4j doesn&#39;t provide a uniform &quot;give me the text&quot; on the ChatMessage interface.</p><h3>The agent endpoint: three steps, all manual</h3><p>This is where tool calling gets interesting. LangChain4j gives you the building blocks — ToolSpecification, ToolExecutionResultMessage — but not the loop itself. An agent that can use a weather tool needs three explicit steps in Spring Boot:</p><ul><li><strong>Planning call:</strong> the model receives the tool spec and decides whether (and which) tool it needs. If it responds with FinishReason.TOOL_EXECUTION, it wants a tool call.</li><li><strong>Tool execution:</strong> the demo simulates a weather lookup here — with its own, manually created span execute_tool get_current_weather, carrying the GenAI tool attributes (gen_ai.tool.name, gen_ai.tool.call.id) plus a tool.input.city/tool.output pair for traceability.</li><li><strong>Final call:</strong> the model gets back the original request, its own planning response, and the tool result, and formulates the answer from that.</li></ul><pre>ChatResponse planningResponse = chatModel.chat(planningRequest);<br>if (planningResponse.finishReason() != FinishReason.TOOL_EXECUTION) {<br>    return planningResponse.aiMessage().text();<br>}<br>var toolCall = planningResponse.aiMessage().toolExecutionRequests().get(0);<br>String toolResult = executeWeatherTool(city, toolCall.id());<br>ChatRequest finalRequest = ChatRequest.builder()<br>        .messages(List.of(<br>                UserMessage.from(prompt),<br>                planningResponse.aiMessage(),<br>                ToolExecutionResultMessage.from(toolCall, toolResult)<br>        ))<br>        .build();<br>return chatModel.chat(finalRequest).aiMessage().text();</pre><p>The result in Jaeger is a three-part trace — two chat spans (created by the listener) with an execute_tool span in between (created manually). Correct, complete, GenAI-compliant. But every single line of it is handwritten.</p><h3>What you’ll see in Jaeger</h3><p>After docker compose up -d and mvn spring-boot:run, a single call is enough to produce the first trace:</p><pre>curl &quot;http://localhost:8080/lc4j/chat?prompt=What+is+OpenTelemetry&quot;</pre><p>And for the agent endpoint with a tool call:</p><pre>curl &quot;http://localhost:8080/lc4j/agent?city=Berlin&quot;</pre><p>Then open the Jaeger UI (<a href="http://localhost:16686/">http://localhost:16686</a>), pick the otel-langchain4j-demo service, and click &quot;Find Traces&quot;:</p><ul><li>/lc4j/chat produces one span chat claude-haiku-4-5-20251001 with prompt and response events</li><li>/lc4j/chat/system the same span, plus a gen_ai.system.message event</li><li>/lc4j/agent a span chain of planning call → tool call → final call, all correctly nested</li><li>Every span carries the full GenAI attributes — because the listener sets them explicitly, not because they show up “automatically”</li></ul><h3>My Takeaway</h3><p>This isn’t a design flaw in LangChain4j — ChatModelListener is exactly what the library promises: a hook, not a ready-made observability package. If you&#39;re on Spring Boot, you pay for that gap in implementation effort. Once built, LangChain4jOtelListener is reusable across any project — but it has to be built first.</p><p>The next article looks at the same task in Quarkus. Spoiler: there, the missing module actually exists — as an official extension. What that means for the code (and what still has to be written by hand even then) is just as revealing as what was handwritten here.</p><p><strong>About the author:</strong> Michael Seemann is a senior full-stack developer and frontend architect with 25 years of software development experience. He’s currently deep into AI observability and EU AI Act compliance for enterprise Java applications.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b41d6871b974" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTelemetry in 30 Minutes: What Traces, Spans, and the Collector Concept Actually Mean]]></title>
            <link>https://medium.com/@mseemann.io/opentelemetry-in-30-minutes-what-traces-spans-and-the-collector-concept-actually-mean-dcd17428fcf1?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcd17428fcf1</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[distributed-tracing]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 10:53:06 GMT</pubDate>
            <atom:updated>2026-06-21T10:53:06.632Z</atom:updated>
            <content:encoded><![CDATA[<p>A hands-on introduction for Java developers: a single Spring Boot request, made visible in Jaeger — and the foundation every later AI observability setup builds on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5S25uIM_4qbzwdyCVKDrUQ.png" /></figure><p>A request comes in, the response time is bad, and you don’t know why. You open the logs of three different services, eyeball the timestamps, and hope that the request ID one service logs happens to show up in the other too. Twenty minutes later you have a theory. You’re not sure it’s right.</p><p>That’s exactly the problem OpenTelemetry (OTel) solves — not with more logs, but with a data model that represents a request as one coherent story across service boundaries. Before talking about “AI observability,” it’s worth taking an honest look at the foundation: What is a trace, what is a span, and what does that collector everyone keeps mentioning actually do?</p><p>I’m Michael Seemann, a senior fullstack developer with 25 years of experience in enterprise projects. I’m currently building a learning series on AI observability and EU AI Act compliance for Java stacks — with real, runnable code instead of slides. This article is the first building block: no AI, no LLM, just OTel fundamentals on a single Spring Boot endpoint. If you don’t have these down, you won’t understand later why LLM calls need spans at all.</p><p><strong>Code to follow along:</strong> The complete setup from this article is available as a standalone repo on GitHub: <a href="https://github.com/mseemann/otel-grundlagen-java">github.com/mseemann/otel-grundlagen-java</a>. git clone, docker compose up -d, mvn spring-boot:run – and you&#39;ll see the traces from this article live in your own Jaeger UI.</p><h3>Three Terms You Shouldn’t Confuse</h3><p><strong>Trace:</strong> the entire path of a single request through the system, from entry to response — potentially across multiple services. Identified by a trace_id that&#39;s the same across all participating components.</p><p><strong>Span:</strong> a single unit of work within a trace, with a start and end time. A trace consists of at least one span (the root span), usually several — nested in a parent-child relationship. An HTTP request can be a root span, a database call beneath it a child span.</p><p><strong>Attribute:</strong> key-value pairs attached to a span that provide context — which input was processed, which user, which status code. Without attributes, a span is just a time window without meaning.</p><p>That’s the whole theory. The rest is seeing it in real code.</p><h3>The Setup: Spring Boot, OTel Collector, Jaeger</h3><p>Three components, each with exactly one job:</p><pre>Spring Boot App (:8080)<br>      │ OTLP/HTTP<br>      ▼<br>OTel Collector (:4318)<br>      │ OTLP/gRPC<br>      ▼<br>   Jaeger (:16686)</pre><p>The app creates spans and sends them via OTLP to the collector. Here, the collector is still a pure pass-through — it accepts spans, batches them up, and forwards them to Jaeger. At first this looks like an unnecessary detour (“why not send directly to Jaeger?”), but it pays off once you want to serve multiple backends at the same time later (Jaeger <em>and</em> Tempo, metrics <em>and</em> traces) — more on that in a later article in this series.</p><p>The Maven dependencies for this are deliberately minimal:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;io.micrometer&lt;/groupId&gt;<br>    &lt;artifactId&gt;micrometer-tracing-bridge-otel&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-exporter-otlp&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>And the configuration:</p><pre>spring:<br>  application:<br>    name: otel-demo<br>management:<br>  tracing:<br>    sampling:<br>      probability: 1.0   # 100% – every request gets traced (dev only!)<br>  otlp:<br>    tracing:<br>      endpoint: http://localhost:4318/v1/traces</pre><p>The probability: 1.0 is a deliberate dev-only decision: in production you don&#39;t want to trace every single request, that gets expensive and noisy. For getting started, though, you want to see every request, otherwise you&#39;ll be chasing phantoms while debugging.</p><p>Spin it up with two commands:</p><pre>docker compose up -d        # OTel Collector + Jaeger<br>mvn spring-boot:run         # Spring Boot App</pre><h3>Endpoint 1: Tracing Without Writing a Single Line of Code</h3><pre>@GetMapping(&quot;/hello&quot;)<br>public String hello(@RequestParam(defaultValue = &quot;World&quot;) String name) {<br>    log.info(&quot;hello called with name={}&quot;, name);<br>    return &quot;Hello, &quot; + name + &quot;!&quot;;<br>}</pre><p>No Tracer, no Span, no OTel import – and yet a trace named GET /hello shows up in Jaeger. Spring Boot and Micrometer create the root span automatically as soon as the tracing bridge is on the classpath. For any simple REST endpoint, that&#39;s already the entire job done.</p><p>But that’s not always enough. As soon as you want to know what happened <em>inside</em> a request — which input was processed, what intermediate result came out — you need your own spans.</p><h3>Endpoint 2: The Manual Span</h3><pre>private final Tracer tracer;<br><br>public DemoController(OpenTelemetry openTelemetry) {<br>    this.tracer = openTelemetry.getTracer(&quot;otel-demo&quot;);<br>}<br><br>@GetMapping(&quot;/process&quot;)<br>public String process(@RequestParam(defaultValue = &quot;test-input&quot;) String input) {<br>    Span processingSpan = tracer.spanBuilder(&quot;internal.processing&quot;)<br>            .setAttribute(&quot;input.value&quot;, input)<br>            .setAttribute(&quot;input.length&quot;, input.length())<br>            .startSpan();<br>    try (var scope = processingSpan.makeCurrent()) {<br>        String result = input.toUpperCase() + &quot;_PROCESSED&quot;;<br>        processingSpan.setAttribute(&quot;output.value&quot;, result);<br>        return result;<br>    } catch (Exception e) {<br>        processingSpan.recordException(e);<br>        throw e;<br>    } finally {<br>        processingSpan.end();<br>    }<br>}</pre><p>Three things about this endpoint deserve a second look. First: setAttribute before and after the actual work – attributes can be added after the fact, the span stays mutable until end(). Second: makeCurrent() inside the try-with-resources – this sets the span as the &quot;current&quot; span in context, relevant as soon as another, more deeply nested span gets created. Third, and this is the actual reason this endpoint exists: input.value and output.value are exactly the pattern a trace needs once input is a prompt and output is an LLM response. This endpoint is the rehearsal for the gen_ai.* attributes that follow in the next step of the series.</p><h3>Endpoint 3: When Something Goes Wrong</h3><pre>@GetMapping(&quot;/fail&quot;)<br>public String fail() {<br>    Span span = tracer.spanBuilder(&quot;intentional.failure&quot;).startSpan();<br>    try (var scope = span.makeCurrent()) {<br>        throw new RuntimeException(&quot;Demonstration error – check out the span in Jaeger&quot;);<br>    } catch (Exception e) {<br>        span.recordException(e);<br>        span.setStatus(StatusCode.ERROR, e.getMessage());<br>        throw e;<br>    } finally {<br>        span.end();<br>    }<br>}</pre><p>recordException() attaches the full stack trace as an event on the span, setStatus(StatusCode.ERROR, ...) marks it as failed. In Jaeger, this span shows up highlighted in red, with the stack trace visible right there – no need to switch to the log system to see what broke and in which request context.</p><h3>What You’ll See in Jaeger</h3><p>After three requests (/hello, /process, /fail), the Jaeger UI at localhost:16686 shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JoGngGV-TSHNC9-BHSyauQ.png" /><figcaption><em>Trace for </em><em>GET /process: root span and child span </em><em>internal.processing with the manually set attributes </em><em>input.value, </em><em>output.value, and </em><em>input.length.</em></figcaption></figure><ul><li><strong>Root span </strong><strong>GET /hello</strong> — created automatically by Spring + Micrometer</li><li><strong>Child span </strong><strong>internal.processing</strong> — created manually, the template for later gen_ai.* spans</li><li><strong>Attributes </strong><strong>input.value / </strong><strong>output.value</strong> — context on the span, the core concept for any later compliance logging</li><li><strong>Red error span at </strong><strong>/fail</strong> — recordException() + setStatus(ERROR)</li><li><strong>One </strong><strong>trace_id across all spans</strong> — ties them into a single coherent trace, the basis of any audit trail</li></ul><p>That last detail is the actual payoff of this whole exercise: as soon as a system has more than one service or more than one processing step, the trace_id is the only reliable way to follow a request end to end – without it, you&#39;re back to grepping logs by eye.</p><h3>My Takeaway</h3><p>This article deliberately has nothing to do with AI. That’s the point: if you can’t explain what a trace, a span, and an attribute are, you also won’t be able to explain why your audit trail for a chatbot has holes in it. The three endpoints in this article — automatic, manual, failing — are the only three span patterns that appear anywhere in this entire learning series. Everything that follows is variation, not reinvention.</p><p><em>The next article in this series gets one level more concrete: wiring up LangChain4j with OTel, without half the calls staying invisible.</em></p><p><strong>About the author:</strong> Michael Seemann is an independent senior fullstack developer and frontend architect with over 25 years of experience in enterprise projects. He focuses on modern web architectures, cloud-native solutions, and the professional handling of AI-generated code.</p><p><a href="https://github.com/mseemann">GitHub</a> · <a href="https://medium.com/@mseemann.io">Medium</a> · <a href="https://www.linkedin.com/in/michael-seemann-1478563bb/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcd17428fcf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Result Architecture: How I Set Up AI-Driven Development So I Can Trust the Output]]></title>
            <link>https://medium.com/@mseemann.io/result-architecture-how-i-set-up-ai-driven-development-so-i-can-trust-the-output-bc1968b39774?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc1968b39774</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 15:19:03 GMT</pubDate>
            <atom:updated>2026-06-07T15:19:03.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYwphCHX6hjY2Lf8_HOXLQ.png" /></figure><p>I recently delivered a complete website relaunch for a non-profit cultural organization — without writing a single line of code myself. Not because I was lazy. Because that’s my job now.</p><p>In a LinkedIn post about this, I introduced the term <strong>Result Architecture</strong>. Several people asked what it actually means. This article is the honest answer.</p><h3>The Problem With “I Use AI for Development”</h3><p>When developers say they work with AI tools, they usually mean one of two things:</p><p><strong>Variant 1 — The Copilot User:</strong> AI as intelligent autocomplete. Faster, but fundamentally the same as before. The developer writes, the AI fills in.</p><p><strong>Variant 2 — The Vibe Coder:</strong> Prompt in, code out, hope it works. Fast, cheap, and a maintenance nightmare six months later.</p><p>Both variants share the same problem: <strong>nobody defined the quality bar.</strong> The AI optimizes for “code that compiles” — not for “code that’s still maintainable in two years”, “code that meets accessibility standards”, or “code that fits the existing design system”.</p><p>That’s the difference between prompt engineering and result architecture.</p><h3>What Result Architecture Means</h3><p>Prompt engineering optimizes the input.</p><p>Result architecture first defines the goal — completely, across multiple quality dimensions — and then builds the system that ensures the AI reliably gets there.</p><p>The system consists of three layers.</p><h3>Layer 1: The Project Description (CLAUDE.md)</h3><p>Every project starts with a structured description that doesn’t just say <em>what</em> to build, but defines the entire context in which quality is judged.</p><p>For the website relaunch, this looks like — an excerpt:</p><p>markdown</p><pre>## Development Environment<br>No build tool, no npm, no bundler. Everything is plain PHP + vanilla CSS + vanilla JS.<br>- CSS in assets/css/main.css — one file, no preprocessors<br>## Conventions<br>- Color changes: only in inc/helpers.php — never hardcode in main.css<br>- Function prefix everywhere: fv_<br>- PHP templates: no inline CSS, no inline JS</pre><p>Plus a table of immutable identifiers — CPT slugs and meta field keys that must never be renamed, because doing so orphans database entries.</p><p><strong>The key point:</strong> CLAUDE.md is not a static document. It grows with the project — and is partly updated by the AI itself.</p><p>After each commit, the AI checks whether anything surprising happened during implementation: a CSS property that behaves differently than expected; a layout recipe that will repeat; a trap that throws no error but renders incorrectly. If so, the AI writes the entry into the project description itself — following defined criteria for what belongs in long-term memory and what doesn’t.</p><p>This solves a fundamental problem: the AI has no memory between sessions. So we build one together — and it helps maintain it.</p><h3>Layer 2: Reusable Workflows (Skills)</h3><p>For recurring tasks, I define Skills — Markdown files that describe a complete workflow. The AI isn’t just told what to do, but <em>how</em> to do it.</p><p>An example: the next-story skill defines a strict TDD cycle for implementing new features:</p><pre>Write tests → implement → all tests green →<br>wait for explicit user approval → commit</pre><p>The skill describes every step in detail: how to identify the next open story, how Playwright acceptance tests must be structured, which staging conventions apply. And — crucially — <strong>when the AI must wait for my explicit approval</strong> before committing and pushing.</p><p>Skills are living documents too. A fix-bug skill emerged because bug fixes need a different rhythm than new features — but follow the same TDD principle: write the test first, then fix. When a skill pattern proves itself or a new case class emerges, the skill gets updated — sometimes by me, sometimes the AI proposes the change.</p><p>This isn’t a restriction on the AI. It’s the definition of the handoff point between AI autonomy and human judgment.</p><h3>Layer 3: Automated Quality Assurance (Playwright)</h3><p>AI-generated code is only as good as the criteria it’s tested against. That’s why every change is automatically tested against defined acceptance criteria — before it lands anywhere.</p><p>Concretely: Playwright tests that are written <strong>first</strong> for every new story, before implementation begins. The tests are red. Then implementation happens. Only when all tests are green may a commit be made.</p><p>The tests serve two functions that are often conflated:</p><p><strong>Function 1 — Acceptance:</strong> Each test corresponds to an acceptance criterion. A new feature is done when the test is green — not when it “feels right”.</p><p><strong>Function 2 — Regression protection:</strong> With every new story, <em>all</em> existing tests run. If a change breaks something existing, you see it immediately — not in the next user report.</p><p>An example from the accessibility test suite (WCAG 2.1 Level AA):</p><p>typescript</p><pre>async function runAxe(page): Promise&lt;any[]&gt; {<br>  await page.addScriptTag({ path: AXE_PATH });<br>  const violations = await page.evaluate(() =&gt; {<br>    return new Promise&lt;any[]&gt;(resolve =&gt; {<br>      axe.run(<br>        { runOnly: { type: &#39;tag&#39;, values: [&#39;wcag2a&#39;, &#39;wcag2aa&#39;, &#39;wcag21aa&#39;] } },<br>        (_err, results) =&gt; resolve(results.violations)<br>      );<br>    });<br>  });<br>  return violations;<br>}<br><br>test(&#39;AC-1: axe — no critical violations on the homepage&#39;, async ({ page }) =&gt; {<br>  await page.goto(&#39;/&#39;);<br>  await page.waitForLoadState(&#39;networkidle&#39;);<br>  const critical = criticalViolations(await runAxe(page));<br>  expect(critical).toHaveLength(0);<br>});</pre><p>axe-core automatically checks for WCAG violations. Keyboard navigation is tested via tab simulation. Alt texts are verified on every relevant page.</p><p>What the tests can’t do: whether a screen reader makes navigation <em>genuinely</em> understandable, whether contrast ratios hold up across all usage contexts. That remains human judgment. But the automated portion is more comprehensive than most projects even attempt.</p><h3>How Epics and Stories Are Created</h3><p>The development process doesn’t start with code. It starts with requirements definition — and here too I work with AI support.</p><p>From a description of the desired outcome, structured epics emerge with stories and clear acceptance criteria. Each story has an exact definition of done — not “feels right”, but: which Playwright test must be green?</p><p>This is the point missing from many AI development workflows: <strong>requirements definition is itself a quality process.</strong> Vague requirements produce vague code — regardless of how capable the AI model is.</p><h3>What Has Changed</h3><p>With 25 years of software development experience, I spent most of my career implementing things myself. Today my greatest value is the ability to define a good outcome — technically, visually, strategically — and build the system that ensures the AI gets there.</p><p>This isn’t an abdication of responsibility. It’s a shift in where responsibility is exercised: from the execution layer to the architecture layer.</p><p>Result Architecture.</p><p><em>Michael Seemann is a freelance Senior Fullstack Developer and Frontend Architect with 25 years of experience. He helps SMEs achieve technical outcomes through AI orchestration — without the quality compromises of classic vibe coding.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc1968b39774" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Module Federation to Web Components: The Angular Migration Nobody Warned Me About]]></title>
            <link>https://medium.com/@mseemann.io/from-module-federation-to-web-components-the-angular-migration-nobody-warned-me-about-967f180caded?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/967f180caded</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[module-federation]]></category>
            <category><![CDATA[micro-frontends]]></category>
            <category><![CDATA[angular-elements]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Fri, 29 May 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-05-29T06:01:01.972Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzykVoHXQdQINP0zGT0tgQ.png" /></figure><h3>From Module Federation to Web Components: The Angular Migration Nobody Warned Me About</h3><p><em>How we replaced Webpack Module Federation with Angular Elements — and the non-obvious problems that nearly broke us</em></p><p>We had a micro-frontend. It was built with Webpack Module Federation, blessed by the Nx team’s documentation, and running in production. Life was good.</p><p>Then the host application upgraded to Angular 21. Our remote was on Angular 18. The shared singleton resolution started throwing cryptic runtime errors nobody could explain. Meanwhile, the host team’s new design system was bleeding its CSS custom properties straight through our components, overriding our carefully crafted styles. And our developers kept asking the same question: <em>“Do I really need to clone and run the entire enterprise portal just to change a button label in my feature?”</em></p><p>We decided to migrate to Web Components. What followed was educational in the way that building collapses are educational.</p><p>This article documents every problem we hit, in the order we hit it, and the exact solution for each one.</p><h3>The Case Against Module Federation (For Our Situation)</h3><p>Let me be clear upfront: <strong>Module Federation is not bad</strong>. For teams that share a monorepo, stay in sync on Angular versions, and own both host and remote, it is a powerful tool. This article is not a takedown — it is a story about a specific mismatch between the tool and the team structure.</p><p>Here is what broke for us:</p><p><strong>Version coupling.</strong> Module Federation works by sharing singletons at runtime: Zone.js, Angular core, RxJS. When the host and the remote evolve independently, every Angular upgrade becomes a negotiation. The shared: configuration in webpack.config.js is the treaty document, and like most treaties, it gets violated eventually.</p><p><strong>Style bleeding.</strong> Our remote lived inside the host page’s DOM. The host’s global stylesheets, CSS resets, and design-token overrides cascaded straight into our components. We spent days chasing specificity bugs caused by a class definition we had no control over.</p><p><strong>The host dependency.</strong> Every developer on our team needed a running instance of the enterprise portal — a large, multi-team application — just to see their changes. This was the loudest complaint on the team and the one that ultimately drove the decision to switch.</p><p><strong>The “independence” illusion.</strong> Module Federation <em>feels</em> like independence, but the remote is still wired into the host’s router, change-detection cycle, and injector tree. A breaking change in a shared library surfaces in your remote, and you did not write the code that broke it.</p><p>The alternative we chose: ship the micro-frontend as a <strong>Web Component</strong> using @angular/elements. The host drops in a &lt;service-fleet-dashboard&gt; tag. Everything inside that tag is our responsibility, runs our Angular version, and is style-isolated by a shadow DOM boundary. No shared build configuration. No shared runtime singletons.</p><h3>The Dual-Mode Design: One Codebase, Two Entry Points</h3><p>Before writing a single line of migration code, we had to solve a design question: how do we keep the micro-frontend runnable as a standalone application for local development, <em>and</em> ship it as a web component for production?</p><p>The answer is runtime detection in main.ts:</p><pre>const isStandalone = document.querySelector(&#39;#standalone&#39;) !== null;<br>createApplication({ providers: [...] }).then(appRef =&gt; {<br>    if (isStandalone) {<br>        appRef.bootstrap(AppComponent);          // standalone: serves at /fleet-dashboard/<br>    } else {<br>        const El = createCustomElement(AppComponent, { injector: appRef.injector });<br>        customElements.define(&#39;service-fleet-dashboard&#39;, El);  // web component: host places this tag<br>    }<br>});</pre><p>The index.html for development has &lt;fleet-root id=&quot;standalone&quot;&gt;&lt;/fleet-root&gt;. When it is present, the app bootstraps normally. When it is absent — as it will be when the host page loads the bundle — the app registers itself as a custom element and waits to be placed in the DOM.</p><p>This dual-mode pattern means our developers run nx serve and get a fully functional app with hot-reload, no host required. The host team receives a JavaScript bundle and a custom element tag.</p><h3>Step 1: Migrating the Build — Three Immediate Failures</h3><p>Switching from @nx/module-federation to Angular&#39;s own @angular/build:application (the esbuild-based builder introduced in Angular 17) broke the build in three distinct ways.</p><h3>&quot;main&quot; is not a valid option</h3><p>The webpack-era project.json used &quot;main&quot; as the entry point key. The new executor uses &quot;browser&quot;:</p><pre>// ❌ Does not work with @angular/build:application<br>&quot;main&quot;: &quot;apps/fleet-dashboard/src/main.ts&quot;</pre><pre>// ✅ Correct<br>&quot;browser&quot;: &quot;apps/fleet-dashboard/src/main.ts&quot;</pre><p>The error message — &#39;main&#39; is not found in schema — is precise but gives no hint at the fix.</p><h3>Webpack-only options in the dev configuration</h3><p>buildOptimizer and vendorChunk are webpack concepts. @angular/build:application rejects them with a schema validation error. Remove them from the development configuration block.</p><h3>The tilde prefix in SCSS</h3><p>Any @import &quot;~@angular/material/...&quot; in your stylesheets will fail. The ~ prefix is webpack&#39;s shorthand for node_modules resolution. Esbuild does not know about it:</p><pre>// ❌ Webpack only<br>@import &quot;~@angular/material/prebuilt-themes/indigo-pink.css&quot;;</pre><pre>// ✅ Remove the tilde<br>@import &quot;@angular/material/prebuilt-themes/indigo-pink.css&quot;;</pre><p>In our case the prebuilt theme import was also redundant — we apply a fully custom Material theme via @include mat.all-component-themes(...) — so we deleted the line entirely.</p><h3>Step 2: The Router Trap — Why the Web Component Showed Nothing</h3><p>This was the problem that cost us the most time. After all the build fixes, the app worked perfectly in standalone mode. In web component mode, the custom element appeared in the DOM but rendered nothing. No errors. Just silence.</p><p>Here is what was happening.</p><p>createApplication() runs all Angular APP_INITIALIZER tokens before the returned promise resolves. This includes the router&#39;s own initializer, which fires <strong>initial navigation immediately</strong>. At that point, AppComponent — which contains the &lt;router-outlet&gt; — has not been placed in the DOM yet. The router navigates to /, finds no outlet, and succeeds vacuously. When &lt;service-fleet-dashboard&gt; is later inserted into the host page, the &lt;router-outlet&gt; mounts — but the router has already finished its work and will never navigate again.</p><p>In standalone mode this does not happen. appRef.bootstrap(AppComponent) mounts the outlet <em>before</em> the router&#39;s initial navigation runs.</p><p>The fix has two parts:</p><pre>// main.ts — tell the router not to navigate on its own<br>provideRouter(appRoutes, withDisabledInitialNavigation()),</pre><pre>// app.component.ts — start navigation once the outlet is actually in the DOM<br>ngOnInit(): void {<br>    this.router.initialNavigation();<br>}</pre><p>ngOnInit fires when the component is mounted — which is exactly when the &lt;router-outlet&gt; is available. This works correctly in both modes: in standalone mode bootstrap() mounts the component immediately; in web component mode ngOnInit fires when the host page inserts the tag.</p><h3>Step 3: Routing in an Embedded World — WebComponentLocationStrategy</h3><p>With navigation working, we hit the next problem: the web component’s Angular router was writing to window.location. The host application also had an Angular router. Both attempted to own the browser URL bar. The result was a broken navigation experience in both applications.</p><p>The solution is a custom LocationStrategy that keeps all routing state entirely in memory and never touches window.location:</p><pre>@Injectable()<br>export class WebComponentLocationStrategy extends LocationStrategy {<br>    private history: string[] = [&#39;/&#39;];<br>    private historyIndex = 0;<br>    private listeners: LocationChangeListener[] = [];<br><br>override path(): string {<br>        return this.history[this.historyIndex];<br>    }<br>    override pushState(_s: unknown, _t: string, url: string, query: string): void {<br>        const full = query ? `${url}?${query}` : url;<br>        this.history = this.history.slice(0, this.historyIndex + 1);<br>        this.history.push(full);<br>        this.historyIndex++;<br>    }<br>    override back(): void {<br>        if (this.historyIndex &gt; 0) {<br>            this.historyIndex--;<br>            this.notify(this.history[this.historyIndex]);<br>        }<br>    }<br>    // ... forward(), historyGo(), replaceState() follow the same pattern<br>    // window.location is never read or written<br>}</pre><p>This strategy is provided conditionally — standalone mode keeps the standard PathLocationStrategy so the URL bar works normally during development:</p><pre>{<br>    provide: LocationStrategy,<br>    useClass: isStandalone ? PathLocationStrategy : WebComponentLocationStrategy,<br>}</pre><h3>Route persistence across reloads</h3><p>The host application needs to restore the route the user was on. We expose an activatedRoute signal input and a routeChanged output on AppComponent:</p><pre>readonly activatedRoute = input(&#39;&#39;);<br>readonly routeChanged = output&lt;string&gt;();<br>constructor() {<br>    effect(() =&gt; {<br>        const route = this.activatedRoute();<br>        if (route) this.navigate(route);<br>    });<br>}<br>ngOnInit(): void {<br>    this.router.initialNavigation();<br>    this.router.events<br>        .pipe(filter((e): e is NavigationEnd =&gt; e instanceof NavigationEnd))<br>        .subscribe(e =&gt; this.routeChanged.emit(e.urlAfterRedirects));<br>}</pre><p>Note urlAfterRedirects, not url. We emit the <em>final</em> resolved URL. If the router redirects / to /overview, the host receives /overview and will restore there directly — not trigger the redirect again.</p><p>The host integration is a few lines of plain JavaScript:</p><pre>const el = document.querySelector(&#39;service-fleet-dashboard&#39;);<br>el.setAttribute(&#39;activated-route&#39;, sessionStorage.getItem(&#39;fleet-route&#39;) ?? &#39;/overview&#39;);<br>el.addEventListener(&#39;routeChanged&#39;, e =&gt; sessionStorage.setItem(&#39;fleet-route&#39;, e.detail));</pre><h3>Step 4: Style Isolation — Three Separate Problems</h3><p>Adding ViewEncapsulation.ShadowDom to AppComponent creates a true shadow boundary. We quickly discovered that this boundary has three distinct effects on styles.</p><h3>Problem 1 — Global stylesheets don’t cross the shadow boundary</h3><p>Angular’s styles array in project.json generates a global stylesheet. Shadow DOM ignores global stylesheets. Our Material theme and typography definitions, carefully configured in styles.scss, had no effect inside the component.</p><p>The fix: import the global stylesheet directly into the root component’s own stylesheet. Angular compiles component styles into a &lt;style&gt; tag that lives <em>inside</em> the shadow root:</p><pre>// app.component.scss<br>@import &quot;../styles&quot;;</pre><p>In standalone mode this causes the stylesheet to load twice (once globally, once via the component). This is harmless in practice.</p><h3>Problem 2 — Material overlays appear outside the shadow root</h3><p>Angular CDK appends dialogs, menus, and snack bars to a .cdk-overlay-container div that gets attached to document.body. Everything in that div is outside the shadow root and therefore outside the reach of our shadow-scoped styles.</p><p>The fix: override OverlayContainer to append its container inside the shadow root instead:</p><pre>@Injectable()<br>export class ShadowDomOverlayContainer extends OverlayContainer {<br>    private readonly document = inject(DOCUMENT);<br>protected override _createContainer(): void {<br>        const shadowHost =<br>            this.document.querySelector(&#39;service-fleet-dashboard&#39;) ?? // web component<br>            this.document.querySelector(&#39;fleet-root&#39;) ??              // standalone<br>            this.document.body;<br>        const shadowRoot = shadowHost.shadowRoot ?? shadowHost;<br>        const container = this.document.createElement(&#39;div&#39;);<br>        container.classList.add(&#39;cdk-overlay-container&#39;);<br>        shadowRoot.appendChild(container);<br>        this._containerElement = container;<br>    }<br>}</pre><p>Because AppComponent uses ViewEncapsulation.ShadowDom in both modes, we provide this unconditionally:</p><pre>{ provide: OverlayContainer, useClass: ShadowDomOverlayContainer }</pre><h3>Problem 3 — CSS custom properties cross shadow boundaries by spec</h3><p>This one surprised us most. CSS custom properties (--color-primary, --spacing-md, …) are <strong>inherited through shadow DOM boundaries</strong>. This is defined in the CSS specification and is intentional — it is how design tokens are supposed to propagate. The problem is that it propagates the <em>host&#39;s</em> design tokens into our component, overriding our own.</p><p>The fix: after the first render, read every ---prefixed custom property from the host&#39;s document root and inject an adopted stylesheet into the shadow root that resets each one to initial. This cuts the inheritance chain:</p><pre>constructor() {<br>    afterNextRender(() =&gt; this.resetInheritedCssVariables());<br>}<br>private resetInheritedCssVariables(): void {<br>    const shadowRoot = this.host.nativeElement.shadowRoot;<br>    if (!shadowRoot) return;<br>    const docStyle = window.getComputedStyle(document.documentElement);<br>    const vars: string[] = [];<br>    for (let i = 0; i &lt; docStyle.length; i++) {<br>        if (docStyle[i].startsWith(&#39;--&#39;)) vars.push(docStyle[i]);<br>    }<br>    if (vars.length === 0) return;<br>    const sheet = new CSSStyleSheet();<br>    sheet.replaceSync(`:host { ${vars.map(v =&gt; `${v}: initial`).join(&#39;; &#39;)} }`);<br>    shadowRoot.adoptedStyleSheets = [sheet];<br>}</pre><p>We use afterNextRender rather than ngAfterViewInit because adoptedStyleSheets can only be set after the Angular renderer has created and attached the shadow host to the DOM.</p><h3>For reference, here is the final bootstrapping file with annotations:</h3><pre>registerLocaleData(localeDe, &#39;de-DE&#39;, localeDeExtra);<br>const isStandalone = document.querySelector(&#39;#standalone&#39;) !== null;<br>createApplication({<br>    providers: [<br>        // ← withDisabledInitialNavigation: router waits for AppComponent.ngOnInit()<br>        provideRouter(appRoutes, withDisabledInitialNavigation()),<br>        // ← memory routing in web component mode; real URL bar in standalone<br>        { provide: LocationStrategy,<br>          useClass: isStandalone ? PathLocationStrategy : WebComponentLocationStrategy },<br>        // ← overlays rendered inside shadow root in both modes<br>        { provide: OverlayContainer, useClass: ShadowDomOverlayContainer },<br>        { provide: ErrorHandler, useClass: GlobalErrorHandler },<br>        { provide: LOCALE_ID,    useValue: &#39;de-DE&#39; },<br>        provideZoneChangeDetection(),<br>        provideHttpClient(withInterceptorsFromDi())<br>    ],<br>}).then(appRef =&gt; {<br>    if (isStandalone) {<br>        appRef.bootstrap(AppComponent);<br>    } else {<br>        const El = createCustomElement(AppComponent, { injector: appRef.injector });<br>        customElements.define(&#39;service-fleet-dashboard&#39;, El);<br>    }<br>}).catch(err =&gt; console.error(err));</pre><h3>When to Choose What</h3><p><strong>Keep Module Federation if:</strong></p><ul><li>Host and remote are on the same Angular version and you control both</li><li>You need to share live state or services between host and remote at runtime</li><li>You have a working monorepo with coordinated versioning</li></ul><p><strong>Choose Web Components if:</strong></p><ul><li>Teams are independent and upgrade Angular at their own pace</li><li>You need true style isolation — no shared or conflicting design system</li><li>The host might not be Angular (React, Vue, server-rendered HTML)</li><li>Developers need to work on the micro-frontend without running the host</li><li>You want the integration contract to be expressed as HTML attributes and DOM events</li></ul><p><strong>The dual-mode pattern is the safety net regardless of which you choose.</strong> A standalone serve target costs you nothing to maintain and pays back in developer velocity every single day.</p><h3>Conclusion</h3><p>Module Federation and Web Components solve the same problem — micro-frontend composition — but they make different tradeoffs. Module Federation optimises for sharing: shared bundles, shared runtime, shared DI. Web Components optimise for isolation: separate bundle, separate DOM, separate style scope.</p><p>The migration path is not trivial. The router’s silent failure, the memory location strategy and the three-layer style isolation problem are not documented anywhere as a group. We found each one by running into it. Hopefully this article means you do not have to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=967f180caded" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your software doesn’t need AI. Except for the three places where it does.]]></title>
            <link>https://medium.com/@mseemann.io/your-software-doesnt-need-ai-except-for-the-three-places-where-it-does-bc367cb2dab0?source=rss-e98ee43541c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc367cb2dab0</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[llm-applications]]></category>
            <dc:creator><![CDATA[Michael Seemann]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 05:20:58 GMT</pubDate>
            <atom:updated>2026-04-14T15:36:46.728Z</atom:updated>
            <content:encoded><![CDATA[<h3>Your software doesn’t need LLMs. Except for the three places where it does.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EujH5AhNKdJuoGSnfTLuIQ.png" /></figure><p>Picture a dairy farmer. It’s 5:30 in the morning, he’s standing in the barn, hands dirty, 120 cows waiting to be milked. He has a herd management system — solid software with data entry forms, dashboards, lists. But the laptop is in the office, and he’s with the animals.</p><p>Now someone comes along and says: “We’re going to add AI to your software.”</p><p>The first question no one asks but everyone should: <strong>What for?</strong></p><p>This article grew out of a real project: a herd management system for dairy farms, where the question was whether AI would even make sense here — and if so, where exactly? Not in the abstract, but down to the level of individual functions, dialogue examples, and technical decisions. What emerged is transferable to any business application: from manufacturing execution systems to hospital information systems to logistics platforms.</p><p>And it starts with an uncomfortable insight.</p><h3>60–70% of “AI features” don’t need AI</h3><p>When I tally up the features we designed — appointment reminders, threshold alerts, inventory warnings, status-dependent buttons, KPI dashboards, PDF reports, pre-filled forms — they’re all database queries, rules, and templates.</p><p>Calculate the calving date? Addition. Date field plus 283 days.</p><p>Low inventory warning? `SELECT * FROM inventory WHERE quantity &lt; 5`. Software could do that in the ‘90s.</p><p>Appointment reminder? A cron job that checks each morning which actions are due.</p><p>Status-dependent buttons in the app? `IF status == ‘open’ THEN show button ‘Edit’`. A simple switch statement.</p><p>A good development team could build a system that delivers most of this information without ever calling an AI API. And it would be faster, cheaper, and more reliable — because deterministic logic doesn’t hallucinate and doesn’t cost per API call.</p><p><strong>So the question isn’t: “Where can we use AI?” It’s: “Where does AI deliver value that conventional code can’t — or can only deliver with disproportionate effort?”</strong></p><p>The answer boils down to three capabilities.</p><h3>The three things AI actually does well</h3><ol><li><strong>Synthesis: Many data points, one coherent recommendation</strong></li></ol><p>Back to the farmer. He’s standing in front of a cow and needs to decide which bull to use for insemination. He has to consider: the cow’s breed, breeding history (which bull failed last time), genetic merit of available bulls, semen inventory, calving ease score (avoid difficult births), economic factors — and perhaps his own experience that a particular bull performs worse on his farm than his breeding values suggest.</p><p>You could encode this in rules: If in heat AND last insemination failed AND different bull available AND this bull hasn’t been used on this cow AND inventory &gt; 0 AND genetic merit higher than predecessor THEN recommend this bull. That’s six conditions — doable.</p><p>But then come the edge cases. What if the cow is a repeat breeder? What if the only better bull has just one straw left? What if the last calving was difficult? With ten relevant factors at three to four states each, the rule tree explodes into hundreds of paths. Conventionally programmed, this becomes a maintenance nightmare.</p><p>A language model can weigh all these factors simultaneously and produce a coherent, justified recommendation: “Goldwin was unsuccessful last time. Atlantic has a higher genetic merit and hasn’t been used on this cow yet. Eight straws left in stock.”</p><p>This isn’t magic. It’s the ability to weigh multiple variables simultaneously and express the result in natural language — something that’s trivial for a language model and exponentially complex for a rule tree.</p><p>2. <strong>Interface flexibility: Natural language</strong></p><p>The farmer is in the barn, hands full, and says: “Three forty-two inseminated with Atlantic, Bob did it, was around seven.”</p><p>This needs to become structured data fields: cow ID 342, bull Atlantic, technician Bob, time 07:00. A conventional intent parser with slot filling — <a href="https://dl.acm.org/doi/10.1145/3547138">the standard method in natural language understanding</a>, where an intent is identified and predefined parameters are extracted — handles this for narrowly defined sentence structures. But people don’t talk in templates. They reorder information, leave things out, add others, speak in dialect, use abbreviations.</p><p>Or the farmer replies to the daily report via messenger: “Move pregnancy check 207 to Tuesday, vet’s coming anyway.” There’s an action (reschedule appointment), a reference (cow 207), a new date (next Tuesday), and a reason (vet appointment) — all in a single sentence of colloquial language.</p><p>Natural language as both input and output channel — whether via chat, voice command, or messaging — is where conventional code gives up and a language model shines.</p><p>3. <strong>Interpretation: Making statistical findings actionable</strong></p><p>A rule-based system can detect: “First-service conception rate is below 40%.” That’s a threshold alarm. And conventional statistics can calculate: “First-service conception rate correlates with heat detection rate, r=0.74, p&lt;0.01.” That’s a correlation analysis — Python with pandas or an R script has been able to do this for decades.</p><p>But neither the threshold alarm nor the raw correlation helps the farmer. What helps is the statement: “First-service conception rate has been falling continuously since March. At the same time, heat detection rate is low. Possibly heats are being missed, causing inseminations to happen too late in the cycle.”</p><p>This is a two-step process: Statistics finds the pattern. The language model explains what it means. It contextualizes the statistical finding within the domain (is r=0.74 practically relevant here?), forms a causal hypothesis (why might this correlation exist?), and formulates the whole thing so a non-statistician can understand and act on it.</p><p>An additional contribution of the language model lies in asking the right questions: Which correlations are even worth investigating? With 15 metrics, there are over a hundred possible pairs — most of them meaningless. A language model can use its domain knowledge to suggest which combinations are worth examining. A kind of hypothesis-driven statistics: the language model generates the hypotheses, conventional statistics tests them.</p><h3>Seven ways to integrate AI into an application</h3><p>Starting from this differentiation — conventional code for the deterministic, AI for synthesis, language, and pattern recognition — seven integration patterns emerge. They differ in who triggers the interaction, through which channel it flows, and how deeply it reaches into the application.</p><p>And they all start with an insight that took surprisingly long to arrive at: <strong>The right question isn’t “How do I integrate AI into the software?</strong>” but <strong>“How do I integrate AI into the user’s working day?”</strong></p><p>A farmer doesn’t sit at a desktop for eight hours. He’s in the barn, walking through the herd, driving the tractor. The laptop gets opened briefly in the morning and evening. The actual work happens elsewhere.</p><p>This applies to many industries. The mechanic is at the machine. The nurse is at the bedside. The warehouse worker is between shelves. The software is a tool for part of the day — AI should be there for the whole day.</p><p><strong>Pattern 1: Proactive push</strong></p><p>The AI reaches out to the user on its own, without requiring any action. A morning briefing with the day’s plan, an evening report with a summary and outlook. The channel is deliberately not the business application itself, but the messenger, SMS, push notification — whatever the user already checks constantly. They can reply directly and trigger actions.</p><p>AI capabilities at work here: <strong>Synthesis</strong> (distilling the day into a prioritized summary — “What actually matters today?”), <strong>Natural language</strong> (processing free-text replies — “Move pregnancy check 207 to Tuesday”), and <strong>Interpretation</strong> (contextualizing statistical trends in the daily report — “First-service conception rate has been falling since March, possibly related to heat detection issues”). What doesn’t need AI: the appointment reminders and threshold alerts that make up the bulk of the content.</p><p><strong>Pattern 2: Ambient display</strong></p><p>Information that shows itself when the context is right. A display at a workstation detects via sensor which object is currently being processed and automatically shows the relevant data — no typing, no clicking, no searching.</p><p>The AI layer primarily contributes <strong>Synthesis </strong>here — generating a context-dependent recommendation from master data, histories, and current status that appears on the display as soon as the object is recognized. The basic data comes from the database. Works perfectly fine without AI — but with AI, a data display becomes a decision aid.</p><p><strong>Pattern 3: Voice interface</strong></p><p>The user speaks, hands stay free. A headset, push-to-talk instead of wake word (because work environments are too noisy for always-on voice recognition), and radically short responses.</p><p>This is the paradigm shift. Documentation without a screen: “342 inseminated, Atlantic” — and the system confirms, deducts from inventory, schedules the follow-up. Two sentences instead of five form fields.</p><p>Here <strong>Natural language</strong> dominates — the core promise of this pattern. Intent recognition from free text, context across multiple utterances, understanding dialect and colloquial speech. Add <strong>Synthesis </strong>for follow-up questions (“Which bull should I use?” requires a multivariate recommendation via voice output) and a touch of <strong>Pattern recognition</strong> in deciding when a response is too complex for voice and should be handed off to the display.</p><p>But confirmation recognition (“Yes”, “No”, “Cancel”)? A word list with fuzzy matching. No AI needed.</p><p><strong>Pattern 4: Mobile scan with instant context</strong></p><p>The user holds their phone against an object — NFC chip, barcode, QR code — and instantly gets a context card with the most relevant information and context-dependent quick actions. No app opening, no navigating.</p><p>The principle: Zero navigation steps. The app launches itself on scan. Quick actions adapt to the object’s state. One tap for the most likely action — done.</p><p>The scan itself, the data display, and the status-dependent buttons don’t need AI. AI enters the picture with the context card: <strong>Synthesis</strong> (condensing multiple data points into a compact, situation-appropriate recommendation) and <strong>Natural language</strong> (the contextual chat panel where the user can ask questions freely without having to explain the context).</p><p><strong>Pattern 5: Contextual desktop AI</strong></p><p>AI is woven into multiple places across the existing screen interface — without changing established workflows. Three sub-forms:</p><p>AI-generated summaries on detail pages: Instead of the user piecing together a picture from ten data fields, there’s a paragraph in natural language that puts the situation in context and offers a recommendation.</p><p>AI suggestions in data entry forms: Fields are pre-filled, with transparent reasoning (“Why this suggestion?”) and the freedom to override.</p><p>A contextual chat panel that knows which page the user is on. The question “What’s the alternative?” works without further explanation — the chat knows the context.</p><p>All three capabilities come together here: <strong>Synthesis</strong> for the summaries and suggestions (ten data points into a coherent recommendation with reasoning), <strong>Natural language</strong> for the chat panel (free-text questions with page context), and <strong>Interpretation</strong> for the dashboard insights (the statistics found a correlation between declining conception rate and low heat detection rate — the LLM explains to the farmer what that means for their operation).</p><p><strong>Pattern 6: Asynchronous AI reporting</strong></p><p>The AI analyzes data over weeks and months and spots patterns that remain invisible in day-to-day operations. Creeping deteriorations, seasonal effects, unexpected correlations. The result arrives as a weekly report or monthly analysis — thoughtful and well-prepared.</p><p>This replaces the external consultant who visits every few months and says “I’ve noticed that…” — only continuously and automatically.</p><p>The KPI aggregation and charts don’t need AI. Neither does the correlation analysis itself — that’s conventional statistics. But <strong>Interpretation</strong> is the key AI capability here — contextualizing statistical findings within the domain, forming causal hypotheses, and suggesting which questions are worth asking (“Is it worth investigating the relationship between the feed change and milk yield?”). Plus <strong>Synthesis</strong>, to translate the results into understandable recommendations that a non-statistician can read and act on.</p><p><strong>Pattern 7: Natural language queries — “Show me all cows that…”</strong></p><p>Every business application has a report builder somewhere. A powerful tool with configurable columns, filters, groupings, sort orders, time ranges. The problem: hardly anyone truly masters it. An experienced user needs minutes to click together a complex report. A casual user gives up or asks a colleague.</p><p>The idea is simple: The user describes in natural language what they want to see. “Show me all cows in their third lactation that were inseminated more than twice and whose last pregnancy check was negative, sorted by days in milk.” The AI translates this into a structured query — the right filters, columns, sort order — and generates the view. Not as a static answer, but as a configured report view in the regular interface that the user can then refine further: remove a column, tighten a filter, change the grouping.</p><p>The crucial point: AI is the entry point, not the end product. It lowers the barrier from “I need to know which 12 dropdowns to click in which order” to “I say what I want to see.” After that, the familiar interface takes over. This is a pattern that works in almost any data-driven application — whether herd management, ERP, CRM, or hospital information system. Everywhere users need complex reports but the report builder slows them down.</p><p>Here <strong>Natural language</strong> dominates — the ability to translate an imprecise, colloquial description into an exact, structured query. Add <strong>Synthesis</strong> when the AI doesn’t just build the query but also fills in sensible defaults: “You didn’t mention a time range — I’ll use the current lactation. Does that work?”</p><h3>Four design principles</h3><p>Across all seven patterns, four principles have emerged:</p><p><strong>AI comes to the user, not the other way around.</strong> In none of the patterns does the user have to actively seek out an AI application. The push notification arrives on its own, the display reacts to sensors, the voice interface is always there, the scan launches the app automatically, the desktop AI is embedded. The user never has to think “Now let me go ask the AI.”</p><p><strong>Existing workflows remain intact.</strong> No pattern replaces the existing application. The data entry forms, dashboards, and lists work as before. AI is a layer on top that can be turned on and off. A user who doesn’t want AI can work exactly as they did before.</p><p><strong>Write actions always require confirmation.</strong> Whether via voice, chat, quick action, or pre-filled form — before the AI writes anything to the system, it shows the user what it intends to do and waits for an explicit yes.</p><p><strong>Hybrid handoff between channels.</strong> The patterns aren’t silos. The voice interface hands off to the display when the answer gets too complex. The daily report via messenger enables follow-up questions. The mobile app opens a chat panel when needed. The user switches fluidly between channels — and the context travels with them.</p><p><strong>The architecture recommendation</strong></p><p>Not “all AI” and not “no AI,” but <strong>hybrid layering</strong>:</p><p>Core functions — calculations, database queries, threshold alerts, data entry forms, reports — conventional and deterministic. Fast, cheap, reliable, no surprises.</p><p>The AI layer on top — for synthesis (many data points into one recommendation), natural language (chat, voice, messaging), and pattern recognition (a statistical layer detects trends and correlations; the language model interprets and explains them).</p><p>And this AI layer can be switched off at any time without the core functionality suffering.</p><p>This matters economically too. Every API call to a language model costs money. Having AI calculate an appointment when a single line of code does the same thing is waste. Use AI where a rule tree would explode into hundreds of paths, and write solid conventional code everywhere else — that’s the architecture that works long-term.</p><h3>Outlook: What if the screen disappears?</h3><p>All seven patterns assume a screen exists somewhere — as a dashboard, a chat panel, a context card. But if you follow the logic to its conclusion, a more radical question emerges: What if the default interaction with the application wasn’t a screen at all?</p><p>Roughly 70% of a field worker’s daily interactions with their software are low bandwidth: checking a status, dictating an entry, answering yes or no, confirming an appointment. All of this works via voice — and works better than a screen, because the user doesn’t have to interrupt their actual work.</p><p>The limit is where information needs to be perceived in parallel rather than sequentially. Five numbers in a table — the eye sees them simultaneously. The ear has to hear them one after another, and forgets the first before the fifth arrives. A trend chart conveys in half a second what speech needs thirty seconds for. Comparisons, planning sessions, analytics — those need the screen.</p><p>The model of the future could therefore be: <strong>Voice-first, screen-on-demand.</strong> Speech is the primary interface. The user wears a headset and talks to their application while they work. The phone stays in their pocket. But when an answer becomes too complex for voice — a comparison, a table, a trend — the phone vibrates, and the visualization is already there. Not because the user opened an app, but because the AI recognized that this particular information needs to be seen, not heard.</p><p>The application wouldn’t be invisible in the sense of “not present.” It would be invisible in the sense of “always there, but only visible when there’s something to see.” Voice as the default channel, the screen as an output device that the AI activates on demand.</p><p>This is still a vision today. But all the building blocks exist — speech recognition, language models, text-to-speech, context-dependent channel selection. What’s missing isn’t the technology. It’s the courage to give up the screen as the entry point.</p><p><em>This analysis grew out of a real project involving a herd management system for dairy farms. The seven patterns — proactive push, ambient display, voice interface, mobile scan, contextual desktop AI, asynchronous reporting, and natural language queries — are industry-agnostic and transferable to any business application where users work with structured data, make decisions, and need to document them.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc367cb2dab0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>