<?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 Vladimir Balko on Medium]]></title>
        <description><![CDATA[Stories by Vladimir Balko on Medium]]></description>
        <link>https://medium.com/@vbalko?source=rss-9a8ed63581e0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gRL9KtW6dhNoceNh.</url>
            <title>Stories by Vladimir Balko on Medium</title>
            <link>https://medium.com/@vbalko?source=rss-9a8ed63581e0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:44:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vbalko/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[SAP Integration Suite Access Policies: How to Restrict Cloud Integration Access per Team]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@vbalko/sap-integration-suite-access-policies-how-to-restrict-cloud-integration-access-per-team-5ba65ecf34d8?source=rss-9a8ed63581e0------2"><img src="https://cdn-images-1.medium.com/max/929/1*AWlcdIr4dKsC0lR94fTNPA.png" width="929"></a></p><p class="medium-feed-snippet">How access policies in SAP Integration Suite let you say: everyone in-house can work on everything, and each partner team only on the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@vbalko/sap-integration-suite-access-policies-how-to-restrict-cloud-integration-access-per-team-5ba65ecf34d8?source=rss-9a8ed63581e0------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@vbalko/sap-integration-suite-access-policies-how-to-restrict-cloud-integration-access-per-team-5ba65ecf34d8?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ba65ecf34d8</guid>
            <category><![CDATA[sap-cpi]]></category>
            <category><![CDATA[sap-integration-suite]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[access-policies]]></category>
            <category><![CDATA[sap-btp]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 08:19:20 GMT</pubDate>
            <atom:updated>2026-09-11T08:19:20.311Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Naming iFlows in SAP Cloud Integration: What Two Years of Production Taught Us]]></title>
            <link>https://medium.com/@vbalko/naming-iflows-in-sap-cloud-integration-what-two-years-of-production-taught-us-10dfe6dc0f0f?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/10dfe6dc0f0f</guid>
            <category><![CDATA[sap-cpi]]></category>
            <category><![CDATA[naming-conventions]]></category>
            <category><![CDATA[sap-integration-suite]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[sap-cloud-integration]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 13:12:39 GMT</pubDate>
            <atom:updated>2026-09-10T13:12:39.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jClLFZkWeDCgTbLy" /></figure><p><em>A revised, field-tested version of our original naming guide.</em></p><p>Two years ago I published <a href="https://medium.com/claimate-tech/a-practical-guide-to-naming-iflows-in-sap-cloud-integration-sci-b177a669adc0">A Practical Guide to Naming iFlows in SAP Cloud Integration (SCI)</a>. It described a clean scheme: a numeric ID, a direction, a partner name, the adapters.</p><p>Then we ran it. Across several customer landscapes, hundreds of artifacts, multiple teams, and a few years of change requests. The convention held — but not in the shape we wrote down. Real projects bent it, and the bends turned out to be improvements. Other parts sagged in ways worth warning you about.</p><p>This is version two: the same idea, reshaped by what actually survived.</p><h3>What changed, in one paragraph</h3><p>The original scheme said nothing about landscapes or standby twins, and gave a single &lt;partner&gt; slot that couldn&#39;t express a SAP-to-SAP flow. It defined IN/OUT without saying <em>inbound to what</em>. And its ID packed a message class and a partner lookup into eight digits — elegant, and quietly abandoned within months, because in practice people number by project, not by partner. Version two fixes all four.</p><h3>The template</h3><pre>SCI[&lt;env&gt;]&lt;project&gt;&lt;sequence&gt;_&lt;direction&gt;_&lt;source&gt;_&lt;target&gt;_&lt;srcProto&gt;_&lt;tgtProto&gt;_&lt;message&gt;[_&lt;variant&gt;]</pre><p>A real one, on a multi-tenant landscape:</p><pre>SCI1100010_OUT_PAYROLL-DE_BANKGW_SFTP_SFTP_PaymentOrder</pre><p>And the same flow where all three stages share one tenant:</p><pre>SCIP1100010_OUT_PAYROLL-DE_BANKGW_SFTP_SFTP_PaymentOrder</pre><h3>SCI — platform label</h3><p>Constant. It looks redundant inside Cloud Integration, but names leak: into ticket subjects, monitoring exports, Excel handovers, and the inbox of someone who has never opened your tenant. Keep it.</p><h3>&lt;env&gt; — one letter for the landscape, if you need one at all</h3><p>D development · T test · P production</p><p>And here is the part we got wrong for a while, which is worth more than the letter itself.</p><p><strong>The landscape letter is only useful on a single tenant</strong>. If Dev, Test and Prod are three separate SCI tenants — as they are in most serious setups — the tenant <em>is</em> the landscape. Encoding it again in every artifact name buys you nothing and costs you something real: the name of a flow now changes as it’s transported, so ticket references, runbooks, and endpoint URLs all drift between stages. Leave the letter out.</p><p>Keep it only when one tenant genuinely hosts several stages, which does happen — small landscapes, PoCs, cost-constrained tenants.</p><p>Then what about backup and internal? This was the actual bug in our scheme: one character was carrying three unrelated axes.</p><ul><li><strong>Landscape</strong> (D/T/P) is a property of the <strong>tenant</strong>. Drop it when the tenant already answers the question.</li><li><strong>Standby, backup, blue/green</strong> is a property of <strong>one artifact inside</strong> a tenant — the twin lives right next to the original, in the same tenant, whatever your landscape model. So it is never a landscape letter. It belongs in the _&lt;variant&gt; suffix: _blue, _green, _standby.</li><li><strong>Internal</strong> is a direction, not a landscape and not a variant. It’s INT, in the next token. Our early draft had I as an env letter; that&#39;s the same word doing two jobs, and it will confuse someone within the month.</li></ul><p>One consequence to accept deliberately: with the letter optional, prefix length differs between landscape models — SCI1100010 versus SCIP1100010. That&#39;s fine, as long as it&#39;s fixed <em>within</em> one landscape and your validation regex knows which model you&#39;re on.</p><h3>&lt;project&gt;&lt;sequence&gt; — seven digits, zero-padded</h3><p>Two digits for the project or business area (11 payroll, 13 banking, 07 partner logistics), five for the flow itself.</p><p>Sequences step by <strong>10</strong> — 00010, 00020, 00030 — leaving room to insert. Helper flows attach to their parent with +1: the request flow is 00110, its response handler 00111, its post-processor 00112. A support engineer reading SCIP0700111 in an alert knows instantly it belongs to 00110.</p><p><strong>Zero-pad without exception</strong>. Seven digits, always. This single rule carries the entire value of a numeric prefix, and it is the first one your team will break.</p><h3>&lt;direction&gt; — from the customer&#39;s perspective</h3><p>IN into the customer&#39;s landscape · OUT out of it · INT between the customer&#39;s own systems · EXT between two systems that are both outside it</p><p>The anchor clause matters more than the list. “Inbound” is meaningless until you name the thing it is inbound <em>to</em>. Write the perspective down, once, in the convention itself — otherwise every developer picks their own, and half your names invert.</p><h3>&lt;source&gt; and &lt;target&gt; — systems, not partners</h3><p>Short names from a closed list. Where an endpoint is country-specific, append the ISO 3166–1 alpha-2 code: PAYROLL-DE, ALLOGA-PT.</p><p>Splitting v1’s single &lt;partner&gt; into two slots is what finally let the scheme describe internal integrations, hub-and-spoke routing, and three-legged flows where the partner isn&#39;t either endpoint.</p><h3>&lt;srcProto&gt; and &lt;tgtProto&gt; — protocols, from a closed list</h3><p>HTTP SFTP AS2 IDOC SOAP ODATA AMQP JMS MAIL FTPS PD (ProcessDirect) JOB</p><p>Closed list, one spelling each. Pick PD or ProcessDirect, ODATA or OData, and never the other. Mixed spellings break every search and sort you built the convention for.</p><h3>&lt;message&gt; — the business content</h3><p>PaymentOrder, InboundDelivery, MasterData. This is what a business analyst reads. v1 had it; our production practice let it dissolve into free text. Keep it as a real, required slot.</p><h3>&lt;variant&gt; — optional, and from a closed list</h3><p>manual · migration · retry · resp · blue / green · standby</p><p>The hard-won rule: <strong>a free-text tail becomes a landfill</strong>. Ours accumulated _tmp, _bkp, _test, _manual, _migration, _maninput2, and one _manualTestNazuris before anyone noticed. If a variant isn&#39;t on the list, it doesn&#39;t go in the name — it goes in the description field.</p><h3>Two worked examples</h3><pre>SCIP0700110_OUT_ESB_PARTNERWMS_HTTP_AS2_DeliveryConfirm</pre><p>Production. Outbound from the customer’s landscape. From the internal ESB to a partner warehouse system, HTTP in, AS2 out, carrying delivery confirmations. Project 07, flow 00110.</p><pre>SCIP0700111_OUT_ESB_PARTNERWMS_HTTP_AS2_DeliveryConfirm_resp</pre><p>The response handler for exactly that flow — +1 says so before you read another character.</p><h3>How naming conventions actually rot</h3><p>Every failure below is one we made, in a live tenant, having written the rules ourselves.</p><p><strong>Padding drifts</strong>. 130050 shows up next to 1300010 and 10000010. Six, seven, eight digits, same registry. Sorting is gone, and sorting was the point. <em>Validate the length; don&#39;t trust discipline.</em></p><p><strong>One slot ends up carrying several ideas</strong>. Our landscape letter accumulated P and T(genuinely landscapes), B (a standby twin, which is not a landscape), and I (internal — which is a direction). Three unrelated axes, one character. Backups then <em>also</em> picked up a _bkp suffix, and _bkp_green on top, so no single query finds all of them. <em>One axis per slot, one slot per axis.</em></p><p><strong>Optional tokens quietly become absent tokens.</strong> A handful of utility flows shipped with no direction at all. Once a slot is skippable, position-based parsing dies. <em>If it’s in the template, it’s mandatory.</em></p><p><strong>Metadata contradicts the name</strong>. We have a P-prefixed artifact sitting in a test package, and country codes that disagree with their own registry column — BGR against BG, RSagainst SR, and one payroll flow labelled SD for what the registry calls France. <em>The name and the registry must be checkable against each other, or one will lie.</em></p><p><strong>The registry becomes a place things are copied into</strong>. Six byte-identical rows for the same artifact. <em>Uniqueness needs a constraint, not a convention.</em></p><p>Notice that none of these are design flaws. The scheme was fine. What was missing was <strong>enforcement</strong> — and a naming convention with no validation step is a style guide, not a standard.</p><h3>The three rules that keep it alive</h3><ol><li><strong>One registry, and it is the authority</strong>. Project codes, system short names, protocol abbreviations, and variant keywords all come from it. Notion, Confluence, a repo — the tool is irrelevant; single-source is not.</li><li><strong>Uniqueness is enforced, not assumed</strong>. Project codes unique globally; sequences unique within a project; the full artifact name unique per landscape.</li><li><strong>Names are validated before deploy</strong>. A regex in a pipeline, or a checklist item in review. Fifteen minutes of work, and it is the difference between the v1 article and this one.</li></ol><h3>Conclusion</h3><p>The original guide wasn’t wrong. It was untested. What two years added was a landscape letter, an honest perspective anchor, two endpoints instead of one partner, project-based numbering, and closed lists everywhere a human might improvise.</p><p>And the real lesson isn’t in the template at all: a convention nobody validates degrades into a suggestion. Write the regex.</p><p>The original version stays up for anyone who wants to see where this started.</p><h3>Addendum — extension topics</h3><p><em>Optional reading. The core convention above is complete without it.</em></p><h3>Name vs. ID: which one does this govern?</h3><p>Both, and this trips people up. An SCI integration flow has a <strong>Name</strong> (display, freely editable) and an <strong>ID</strong> (technical, embedded in the artifact, painful to change once deployed and referenced).</p><p>Apply the convention to <strong>both, identically</strong>. A flow whose Name and ID disagree is worse than one with no convention at all, because tooling reads the ID while humans read the Name, and your monitoring and your support engineer will describe different worlds.</p><p>Practical consequence: get the ID right at creation time. Renaming an ID after deployment means undeploy, edit, redeploy, plus updating every ProcessDirect address, every partner-facing endpoint, and every reference in a value mapping that points at it.</p><h3>Length and character limits</h3><p>Keep names under roughly 120 characters. Names propagate into HTTP endpoint addresses, ProcessDirect URIs, monitoring filters, and CSV exports — and something in that chain will truncate. Stick to A–Z a–z 0–9 _ -. No spaces, no dots, no diacritics.</p><p>SCIT0700114_OUT_BIZTALK_PARTNERWMS_SFTP_AS2_OutboundDeliveryReplication is already 70 characters and comfortable. ..._SHP_OBDLV_SAVE_REPLICA_bkp_green is where it stops being comfortable.</p><h3>Adopting this in a tenant full of legacy flows</h3><p>Do not mass-rename. The cost is real (undeploy/redeploy, endpoint churn, partner coordination) and the benefit is cosmetic on flows nobody touches.</p><p>Instead:</p><ul><li><strong>All new artifacts follow the convention from day one</strong>. No exceptions, including throwaways — especially throwaways, since those are the ones that survive.</li><li><strong>Rename on substantial change</strong>. If a flow is being reworked and redeployed anyway, the marginal cost is near zero.</li><li><strong>Leave stable legacy flows alone</strong>, but record them in the registry with their would-be name. You get searchability without the risk.</li><li><strong>Never rename a partner-facing endpoint</strong> without a coordinated change window.</li></ul><p>Expect a mixed tenant for a year or two. That’s not failure; that’s the honest cost of naming conventions arriving after the integrations do.</p><h3>Sibling artifacts</h3><p>The same numeric prefix, reused, is what ties a solution together:</p><ul><li><strong>Packages</strong> — &lt;project code&gt; &lt;business area&gt;, e.g. 13 Bank Integrations. One package per project code per landscape.</li><li><strong>Value mappings</strong> — SCI&lt;project&gt;_VM_&lt;purpose&gt;</li><li><strong>Script collections</strong> — SCI&lt;project&gt;_SC_&lt;purpose&gt;</li><li><strong>Message mappings</strong> — SCI&lt;project&gt;&lt;sequence&gt;_MM_&lt;message&gt;, sharing the flow&#39;s sequence</li><li><strong>Credentials / OAuth</strong> — &lt;SYSTEM&gt;_&lt;usage&gt;, no flow number; they&#39;re shared and outlive individual flows. Add a stage marker only if one tenant really holds credentials for several stages — the same rule as the &lt;env&gt; letter, for the same reason</li></ul><h3>Registry columns worth having</h3><p>Artifact Name · ID · Project code · Landscape · Direction · Source · Target · Source protocol · Target protocol · Message type · Country · Package · Owner · Status · Deployed-on</p><p>The last three are what turn a naming table into something operations will actually open.</p><h3>Blue/green and standby twins</h3><p>Always the variant suffix, never a prefix letter — and the reason is structural, not stylistic.</p><p>A twin exists <em>alongside</em> its original, in the same tenant. A landscape marker answers “which stage is this?”, and both twins give the same answer. So encoding the twin as a landscape letter (SCIB0700110_...) mislabels it, and worse, it makes the twin sort away from the flow it shadows. SCIP0700110_..._blue and _green sit next to each other in the artifact list, exactly where you want them during a cutover.</p><p>What we did before was use the letter <em>and</em> a _bkp suffix <em>and</em> combinations of both — which is how you end up with SCIP08000100_IN_..._bkp_green and a support engineer at 2 a.m. who cannot tell you which artifact is live.</p><p>If you also keep a cold standby distinct from an active blue/green pair, that’s _standby. Another suffix, same slot.</p><h3>Single tenant vs. multi-tenant, restated</h3><p>The one decision to make before you adopt any of this:</p><p><strong>Separate tenants per stage</strong> (the common case) — omit the &lt;env&gt; letter. The tenant is the landscape. Names stay identical as an artifact is transported, so every reference to it survives the trip.</p><p><strong>One tenant, several stages</strong> — keep the letter, first position, D/T/P only. Never overload it with twins or directions.</p><p>Either way, twins are suffixes and directions are the direction token. The letter, when present, means exactly one thing.</p><h3>Why numeric prefixes at all?</h3><p>The objection is fair: names are searchable, so why encode meaning in digits?</p><p>Three reasons that only show up at scale.</p><p><strong>Stable identity</strong>. Partners get renamed, acquired, and merged. SCIP0700110 doesn&#39;t change when PARTNERWMS becomes something else, so tickets, runbooks, and monitoring dashboards from three years ago still resolve.</p><p><strong>Sortability</strong>. An artifact list ordered by name groups every flow of a project, in flow order, with helpers directly beneath their parents. Alphabetical sorting by system name scatters exactly the things you need together.</p><p><strong>Conversational compression</strong>. “Check 0700111” is a sentence a support engineer can say on a call. SCIP0700111_OUT_ESB_PARTNERWMS_HTTP_AS2_DeliveryConfirm_resp is not.</p><p>The digits are for machines and for tired humans at 2 a.m. The words are for everyone else. That’s why both halves are in the name.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10dfe6dc0f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Follow an HTTP Redirect in SAP CPI]]></title>
            <link>https://medium.com/claimate-tech/how-to-follow-an-http-redirect-in-sap-cpi-9c4293b63232?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c4293b63232</guid>
            <category><![CDATA[sap-integration-suite]]></category>
            <category><![CDATA[presigned-url]]></category>
            <category><![CDATA[apache-camel]]></category>
            <category><![CDATA[sap-cpi]]></category>
            <category><![CDATA[http-redirect]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 16:04:16 GMT</pubDate>
            <atom:updated>2026-07-16T17:07:58.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivPguKDOt7I8nSEK9RKQow.jpeg" /></figure><h4>The HTTP adapter does not follow redirects. Here is how to handle a 302 — and a trap that gives you a 403 on pre-signed URLs.</h4><p>Many APIs answer a request with <strong>302 Moved Temporarily</strong> and a Location header, instead of returning the data directly. The SAP CPI HTTP adapter does <strong>not</strong> follow that redirect automatically. This post shows how to handle it, and one trap that costs a lot of time when the redirect points to an AWS pre-signed URL.</p><blockquote><strong><em>TL;DR</em></strong><em> — CPI does not follow redirects. Read the </em><em>Location header and call it again. But if that URL is a pre-signed URL (AWS S3/CloudFront, Azure SAS, ...), the HTTP adapter re-encodes it and you get a 403. The safe fix is to make that second call from a Groovy script with </em><em>java.net.URL, which sends the URL exactly as it is.</em></blockquote><h3>Step 1: handle the redirect</h3><p>The CPI HTTP adapter has no “follow redirects” option. By default it even throws an exception on a 3xx response. The standard way to handle it:</p><ol><li>On the first HTTP call, set <strong>Throw Exception on Failure = OFF</strong>.</li><li>Copy the Location response header into a property (for example TargetLocation).</li><li>Make a second HTTP call to that URL.</li></ol><p>For most APIs this is enough. The problems start when the Location is a <strong>pre-signed URL</strong>.</p><h3>The trap: a 403 on the second call</h3><p>Here is a real example. The <strong>Basware API</strong> (public API behaviour, nothing customer-specific) returns the invoice attachment as a redirect:</p><pre>GET /v1/accountingDocuments/{id}/attachments/{attachmentId}<br>-&gt; 302, Location: https://api.us.basware.com/cfsecure/.../INVOICE%20%28copy%202%29%202026.pdf<br>   ?Expires=...&amp;Signature=W-4m2LqUesX~Bxpzq6CfZ~Upf87...&amp;Key-Pair-Id=...</pre><p>The second call to that pre-signed URL fails with <strong>403 Forbidden</strong>. But the same URL works in Postman or Bruno with “follow redirects” on. Why?</p><p>Turn on the trace and compare the Location you received with the URL CPI really sent (RealDestinationUrl). They are different:</p><pre>Path:    received  ...INVOICE%20%28copy%202%29%202026.pdf<br>         CPI sent   ...INVOICE%20(copy%202)%202026.pdf      (%28/%29 decoded to &quot;(&quot; &quot;)&quot;)</pre><pre>Query:   received  ...W-4m2LqUesX~Bxpzq6CfZ~Upf87...<br>         CPI sent   ...W-4m2LqUesX%7EBxpzq6CfZ%7EUpf87...   (every &quot;~&quot; encoded to %7E)</pre><p>A pre-signed URL is signed over the <strong>exact bytes</strong> of the URL. If one character changes its encoding, the signature no longer matches, and you get a 403. Postman sends the URL exactly as it is. CPI changes it.</p><p>Note: this is <strong>not an AWS problem</strong>. It happens with any URL where the exact encoding must stay the same — AWS S3/CloudFront, Azure SAS tokens, Google Cloud signed URLs, and others.</p><h3>Why CPI changes the URL</h3><p>The answer is not in the SAP Help Portal — it is in the <strong>Apache Camel source code</strong>, which the HTTP adapter is built on. Two layers change the URL:</p><ul><li><strong>Camel </strong><strong>UnsafeUriCharactersEncoder.</strong> Camel keeps a list (&quot;BitSet&quot;) of characters it treats as unsafe and encodes them. The tilde is on that list (unsafeCharactersHttp.set(&#39;~&#39;) in the source), so every ~ becomes %7E.</li><li><strong>Apache HttpClient.</strong> It normalizes the URI following RFC 3986. Parentheses are allowed in a path, so HttpClient <strong>decodes</strong> %28/%29 back to ( ).</li></ul><p>Neither layer can be turned off in the adapter. If you want to check it yourself:</p><ul><li>UnsafeUriCharactersEncoder: <a href="https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java">https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java</a></li><li>HttpProducer: <a href="https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java">https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java</a></li></ul><p>Reading the Camel source is a good habit — it answers questions the docs leave open.</p><h3>What does not fix it</h3><ul><li><strong>CamelHttpUri / </strong><strong>CamelHttpQuery headers.</strong> They only change which URL goes into the adapter. The adapter still runs the same encoder. (I confirmed this with a trace: still 403.)</li><li><strong>Adapter settings.</strong> There is no “raw URL” or “disable encoding” option.</li><li><strong>The </strong><strong>%25 escaping trick</strong> (SAP <strong>KBA 3131448</strong>, which I also described in an earlier post, <em>&quot;</em><a href="https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37"><em>SAP Cloud Integration — URL escaping hack</em></a><em>&quot;</em>). It helps with characters the adapter <em>decodes</em> (the parentheses): send %2528, and it stays %28. But it cannot help with the tilde, because the adapter always <em>encodes</em> ~ to %7E and there is no input that keeps a plain ~. So a configuration-only fix is not possible here.</li></ul><h3>The fix: call the URL from Groovy</h3><p>Since no setting stops the encoding, make the second call <strong>outside</strong> the adapter — from a Groovy script with java.net.URL. new URL(str) sends the URL exactly as it is, like a browser or Postman.</p><p>Replace the second HTTP call (the Request-Reply step and its receiver channel) with one Groovy script step that reads the pre-signed URL from the property and downloads the file:</p><pre>import com.sap.gateway.ip.core.customdev.util.Message<br>import java.net.HttpURLConnection<br>import java.net.URL<br><br>/**<br> * Downloads a file from a pre-signed URL captured from the 302 &quot;Location&quot; header<br> * (stored in property TargetLocation).<br> *<br> * Why Groovy and not the HTTP adapter:<br> * The CPI HTTP adapter (Apache Camel + HttpClient) always re-encodes the URL - it<br> * turns &#39;~&#39; into &#39;%7E&#39; and decodes &#39;%28&#39;/&#39;%29&#39; to &#39;(&#39; &#39;)&#39;. A pre-signed URL is<br> * signed over the exact bytes, so any change -&gt; 403. java.net.URL sends the URL<br> * exactly as it is.<br> */<br>def Message processData(Message message) {<br><br>    def messageLog = messageLogFactory.getMessageLog(message)<br>    def rawUrl = message.getProperty(&quot;TargetLocation&quot;)?.toString()<br><br>    // Guard: nothing to download<br>    if (rawUrl == null || rawUrl.trim().isEmpty()) {<br>        if (messageLog != null) {<br>            messageLog.addCustomHeaderProperty(&quot;Termination_Reason&quot;, &quot;Missing_TargetLocation&quot;)<br>        }<br>        throw new IllegalStateException(&quot;TargetLocation is empty - no URL to download&quot;)<br>    }<br><br>    HttpURLConnection conn = null<br>    try {<br>        URL url = new URL(rawUrl)                    // keeps the URL byte-for-byte<br>        conn = (HttpURLConnection) url.openConnection()<br>        conn.setRequestMethod(&quot;GET&quot;)<br>        conn.setInstanceFollowRedirects(true)<br>        conn.setConnectTimeout(60000)<br>        conn.setReadTimeout(60000)<br>        // Pre-signed URL is self-authenticating -&gt; no Authorization header.<br><br>        int rc = conn.getResponseCode()<br>        if (messageLog != null) {<br>            messageLog.addCustomHeaderProperty(&quot;Attachment_HTTP_Status&quot;, String.valueOf(rc))<br>        }<br><br>        if (rc &gt;= 200 &amp;&amp; rc &lt; 300) {<br>            // Read the body in 8 KB chunks. Fine for normal documents;<br>            // for very large files, use a streaming pattern to avoid OOM.<br>            def buffer = new ByteArrayOutputStream()<br>            conn.getInputStream().withStream { input -&gt;<br>                byte[] chunk = new byte[8192]<br>                int n<br>                while ((n = input.read(chunk)) != -1) {<br>                    buffer.write(chunk, 0, n)<br>                }<br>            }<br>            byte[] data = buffer.toByteArray()<br><br>            message.setBody(data)<br>            def ct = conn.getContentType()<br>            if (ct != null) { message.setHeader(&quot;Content-Type&quot;, ct) }<br>            message.setHeader(&quot;CamelHttpResponseCode&quot;, rc)<br><br>            if (messageLog != null) {<br>                messageLog.addCustomHeaderProperty(&quot;Attachment_Size_Bytes&quot;, String.valueOf(data.length))<br>            }<br>        } else {<br>            def err = &quot;&quot;<br>            try {<br>                def es = conn.getErrorStream()<br>                if (es != null) { es.withStream { err = it.getText(&quot;UTF-8&quot;) } }<br>            } catch (ignored) { }<br>            if (messageLog != null) {<br>                messageLog.addCustomHeaderProperty(&quot;Termination_Reason&quot;, &quot;Download_Failed&quot;)<br>                messageLog.addCustomHeaderProperty(&quot;Error_Detail&quot;, &quot;HTTP &quot; + rc + &quot;: &quot; + err)<br>            }<br>            throw new RuntimeException(&quot;Download failed, HTTP &quot; + rc + &quot;: &quot; + err)<br>        }<br>    } finally {<br>        if (conn != null) { conn.disconnect() }<br>    }<br><br>    return message<br>}</pre><h3>A note on using Groovy for HTTP</h3><p>SAP recommends the HTTP adapter by default, and that is a good rule. But for a public pre-signed URL, the usual reasons against Groovy do not apply: no Cloud Connector, no client certificate, no proxy needed on Cloud Foundry. Two things still matter, and the script handles both: add MPL log entries so the call is visible in monitoring, and be careful with memory for very large files (stream instead of loading the full body).</p><h3>Summary</h3><ul><li>The CPI HTTP adapter does not follow redirects — read the Location header and call again.</li><li>A 403 on a pre-signed URL is usually <strong>URL re-encoding</strong>, not authentication, and it is not AWS-specific.</li><li>The adapter re-encodes the URL in two layers (~ → %7E and %28 → (), and this cannot be turned off. When unsure, read the Camel source.</li><li>The %25 trick (KBA 3131448) fixes the parentheses but not the tilde.</li><li>To send the URL exactly as it is, use a <strong>Groovy script with </strong><strong>java.net</strong>, and add MPL logs.</li></ul><h3>References</h3><ul><li>SAP KBA 3131448 — <em>HTTP Receiver adapter discards encoding of special characters in address</em></li><li><em>SAP Cloud Integration — URL escaping hack</em> (my earlier post): <a href="https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37">https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37</a></li><li>Apache Camel UnsafeUriCharactersEncoder: <a href="https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java">https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java</a></li><li>Apache Camel HttpProducer: <a href="https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java">https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4293b63232" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claimate-tech/how-to-follow-an-http-redirect-in-sap-cpi-9c4293b63232">How to Follow an HTTP Redirect in SAP CPI</a> was originally published in <a href="https://medium.com/claimate-tech">CLAIMATE Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[284 billion parameters on your desk: running DeepSeek V4 Flash on the NVIDIA GB10 Superchip]]></title>
            <link>https://medium.com/@vbalko/284-billion-parameters-on-your-desk-running-deepseek-v4-flash-on-the-nvidia-gb10-superchip-712823a1d819?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/712823a1d819</guid>
            <category><![CDATA[nvidia-gb10]]></category>
            <category><![CDATA[deepseek-v4]]></category>
            <category><![CDATA[speculative-decoding]]></category>
            <category><![CDATA[local-llm]]></category>
            <category><![CDATA[flash-attention]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Sun, 17 May 2026 19:17:19 GMT</pubDate>
            <atom:updated>2026-05-18T06:23:04.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tAO2KOkxxtbit5_qaG_CbA.png" /></figure><p>This weekend I ran DeepSeek V4 Flash (284B MoE, 13B active) on a single ASUS Ascent GX10 — the ASUS-branded GB10 Superchip workstation. The model fits, runs at 15–19 tokens/sec decode at 128K context, and is genuinely usable as a backend for coding agents.</p><p>My motivation was three-fold:</p><ol><li>See what GB10 can actually do with a frontier-class open model</li><li>Push the silicon to the limit — try to wring out every percent</li><li>Touch the recent wave of LLM-optimization techniques that have emerged in the last few weeks: MTP (multi-token prediction), TurboQuant KV compression, EAGLE-3, custom Flash Attention kernels for unusual head dims, etc.</li></ol><p>I tried each of them. Some worked, most didn’t (for reasons I’ll get into), and the cumulative weekend speedup ended up around +10.5% over Saturday’s baseline. Here’s the technical breakdown — every attempt, every failure, every “huh, that’s interesting.”</p><h3>Setup — hardware and model</h3><p>The box: ASUS Ascent GX10 — ASUS’s productization of NVIDIA’s GB10 design (same Superchip as NVIDIA’s own DGX Spark, just a different OEM enclosure):</p><ul><li>GB10 Grace Blackwell Superchip:</li><li>20 ARM cores (10× Cortex-X925 + 10× Cortex-A725)</li><li>Blackwell GPU integrated (~1 PFLOP FP4, native MXFP4 tensor cores)</li><li>128 GiB LPDDR5X unified memory @ 273 GB/s — shared between CPU and GPU</li><li>Compute capability 12.1 (sm_121a)</li><li>Comes preloaded with Ubuntu 24.04 + CUDA 13.0 + NVIDIA driver 580</li></ul><p>This is not server-class hardware. It’s a quiet workstation-class node, ~$4000 retail, designed for personal AI work. The unified memory is the whole pitch: 128 GB of GPU-addressable memory at less than half the latency of full discrete GPU memory.</p><p>The model: DeepSeek V4 Flash, released April 24 2026 by DeepSeek-AI:</p><ul><li>284 billion total parameters, 13B active per token (MoE, 256 experts, top-K=6)</li><li>1 million token native context</li><li>Hybrid attention: Compressed Sparse Attention (CSA) + Heavily Compressed Attention (HCA)</li><li>MTP head (Multi-Token Prediction) trained jointly as 1 extra layer</li><li>MIT license, weights on HuggingFace</li></ul><p>V4 Flash’s native checkpoint is ~160 GB (FP4-FP8 mixed). For a single 128 GB box you need community quants.</p><p>I used antirez (Salvatore Sanfilippo)’s quantization: DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix.gguf — 87 GB.</p><h4>What’s “IQ2_XXS” and why does it work?</h4><p>A 2-bit-per-weight quantization that <em>isn’t</em> awful needs to be smart about which bits go where. The recipe:</p><ul><li>Routed experts (the bulk of V4’s parameters, 256 of them per layer, of which only 6 fire per token): IQ2_XXS — &quot;i-quant&quot; extra extra small. 2 bits per weight nominally, ~2.06 bits-per-channel effective. Uses a codebook lookup (E8 lattice centroids) instead of straight per-tensor scaling. The &quot;i&quot; prefix means importance-matrix calibrated — antirez ran ~1M tokens through the FP16 model, recorded which weights matter most, and used that to bias quantization toward preserving the high-impact channels.</li><li>Attention LoRA Q/B projections, shared experts, output projection: Q8_0 — 8-bit, basically lossless. These tensors are <em>active on every token</em> (no MoE gating), so the quality hit from aggressive quantization would compound badly.</li><li>Output unembed: also Q8_0.</li></ul><p>The result: 86.72 GB total, fits with 30+ GiB free for KV cache and runtime buffers. Quality, by my measurement at temperature=0, is indistinguishable from FP8 for chat and code prompts — V4 was designed with aggressive quantization in mind (the official native checkpoint mixes FP4 experts with FP8 attention).</p><p>There’s also a separate 3.8 GB MTP weights file (DeepSeek-V4-Flash-MTP-Q4K-Q8_0-F32.gguf). This is the trained MTP head — one extra transformer layer that DeepSeek trained jointly with the main 43-layer stack. Its job at inference: given the parent model&#39;s hidden state at position t and the predicted next token, predict token t+2 in parallel. We&#39;ll come back to this in Attempt 1.</p><h3>The first plot twist: V4 is already well-optimized</h3><p>What I expected: huge model on small-ish memory bandwidth box (273 GB/s) → bandwidth-bound decode → low t/s, room for tricks.</p><p>What I measured with llama.cpp (the Fringe210 fork of antirez’s V4-specific llama.cpp branch):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*3r8NhGMASXy_kgRSDbVxIQ.png" /></figure><p>ContextMemory usedDecode @ 8K promptDecode @ 128K context fully filled16K84 GiB14.78 t/s–128K (production)87 GiB15.4 t/s–1M94 GiB (+9 vs 16K)14.82 t/s10.6 t/s @ 8K prompt</p><p>Three surprises:</p><ol><li>Decode is essentially the same at 16K vs 1M context (14.78 vs 14.82 t/s). On any normal Transformer, going from 16K to 1M would 64× the KV cache and <em>crater</em> the decode — meaning per-token generation slows to a crawl, because attention has to read more and more cached keys/values from memory for each new token. At 1M context with f16 KV, you’re moving hundreds of GB through memory bandwidth per token. V4 doesn’t crater because of how its attention works:</li></ol><ul><li>CSA (Compressed Sparse Attention): compresses chunks of past KV state by 4× into “summary tokens,” then does query-dependent top-K selection over those summaries. So instead of attending to all 1M cached positions, the model attends to a few hundred summaries.</li><li>HCA (Heavily Compressed Attention): compresses <em>even harder</em> — by 128× — and runs dense attention over the resulting short sequence. Because the sequence is now ~8K tokens of summaries for a 1M context, dense attention is cheap.</li><li>V4 interleaves CSA and HCA layers through the stack, getting both fine-grained query-dependent attention (CSA) and broad global context (HCA) at extremely low cost.</li><li>Net effect: the per-token attention cost stays roughly constant as context grows. No crater.</li></ul><ol><li>The 1M KV cache is only ~7 GB, not 50+ GB. That compression is real, and it’s the whole point of V4’s “Flash” variant.</li><li>Prefill peaks at ~334 tokens/sec for ~256-token prompts, then degrades to ~220 t/s at 9K — a totally non-pathological curve. Long-context prefill is workable.</li></ol><h4>Visualization 1 — V4 doesn’t crater</h4><pre>Decode tokens/sec by context size (small prompt, V4-Flash baseline)</pre><pre>  15 ┤●────●────●────●────●       ← Hybrid CSA+HCA keeps decode flat<br>  14 ┤<br>  13 ┤<br>  12 ┤<br>  11 ┤<br>  10 ┤<br>     └────┬────┬────┬────┬────┬──<br>       16K   64K  128K  256K   1M    context</pre><pre>Compare: a standard Transformer with f16 KV would drop ~80%<br>from 16K to 1M on this hardware.</pre><h4>Visualization 2 — prefill vs prompt size</h4><pre>Prefill t/s vs prompt tokens (V4-Flash @ 128K ctx, baseline)</pre><pre> 350 ┤        ●  (285 tok: 330 t/s peak)<br> 300 ┤      ╱  ╲<br> 250 ┤    ╱      ╲● (1138)<br> 200 ┤  ╱           ●─────● (4552 → 8890, ~220 t/s)<br> 150 ┤<br> 100 ┤●● (72: ~170 t/s)<br>  50 ┤<br>  30 ┤● (18: 30 t/s — first-token alloc overhead)<br>     └────┬────┬────┬────┬────┬────<br>        18   72  285  1K   4K   9K     prompt size</pre><p>DeepSeek’s paper claims V4-Flash uses only ~7% of V3.2’s KV cache and ~10% of V3.2’s inference FLOPs. The benchmarks back this up. The bandwidth-bound bottleneck you’d expect on this hardware just isn’t there.</p><p>This sets up the real question.</p><h3>The wrong question, and how I asked it for three days</h3><p>The wrong question is: “how do I get V4 to run faster?”</p><p>That implies there’s a speedup left on the table. There mostly isn’t, because V4’s authors already took most of them. The right question is “where is the actual decode time going, and which of those buckets is amenable to optimization?”</p><p>I asked the wrong question for most of the weekend.</p><h4>Attempt 1: MTP via antirez’s ds4 engine</h4><p>DeepSeek V4 ships with a trained MTP head (multi-token prediction). The idea: predict 1 token ahead, verify in the same forward pass as the main model. If accepted, you got 2 tokens for the price of one decode step.</p><p>Antirez wrote a dedicated C+CUDA inference engine, ds4, with native MTP support. Build: make cuda-spark on GB10. Works, fast, polished.</p><blockquote>I ran a 4×3 sweep across two MTP-tuning knobs:<em>Parameter notes (ds4’s MTP API):</em></blockquote><blockquote>--mtp-draft N: maximum number of draft tokens the MTP head proposes per speculative step. N=1 means &quot;predict one token ahead.&quot; N=4 means &quot;try predicting 4 tokens ahead via recursive draft.&quot;</blockquote><blockquote>--mtp-margin F: minimum confidence threshold (in log-prob space) for the draft to &quot;commit&quot; to a proposal before verification. Higher = stricter = lower acceptance but fewer wasted verifications.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*SDIFiEe5wdrYwrKpyIqDrg.png" /></figure><p><strong>MTP doesn’t help.</strong> Best case (draft=1): -1% (noise). Anything &gt; 1: -40–50%.</p><blockquote>Antirez’s own README acknowledges: <em>“the MTP/speculative decoding path is still experimental: at most a slight speedup, not a meaningful generation-speed win.”</em> My measurements confirm.</blockquote><p>Why? The MTP head is itself a 256-expert MoE layer (~3.6 GB Q4). Each draft forward is roughly as expensive as one main-model step. With 100% acceptance, that nets zero. With realistic acceptance &lt; 100% (at temperature &gt; 0), it’s a net loss.</p><p>This was the first hint that V4 isn’t bandwidth-bound — if it were, the cheap MTP draft would amortize over the saved main-model decode step. Instead the draft costs about the same as what it saves.</p><h4>Attempt 2: implement MTP in llama.cpp from scratch</h4><p>I wanted MTP in llama-server specifically — that&#39;s what opencode (my coding-agent harness) talks to via OpenAI-compatible API. Fringe210&#39;s CUDA fork doesn&#39;t have MTP. I delegated to a Claude Code subagent with a detailed spec.</p><p>The subagent produced ~400 LOC of patches across 14 files: new arch enum, 32 new tensor enums, new layer struct, new C API for sharing parent’s token_embd / output / vocab with the draft, new llm_build_deepseek4_mtp graph class. The build passed, the server loaded the draft, and at temperature=0 it reported 100% acceptance. By every box-checking metric, MTP was working.</p><p>The actual benchmark numbers were a different story:</p><pre>Decode tokens/sec vs context size (our MTP impl)</pre><pre>  15 ┤●  (16K: 10.8)<br>  12 ┤<br>   9 ┤    ●  (64K: 8.5)<br>   6 ┤<br>   3 ┤         ●  (256K: 1.4)<br>   0 ┤              ●  (1M: 0.24)  ← catastrophic<br>     └────┬────┬────┬────┬────<br>       16K   64K  256K   1M</pre><pre>ds4 reference impl (same hardware, same model, same algorithm):<br>   ●─────●─────●─────●─────●─────●  ~13.5 t/s flat across 32K to 1M</pre><p>A <strong>56× regression at 1M context</strong> versus the reference implementation. Same hardware, same model, same algorithm — different code.</p><p>Short version of what was wrong: the draft layer used a h_t = e_t shortcut (token embedding as a stand-in for parent hidden state) and disabled the compressed-attention pathway in the MTP layer. The result is effectively <strong>O(N²) </strong>attention scaling with the <em>configured max context</em>, not actual sequence length. Patching it hits a deeper issue with V4&#39;s recurrent state cache also scaling with n_ctx_seq — fixable, but ~8-15 hours of work I didn&#39;t commit to.</p><p><strong>Lesson #1: code completeness ≠ performance correctness. </strong>The MTP code loads and generates valid tokens — but 56× slower than a known-good reference. You don’t catch this with unit tests; you catch it by benchmarking against a reference implementation on day 1.</p><blockquote>(Bonus: also worth noting that upstream ggml-org/llama.cpp merged MTP support for Qwen — <a href="https://github.com/ggml-org/llama.cpp/pull/22673">PR #22673 by am17an</a>, May 16 2026, the day before this experiment. Their architecture uses separate llama_context for the draft but shares token embeddings and uses an after-ubatch hook to plumb the parent hidden state. On Qwen3.6-27B + RTX 3090: 1.85× decode speedup with 72-75% acceptance. So MTP <em>can</em> work — it just doesn&#39;t on V4 in its current form.)</blockquote><h3>TurboQuant: an excellent paper, a poor fit</h3><p>After MTP didn’t pan out, I went looking for orthogonal speedups. TurboQuant (Zandieh et al., ICLR 2026) caught my eye: a Walsh-Hadamard-rotation + Lloyd-Max-codebook KV cache quantizer with 3.5 bits-per-channel lossless or 2.5 bpc with marginal degradation. 4.5× compression of f16 KV cache. Implementations exist for llama.cpp.</p><p>If decode is bandwidth-bound and the KV cache is sitting in HBM, a 4.5× KV compression should give ~4.5× decode speedup.</p><p>I delegated the port to another subagent. The subagent’s first action — and credit to it — was to read the V4-specific code and report back: TurboQuant doesn’t help on V4. Three reasons:</p><ol><li>V4’s KV cache is already quantized. The fork has a custom GGML_OP_DSV4_FP8_KV_QUANTIZEkernel that quantizes the compressed-cache outputs to FP8 (8-bit). TurboQuant on top of FP8 would be double-quantization, not 4.5× over f16.</li><li>V4 attention doesn’t go through ggml_flash_attn_ext. It uses explicit mul_mat → soft_max → mul_mat. The &quot;fused dequant inside Flash Attention&quot; optimization (which is where TurboQuant&#39;s wins live in the reference impl) has nowhere to dispatch.</li><li>The compressed KV at 128K context is only 860 MiB, not the multi-GB I assumed. It’s not the dominant memory traffic; the dense per-token matmuls and the indexer top-k path are.</li></ol><p>The subagent refused to do the work and wrote a clean report.</p><blockquote><strong>This was the most productive 3 minutes of the weekend.</strong></blockquote><h3>The actual bottleneck: Flash Attention auto-disabled</h3><p>The same subagent’s investigation pointed me at the real issue. V4’s server log had been quietly emitting:</p><pre>sched_reserve: layer 2 is assigned to device CUDA0 but the Flash Attention<br>  tensor is assigned to device CPU (usually due to missing support)<br>sched_reserve: Flash Attention was auto, set to disabled</pre><p><strong>Flash Attention is disabled for 41 of V4’s 43 layers.</strong></p><p>Why? V4 has head_dim=512 (large MLA latent rank). llama.cpp’s fattn-mma-* CUDA kernels require K_seqlen % 256 == 0 for head_dim=512 to enable Tensor Core packing. V4&#39;s compressed-attention path produces K_seqlen = 1 + n_comp_visible, which is essentially never divisible by 256 (e.g. decode at 128K: 1 + 32767 = 32769, not divisible).</p><p>So CUDA refuses the kernel, scheduler falls back to explicit mul_mat + softmax + mul_mat, and we lose the Flash Attention win on 95% of attention layers.</p><p>A subagent did a Path A + Path B experiment:</p><ul><li><strong>Path A:</strong> enable FA for the 2 dense layers (compress_ratio=0) by suppressing the broken cases at the graph level. Server log now says <em>“Flash Attention was auto, set to enabled”</em>.</li><li><strong>Path B:</strong> swap the FP8 quantization in dsv4.cu for Walsh-Hadamard + Lloyd-Max (still 8-bit storage, just a different math path).</li></ul><p>Combined gain: +1 to +5% decode across context sizes. Modest because only 2 of 43 layers benefit.</p><p>The real win — +10–15% decode — requires writing a custom CUDA Flash Attention kernel for head_dim=512 without the 256-alignment constraint. I delegated this to another subagent. The result:</p><h3>Outcome of the custom kernel (updated)</h3><p>The subagent wrote a from-scratch CUDA kernel (ggml/src/ggml-cuda/fattn-v4-head512.cu, ~300 LOC):</p><ul><li>Standard online-softmax Flash Attention (Rabe-Staats / FA2 pattern)</li><li>Single-block per (head, sequence), 256 threads, 67 KB shared memory</li><li>Handles arbitrary K seqlen via per-tile clamping — solves the alignment problem</li><li>fp32 accumulators, half I/O</li></ul><p>Result on the full matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*kvr4paaDiWpryBuPkT1SaQ.png" /></figure><p><strong>Total weekend gain: +8–11% decode</strong> across context sizes. Quality preserved on factual, narrative, and code prompts.</p><p>But here’s the kicker — the subagent’s honest debrief: the kernel uses scalar fp32 fmadd, not Tensor Cores. The stock MMA kernel uses Blackwell’s Tensor Core instructions for ~30× higher arithmetic throughput per op. <strong>The pragmatic alternative</strong>, which I didn’t ask for: just relax the existing MMA dispatcher to accept V4’s head_dim=512 + Q-&gt;ne[1]==1 case by adding 4 template instantiations. Estimated 3–5 hours of work. Expected gain: +12–15% (using actual Tensor Cores instead of scalar math).</p><p>So there’s still more on the table. The custom kernel was 1–2 days of work that the subagent did honestly and well, but the cheaper path was sitting in the existing codebase the whole time. Lesson #6: <strong>read the existing dispatcher before writing a new kernel.</strong></p><h3>What I’d tell someone starting this experiment over</h3><p>The goal of the weekend wasn’t to ship a 50%-faster V4 in production. It was to <em>try things</em>: get a feel for what GB10 can actually run, touch the new wave of optimization techniques, see which ones transfer and which don’t. By that bar, every “failed” attempt was a successful experiment — I now know things about V4’s internals that I couldn’t have learned without trying.</p><p>That said, a few patterns showed up worth writing down:</p><ol><li><strong>Don’t trust general-purpose optimization claims for highly-specialized models.</strong> V4 is sufficiently custom (MLA, CSA, HCA, MTP, hyper-connections, gated delta net) that off-the-shelf tricks miss. The “TurboQuant gives 4.5× compression” claim is true for f16 KV on standard transformers; it’s irrelevant for V4 because the KV path is already FP8-quantized and the attention doesn’t use ggml_flash_attn_ext. Read the model&#39;s source first, then optimize.</li><li><strong>Reference implementations are gold.</strong> ds4 saved me hours of debugging by being a known-good baseline. The 56× MTP regression in my llama.cpp port was invisible from inside my own code — it only showed up when compared against ds4 running the same algorithm on the same hardware.</li><li><strong>The unified-memory pitch of GB10 is real.</strong> 87 GB models that wouldn’t fit on any single discrete GPU run at usable speeds on this thing. Long context comes essentially for free thanks to V4’s hybrid attention. This is a genuinely useful machine.</li><li><strong>The 273 GB/s bandwidth is <em>not</em> the bottleneck for V4 specifically.</strong> I went in expecting it to be the limiter and it isn’t. Indexer top-k and per-token MoE compute dominate. Don’t assume your slowest hardware metric is the binding constraint.</li><li><strong>The new optimization techniques aren’t interchangeable.</strong> MTP, TurboQuant, EAGLE-3, Flash Attention variants — they each target a specific layer of the inference stack. You can’t just pick the one with the biggest headline number; you need to understand which bottleneck <em>yours</em> hits. For V4 on GB10, that turned out to be Flash Attention auto-disabled by a CUDA alignment constraint — not what I would have guessed going in.</li></ol><h3>Visualization 3 — cumulative weekend speedup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*DpWAirAUdpcpS3wukHjRCQ.png" /></figure><h3>Visualization 4 — what failed and why</h3><pre>Attempt              | Time   | Outcome<br>─────────────────────┼────────┼────────────────────────────────────────<br>MTP via ds4          | ~2h    | Best case -1% (no speedup)<br>MTP in llama.cpp     | ~5h    | -27% to -98% (catastrophic, bug)<br>TurboQuant adapt     | ~3min  | Subagent refused: doesn&#39;t fit V4 ★<br>Path A (FA dense)    | ~4h    | +2.4% (only 2 of 43 layers benefit)<br>Path B (Lloyd-Max)   | ~3h    | +0.6% (storage already FP8)<br>Custom FA kernel     | ~2h    | +7.3% (the actual win, no TC use yet)<br><br>★ Most productive 3 minutes of the weekend.</pre><h3>Where this lands</h3><p>For my coding-agent setup (V4 Flash served on :8005 via opencode-compatible API):</p><ul><li><strong>15–19 t/s decode at 128K context</strong>, no MTP, full quality</li><li>Long-context (256K+) works without performance degradation</li><li>Quality is genuinely good — IQ2_XXS at 87 GB stays close to FP8 native (160 GB) for chat/code tasks</li><li><strong>+8–11% over baseline</strong> from the full weekend’s optimization stack (FA enable + Lloyd-Max KV + custom head_dim=512 kernel)</li><li>The remaining ~4–7% (to hit the +15% theoretical) is one dispatcher tweak away (Tensor Cores via MMA template instances)</li></ul><p><strong>Net of the weekend</strong>: V4 Flash on GB10 is demonstrably faster than the day I started, the optimizations are upstream-able, and there’s a clear (and cheap) next step. The final pragmatic recommendation is to skip the custom kernel and instead extend the MMA dispatcher with V4-shape-aware template instances. That’s the path that uses Blackwell’s Tensor Cores properly and is ~3–5 hours of focused work.</p><h3>Appendix: full data tables</h3><p>[See “DATA TABLES” section below]</p><h3>Appendix: source code</h3><p>All four attempts are preserved as branches in the local working copy on gx10:</p><ul><li>master — Fringe210 upstream, commit 44c7b01 (untouched)</li><li>weekend/03-path-a-b — after Attempts 1+2 (MTP scaffolding) and 3 (FA enable + Lloyd-Max). Production state mid-Sunday afternoon.</li><li>weekend/04-final — + Custom V4 head_dim=512 Flash Attention kernel. Production state Sunday evening, what :8005 is running.</li></ul><p>Each commit message documents the full chain of changes. The MTP-only states from Attempts 1 and 2 weren’t separately checkpointed because they were never production candidates — refer to the weekend/03-path-a-b commit message for the cumulative diff narrative.</p><h3>Appendix: tools used</h3><ul><li>llama.cpp (Fringe210 fork of antirez/llama.cpp-deepseek-v4-flash, sm_121a build)</li><li>antirez/ds4 (independent V4 inference engine, make cuda-spark)</li><li>antirez/deepseek-v4-gguf (IQ2_XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8 quantization)</li><li>Claude Code with subagents for parallel CUDA work</li><li>huggingface-cli + aria2c for model download</li><li>opencode for harness integration</li></ul><h3>Appendix: useful links</h3><ul><li>DeepSeek V4 paper: <a href="https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro">https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro</a></li><li>antirez ds4 engine: <a href="https://github.com/antirez/ds4">https://github.com/antirez/ds4</a></li><li>antirez’s llama.cpp V4 fork: <a href="https://github.com/antirez/llama.cpp-deepseek-v4-flash">https://github.com/antirez/llama.cpp-deepseek-v4-flash</a></li><li>Fringe210 CUDA fork: <a href="https://github.com/Fringe210/llama.cpp-deepseek-v4-flash-cuda">https://github.com/Fringe210/llama.cpp-deepseek-v4-flash-cuda</a></li><li>TurboQuant paper (ICLR 2026): <a href="https://arxiv.org/abs/2504.19874">https://arxiv.org/abs/2504.19874</a></li><li>am17an’s MTP support PR for llama.cpp (Qwen-focused): <a href="https://github.com/ggml-org/llama.cpp/pull/22673">https://github.com/ggml-org/llama.cpp/pull/22673</a></li><li>davide.zenati’s MXFP4 single-GB10 proof-of-life: <a href="https://forums.developer.nvidia.com/t/deepseek-v4-flash-mxfp4-proof-of-life-on-a-single-gb10-gx10/369131">https://forums.developer.nvidia.com/t/deepseek-v4-flash-mxfp4-proof-of-life-on-a-single-gb10-gx10/369131</a></li></ul><h3>📊 DATA TABLES (for reference / inclusion in blog)</h3><h3>Hardware</h3><ul><li>ASUS Ascent GX10 (ASUS-branded GB10 workstation, same Superchip as NVIDIA’s own DGX Spark)</li><li>GB10 Grace Blackwell Superchip</li><li>10× Cortex-X925 + 10× Cortex-A725 ARM cores</li><li>Blackwell GPU, compute capability 12.1 (sm_121a), native MXFP4 tensor cores</li><li>128 GiB LPDDR5X unified memory @ 273 GB/s</li><li>CUDA 13.0, driver 580.142</li><li>Ubuntu 24.04</li></ul><h3>Model</h3><ul><li>DeepSeek V4 Flash (released 2026–04–24, MIT license)</li><li>284B total / 13B active params, 256 MoE experts top-K=6</li><li>Native 1M context, hybrid attention (CSA + HCA)</li><li>Built-in MTP head (1 extra trained layer)</li></ul><h3>Quantization (antirez/deepseek-v4-gguf)</h3><ul><li>Routed experts: IQ2_XXS (2-bit i-quant, imatrix-calibrated)</li><li>Attention LoRA Q/Q_b: Q8_0</li><li>Shared experts: Q8_0</li><li>Output projection: Q8_0</li><li>File size: 86.72 GB (vs 160 GB FP4-FP8 native)</li><li>MTP draft (separate): 3.6 GB</li></ul><h3>Baseline benchmarks (no MTP, llama.cpp Fringe210 fork)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*5pS3WXZMdou8KBa8drc39w.png" /></figure><h3>Full prompt-size × gen matrix @ 16K context (baseline)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*dUj9qUgQGodF9_lcV9cWnA.png" /></figure><h3>Full matrix @ 1M context (baseline)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*OlPzWkFmWN5cdFDEC2Iuew.png" /></figure><h3>Key takeaway: 1M decode ≈ 16K decode</h3><p>The 1M cliff in <em>prefill</em> (3.44 vs 30.91 at small prompts) is real (fixed ~4.5s slot-prep overhead). But <strong>decode at small prompts is essentially the same</strong>: 14.82 (1M) vs 14.74 (16K). The KV cache pressure that destroys long-context decode in other models doesn’t exist in V4 thanks to hybrid CSA+HCA.</p><h3>ds4 engine (antirez’s native C+CUDA, independent of llama.cpp)</h3><p>Build: make cuda-spark on GB10.</p><p>Baseline at default ctx (32K): 14.99 t/s decode, 32.17 t/s prefill.</p><p>ds4 + MTP sweep (4×3, prompt = haiku about quantization, default ctx):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*f532yNwJB6fR5tEuV9yGzg.png" /></figure><p>ds4 scaling test (MTP enabled, draft=1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*Pn2xyazL0AlxY0IXfjk7tA.png" /></figure><h3>Our llama.cpp MTP port (vs ds4)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*7mWqdV6Civvkz3DAjXmWYA.png" /></figure><h3>MTP code stats (our impl)</h3><ul><li>14 files modified, ~400 LOC of new patches</li><li>New arch enum, 32 new tensor enums, new layer struct</li><li>New llm_build_deepseek4_mtp graph class (~180 LOC)</li><li>New shared-vocab API (llama_vocab::share_from())</li><li>Works (loads, generates valid text, 100% draft acceptance at T=0)</li><li>Catastrophically slow (O(N²) cost over n_ctx_seq due to disabled compressed attention)</li></ul><h3>Path A + Path B experiment (Flash Attention + Lloyd-Max swap)</h3><p><strong>Path A</strong>: enable FA for 2 of 43 V4 layers (the 2 dense layers, compress_ratio=0). Identified via sched_reserve diagnostic. 41 compressed layers still fall back because CUDA&#39;s fattn-mma-f16requires K-&gt;ne[1] % 256 == 0 for head_dim=512.</p><p><strong>Path B</strong>: replace FP8 KV quantization in ggml/src/ggml-cuda/dsv4.cu with WHT + Lloyd-Max codebook (per TurboQuant paper, 16 centroids from Beta((d-1)/2, (d-1)/2) distribution).</p><p>Combined results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*zYe-0yJZVTUTNTuHFEJoOA.png" /></figure><p>Pattern: short prompts benefit most (FA helps the 2 dense layers), longer prompts barely move because compressed-path layers (95% of compute) don’t use FA.</p><h3>Custom V4 Flash Attention kernel (the final step)</h3><p>Wrote ggml/src/ggml-cuda/fattn-v4-head512.cu — a from-scratch CUDA kernel handling head_dim=512 with arbitrary K seqlen:</p><ul><li>Online softmax (Rabe-Staats / FA2 pattern), single-token decode</li><li>One block per (head, sequence), 256 threads</li><li>67 KB shared memory (Q tile + reused K/V tile + scratch)</li><li>fp32 accumulators, half I/O via float4 vectorized loads</li><li>Per-tile K seqlen clamping → handles unaligned K (the whole point)</li></ul><p>Dispatcher hook in ggml/src/ggml-cuda/fattn.cu: only activates for head_dim=512 &amp;&amp; Q-&gt;ne[1]==1 &amp;&amp; f16 K/V &amp;&amp; single KV head &amp;&amp; stock dispatcher would reject. Other models / shapes untouched.</p><p>Removed previous Path A’s local FA guard in src/llama-graph.cpp — the kernel now handles those cases properly.</p><p>Final benchmark (custom kernel on top of FA+TBQ):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*WF5za4z_cYPs1yqD1g0v_g.png" /></figure><p><strong>Final cumulative gain over Saturday baseline</strong>: +8–11% decode for context-significant prompts (285+ tokens).</p><p>Why not the +15% stretch: the custom kernel uses scalar fp32 fmadd, no Tensor Cores. Blackwell’s Tensor Core instructions are ~30× faster per op. The cheaper alternative (the agent’s recommended next step, not done): add 4 MMA template instantiations under template-instances/ for (512, 512, N, 1) shapes and tweak the dispatcher. Estimated 3-5 hours, expected to land the missing 4-7%.</p><h3>Memory breakdown (V4 + main, no MTP, ctx 128K)</h3><pre>CUDA0:<br>  Model buffer:              81687 MiB (the 87 GB GGUF)<br>  Compressed KV cache:        860 MiB (V4 hybrid attention)<br>  Standard KV cache:           32 MiB (SWA)<br>  Recurrent state:             20 MiB (Gated Delta Net)<br>  Compute buffer:             697 MiB<br>  ─────────────────────────────────<br>  Total used:                ~83.3 GiB<br>  Free:                       ~41 GiB (room for prompt cache, slots)</pre><h3>Memory breakdown @ 1M ctx</h3><p>Only the compressed KV grows: 860 MiB → 6880 MiB (+6 GB). Everything else stays the same. <strong>The model fits 1M context with 30+ GiB free.</strong></p><h3>Quality samples (FA+TBQ binary, T=0)</h3><p>Prompt: &quot;The capital of France is&quot;<br>Output: Paris. The capital of France is Paris. The capital of France is Paris...</p><p>Prompt: &quot;Once upon a time, in a far away land&quot;<br>Output: , there was a little girl who lived in a scary house...</p><p>Prompt: &quot;def fibonacci(n):&quot;<br>Output: \n if n &lt;= 1:\n return n\n else:\n return fibonacci(n-1) + fibonacci(n-2)\n...</p><p>All coherent, no NaN, quality matches FP8 baseline.</p><h3>What’s in production</h3><p>Server</p><ul><li>llama-server from Fringe210 fork (sm_121a build) with Path A + Path B + custom V4 FA kernelpatches</li><li>DeepSeek-V4-Flash-IQ2XXS as deepseek-v4-flash (no MTP, baseline)</li><li>128K context, OpenAI-compatible /v1/chat/completions + /completion endpoints</li><li>Wired to opencode config as provider v4flash-gx10</li><li>Decode: 15–19 t/s @ small prompts, 11.4 t/s @ 8K prompts (+10% over Saturday)</li><li>All Flash Attention paths report Flash Attention was auto, set to enabled</li></ul><h3>Cumulative weekend speedup summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*QhW8e8973j-P2bnrhthkAA.png" /></figure><p>Theoretical reachable (Tensor Core MMA via template instances): ~12.0–12.4 t/s, +17–20% vs Saturday baseline. Estimated 3–5 hours additional work — not done this weekend.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=712823a1d819" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Chrome Extension in 4 Hours Using Claude Opus 4.6]]></title>
            <link>https://medium.com/@vbalko/i-built-a-chrome-extension-in-4-hours-using-claude-opus-4-6-f89e93a2b5aa?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f89e93a2b5aa</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[aiempowered]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 21:19:00 GMT</pubDate>
            <atom:updated>2026-02-09T21:19:00.276Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Built a Chrome Extension in 4 Hours Using Claude Opus 4.6 — A Real-World Test of Spec-Driven AI Development</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*St6RKKMl9Gddo3dfpjDSlg.png" /></figure><blockquote><em>I couldn’t find the extension I needed. So I built it in 4 hours. And I used it to stress‑test Claude Opus 4.6 in a real production scenario.</em></blockquote><p>If you work with APIs long enough, you develop a quiet, daily annoyance.</p><p>Mine was this: copy minified JSON from a &lt;textarea&gt;, paste into a formatter, copy it back. Repeat. Every. Single. Day.</p><p>So I did what any developer would do — I searched the Chrome Web Store.</p><p>Surely there’s an extension that formats JSON and XML <strong>directly inside textareas and code editors</strong>, right?</p><p>Wrong.</p><p>Everything I found either formatted raw responses only, forced copy‑paste, or ignored editors like Ace, CodeMirror, and Monaco.</p><p>That’s when this stopped being a search problem and became an experiment.</p><p>I’ve been writing about how AI coding evolved from “vibe prompting” to spec‑driven engineering. When Claude Opus 4.6 was released, I wanted a real test.</p><p>Not a toy script. Not a hello‑world demo.</p><p>A production Chrome extension. Built properly. Shipped the same day.</p><h3>The Build: 3–4 Hours of Actual Implementation</h3><p>The full journey (<em>idea → Web Store submission</em>) took about 8 hours.</p><p>But the <strong>actual implementation time? Around 3–4 hours.</strong></p><p>I started with a long initial prompt where I:</p><ul><li>Described the problem</li><li>Outlined all feature ideas</li><li>Asked Claude to brainstorm and challenge assumptions</li></ul><p>Then I switched to <strong>plan mode</strong> and asked it to do comprehensive research first.</p><p>This is where Opus 4.6 surprised me.</p><p>It reasoned through:</p><ul><li>Manifest V3 constraints</li><li>ISOLATED vs MAIN execution worlds</li><li>Shadow DOM isolation</li><li>window.postMessage communication bridge</li><li>Editor API access patterns</li></ul><p>Smoothly. Cleanly. Architecturally consistent.</p><p>This was easily the smoothest AI-assisted programming experience I’ve had so far.</p><p>Was it truly one-shot?<br>Let’s say… 3–4 shots. But no architectural rewrites. No chaos.</p><p>Compared to my earlier “vibe coding” experiments — where prompts produced working but messy code — this felt fundamentally different. The model maintained structure across files and iterations. It behaved more like a senior engineer than an autocomplete engine.</p><p>That’s the biggest improvement.</p><h3>What JSON Spot Does</h3><p>The extension (JSON Spot) does one thing well:</p><p>It detects JSON or XML inside:</p><ul><li>Textareas</li><li>Ace</li><li>CodeMirror 5/6</li><li>Monaco</li><li>contenteditable elements</li></ul><p>And lets you format/minify it in place.</p><p>Features:</p><ul><li>Floating format/minify button</li><li>Keyboard shortcut (Alt+Shift+F)</li><li>Context menu integration</li><li>Element picker mode</li><li>Syntax highlighting</li><li>Clipboard copy</li><li>Dark mode popup</li><li>Badge count per page</li></ul><blockquote>~1,100 lines of JavaScript.<br>0 dependencies.<br>Pure Manifest V3.</blockquote><p>And most importantly: no more copy‑paste.</p><h3>Screenshots</h3><p><em>(Add screenshots here once extension is public)</em></p><p>Suggested images to include:</p><ol><li>Floating format button inside a textarea</li><li>Element picker highlighting a selected JSON block</li><li>Before/after formatting comparison</li><li>Dark mode popup UI</li><li>Chrome Web Store listing page</li></ol><h3>What Improved Since “Vibe Coding”</h3><p>In my earlier articles, AI coding felt like this:</p><ul><li>Fast generation</li><li>Frequent refactoring</li><li>Architectural drift</li><li>Lots of cleanup</li></ul><p>With Opus 4.6 + plan mode, this changed.</p><p>What improved:</p><ol><li><strong>Architectural stability</strong> — no structural rewrites.</li><li><strong>Cross-file reasoning</strong> — consistent patterns across modules.</li><li><strong>Better upfront thinking</strong> — planning actually reduced total iteration.</li><li><strong>Less entropy</strong> — the codebase didn’t degrade over time.</li></ol><p>The key difference wasn’t just the model. It was combining a stronger model with a spec-first workflow.</p><blockquote>Specs &gt; vibes.</blockquote><p>And now it actually feels practical.</p><h3>The Numbers</h3><ul><li>~3–4 hours implementation</li><li>~8 hours total (including packaging, store prep)</li><li>~1,400 LOC across 7 files</li><li>0 dependencies</li><li>24KB zipped</li><li>v0.1.0 → v0.7.0 in one day</li></ul><h3>Try It</h3><p>The extension will be available on the Chrome Web Store once it’s verified and public.</p><p><strong>Chrome Web Store:</strong> <a href="https://chromewebstore.google.com/detail/henkkoibcmmfphlpfmfnafejgalomhok?utm_source=item-share-cb">https://chromewebstore.google.com/detail/henkkoibcmmfphlpfmfnafejgalomhok?utm_source=item-share-cb</a></p><p><strong>GitHub:</strong></p><p><a href="https://github.com/vbalko-claimate/json-spot-extension">https://github.com/vbalko-claimate/json-spot-extension</a></p><p>If you’ve read my previous AI coding articles, this is the first real production case study.</p><p>If you haven’t, start here:</p><p>How AI Coding Evolved from Vibes to Specs<br><a href="https://medium.com/@vbalko/how-ai-coding-evolved-from-vibes-to-specs-f6f8b0ffd086">https://medium.com/@vbalko/how-ai-coding-evolved-from-vibes-to-specs-f6f8b0ffd086</a></p><p>This extension is proof that the workflow described there now holds up in real shipping conditions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89e93a2b5aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MYSAPSSO2 on BTP: Principal Propagation Without PrincipalPropagation — Forwarding SSO Cookies…]]></title>
            <link>https://medium.com/@vbalko/mysapsso2-on-btp-principal-propagation-without-principalpropagation-forwarding-sso-cookies-f2ad5f12839e?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2ad5f12839e</guid>
            <category><![CDATA[principal-propagation]]></category>
            <category><![CDATA[sap-cloud-integration]]></category>
            <category><![CDATA[btp]]></category>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[mysapsso2]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 21:07:06 GMT</pubDate>
            <atom:updated>2026-06-03T09:13:15.024Z</atom:updated>
            <content:encoded><![CDATA[<h3>MYSAPSSO2 on BTP: Principal Propagation Without PrincipalPropagation — Forwarding SSO Cookies Through SAP Cloud Integration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Un0gdVeNexKgG9PhkOWXhg.png" /></figure><blockquote>Forward MYSAPSSO2 cookies through SCI iFlows to S/4HANA — user identity propagation on BTP without PrincipalPropagation. Plus a debugging tool. Updated June 2026 with corrections and lessons from a real production deployment.</blockquote><blockquote>Update (June 2026): After deploying this pattern in production (a CAP Node.js app on BTP issuing tokens directly against S/4HANA, kernel 7.93, CommonCryptoLib 8.5.x), I found two factual errors in the original article and a series of undocumented gotchas that cost days of ICM/SSF trace debugging. The corrections are integrated below and the new section “Errata: What a Real Deployment Taught Me” covers the details — including working Node.js code.</blockquote><p>You’re building an integration flow in SAP Cloud Integration (SCI/CPI). The external system sends a SOAP request to your iFlow, which routes it through Cloud Connector to S/4HANA’s /sap/bc/soap/rfcendpoint. Authentication? A MYSAPSSO2 cookie — SAP&#39;s cookie-based Single Sign-On token.</p><p>Everything works in the test system. Then you move to production and get a 401 Unauthorized. Or worse — it authenticates, but as the wrong user. You open the SCI trace, find the token, and stare at a wall of base64. No idea what’s inside it. No idea if it expired, if the user is wrong, if the certificate doesn’t match.</p><p>I’ve been there. So I built a tool for it.</p><p><a href="https://mysapsso2.app.claimate.tech/">mysapsso2-tool</a> — paste a MYSAPSSO2 token, see exactly what’s inside. Decode, inspect, debug. Also on <a href="https://github.com/vbalko-claimate/mysapsso2-tool">GitHub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xw2H5RzrpS8eoKaMv4N6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1fGo0LykIasccjxLX_MIkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*ehccV6q6YbsLRGq7bigWpg.png" /></figure><p>This post walks through what’s actually inside these tokens, how to forward them through SCI iFlows to authenticate against S/4HANA, and how to use the tool when things go wrong.</p><h3>What’s Inside the Token</h3><p>Let’s decode one. Go to <a href="https://mysapsso2.app.claimate.tech/">mysapsso2.app.claimate.tech</a>, paste a base64-encoded MYSAPSSO2 token, and hit Decode. Here’s what you’ll see:</p><ul><li><strong>User</strong> — the SAP user ID this token authenticates as (e.g. JSMITH)</li><li><strong>System ID</strong> — the <strong>issuing </strong>system’s ID (e.g. PRD) — <em>not the target system. See the correction below.</em></li><li><strong>Client</strong> — the <strong>issuing</strong> client number (e.g. 100)</li><li><strong>Creation time — </strong>the timestamp when the token was created, in UTC. ⚠️ <strong>Correction</strong>: the original version of this article called this field “Validity / expiration timestamp.” It is not. SAP reads TLV field 4 as the <em>ticket creation date</em> and computes expiration itself as creation time + the accepting system’s login/ticket_expiration_time (default 8 hours). If you put a future timestamp here, SAP rejects the ticket with invalid format: ticket creation date / HMskiCheckValidity failed.</li><li><strong>Signature</strong> — the PKCS#7 digital signature, including the issuer’s certificate CN, serial number, signing algorithm, and signing time</li></ul><p>Under the hood, the token is a compact binary structure, not JSON, not XML — a custom SAP binary format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1IHDJWA1kYzq6IDWIxDrvQ.png" /></figure><blockquote>⚠️ Correction — System ID and Client identify the issuer, not the target. A token with sysid=MCP, client=100 says &quot;this token was issued by system MCP, client 100&quot; — your BTP application, in this pattern. The target S/4HANA system (say, CS4) never appears in the token at all. The ACL in the target&#39;s STRUSTSSO2 must match the <em>issuer</em> values. A nice consequence: the same token works on multiple SAP systems — just register the certificate and ACL entry on each target.</blockquote><p>One thing that trips up generic ASN.1 parsers: SAP uses BER indefinite-length encoding in the PKCS#7 signature block. Standard tools like openssl asn1parse may choke on it. The mysapsso2-tool handles this correctly — it&#39;s one of the reasons I built it. Check the Help tab in the tool for a full field reference.</p><h3>The Real Use Case: SCI iFlow to S/4HANA via MYSAPSSO2</h3><p>This is the pattern that makes MYSAPSSO2 tokens relevant in modern integration scenarios. It’s not the standard BTP PrincipalPropagation flow (that uses X.509 certificate-based identity propagation). This is <strong>manual cookie forwarding</strong> — and it’s a perfectly valid, production-proven approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDKc3kAySOtMWe3AZkRQMQ.png" /></figure><h3>How the External System Creates the Token</h3><p>The external system doesn’t have to be an SAP system. Any system that can perform PKCS#7 signing can create a valid MYSAPSSO2 token. This isn’t widely documented by SAP, but it’s production-proven — companies like P&amp;G have open-sourced libraries for it, and identity providers like Nevis and Ping Federate support it natively. SAP’s own “Baking Biscuits” blog confirms: if you can sign with PKCS#7, you can bake a logon cookie.</p><p>At runtime, the external system:</p><ol><li>Assembles the binary token: version byte, codepage, TLV fields with the target SAP user, the <strong>issuer</strong> system ID and client (identifying your application, not the target S/4), and <strong>creation timestamp</strong> (UTC, format yyyyMMddHHmmss — current time, not a future expiration)</li><li>Signs the data block with its private key using PKCS#7/CMS (<strong>detached </strong>signature, SHA-1 digest, <strong>no authenticatedAttributes</strong> — see the errata section for why)</li><li>Appends the 0xFF marker, 2-byte signature length, and the DER-encoded PKCS#7 block</li><li>Base64-encodes the entire binary blob</li><li>Sends it as a header in the SOAP request to SCI</li></ol><p>For signing algorithms: DSA 1024-bit with SHA-1 has universal compatibility across all SAP NetWeaver versions. RSA works on modern S/4HANA systems running CommonCryptoLib 8.x or later — but with two non-obvious requirements verfied in production: the certificate itself must be <strong>signed with SHA-1</strong> (sha1WithRSAEncryption), and the PKCS#7 structure must not include authenticationAttributes. Details and working code in errata section below.</p><h3>The iFlow, Step by Step</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFa6KY7MbXQZIVPRwE4-JQ.png" /></figure><p><strong>Step 1: </strong>SOAP Adapter receives the request. The MYSAPSSO2 token arrives as a custom header (e.g. mysapsso2token).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEp92A9HLxSxpjgEy2NnZw.png" /></figure><p><strong>Step 2:</strong> Content Modifier sets the Cookie header. This is the critical step. You create an HTTP header:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9JuzA2w0g7zzDpI_-JSTg.png" /></figure><pre>Cookie: MYSAPSSO2=${header.mysapsso2token}</pre><p>This transforms the inbound header into a proper HTTP cookie that S/4HANA will recognize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lpMUu6XOsR7DEu6hvgMlw.png" /></figure><p><strong>Step 3:</strong> Body handling. The SOAP body is wrapped in the expected SOAP envelope format for the target RFC function module.</p><pre>&lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;<br>  &lt;soap:Header&gt;<br>    &lt;!-- Optional header info --&gt;<br>  &lt;/soap:Header&gt;<br>  &lt;soap:Body&gt;<br>    ${in.body}<br>  &lt;/soap:Body&gt;<br>&lt;/soap:Envelope&gt;</pre><p><strong>Step 4:</strong> HTTP Receiver Adapter. The outbound call goes to:</p><pre>http://&lt;webdispatcher&gt;:&lt;port&gt;/sap/bc/soap/rfc?sap-client=100</pre><p><strong>Step 5:</strong> Adapter settings — this is where people get tripped up:</p><ul><li>Proxy Type: On-Premise (routes through Cloud Connector)</li><li>Authentication: None</li><li>Location ID: Points to the Cloud Connector instance connected to your S/4 landscape</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydh1hPkCEtfcdQjzCXy-rQ.png" /></figure><p><strong>Step 6:</strong> S/4HANA validates. The system receives the MYSAPSSO2 cookie, extracts the PKCS#7 signature, checks it against the certificates imported into transaction STRUSTSSO2, and if valid, authenticates the request as the user embedded in the token.</p><h3>Why Authentication = None?</h3><p>This confuses people. You’re calling S/4HANA with Authentication=None — how does that work?</p><p>Because the MYSAPSSO2 cookie IS the authentication. S/4HANA doesn’t need basic auth or client certificates from SCI. It validates the token’s PKCS#7 signature against its trust store. S/4HANA doesn’t care whether the token was issued by another SAP system or by an external identity provider — it validates purely by signature. If the signing certificate is in STRUSTSSO2, the token is trusted.</p><h3>Why This Pattern Works</h3><ul><li>The external system is a trusted token issuer — its certificate is registered in S/4’s STRUSTSSO2ACL</li><li>SCI acts as a transparent proxy, forwarding the cookie as an HTTP header</li><li>Cloud Connector handles the on-premise routing</li><li>No PrincipalPropagation needed — no X.509 certificate mapping, no BTP destination config for identity propagation</li><li>Per-request user identity — each SOAP call can authenticate as a different SAP user, because each carries its own token</li></ul><h3>S/4HANA Configuration Checklist</h3><h3>Issuing Side (if S/4HANA issues the token)</h3><ul><li>STRUST — System PSE has a valid key pair and certificate (DSA 1024-bit for widest compatibility)</li><li>login/create_sso2_ticket = 2 — creates logon tickets without embedding the full certificate in the token (smaller cookies, recommended for integration scenarios)</li><li>0 = disabled</li><li>1 = with embedded certificate (large tokens)</li><li>2 = without embedded certificate (compact tokens)</li><li>3 = assertion tickets only</li><li>login/ticket_expiration_time = 8 — token validity in hours (adjust to your needs; shorter = more secure)</li><li>Export the signing certificate: STRUST → System PSE → Own Certificate → Export as Base64 (.crt)</li></ul><h3>Accepting Side (the S/4 receiving the token via SCI)</h3><ul><li>login/accept_sso2_ticket = 1 — required; enables acceptance of incoming SSO2 tickets (check via RZ11)</li><li>STRUSTSSO2 in client 000 — import the issuing system&#39;s (or external system&#39;s) signing certificate into the System PSE certificate list</li><li>ACL entry in the TARGET client: ⚠️ this is the part everyone misses. The certificate list is managed in client 000, but the ACL is evaluated per client. If users log into client 100, the ACL entry (System = issuer SysID, Client = issuer client) must exist in client 100. The underlying table is TWPSSO2ACL (editable via SM30). An ACL entry only in client 000 yields: No entry in TWPSSO2ACL for SYS &lt;id&gt; and CLI &lt;client&gt;.</li><li>ICM soft restart after STRUSTSSO2 changes — SMICM → Administration → ICM → Exit Soft → Local. Unlike STRUST for SSL, STRUSTSSO2 changes may not be picked up automatically (SAP Note 510007).</li><li>Verify: Transaction SSO2 — tests ticket generation and acceptance end-to-end; use this to confirm the trust relationship is correctly configured</li></ul><h3>SCI / Cloud Connector Side</h3><ul><li>Cloud Connector: Virtual host mapped to S/4 system, path /sap/bc/soap/rfc allowed in the access control</li><li>No principal propagation config needed — the cookie passes through as a plain HTTP header</li><li>SCI HTTP adapter: Authentication=None, Proxy Type=On-Premise, Location ID matching your Cloud Connector</li><li>If calling via a BTP destination instead of SCI: the destination URL must point to the backend’s actual HTTP port (typically 8000), not the HTTPS port (8443). http://host:8443 silently half-works — you get a 401, and the sap-ssolist response header won&#39;t contain the certificate hash entry (c= prefix instead of r=), meaning SSO authentication isn&#39;t available on that endpoint.</li></ul><h3>Errata: What a Real Deployment Taught Me</h3><p>The original version of this article was written from the SCI cookie-forwarding perspective. Since then I’ve deployed the <em>issuing</em> side in production — a CAP Node.js application on BTP generating MYSAPSSO2 tokens and calling S/4HANA (kernel 7.93, CommonCryptoLib 8.5.x) directly through a destination + Cloud Connector. Getting the token accepted took several days of ICM traces, SM50 security traces, and SICF traces. Here is everything I learned, so you don’t have to.</p><h3>1. The certificate must be signed with SHA-1</h3><p>OpenSSL defaults to sha256WithRSAEncryption. CommonCryptoLib imports such a certificate into STRUSTSSO2 without complaint — and then fails signature verification at runtime:</p><pre>SsfVerify returned 5 :: SSF_API_SIGNER_ERRORS :: Error during verify - signer error.<br>SSF LIB returned 27 :: SSF_API_RECIPIENT_NOT_OK :: Operation not ok for recipient.</pre><p>The fix is the -sha1 flag when generating the certificate:</p><pre># RSA 2048 + SHA-1 certificate (works on S/4HANA with CommonCryptoLib 8.x)<br>openssl genrsa -out sso-private.key 2048<br>openssl req -new -x509 -key sso-private.key -out sso-cert.pem -days 730 \<br>  -sha1 -subj &quot;/C=DE/O=Example Corp/CN=my-btp-token-issuer&quot;</pre><pre># Verify — must say sha1WithRSAEncryption:<br>openssl x509 -in sso-cert.pem -noout -text | grep &quot;Signature Algorithm&quot;</pre><p>For maximum compatibility (all NetWeaver versions), DSA 1024 still works:</p><pre>openssl dsaparam -out dsaparam.pem 1024<br>openssl gendsa -out sso-private.key dsaparam.pem<br>openssl req -new -x509 -key sso-private.key -out sso-cert.pem -days 730 \<br>  -subj &quot;/C=DE/O=Example Corp/CN=my-btp-token-issuer&quot;<br>rm dsaparam.pem</pre><p>RSA 2048 with a SHA-1 certificate is also what at least one commercial third-party SAP auth product uses in production, so this combination is well-trodden.</p><h3>2. The PKCS#7 signature must NOT contain authenticatedAttributes</h3><p>My first implementation included the standard authenticatedAttributes (contentType, messageDigest, signingTime). With an RSA key, CommonCryptoLib rejects this with SSF_API_SIGNER_ERRORS. Why: when authenticatedAttributes are present, PKCS#7 requires the signature to be computed over the DER-encoded attributes rather than directly over the content — and CommonCryptoLib doesn&#39;t handle that correctly for RSA (it does for DSA).</p><pre>p7.addSigner({<br>    key,<br>    certificate: cert,<br>    digestAlgorithm: forge.pki.oids.sha1,<br>    // NO authenticatedAttributes — RSA + CommonCryptoLib requires their absence<br>});</pre><p>Side effect: without authenticatedAttributes there is no signingTime in the signature, which SAP would otherwise use as the ticket creation date. SAP falls back to reading the creation date from TLV field 4 — which leads directly to the next point.</p><h3>3. TLV field 4 is the CREATION time, not the expiration</h3><p>This corrects the original article. SAP interprets tag 0x04 as the ticket creation date. If you write a future timestamp there (e.g. now + 8 hours, thinking it&#39;s an expiry), SAP rejects the token:</p><pre>*** ERROR =&gt; invalid format: ticket creation date (len=14) [ssoxxlnk.c 272]<br>*** ERROR =&gt; HMskiCheckValidity failed. [ssoxxkrn.c 1050]</pre><pre>// WRONG — expiration:<br>const ts = new Date(Date.now() + 8 * 60 * 60 * 1000);</pre><pre>// RIGHT — current time = token creation time:<br>const ts = new Date();</pre><p>The accepting system computes the expiration itself: creation time + login/ticket_expiration_time (profile parameter, default 8 hours).</p><h3>4. The digest algorithm must be SHA-1 too</h3><p>node-forge defaults to SHA-256 for the message digest. The SAP-side trace expects Alg=SHA1. Set it explicitly: digestAlgorithm: forge.pki.oids.sha1.</p><h3>5. STRUSTSSO2: certificate in client 000, ACL in the target client</h3><p>Covered in the checklist above, but worth repeating because the error is so misleading. The Certificate List lives in client 000; the ACL (TWPSSO2ACL) is evaluated per login client. Without an ACL entry in the client users actually log into:</p><pre>No entry in TWPSSO2ACL for SYS MCP and CLI 100.<br>*** ERROR =&gt; Neither was ticket issued by myself nor can I find issuer in TWPSSO2ACL</pre><p>So: import the certificate in client 000, then add the ACL entry (issuer System ID + issuer Client) in each target client. And soft-restart the ICM afterwards (SMICM, SAP Note 510007).</p><h3>6. Working Node.js token generator</h3><p>Putting it all together — this code is verified against a production S/4HANA (kernel 7.93, CommonCryptoLib 8.5.x):</p><pre>import forge from &quot;node-forge&quot;;<br>import fs from &quot;node:fs&quot;;<br>import path from &quot;node:path&quot;;</pre><pre>function utf16le(str) {<br>    const buf = Buffer.alloc(str.length * 2);<br>    for (let i = 0; i &lt; str.length; i++)<br>        buf.writeUInt16LE(str.charCodeAt(i), i * 2);<br>    return buf;<br>}<br>function tlv(tag, value) {<br>    const header = Buffer.alloc(3);<br>    header.writeUInt8(tag, 0);<br>    header.writeUInt16BE(value.length, 1);<br>    return Buffer.concat([header, value]);<br>}<br>class SAPSSOClient {<br>    constructor() {<br>        this.privateKey = fs.readFileSync(<br>            path.join(import.meta.dirname, &quot;..&quot;, &quot;certs&quot;, &quot;sso-private.key&quot;),<br>            &quot;utf8&quot;,<br>        );<br>        this.certificate = fs.readFileSync(<br>            path.join(import.meta.dirname, &quot;..&quot;, &quot;certs&quot;, &quot;sso-cert.pem&quot;),<br>            &quot;utf8&quot;,<br>        );<br>    }<br>    createSSOToken(username, sysId = &quot;MCP&quot;, client = &quot;100&quot;) {<br>        // CREATION time (not expiration - SAP adds its own validity period)<br>        const createdAt = new Date();<br>        const timestamp = createdAt.toISOString()<br>            .replace(/[-T:.Z]/g, &quot;&quot;)<br>            .substring(0, 14);<br>        const dataToSign = Buffer.concat([<br>            Buffer.from([0x02]),            // version 2<br>            Buffer.from(&quot;4103&quot;, &quot;ascii&quot;),   // codepage UTF-16LE<br>            tlv(0x01, utf16le(username)),   // User<br>            tlv(0x02, utf16le(sysId)),      // Issuer System ID<br>            tlv(0x03, utf16le(client)),     // Issuer Client<br>            tlv(0x04, utf16le(timestamp)),  // Creation timestamp<br>            tlv(0x05, Buffer.alloc(4, 0)),  // Flags<br>        ]);<br>        const cert = forge.pki.certificateFromPem(this.certificate);<br>        const key = forge.pki.privateKeyFromPem(this.privateKey);<br>        const p7 = forge.pkcs7.createSignedData();<br>        p7.content = forge.util.createBuffer(<br>            dataToSign.toString(&quot;binary&quot;)<br>        );<br>        p7.addCertificate(cert);<br>        p7.addSigner({<br>            key,<br>            certificate: cert,<br>            digestAlgorithm: forge.pki.oids.sha1,<br>            // NO authenticatedAttributes - RSA + CommonCryptoLib requires it<br>        });<br>        p7.sign({ detached: true });<br>        const sigDer = Buffer.from(<br>            forge.asn1.toDer(p7.toAsn1()).getBytes(),<br>            &quot;binary&quot;<br>        );<br>        const sigLenBuf = Buffer.alloc(2);<br>        sigLenBuf.writeUInt16BE(sigDer.length, 0);<br>        const token = Buffer.concat([<br>            dataToSign,<br>            Buffer.from([0xff]),<br>            sigLenBuf,<br>            sigDer,<br>        ]);<br>        return token.toString(&quot;base64&quot;);<br>    }<br>}<br>export default new SAPSSOClient();</pre><p>Remember: sysId and client identify your application as the issuer — they must match the ACL entry in the target system&#39;s STRUSTSSO2, and they have nothing to do with the target system&#39;s SID.</p><h3>7. How to actually debug this on the SAP side</h3><p>Ordered by usefulness, from days of trial and error:</p><ol><li>SICF → Activate Trace on the service — the most reliable; doesn’t depend on which work process handles the request</li><li>SICF Recorder — quick overview (LOGON_METHOD, LOGON_USER, LOGON_FAILED)</li><li>SM50 → security trace level 3, then ST11 → dev_w* — detailed SSF verification errors (this is where SsfVerify returned 5 shows up)</li><li>SMICM → trace level 3 — ICM level only; does <em>not</em> show SSO verification details</li><li>SM21 — system log; may miss ICM-level rejections entirely</li><li>SSO2 transaction — configuration and signature verification</li><li>Postman / curl — inspect the sap-ssolist response header (base64-decode it); entries prefixed r= mean SSO ticket auth is active on the endpoint, c= means it isn&#39;t</li></ol><p>Relevant SAP Notes: <a href="https://me.sap.com/notes/1055856/E">1055856</a> (SsfVerify failed — configuration for external certificates), <a href="https://me.sap.com/notes/510007/E">510007</a> (ICM restart after certificate changes).</p><h3>Troubleshooting with the Tool</h3><p>Here’s where the <a href="https://mysapsso2.app.claimate.tech/">mysapsso2-tool</a> earns its keep. These are the scenarios I’ve hit in production.</p><h3>“401 Unauthorized from S/4HANA”</h3><p>The most common issue. Grab the MYSAPSSO2 token from the SCI trace (Monitor → Message Processing → select the message → Trace → find the Cookie header). Paste the base64 value into the tool and decode it.</p><p>Check the creation timestamp first. The token expires at creation time + the target system’s login/ticket_expiration_time (default 8 hours). If the token was generated long ago — typically because the external system caches tokens — it&#39;s expired. This is the #1 cause of intermittent 401s in production. And the inverse failure mode: if the issuer wrote a <em>future </em>timestamp into field 4 (treating it as an expiry — the mistake the original version of this article encouraged), SAP rejects the ticket outright with HMskiCheckValidity failed.</p><p>Check the Signature section. Look at the Issuer CN and serial number. Does the issuer CN match the certificate imported into STRUSTSSO2 on the target S/4HANA system? If the external system recently rotated its signing certificate, the old cert may still be the one in S/4&#39;s trust store. Also check the certificate&#39;s signature algorithm — sha256WithRSAEncryption will import fine but fail verification (SsfVerify returned 5); it must be SHA-1-signed.</p><p>If the signature and timestamp look fine, check the ACL: the token’s System ID and Client (the <em>issuer</em>) must have an ACL entry in STRUSTSSO2 in the client you&#39;re logging into, not just client 000. Look for No entry in TWPSSO2ACL in the trace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*pe1kmMijTvUQ2m5P6s536Q.png" /></figure><h3>“Wrong User / Unexpected User”</h3><p>Decode the token and check the User field. Is it the expected user, or a technical/service account? A common cause: the external system reuses a cached token from a previous session or a different user context. Each request should carry a freshly generated token for the correct user.</p><p>The System ID and Client fields identify the <em>issuer</em>, so don’t expect them to match the target system — but they must match the ACL entry on the target. An issuer mismatch (token says sysid=MCP, client=100, ACL says something else) results in rejection.</p><h3>“Certificate Not Trusted”</h3><p>Decode the token. In the Signature section, note the Issuer CN and Serial Number. Now go to STRUSTSSO2 on the target S/4 system and compare:</p><ul><li>Is there a certificate with that exact CN?</li><li>Does the serial number match?</li><li>Is the ACL entry correctly mapping the issuing system/client to this certificate — in the right client?</li></ul><p>If the certificates don’t match, re-export from the issuing system and re-import. Certificate renewals are a common source of this error — the new cert has a different serial number. After any change in STRUSTSSO2, do an ICM soft restart (SMICM → Administration → ICM → Exit Soft → Local) — STRUSTSSO2 changes aren&#39;t always picked up automatically (SAP Note <a href="https://me.sap.com/notes/510007/E">510007</a>).</p><h3>“Token Too Large / Cookie Rejected”</h3><p>If the HTTP cookie exceeds size limits (some web dispatchers or reverse proxies cap cookies at 4KB or 8KB), check whether the token was created with login/create_sso2_ticket = 1. This embeds the full signing certificate inside the token, making it significantly larger. Switch to = 2to omit the embedded certificate — the accepting system will look up the certificate in STRUSTSSO2 by issuer/serial instead.</p><h3>Round-Trip Testing Without S/4</h3><p>Use the Encode tab in the tool to create a test token with known values — specific user, system ID, client, and creation timestamp. Then click “Decode This” to verify the round-trip. This is useful for testing your SCI iFlow’s header handling without needing a live S/4 system — you can verify that the Content Modifier correctly sets the Cookie header and that the token survives the journey through SCI and Cloud Connector intact.</p><h3>Wrap-Up</h3><p>MYSAPSSO2 is SAP’s legacy SSO mechanism, and yes, SAP has been pushing SAML and X.509-based authentication for years. But in the integration world — especially when third-party systems need to authenticate as specific SAP users through SCI flows — the MYSAPSSO2 cookie pattern is alive and well. It’s simpler than setting up full PrincipalPropagation with X.509 certificate mapping, and it gives you per-request user identity out of the box.</p><p>The key insight: S/4HANA validates MYSAPSSO2 tokens purely by PKCS#7 signature. It doesn’t care if the issuer is another SAP system or an external identity provider. If the signing certificate is trusted (registered in STRUSTSSO2, with an ACL entry in the target client), the token is accepted. This makes MYSAPSSO2 a practical authentication mechanism for SCI integration flows — the iFlow just needs to forward the cookie, and S/4 does the rest.</p><p>But the devil is in undocumented details: SHA-1-signed certificates, no authenticatedAttributes with RSA, creation time (not expiry) in field 4, client-dependent ACLs, ICM restarts. None of this is in the official docs — it’s in the kernel traces. Hopefully this article saves you the days I spent there.</p><p>When something breaks — and in integration scenarios, something always breaks — you need to see inside the token. That’s what the tool is for.</p><p><a href="https://mysapsso2.app.claimate.tech/">mysapsso2-tool</a> | <a href="https://github.com/vbalko-claimate/mysapsso2-tool">GitHub</a></p><h3>References</h3><ul><li>SAP Note <a href="https://me.sap.com/notes/1055856/E">1055856</a> — SsfVerify failed; configuration for external certificates</li><li>SAP Note <a href="https://me.sap.com/notes/510007/E">510007</a> — ICM restart after certificate changes</li><li>P&amp;G open-source: <a href="https://github.com/procter-gamble-oss/mysapsso2-sp-token-adapter">github.com/procter-gamble-oss/mysapsso2-sp-token-adapter</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2ad5f12839e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Send IDoc from SAP Cloud Integration to On-Premise SAP S/4HANA]]></title>
            <link>https://medium.com/@vbalko/send-idoc-from-sap-cloud-integration-to-on-premise-sap-s-4hana-66e7f2598024?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/66e7f2598024</guid>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[cloud-integration]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[sap-btp]]></category>
            <category><![CDATA[idoc]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 13:07:52 GMT</pubDate>
            <atom:updated>2026-01-30T13:07:52.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQFGhCz2r0dZ2Eq5TComxQ.jpeg" /></figure><p>This post flips the direction of the Medium article I published about receiving IDocs from on-premise S/4HANA into SAP Cloud Integration, so you can keep both flows side by side. <a href="https://medium.com/@vbalko/receive-idoc-from-sap-s4-to-sap-cloud-integration-2cea82cf97c7">Receive IDoc from SAP S/4 to SAP Cloud Integration</a></p><h3>Architecture overview</h3><p>An IDoc receiver channel in CPI calls SAP Cloud Connector’s reverse proxy, which tunnels the HTTPS /sap/bc/srt/idoc request down to the on-premise S/4HANA system. This setup keeps the backend hidden behind the virtual host/port that Cloud Connector publishes, and the adapter’s Location ID is how CPI chooses the correct connector tunnel when multiple connectors exist for the same subaccount. See the <a href="https://help.sap.com/docs/SAP_CLOUD_CONNECTOR">SAP Cloud Connector documentation</a> for the supporting architecture and Location ID behavior.</p><h3>Prerequisites</h3><ul><li><strong>SAP Integration Suite</strong>: an active tenant with the IDoc receiver adapter deployed, a credentials artifact for the technical user or OAuth client that will post XML to S/4HANA, and the appropriate roles so CPI can call an on-premise HTTP service. The <a href="https://help.sap.com/docs/SAP_CLOUD_INTEGRATION">SAP Cloud Integration documentation</a> describes how to secure receiver adapters and store credentials.</li><li><strong>SAP Cloud Connector</strong>: installed in the same network as S/4HANA, registered to your Integration Suite subaccount, and configured with a virtual host/port mapping plus a Location ID for the backend. The connector’s access control list must expose /sap/bc/srt/idoc via HTTPS so only IDoc traffic is allowed.</li><li><strong>On-premise SAP S/4HANA</strong>: activate /sap/bc/srt/idoc in SICF/SRTIDOC, and configure an inbound partner profile (WE20) that contains the logical system, message type/basic type, and HTTP receiver port so the posted IDoc is processed by the right application. Refer to the <a href="https://help.sap.com/docs/SAP_S4HANA">SAP S/4HANA documentation</a> for guidance on SRTIDOC services and partner profiles.</li></ul><h3>Step 1 — map the on-premise system in Cloud Connector</h3><ol><li>Under <strong>Cloud to On-Premise</strong>, add the Integration Suite subaccount record so the connector knows your tenant and records the Location ID that CPI will later select on the adapter.</li><li>Create a system mapping where the <strong>Internal Host</strong>/port point to the real S/4HANA server and the <strong>Virtual Host</strong>/port are what CPI should call instead of the backend host.</li><li>In the access control list add /sap/bc/srt/idoc as an HTTPS resource and set the access policy to “<strong>Path and All Sub Paths</strong>” so only the IDoc inbound service is reachable. The connector documentation lists these settings in its “Access Control” section.</li><li>Save the mapping and keep the Location ID handy; CPI uses it whenever more than one connector is registered to the subaccount.</li></ol><h3>Step 2 — build the iFlow that pushes IDocs</h3><ol><li>End your flow with the IDoc receiver adapter — pick the message type/basic type you intend to deliver so CPI can generate the XML payload automatically.</li><li>Point the adapter <strong>Address</strong> to https://&lt;virtual-host&gt;:&lt;virtual-port&gt;/sap/bc/srt/idoc, turn on the <strong>On-Premise</strong> switch, and keep the protocol as HTTPS because Cloud Connector only exposes secure tunnels.</li><li>Supply the credentials artifact that stores the technical user (or OAuth client) used for S/4 authentication before the request enters Cloud Connector.</li><li>Enter the Location ID recorded in Step 1 so CPI picks the correct connector when multiple proxies exist.</li></ol><h3>Step 3 — prepare the S/4HANA inbound plumbing</h3><ol><li>Activate the /sap/bc/srt/idoc service in SICF and register the runtime via SRTIDOC so the HTTP entry is reachable and bound to an inbound handler.</li><li>Define the inbound partner profile in WE20 (partner type LS) with the matching logical system, message type/basic type (for example, MATMAS05), and the HTTP receiver port.</li><li>Make sure the technical user has the authorization objects that allow HTTP calls to post IDocs; these requirements are described in the Integration Suite and S/4HANA docs.</li><li>If your scenario uses partner functions, queue names, or processing codes, enable them in the profile so the IDoc is routed to the correct application module.</li></ol><h3>Step 4 — validate and monitor</h3><ol><li>Use WE19 to create a test IDoc, populate the required segments, set the receiver port to the HTTP entry, and execute Standard Outbound Processing. This proves the format and partner setup before CPI sends production data.</li><li>Monitor the IDoc lifecycle in WE05/WE02 — the status codes progress from 03 (data passed to port) to 53 (application document posted), and the transactions expose dumps when the inbound processing fails (the Medium article linked above runs through these same status codes).</li><li>Open the Integration Suite Message Operations view to review CPI’s message log, inspect the IDoc adapter response, and rerun or replay the message if necessary. See the <a href="https://help.sap.com/docs/SAP_INTEGRATION_SUITE">SAP Integration Suite documentation</a> for the monitor’s capabilities.</li><li>If CPI never reaches the backend, check the Cloud Connector log files (default log/scc directory) to confirm the Location ID and virtual host mapping handled the HTTP call.</li></ol><h3>Troubleshooting highlights</h3><ul><li><strong>SRTIDOC registration errors</strong>: re-register the HTTP service in SRTIDOC and ensure the ICF node is active; missing runtime entries raise the familiar “service name is not registered” message.</li><li><strong>Receiver adapter returns 403/404</strong>: double-check the /sap/bc/srt/idoc ACL entry, use “Path and All Sub Paths,” and confirm the technical user credentials so Cloud Connector forwards the HTTPS call.</li><li><strong>IDocs stuck in status 51 or 29</strong>: these typically indicate inbound partner profile misconfigurations — review the logical system, message type, and receiving function module in WE20/WE57 so the IDoc arrives at the right application logic.</li></ul><h3>Where to go next</h3><p>Once the CPI-to-S/4HANA flow is stable, revisit the reverse-direction article (<a href="https://medium.com/@vbalko/receive-idoc-from-sap-s4-to-sap-cloud-integration-2cea82cf97c7">Receive IDoc from SAP S/4 to SAP Cloud Integration</a>) so you can document the full bidirectional architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66e7f2598024" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Receive IDoc from SAP S4 to SAP Cloud Integration]]></title>
            <link>https://medium.com/@vbalko/receive-idoc-from-sap-s4-to-sap-cloud-integration-2cea82cf97c7?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cea82cf97c7</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[sap-btp]]></category>
            <category><![CDATA[cloud-integration]]></category>
            <category><![CDATA[idoc]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 16:00:07 GMT</pubDate>
            <atom:updated>2026-01-09T16:00:07.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZgnOpc2cAVlrVnTJ659jQ.png" /></figure><h3>What This Covers</h3><p>This document explains the process of setting up IDoc transmission from an on-premise SAP environment to an integration flow (iFlow) running on SAP Business Technology Platform.</p><h3>Architecture Overview</h3><p>The setup involves configuring your on-premise SAP system to send IDoc messages to a cloud-based integration flow. The communication happens over HTTP/HTTPS, with the BTP platform receiving and processing the incoming IDoc data.</p><h3>Prerequisites</h3><p>Before starting the configuration, ensure you have:</p><p><strong>On-Premise SAP System:</strong></p><ul><li>Authorization for transactions: SM59, WE21, WE20, WE19, WE05</li><li>Authorization to create RFC destinations</li><li>Authorization for IDoc configuration (ALE configuration)</li><li>The IDoc type you want to send must exist in the system</li></ul><p><strong>BTP Side:</strong></p><ul><li>Active SAP Integration Suite subscription</li><li>Deployed iFlow with IDoc Adapter configured</li><li>iFlow endpoint URL (e.g., https://&lt;tenant&gt;.it-cpi.cfapps.eu10.hana.ondemand.com/http/idoc_receiver)</li><li>Authentication credentials (user/password or OAuth2 token)</li></ul><p><strong>Network:</strong></p><ul><li>Firewall rules allowing outbound HTTPS traffic from SAP to BTP</li><li>SSL certificates trusted (BTP certificate chain)</li></ul><h3>Configuration Workflow</h3><h4>1. BTP Side: Integration Flow Setup</h4><p>Your iFlow should already be deployed on BTP with an IDoc Adapter configured as the entry point. You’ll need the endpoint URL and authentication details for the on-premise configuration.</p><h4>2. On-Premise: RFC Destination Configuration</h4><p>Using transaction <strong>SM59</strong>, create a new RFC destination:</p><p><strong>Technical Settings Tab:</strong></p><ol><li>Click “Create” button</li><li>Enter a destination name (e.g., BTP_IDOC_HTTP)</li><li>Connection Type: Select <strong>G</strong> (HTTP Connection to External Server)</li><li>Description: Enter meaningful description (e.g., “BTP iFlow IDoc Receiver”)</li><li>In the Technical Settings tab:</li></ol><ul><li><strong>Target Host</strong>: Enter only the hostname from your BTP URL</li></ul><blockquote>Example: mytenant.it-cpi.cfapps.eu10.hana.ondemand.com</blockquote><blockquote>DO NOT include https://</blockquote><ul><li><strong>Port</strong>: 443</li><li><strong>Path Prefix</strong>: Enter the path from your iFlow endpoint</li></ul><blockquote>Example: /http/idoc_receiver</blockquote><p><strong>Logon &amp; Security Tab:</strong><br>6. Switch to “Logon &amp; Security” tab<br>7. <strong>SSL</strong>: Set to <strong>Active</strong><br>8. <strong>SSL Certificate</strong>: Select “Default SSL Client (Standard)” or your custom certificate</p><p>9. <strong>Authentication Settings:</strong></p><ul><li><strong>User</strong>: Enter BTP service user (from service key)</li><li><strong>Password</strong>: Enter the password</li><li>OR configure OAuth2 if using token-based authentication</li></ul><p>10. <strong>System ID</strong> and <strong>Client</strong>: Leave empty for BTP connections</p><p>11. <strong>Save</strong> the configuration</p><p>12. <strong>Test Connection</strong> using “Connection Test” button (should show green success)</p><blockquote><strong>Tip</strong>: When you do connection test in SM59, it returns http error and you should see an error message in the SCI message log. This is because connection test sends just blank message and IDoc adapter expects xml structured body of IDoc. Its just mark, that connection works as it should — no infrastructure problems, no authorization problems.</blockquote><h4>3. On-Premise: XML HTTP Port Setup</h4><p>Navigate to transaction <strong>WE21</strong> to create a port configuration:</p><ol><li>Expand the node <strong>XML HTTP</strong> in the left tree</li><li>Click the <strong>Create</strong> button (or right-click → Create)</li><li>Enter a <strong>Port Name</strong> (e.g., BTP_XML_HTTP)</li><li><strong>Description</strong>: Enter descriptive text (e.g., “BTP IDoc Port”)</li><li>In the port configuration screen:</li></ol><ul><li><strong>RFC Destination</strong>: Select the RFC destination created in SM59 (e.g., BTP_IDOC_HTTP)</li><li><strong>Content Type</strong>: Usually application/xml (may be pre-filled)</li></ul><ol><li><strong>Save</strong> the configuration</li></ol><p>This port acts as the bridge between IDoc processing and the HTTP connection to BTP.</p><h4>4. On-Premise: Outbound Partner Configuration</h4><p>In transaction <strong>WE20</strong>, configure the outbound processing:</p><ol><li>Select <strong>Partner Type LS</strong> (Logical System) from the left tree</li></ol><p>2. Find and select your <strong>sending logical system</strong></p><ul><li>If it doesn’t exist, create it using transaction <strong>SALE</strong> (IMG → Define Logical System)</li></ul><p>3. Double-click on the logical system to expand it</p><p>4. Navigate to the <strong>Outbound Parameters</strong> section</p><p>5. Click the <strong>Create Outbound Parameter</strong> button</p><p>6. Configure the message type:</p><ul><li><strong>Message Type</strong>: Enter the IDoc message type (e.g., MATMAS for material master)</li><li><strong>Receiver Port</strong>: Select the XML HTTP port created in WE21 (e.g., BTP_XML_HTTP)</li><li><strong>Receiver Partner Number</strong>: Enter the receiver identifier (can be logical system name or custom value)</li><li><strong>Receiver Partner Type</strong>: Select LS (Logical System)</li></ul><p>7. In the <strong>Outbound Options</strong> tab:</p><ul><li><strong>Transfer IDocs Immediately</strong>: Check this box (recommended for testing)</li><li><strong>Basic Type</strong>: Should auto-populate based on message type (e.g., MATMAS05)</li><li><strong>Queue Processing</strong>: Can be left unchecked for immediate processing</li></ul><p>8. <strong>Save</strong> the configuration</p><p>Now your system knows to send IDocs of this message type through the BTP port.</p><h4>5. Testing Your Configuration</h4><p>Use transaction <strong>WE19</strong> for testing:</p><ol><li>Enter the <strong>IDoc Type</strong> (e.g., MATMAS05) and click Create</li><li>Fill in mandatory segment fields with test data</li><li>Click <strong>Control Record (EDIDC)</strong> button and configure:</li></ol><ul><li><strong>Sender Port</strong>: Can be left blank</li><li><strong>Sender Partner Number</strong>: Your logical system</li><li><strong>Sender Partner Type</strong>: LS</li><li><strong>Receiver Port</strong>: The XML HTTP port (e.g., BTP_XML_HTTP)</li><li><strong>Receiver Partner Number</strong>: Receiver identifier</li><li><strong>Receiver Partner Type</strong>: LS</li><li><strong>Message Type</strong>: The message type configured in WE20</li></ul><p>4. Click <strong>Standard Outbound Processing</strong> button</p><p>5. Check the status — should show success message with IDoc number</p><p>You can verify in transaction <strong>WE05</strong> that the IDoc status is <strong>03</strong> (Data passed to port OK).</p><h3>Monitoring and Verification</h3><h4>On-Premise Monitoring</h4><p>Transaction <strong>WE05</strong> provides IDoc status tracking. You can see:</p><ul><li>Whether the IDoc was sent</li><li>Any error messages</li><li>Processing status codes</li></ul><h4>BTP Monitoring</h4><p>Access the BTP integration monitoring dashboard to:</p><ul><li>Confirm message receipt</li><li>View processing logs</li><li>Enable trace mode for detailed debugging</li></ul><h4>Working with IDoc Data in iFlow</h4><p>Once the IDoc reaches your iFlow, you can extract specific field values using:</p><ul><li>Content Modifier step: Define custom properties</li><li>Property extraction: Pull values from specific IDoc segments and fields</li><li>This allows you to map IDoc data to other systems or transform it as needed</li></ul><h3>Troubleshooting</h3><h4>Common IDoc Status Codes (WE05)</h4><ul><li><strong>Status 03</strong>: Data passed to port OK (successful transmission)</li><li><strong>Status 30</strong>: IDoc ready for dispatch (not yet sent)</li><li><strong>Status 29</strong>: Error in ALE service (communication failure)</li><li><strong>Status 25</strong>: Processing with errors</li></ul><h4>Common Errors and Solutions</h4><p>1. <strong>HTTP 401 Unauthorized</strong></p><ul><li>Check username/password in SM59 RFC destination</li><li>Verify BTP service key credentials are correct</li><li>Ensure the user has proper authorizations in BTP</li></ul><p>2. <strong>HTTP 403 Forbidden</strong></p><ul><li>Check that the iFlow is deployed and active</li><li>Verify the endpoint URL path is correct</li><li>Ensure BTP service user has permission to access the iFlow</li></ul><p>3. <strong>HTTP 404 Not Found</strong></p><ul><li>Verify the Path Prefix in SM59 matches the iFlow endpoint</li><li>Check for typos in the URL path</li><li>Confirm the iFlow is deployed to the correct tenant/space</li></ul><p>4. <strong>SSL Certificate Errors</strong></p><ul><li>Import BTP SSL certificate chain into transaction STRUST</li><li>Set SSL to “Active” in SM59</li><li>Check that “SSL Certificate” field is set correctly</li></ul><p>5. <strong>IDoc Status 29 (Error in ALE Service)</strong></p><ul><li>Check SM59 connection test — must be successful</li><li>Verify WE21 port points to correct RFC destination</li><li>Check network connectivity and firewall rules</li></ul><p>6. <strong>IDoc Stuck in Status 30</strong></p><ul><li>Ensure “Transfer IDocs Immediately” is checked in WE20</li><li>Check that the receiver port is correctly set</li><li>Verify outbound parameters are complete</li></ul><h3>Debugging Tips</h3><ul><li>Enable trace mode in BTP monitoring dashboard for detailed logs</li><li>Use transaction <strong>WE02</strong> to display IDoc contents</li><li>Check <strong>SM58</strong> for transactional RFC errors</li><li>Review <strong>SLG1</strong> application log for detailed error messages</li><li>Test the RFC connection in <strong>SM59</strong> before testing IDocs</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cea82cf97c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Inquisition Returns: Generating a Comic with Gemini Nano Banana PRO]]></title>
            <link>https://medium.com/@vbalko/the-inquisition-returns-generating-a-comic-with-gemini-nano-banana-pro-aa0586240895?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa0586240895</guid>
            <category><![CDATA[warhammer]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[wh40k]]></category>
            <category><![CDATA[nanobanana-ai]]></category>
            <category><![CDATA[comics]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 17:02:27 GMT</pubDate>
            <atom:updated>2025-11-22T17:02:27.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EUG-jIOjO4pVBwpUULGEdg.jpeg" /></figure><p><strong>You might remember </strong><a href="https://medium.com/p/9802666fb66b"><strong>my recent experiment</strong></a><strong> where I tried to generate a short comic about the origins of the Inquisition in the Warhammer 40,000 universe using AI. It was an interesting ride with ChatGPT and DALL-E that showed a lot of potential, but also clear limits. But technology moves at breakneck speed.</strong></p><p>No sooner had I hit publish on the <a href="https://www.google.com/url?sa=E&amp;q=https%3A%2F%2Fmedium.com%2Fp%2F9802666fb66b">previous article</a> than a new player entered the arena: <strong>Gemini Nano Banana PRO</strong>.</p><p>When I saw the specs and the initial reviews, I paid attention. People who tested the model before me were raving about a massive shift in multimodal capabilities and better context understanding. I told myself I had to try this firsthand. And what better stress test than the exact same script we already have in the drawer?</p><p>The goal was clear: Find out how far the technology has shifted. Can this model finally create a consistent comic page that makes sense, has the right panels, and — in an ideal world — readable text?</p><h3>The Mission: Darkness, Dust, and Malcador</h3><p>The script remained unchanged. Three pages, the dense atmosphere following the Siege of Terra, Malcador the Sigillite, and the birth of the Inquisition.</p><p>First, I fed the model the script (the same one as last time) and asked it to generate the visuals. I was primarily interested in the <strong>layout (panel arrangement)</strong> and <strong>instruction following</strong>. With the previous version (Nano Banana Lite), this often ended up as one big, confused image where the concept of “sequential panels” got lost in translation.</p><h3>The Good: Structure and Visuals</h3><p>Here, I have to take my hat off. <strong>Instruction following and panel creation in the PRO version is leagues ahead of the Lite version.</strong></p><p>The model understood that I wanted a comic book page. It understood that there needed to be separate scenes. The structural result is comparable to what ChatGPT/DALL-E gave me last time, which is a huge leap forward for this specific model family.</p><p>And what’s more — <strong>the stylization is excellent</strong>. The graphic execution, the “grimdark” future atmosphere, the play of shadows… it’s all there. Visually, the pages feel like a real comic; they have depth and that specific “feeling” that belongs to WH40k. If I were judging solely on artistic impression and composition, I’d be thrilled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkZuvv3Q2vSYsPH9Go4S9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJTZgRWke54CYkfJdhwx4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CC6e4aK0_7hzTm079zHzqQ.png" /></figure><h3>The Bad: The Textual “Hot Mess”</h3><p>Now for the cold shower.</p><p>Based on the reviews and the hype surrounding the PRO version, I had an expectation (perhaps a naive one) that the text in the speech bubbles would be usable. I wasn’t asking for perfection, but at least… legibility?</p><p>As you can see in the images above, that didn’t happen. Even though the model understands <em>where</em> the bubble should be and <em>who</em> is supposed to be speaking, the content is absolute gibberish. Instead of Malcador’s fateful monologue, we get a cluster of characters resembling an alien script that only vaguely resembles the Latin alphabet.</p><p>It is a disappointment, especially since this model is marketed as being advanced in handling text and image simultaneously. In this regard, we haven’t moved an inch since last time. DALL-E or Midjourney (in their newer versions) still have the upper hand in text rendering — or are at least equally bad at it, but with less hype attached.</p><h3>The Verdict: Step by Step</h3><p>Gemini Nano Banana PRO is undeniably a step forward. The ability to maintain the structure of a comic page and understand the complex flow of panels is impressive, and working with it is much smoother than with the “Lite” version. Visually, it is a treat.</p><p>However, if you are looking for a tool that will spit out a finished comic including lettering with “one click,” we aren’t there yet. The workflow remains the same: <strong>Let AI handle the visuals and layout -&gt; open Photoshop -&gt; rewrite the text manually.</strong></p><p>So, the Inquisition has been founded, and it looks epic, but exactly what those figures are whispering in the shadows remains a secret of the machine.</p><p>Have you tried Nano Banana PRO for something similar? Let me know in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa0586240895" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI Coding Evolved from Vibes to Specs]]></title>
            <link>https://medium.com/@vbalko/how-ai-coding-evolved-from-vibes-to-specs-f6f8b0ffd086?source=rss-9a8ed63581e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6f8b0ffd086</guid>
            <category><![CDATA[ai-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[coding-with-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Mon, 20 Oct 2025 19:31:13 GMT</pubDate>
            <atom:updated>2025-10-22T12:28:04.215Z</atom:updated>
            <content:encoded><![CDATA[<p>How AI Coding Evolved from Vibes to Specs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zgpRi3IQHHlyke-u4iaHpg.png" /></figure><blockquote>🧩 This post is part of my ongoing series about vibe coding — tracing how AI-assisted development evolved from early experiments to structured, spec-driven workflows.<br>Previous posts:</blockquote><blockquote><a href="https://medium.com/@vbalko/when-ai-crafts-games-a-peek-into-building-a-js-game-with-chatgpt-f37145a6cadc">When AI Crafts Games: A Peek into Building a JS Game with ChatGPT</a></blockquote><blockquote><a href="https://medium.com/@vbalko/exploring-the-hype-around-claude-3-5-opus-by-anthropic-f8182f141ed4">Exploring the Hype Around Claude 3.5 Opus by Anthropic</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3qq-sbh88sdUH7eG" /><figcaption>Vibe coding timeline</figcaption></figure><h3>When the Code Started Talking</h3><p>It all began at the end of 2022, when ChatGPT-3.5 arrived and suddenly the code started to talk back. Until then, coding had always been a solo act. You wrote, compiled, debugged, and maybe cursed under your breath. But with ChatGPT-3.5, something shifted. You could <em>ask</em> for a snippet and get a working solution. I probably started with some SAP UI5 component or Groovy script for SAP SCI. It wasn’t perfect, but it was faster than anything I’d known before.</p><p>Memory was short — 8k tokens — but we didn’t know any better, so we adapted. You learned to live with amnesia, saving context by committing code obsessively, terrified of losing that one magical generation. Yet even with such constraints, it felt like a revolution. ChatGPT-3.5 wasn’t just an assistant — it was a curious, clumsy coding buddy who occasionally hallucinated but almost always surprised you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g4aRG1UP0dhA6yMMoPL6nA.png" /><figcaption>Trying to build an SAP UI5 snippet at 2 AM — it worked, somehow</figcaption></figure><h3>The Vibe Coding Era (GPT-4 → Claude 2/3)</h3><p>Then came GPT-4 and Claude 2, and suddenly the vibe had rhythm. Context windows grew, hallucinations dropped, and intent recognition improved. It was no longer about brute-force prompting but about co-creation. For many, this period defined what became known as <em>vibe coding</em> — that intuitive, conversational style of programming where you could just say, “I have an idea — can you make it for me?”</p><p>At first, it felt like advanced autocomplete — something between GitHub Copilot and a creative brainstorming partner. Tools like Copilot X and Cursor IDE made it even smoother. By mid-2023, you could chat through an entire feature or refactor with minimal manual typing. The community exploded with examples — YouTube tutorials, Medium posts, and wild X threads where people built full apps by “vibing” with AI. We went from hyped prototypes to structured experiments in context and creativity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q7WssHQe4kZuch6MXkrINg.png" /><figcaption>The transition from autocomplete to conversation.</figcaption></figure><h3>The Agent Awakening (Mid-2024)</h3><p>The real game-changer came with the agentic tools. Cursor’s agent mode hit like a flash from a clear sky: it didn’t just write code — it ran it, debugged it, and fixed its own mistakes. The first time I saw it execute and rerun without being told, I just stared at the screen for a few seconds in awe. The feeling was somewhere between excitement and slight dread — maybe 80% thrilled, 20% worried about what could go wrong.</p><p>Then came Claude Code and Gemini CLI, followed by GPT Codex and smaller experiments like Kiro. Suddenly, I wasn’t just coding <em>with</em> AI — I was managing a team of digital juniors. You had to learn to shepherd them, like a flock of eager but unpredictable sheep. Let them run in YOLO mode and they’d break things. Guide them carefully, and they’d deliver elegant, usable results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qre1XoOc7cBdk4nbWEdMbQ.png" /><figcaption>You orchestrating multiple agents.</figcaption></figure><h3>Context Engineering and the PRD Phase (Late 2024 — Early 2025)</h3><p>As agents improved, a new problem emerged: context loss. Your once-expert AI partner could wake up one morning lobotomized — forgetting your project, your style, your process. The fix wasn’t more prompting but <em>better structure</em>. That’s when I started writing PRDs (Product Requirement Documents) for AI.</p><p>I adopted GitHub SpecKit’s structure: <strong>Spec → Plan → Tasks</strong>. It made perfect sense — teach the model what it’s building, then how to build it. The discipline of writing structured specs transformed my workflow. I learned that good folder organization and clean code weren’t just for humans; they helped AIs handle context compression better. Ironically, vibe coding led me straight into structured project thinking.</p><p>Context persistence tools — SpecKit, OpenSpec, and others — offered huge improvements, but none solved it completely. Even today, context degradation remains the biggest challenge in long-form AI development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ShzHBDY_PAESCiK2mse0vg.png" /><figcaption>Teaching AI context.</figcaption></figure><h3>Post-Vibe Coding and the Context-Persistent Era (Mid-2025 → Present)</h3><p>By 2025, the vibe evolved. The tools matured, and so did we. Post-vibe coding arrived — not as the death of creativity, but as its discipline. GitHub SpecKit, OpenSpec, BMAD, and PRP brought persistent specs and reasoning chains. Now, AI could maintain continuity between sessions, remember design decisions, and act as a structured collaborator.</p><p>Preparation time skyrocketed — you spent hours crafting a spec — but the payoff was undeniable. The AI delivered cleaner code, uncovered hidden edge cases, and forced you to think like an architect. It’s not just <em>faster coding</em> anymore; it’s <em>smarter building.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7apQX1o0_YiZpASGd1ULgg.png" /><figcaption>The vibe didn’t die — it matured.</figcaption></figure><h3>Reflection: The Shepherd of the Bots</h3><p>Looking back, I moved from tinkerer to collaborator to what I jokingly call a <em>shepherd of bots</em>. My job is no longer writing code line by line — it’s orchestrating context, setting direction, and guiding a team of tireless digital apprentices.</p><p>If there’s one piece of advice for anyone entering AI-assisted development, it’s simple: <strong>don’t be afraid.</strong> The worst that can happen is you lose some code (so commit often). Experiment, iterate, and treat the AI like a partner that learns as you do.</p><p>Documentation-first thinking isn’t new — it just trickled down from large enterprise systems into individual workflows. Thanks to AI, even small prototypes now deserve structured specs, architecture planning, and proper documentation. And with that shift, we’ve become one-person development teams: architects, designers, testers, and developers all in one.</p><p>The revolution isn’t about machines replacing us — it’s about learning to collaborate at scale with them. The vibe lives on, just wearing a suit now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKcR7XfuvbyKdK7vCkYPwg.png" /><figcaption>Still coding, still vibing — but now with specs.</figcaption></figure><h3>Further Reading &amp; Tools Mentioned</h3><p>If you’d like to explore the evolution of AI-assisted coding and the frameworks shaping post-vibe development, here are some useful resources:</p><ul><li><a href="https://github.com/github/spec-kit">GitHub SpecKit</a> — Persistent project specs and planning structure.</li><li><a href="https://github.com/Fission-AI/OpenSpec">OpenSpec</a> — Open, model-agnostic specification standard.</li><li><a href="https://github.com/bmad-code-org/BMAD-METHOD">BMAD Framework</a> — Build–Measure–Align–Deliver methodology for AI projects.</li><li><a href="https://github.com/Wirasm/PRPs-agentic-eng">PRP (Persistent Reasoning Protocol) </a>— Community-driven protocol for maintaining reasoning continuity.</li><li><a href="https://www.claude.com/product/claude-code">Claude Code</a> — Anthropic’s CLI agent for contextual coding.</li><li><a href="https://cursor.com/">Cursor IDE</a> — Context-aware IDE integrating LLM agents.</li><li><a href="https://github.com/google-gemini/gemini-cli">Gemini CLI</a> — Google’s conversational coding agent.</li></ul><blockquote>“AI didn’t replace developers; it made us plan like architects and think like teams.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbwH3qshf0zTNhKQeWUAKw.png" /><figcaption>The post-vibe toolkit.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6f8b0ffd086" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>