<?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[syngenta-digitalblog - Medium]]></title>
        <description><![CDATA[Our Syngenta Digital Blog is where our team shares the challenges and technical solutions they face at Syngenta to improve agriculture. The focus is on software engineering and related technical content areas. - Medium]]></description>
        <link>https://medium.com/syngenta-digitalblog?source=rss----d9fa09ecf14---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>syngenta-digitalblog - Medium</title>
            <link>https://medium.com/syngenta-digitalblog?source=rss----d9fa09ecf14---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:59:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/syngenta-digitalblog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond Test Scripts: A Practical Architecture for Agentic E2E Testing]]></title>
            <link>https://medium.com/syngenta-digitalblog/beyond-test-scripts-a-practical-architecture-for-agentic-e2e-testing-5f64c5110f1b?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/5f64c5110f1b</guid>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[playwright-automation]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[2026]]></category>
            <dc:creator><![CDATA[Asif Azeez]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 19:15:54 GMT</pubDate>
            <atom:updated>2026-11-19T19:15:53.330Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Beyond Test Scripts: A Practical Architecture for Agentic E2E Testing" src="https://cdn-images-1.medium.com/max/1024/1*ahiwWdbf2J3U83m6mshEbw.png" /></figure><p>A reference architecture for giving AI agents room to explore — without giving up deterministic tests, auditability, or human control.</p><p>End-to-end tests are excellent at answering a question we already know how to ask: <em>does this exact journey still work?</em> They are less suited to a different question: <em>the outcome matters, but what happens if the route is unfamiliar, the UI shifts, or a dependency fails?</em></p><p>That second question led me to experiment with agentic end-to-end testing. Not as a replacement for my test suite, and not as an autonomous bug-fixing system. I wanted a bounded discovery layer that could explore a test environment, collect useful evidence, and propose changes that engineers could review.</p><p>The browser-driving model turned out to be only one part of the problem. The harder — and more interesting — work was designing the system around it: goal contracts, fresh sessions, structured evidence, failure semantics, validation gates, controlled integrations, and a clear boundary between machine output and engineering judgment.</p><figure><img alt="An evidence-first architecture for agentic E2E testing" src="https://cdn-images-1.medium.com/max/1024/1*0YDrNClk7WvGRkxtdEUlGw.png" /><figcaption>An evidence-first architecture for agentic E2E testing</figcaption></figure><h3>The problem is not “how do we make tests autonomous?”</h3><p>That framing pushes the conversation toward replacing tests. A more useful framing is: <strong>how do we discover which behaviors deserve durable tests, and how do we preserve what we learn?</strong></p><p>Traditional E2E tests remain the best tool for known, high-value journeys. They are repeatable, debuggable, and fast enough for continuous integration. What they do not do is spontaneously decide that an adjacent route, an unusual dependency response, or an inconsistency across modules is worth investigating.</p><p>An agent can help with that discovery. It can receive an outcome — such as “a user should understand and recover from a supporting-data failure” — then navigate an application without being handed every click. But unbounded freedom would make the result noisy and difficult to trust. The engineering goal is therefore not maximum autonomy. It is <strong>bounded exploration with inspectable outputs.</strong></p><h3>A six-part design framework</h3><p>The architecture that emerged can be understood as six layers. Each answers a different trust question.</p><h4>1. Contract: what outcome are we protecting?</h4><p>A goal is a small, typed contract rather than a long conversational instruction. It describes observable success criteria, the relevant user-journey documentation, permitted actions, risk level, and time/turn budgets. If the contract is vague, the agent’s conclusion will be vague too.</p><p>The important distinction is <strong>outcome versus route</strong>. “Open this exact form, click this exact button” is a test step. “A user receives a clear confirmation before saving when supporting data is unavailable” is an outcome that can be explored through multiple routes.</p><pre># Illustrative and intentionally simplified<br>id: EXPERIENCE-01<br>risk: constructive<br>goal: &gt;<br>  Check that a supporting-data failure produces<br>  a clear confirmation before a record is saved.<br>success_criteria:<br>  - The failure condition is established and disclosed<br>  - The documented confirmation is observed in the UI<br>  - If confirmed, an unmocked save request is sent and its response is recorded<br>guardrails:<br>  - Use ordinary visible UI controls<br>  - Never mock the persistence write<br>budget:<br>  max_turns: 40<br>  max_minutes: 10</pre><h4>2. Bound: how much exploration is safe?</h4><p>Each goal receives a fresh browser-agent session and explicit limits. The run targets a test environment, reuses managed authentication state, and follows rules for any data it creates or deletes. Sequential execution is a reasonable starting point when multiple goals share test data; parallelism should be introduced only after isolation and cleanup have been proven.</p><p>This makes resource use and risk easier to reason about. It also keeps one rambling exploration from dominating an entire run.</p><h4>3. Observe: what counts as evidence?</h4><p>A screenshot can support a narrative, but it is not a sufficient basis for an assertion. A useful result combines user-visible behavior with browser/network observations. After a mutation, for example, I want to know the actual HTTP method, path category, and status — not merely that a success toast appeared.</p><p>The Explorer should use ordinary controls for product reproduction. DOM and network inspection can support evidence, but directly manipulating state or bypassing a user-visible obstacle would make the result less meaningful.</p><h4>4. Structure: how do we consume an agent’s answer?</h4><p>The agent returns a typed result, not a prose-only summary. My runner normalizes it, attaches run metadata, validates it, and retains the raw and processed artifacts. This is where semantics matter:</p><ul><li><strong>goal_met:</strong> Every success criterion was observed. This must not imply that the whole product area is defect-free.</li><li><strong>goal_not_met:</strong> Observed behavior contradicted a stated criterion. This must not imply that the intended product contract needs no human confirmation.</li><li><strong>blocked:</strong> A precondition, access issue, or environment problem prevented verification. This is not a pass—or automatically a product defect.</li><li><strong>agent_error:</strong> The agent or harness could not complete a valid attempt. This is not a pass, even if the CI process itself exits cleanly.</li></ul><p>This distinction is vital when integrating with CI. “The job completed” and “the product behavior passed” are different statements. The run report — not the green job badge alone — is the source of truth.</p><pre>{<br>  &quot;status&quot;: &quot;goal_not_met&quot;,<br>  &quot;finding&quot;: {<br>    &quot;type&quot;: &quot;product_bug_candidate&quot;,<br>    &quot;expected&quot;: &quot;A confirmation before save&quot;,<br>    &quot;actual&quot;: &quot;No confirmation; save remained available&quot;,<br>    &quot;evidence&quot;: [<br>      &quot;supporting_read: deliberately returned 500&quot;,<br>      &quot;ui: documented confirmation not present&quot;,<br>      &quot;unmocked_save_request: HTTP 200&quot;<br>    ]<br>  }<br>}</pre><h4>5. Verify: what happens before publication?</h4><p>A second, separate Author role can consume actionable findings and prepare tests, selector corrections, or documentation. It does not publish directly. The proposed diff still goes through repository conventions, type checks, affected test execution, and self-review.</p><h4>6. Review: who owns the decision?</h4><p>Integration code creates or verifies the triage record, creates a signed commit on an isolated branch, and opens a draft pull request. The human reviewer sees the finding, evidence, and diff together. Nothing auto-merges. Automated review feedback is another signal, not permission to bypass engineering judgment.</p><figure><img alt="A sanitized reproduction pattern. The finding concerns the missing user-facing confirmation" src="https://cdn-images-1.medium.com/max/1024/1*B7JYDkTsumLtvJObi5CQTA.png" /><figcaption>A sanitized reproduction pattern. The finding concerns the missing user-facing confirmation</figcaption></figure><h3>A small case study: why the wording matters</h3><p>In an isolated test environment using synthetic data, we explored a record-saving workflow with a supporting-data dependency. My documented experience required confirmation before continuing. To establish that the backend condition is deterministic, the Explorer observed the original read and then mocked only that request to return a server error.</p><p>The UI showed an error but not the expected confirmation. The agent continued through ordinary controls, and the unmocked save request returned HTTP 200. That made the observed gap specific: <strong>the scenario could proceed without the documented confirmation.</strong></p><p>Two details had to remain explicit in every report:</p><ul><li>The dependency failure was a deliberate test condition, not an observed production outage. The isolated scenario caused no impact on production or customers.</li><li>HTTP 200 was an observed protocol response — not proof of business correctness, data integrity, a real financial transaction, or financial impact.</li></ul><p>The resulting E2E change preserved the reproduction as pending work while the product claim was triaged. A developer later changed the shared product behavior and added a regression test. Those were different deliverables: one preserved exploratory learning; the other fixed the product.</p><p>The valuable outcome was not “AI found and fixed a bug.” It was: <strong>the agent captured and structured evidence; engineers triaged, refined, and addressed the behavior through separate review paths.</strong></p><h3>Failure paths are part of the architecture</h3><p>A system like this should be evaluated as much by how it stops as by how it proceeds. My normal decision rules look like this:</p><ul><li><strong>Not actionable:</strong> Keep the report; do not start the Author or open a pull request.</li><li><strong>No committable change:</strong> Stop without creating empty triage or review work.</li><li><strong>Validation fails:</strong> Do not publish. Never weaken an assertion merely to obtain green output.</li><li><strong>Judgment required:</strong> Move the finding into an explicit human-review path rather than silently dropping it.</li><li><strong>Integration ambiguous:</strong> Fail safely rather than risk duplicate issues or an untracked pull request.</li><li><strong>Run retried:</strong> Resolve the original exploration artifacts and preserve idempotency where possible.</li></ul><p>These rules sound mundane compared with a model demonstration. They are also what turn a demonstration into a maintainable engineering system.</p><h3>What I would measure before scaling</h3><p>It is tempting to count generated tests. That would be a poor success metric. I would baseline four dimensions instead:</p><ul><li><strong>Signal quality:</strong> Useful and confirmed findings, false positives, duplicates, reproducibility, and blocked/error rates.</li><li><strong>Coverage value:</strong> Accepted changes, time from finding to durable regression coverage, and whether fixed defects recur.</li><li><strong>Operational cost:</strong> Actual duration and model cost per run, test-data collisions, notification reliability, and retention needs.</li><li><strong>Human load:</strong> Triage and review time, deferred findings, and the age of pending reproductions.</li></ul><p>Only with that evidence would I expand into additional journeys, user roles, or concurrency. New roles require genuinely differentiated test credentials; concurrency requires test-data isolation. Neither is just a configuration toggle.</p><p>I would also keep the exploratory workflow non-blocking while its reliability and review burden are measured. Deterministic tests remain the natural home for repeatable validation. Agentic exploration should not default to an unpredictable merge dependency.</p><h3>Start with one goal, not a platform transformation</h3><p>For teams considering a similar experiment, the starting point can be small:</p><ol><li><strong>Choose one ambiguous but valuable journey.</strong> Write down the outcome and observable success criteria.</li><li><strong>Define the evidence contract.</strong> Decide what counts as met, not met, blocked, and harness failure.</li><li><strong>Set safety and resource limits.</strong> Use a test environment, managed authentication, explicit data rules, and turn/time budgets.</li><li><strong>Make the output reviewable.</strong> Retain raw output, normalized evidence, and a human-readable report.</li><li><strong>Add authoring only when the finding loop works.</strong> Then apply the same code quality and human-review standards as for any other contribution.</li><li><strong>Measure whether humans find the output useful.</strong> Scale signal, not the number of agent actions.</li></ol><p>The long-term opportunity is a learning loop: explore an outcome, preserve the useful learning, convert some of it into deterministic coverage, and repeat.</p><p>That is a less dramatic vision than fully autonomous testing. It is also much more useful.</p><h3>Further reading</h3><ul><li><a href="https://playwright.dev/docs/intro">Playwright documentation</a></li><li><a href="https://github.com/microsoft/playwright-mcp">Playwright MCP browser-automation server</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f64c5110f1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/beyond-test-scripts-a-practical-architecture-for-agentic-e2e-testing-5f64c5110f1b">Beyond Test Scripts: A Practical Architecture for Agentic E2E Testing</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Made Mobile Releases Boring and Improved Delivery Flow]]></title>
            <link>https://medium.com/syngenta-digitalblog/how-we-made-mobile-releases-boring-and-improved-delivery-flow-fb3fa068249a?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/fb3fa068249a</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[2026]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Brett Johnsen]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 17:50:54 GMT</pubDate>
            <atom:updated>2026-11-13T17:50:53.276Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How We Made Mobile Releases Boring and Improved Delivery Flow" src="https://cdn-images-1.medium.com/max/1024/1*Fdj_nqcUNfjEF6QhJz78zA.jpeg" /></figure><h3><em>Team Horizon’s path to frequent, low-risk mobile delivery wasn’t about finding one perfect tool. It was about connecting ownership, small changes, feature flags, and automation into a system.</em></h3><p>When people talk about mobile delivery, release frequency often comes with a warning: slow down, or you’ll increase risk.</p><p>It’s an understandable instinct. Mobile releases involve app stores, devices we don’t control, users who may not update immediately, and experiences that must work in challenging environments. A bad release can be hard to undo.</p><p>But Team Horizon found that releasing less frequently wasn’t the only way to manage that risk. In fact, waiting often created a different problem: larger batches of changes, more coordination, slower feedback, and harder recovery when something went wrong.</p><p>So we focused on a different question:</p><p><strong>How could we make small, controlled changes flow from idea to production without turning every release into an event?</strong></p><p>For the Protector Single App, that meant changing more than our release process. We built a connected delivery system — from planning through production — where developers own the journey, automation reduces waiting, and controls remain in place.</p><p>The results: between January 1 and October 26, 2026, we published <strong>55 production-labeled releases</strong>, averaging <strong>1.29 per week</strong>. Our reported cycle time was approximately <strong>one day</strong>.</p><p>Those numbers are useful, but they aren’t the point. They are signals of a healthier delivery system.</p><h3>The problem wasn’t reliability alone</h3><p>The conversation started when leadership looked across the organization’s DORA metrics.</p><p>Reliability was already a strength: 94% of teams were at Elite status for change failure rate, and 95% for mean time to recovery. Flow was the bigger opportunity. Sixty-two percent of teams were at Elite status for cycle time, and 56% for deployment frequency. Mobile teams appeared frequently on the improvement list.</p><p>Leadership asked us to share what Horizon was doing differently.</p><p>It would have been easy to answer with a list of tools: feature flags, AI-assisted reviews, Jira automation, auto-merge. But none of those practices explain the outcome on its own.</p><p>The more useful answer is that we reduced friction throughout the entire journey while maintaining appropriate controls.</p><p>A green metric is not a delivery strategy. If a team changes its behavior only to improve a dashboard, it can end up optimizing the number rather than the work. We wanted the metrics to show us whether the system was healthy — and where it still needed attention.</p><h3>Releasing less often doesn’t automatically reduce risk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCVHErnFmbvPrD7dAmZU1Q.png" /></figure><p>The traditional response to release risk is to deploy less frequently. The reasoning sounds simple: fewer releases mean fewer opportunities for something to go wrong.</p><p>But delaying releases also lets changes accumulate. Over time, that means:</p><ul><li>More code and behavior bundled together</li><li>More coordination around each release</li><li>Longer waits for feedback</li><li>More possible causes to investigate when something fails</li></ul><p>We chose to work in the opposite direction: integrate smaller changes, release frequently, and control customer exposure with feature flags.</p><p>That doesn’t mean frequency alone makes delivery safe. Frequent releases need small batches, fast feedback, and a way to recover when things go wrong. Without those conditions, a faster cadence can simply move problems faster.</p><h3>An operating model, not a collection of tools</h3><p>Our delivery model starts with three ideas:</p><ol><li><strong>Developers own delivery</strong>, from understanding product intent through getting the work into production.</li><li><strong>Risk is managed, not eliminated.</strong> We make deliberate decisions about exposure and review.</li><li><strong>Recovery matters.</strong> We want changes and feedback loops small enough that problems are easier to identify and address.</li></ol><p>Those ideas are supported by practices that reinforce one another.</p><p>We use trunk-based development to keep work moving toward a releasable main branch. We keep pull requests small enough to review and integrate incrementally. We use feature flags to keep unfinished work from becoming visible before it is ready. And we automate handoffs that would otherwise become queues.</p><p>The connection between the practices matters. Small PRs are easier to review. Flags make it possible to safely merge incomplete features. Automation reduces waiting after checks pass. Together, they make a sustainable release rhythm.</p><h3>Good flow starts before anyone writes code</h3><p>Our process begins with a Product Owner’s Jira Idea. A developer works directly with the Product Owner to understand and shape it.</p><p>We then use an AI Ticket Writer to help turn that intent into an epic, stories, acceptance criteria, feature-flag work, and implementation considerations.</p><p>The developer remains accountable for the plan. AI helps with decomposition and consistency; it doesn’t replace the conversation or the ownership.</p><p>This is important because delivery problems often begin before development starts. If feature-flag work or test planning appears only near release, the team has already created a late-stage handoff. Bringing those concerns into planning makes them part of the feature rather than an afterthought.</p><h3>Deploy continuously. Release intentionally.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TxgtpDafrFbJwJagmQPaOg.png" /></figure><p>Feature flags changed the meaning of deployment for us.</p><p>In a traditional flow, teams may hold code until an entire feature is ready. Deployment and customer exposure happen together. That encourages long-lived branches and larger releases.</p><p>With a flag, we can deploy code while keeping the experience unavailable until it is ready. Product exposure remains a deliberate decision rather than an automatic consequence of merging code.</p><p>That separation gives the team more room to work in small increments:</p><p><strong>Code → deploy → control exposure → release when ready.</strong></p><p>It also helps keep the main branch releasable without requiring every feature to be complete at every moment.</p><h3>Review risk, not every change in the same way</h3><p>Small PRs make review easier, but review can still become a queue. That’s especially true when every change receives the same process regardless of its scope and risk.</p><p>Our Horizon Review process uses automated analysis to summarize a pull request, classify its risk, check policy and quality signals, and provide an evidence-backed recommendation.</p><p>Eligible low-risk changes can qualify for Horizon approval and auto-merge once required controls pass. Higher-risk changes still receive deeper human review.</p><p>The goal is not to remove people from review. It is to direct human attention where it adds the most value — and avoid making straightforward changes wait behind unnecessary handoffs.</p><h3>We removed waiting, not controls</h3><p>When teams talk about cycle time, it’s tempting to focus on coding speed. But a significant portion of delivery time can sit between decisions:</p><ul><li>Waiting for planning</li><li>Waiting for work to be tracked or updated</li><li>Waiting for review</li><li>Waiting for an approved change to merge</li></ul><p>Our automation addresses those handoffs. The Ticket Writer supports planning. Jira automation helps keep work synchronized. Horizon Review accelerates risk triage. Auto-merge completes eligible changes after required checks pass.</p><p>We didn’t need developers to type dramatically faster. We needed work to spend less time sitting still.</p><p>That distinction matters: <strong>the aim is to remove queues while retaining the controls that ensure safe delivery.</strong></p><h3>When releases became routine, the metrics followed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fTUPft5fljnj7ySaMv4aPg.png" /></figure><p>From January 1 through October 26, 2026, Cropwise Protector published 55 production-labeled GitHub releases, excluding drafts and prereleases. That worked out to an average of 1.29 releases per week. The cadence increased during the year, including eight releases in May and eight in September. October’s count was partial through the 26th.</p><p>Releasing became less of a special event and more of a team rhythm. That was a positive change: routine releases meant smaller batches and less ceremony around each one.</p><p>Our reported current averages also showed approximately one day of cycle time, with around nine hours of coding time, six and a half hours each for pickup and review, and four hours for deploy time.</p><p>These aren’t universal targets. A maintenance-only product, for example, may need a different intentional cadence. The more important question is whether a team can move work predictably, see where it waits, and respond when a bottleneck appears.</p><h3>Start with one bottleneck</h3><p>Other teams don’t need to copy Horizon’s implementation to use the lesson.</p><p>The lesson is to treat delivery as a connected system. Ownership keeps product intent close to implementation. Planning makes controls visible early. Small changes reduce batch size. Risk-based review puts attention where it matters. Frequent releases shorten the feedback loop.</p><p>Start with one visible bottleneck. Run a small experiment. Measure whether waiting or batch size improves.</p><p>That experiment might be planning feature flags earlier, reducing PR size, automating review notifications, or enabling auto-merge after required checks.</p><p>The goal isn’t to make a metric green. It’s to make the safe path easier to follow — and make delivery predictable enough that releasing becomes boring.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb3fa068249a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/how-we-made-mobile-releases-boring-and-improved-delivery-flow-fb3fa068249a">How We Made Mobile Releases Boring and Improved Delivery Flow</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI-Powered Container Scan Analyzer into our CI/CD Pipeline]]></title>
            <link>https://medium.com/syngenta-digitalblog/building-an-ai-powered-container-scan-analyzer-into-our-ci-cd-pipeline-786336740ce5?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/786336740ce5</guid>
            <category><![CDATA[vulnerability-scanning]]></category>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[circleci]]></category>
            <category><![CDATA[2026]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <dc:creator><![CDATA[Bitan Mallick]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 17:08:17 GMT</pubDate>
            <atom:updated>2026-10-16T17:08:16.202Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How we plugged N8N into our ECR orb to turn raw vulnerability reports into developer-ready remediation guides — automatically.</em></p><figure><img alt="Building an AI-Powered Container Scan Analyzer into our CI/CD Pipeline" src="https://cdn-images-1.medium.com/max/1024/1*cwyrjgdV507nO0DslAi1yA.png" /></figure><p><strong>The Problem Nobody Talks About</strong></p><p>Every platform team eventually gets security scanning working. You wire up the scanner, it runs on every build, and — great — now you have a pipeline that fails with a wall of CVEs. You’ve solved visibility. You haven’t solved anything else.</p><p>The real problem isn’t finding vulnerabilities. It’s what happens next.</p><p>A developer opens the failed build, sees something like:</p><pre>CVE-2024–45490 critical libexpat 2.5.0<br>CVE-2023–52425 high libexpat 2.5.0<br>CVE-2024–3596 critical freeradius-client 1.1.7</pre><p>And then what? Sure, AWS Inspector suggests fixes, but you still need to parse them, cross-reference which ones apply to your Dockerfile, verify the base image ships the update, check if upgrading breaks anything, reconcile conflicting recommendations, and — if you’re lucky — arrive at an actionable version pin and Dockerfile diff forty-five minutes later. For each CVE. For every team.</p><p>That’s the tax we were silently paying on every vulnerable image. We built a tool to close the gap.</p><p><strong>Our Setup: The ECR Orb</strong></p><p>Before diving into the AI layer, some context. We maintain a CircleCI orb — <em>syngenta-digital/aws-ecr</em> — that handles the full image lifecycle for all our services: build, lint, scan, promote. Amazon Inspector (via <em>inspector-sbomgen</em>) is our scanner. Every image that goes through the <em>build-and-push</em> job gets scanned before it ever touches ECR.</p><p>The orb already had:</p><ul><li>Hadolint for Dockerfile linting</li><li>Amazon Inspector for vulnerability scanning</li><li>Compliance checks against our internal security controls service</li><li>Golden Base Image (GBI) management — a curated catalog of org-approved base images</li></ul><p>What it didn’t have was any intelligence on how to <em>handle</em> scan results.</p><p>You can find more details on our ECR setup and the orb in <a href="https://medium.com/syngenta-digitalblog/building-a-centralized-and-secure-aws-ecr-architecture-for-scalable-container-delivery-22f0964c629b">this</a> article.</p><p><strong>The Solution: AI Scan Analysis</strong></p><p>We built <em>ai_scan_analysis</em> — a new step in the orb’s <em>build-and-push</em> job that fires automatically when critical or high vulnerabilities are detected. It takes the raw Inspector JSON, the project’s Dockerfile, and our Golden Base Image catalog, ships them to an N8N workflow, and returns a complete remediation report as a CircleCI artifact.</p><p>One flag enables it all:</p><pre>- aws-ecr/build-and-push:<br>    context: project_cicd_context<br>    repo: my-service<br>    application_name: my-service<br>    region: us-east-1<br>    enable_n8n_ai_scan_analysis: &quot;true&quot; #ENABLES AI SCAN ANALYSIS</pre><p>No code changes in the application. No extra pipeline steps. No manual triage.</p><p><strong>Architecture: How It All Fits Together</strong></p><p>The system is built across two layers — the CircleCI pipeline and the <a href="https://n8n.io/">N8N</a> workflow — with Claude Sonnet 4 doing the heavy lifting in between.</p><p><strong>CircleCI Pipeline</strong></p><ul><li>Docker image is built and scanned using Amazon Inspector</li><li>If critical/high CVEs are found, <em>ai_scan_analysis.sh</em> (in the orb) fires automatically in a non-blocking subshell</li><li>Scan report, Dockerfile, and metadata are base64-encoded and POSTed to the N8N webhook</li><li>The final HTML report lands as a CircleCI artifact (<em>scan_analysis.html</em>)</li></ul><p><strong>N8N Workflow</strong></p><ul><li>Receives the payload and fans out in parallel: extracts the Dockerfile, parses vulnerabilities, and fetches the org’s Golden Base Image catalog from our internal DevOps Service API</li><li>Filters CVEs down to critical/high only, trims them to essential fields (CVE ID, package, severity, fixed version), and merges all three data streams before passing to the AI</li><li>Claude Sonnet 4 (AWS Bedrock, EU region, via Portkey gateway) receives the structured context and returns a remediation report as HTML</li><li>The response is base64-encoded and returned to the pipeline</li></ul><p><strong>Output</strong></p><ul><li>The shell script decodes the response, wraps it in a styled HTML shell with a dark/light theme toggle, and stores it as <em>scan_analysis.html</em> in the CircleCI artifacts directory</li></ul><p><strong>The Shell Script: <em>ai_scan_analysis.sh</em></strong></p><p>The script (within the CircleCI orb) runs in a non-blocking Bash subshell after the Inspector scan completes — it can never fail the build on its own. A few design choices worth calling out:</p><ul><li><strong>Severity-matched filtering</strong> — It only sends CVEs at the severity level you’re already failing on. If <em>scan_fail_on_high</em> is enabled, you get analysis on both critical and high. If not, critical only. No noise.</li><li><strong>Payload safety </strong>— The Dockerfile and scan report are base64-encoded before transport. The API key is resolved at runtime from a named environment variable and passed as a request header — never embedded in the payload.</li><li><strong>Graceful degradation </strong>— If the scan report doesn’t exist, no CVEs are found at the target severity, or the N8N call fails for any reason, the script exits 0 and logs a warning. The pipeline is never blocked by the analysis layer.</li></ul><p><strong>The N8N Workflow: Inside the AI Engine</strong></p><p>N8N orchestrates the entire AI processing pipeline. The workflow has two intake paths — direct payload (scan data embedded in the POST body) and artifact fetch mode (the workflow downloads the scan report from CircleCI artifacts using the build number) — and converges into a single AI call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1sbAl0V17s3vHNaPbD_-w.png" /></figure><ul><li><strong>Webhook</strong> — Entry point. Accepts <em>POST /ai-scan-analysis</em> with header authentication. The workflow supports both direct payload mode (scan data in the request body) and artifact fetch mode (downloads from CircleCI artifacts using the build number).</li><li><strong>Download Scan Report (conditional)</strong> — If the scan report is missing from the body, the workflow calls the CircleCI v2 API with the build number to fetch the scan report artifact directly. This handles cases where payload size would exceed webhook limits.</li><li><strong>Get Dockerfile</strong> — Extracts the base64-encoded Dockerfile from the request body.</li><li><strong>Get Golden Base Images</strong> — Queries our internal DevOps Service API to fetch the curated list of approved base images. The AI uses this to recommend GBI-aligned alternatives rather than arbitrary upstream images.</li><li><strong>Parse Vulnerabilities </strong>— A code node that filters to critical/high only and trims each entry to essential fields (severity, CVE ID, package, truncated description, fixed version). This keeps the prompt tight.</li><li><strong>Merge + Aggregate</strong> — Combines the three data streams (vulnerabilities, Dockerfile, GBI list) and validates that all three are present and non-empty before proceeding.</li><li><strong>AI Analyzer</strong> — The core node. Runs Claude Sonnet 4 on AWS Bedrock via Portkey as an AI gateway.</li><li><strong>Success Response</strong> — Returns the AI output as base64-encoded plain text with a 200 status. The shell script on the CircleCI side decodes it and assembles the final report.</li></ul><p><strong>The Output: <em>scan_analysis.html</em></strong></p><p>The generated report is a self-contained HTML file available under the <em>Artifacts</em> tab in CircleCI. It contains:</p><ul><li><strong>Vulnerability Summary </strong>— A table of every CVE analyzed, with current and fixed versions</li><li><strong>Root Cause Analysis</strong> — Why each package is vulnerable and what introduced it</li><li><strong>Remediation Steps</strong> — Broken into three sections:</li></ul><ol><li>Package-level version pins</li><li>Updated Dockerfile (with Golden Base Image recommendations where applicable)</li><li>Dependency file changes (<em>requirements.txt</em>, <em>package.json</em>, <em>build.gradle</em>, etc.)</li></ol><ul><li><strong>Alternative Mitigations</strong> — When a direct fix isn’t available</li><li><strong>Dark/Light Theme Toggle</strong> — Because developer experience matters</li></ul><p>Here’s a representative snippet of what the AI generates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0UbR6UhnUpR6alDtb4Pcw.png" /></figure><p><strong>Why This Approach Works</strong></p><ul><li><strong>Non-Blocking Execution</strong></li></ul><p>The analysis runs in a Bash subshell. If N8N is unavailable, if the AI call times out, or if anything else goes wrong, the pipeline continues. The scan still fails on critical CVEs (if configured); the analysis is additive, never a blocker.</p><ul><li><strong>Context-Aware, Not Generic</strong></li></ul><p>Most LLM-based security tools give you generic CVE advice — the same boilerplate you’d find on NVD. Our implementation sends:</p><p>1. <strong>The actual Dockerfile</strong> — The AI sees your specific base image, your multi-stage build, your package installs</p><p>2. <strong>The filtered scan results</strong> — Not the entire SBOM, just the actionable severity tier</p><p>3. <strong>Org’s Golden Base Images</strong> — The AI recommends <em>our approved images</em>, not arbitrary DockerHub tags</p><p>The output is specific to the image, stack, and organization’s approved catalog.</p><ul><li><strong>Severity-Scoped Analysis</strong></li></ul><p>The analysis scope is tied to your fail condition. If <em>scan_fail_on_high: true</em>, you get analysis on high <em>and</em> critical. If not, only critical. This means the report covers exactly the CVEs that are blocking your build — no noise from medium/low findings that aren’t blocking anything.</p><ul><li><strong>Cost-Conscious Design</strong></li></ul><p>The <em>Parse Vulnerabilities</em> code node intentionally truncates CVE descriptions to 200 characters and strips non-essential SBOM fields before the AI call. Sending a 5MB SBOM to a language model is both expensive and counterproductive — the AI performs better with clean, focused input.</p><p><strong>Caveats and Honest Limitations</strong></p><ul><li><strong>AI Recommendations Require Human Judgment</strong></li></ul><p>The generated steps are a starting point, not a merge request. Version pins suggested by the AI need to be tested. Base image upgrades might introduce breaking changes. Treat the report as an expert first draft, not a finished solution.</p><ul><li><strong>Latency</strong></li></ul><p>The analysis is non-blocking but not instantaneous. An N8N workflow that includes an AWS Bedrock call adds 15–60 seconds to the build time. The artifact won’t appear until the step completes. For large vulnerability sets, this can take longer.</p><ul><li><strong>No Feedback Loop (Yet)</strong></li></ul><p>The current system doesn’t track whether recommendations were acted upon. There’s no mechanism to close the loop — to learn which suggestions were useful, which were irrelevant, or to improve prompt quality over time. That’s on the roadmap.</p><ul><li><strong>Rate Limits and Availability</strong></li></ul><p>N8N webhook availability and Bedrock quota limits are external dependencies. If either is degraded, the step silently skips analysis (exit 0). This is the right failure mode for CI, but it means teams need to check the Artifacts tab proactively when a scan fails — the absence of the artifact doesn’t mean no vulnerabilities; it may mean the analysis was skipped.</p><p><strong>What This Changed for Our Teams</strong></p><p>Before this, a failed scan on a critical CVE meant: find the CVE, figure out which package, check if a fix exists, update the Dockerfile, rebuild, re-scan. An hour of work per incident, often more for multi-CVE failures, and often done reactively rather than proactively.</p><p>After: open the Artifacts tab, read the HTML report, copy the Dockerfile snippet, push. The same knowledge work is done — it’s just done by the AI on every build rather than by a developer on every failed build.</p><p>The secondary benefit is consistency. Different engineers attacking the same CVE would previously arrive at different solutions depending on their familiarity with the vulnerability and the package ecosystem. Now the baseline recommendation is the same for everyone — and it’s aligned with our Golden Base Image catalog.</p><p><strong>What’s Next</strong></p><p>A few things we’re thinking about:</p><ul><li><strong>Slack/Teams notification </strong>— Post a summary of the AI report directly to the team’s security channel when a scan fails</li><li><strong>Auto-PR generation</strong> — Use the Dockerfile diff from the AI report to open a draft PR with the suggested changes</li><li><strong>Feedback loop</strong> — Allow developers to mark recommendations as <em>applied</em> or <em>rejected</em> and feed that signal back to improve prompt quality</li><li><strong>Cost dashboard</strong> — Track Bedrock token usage per team/repo to understand the cost-per-analysis and optimize accordingly</li></ul><p><strong>Conclusion</strong></p><p>Container security scanning is table stakes. Turning scan results into developer action is the hard part — and it’s been a largely manual, time-consuming process for most teams.</p><p>By connecting Amazon Inspector, N8N, AWS Bedrock, and Claude Sonnet to our existing ECR orb, we automated the gap between <em>finding a vulnerability and</em> getting <em>&quot;here’s exactly how to fix it</em>.&quot; The integration is non-breaking, opt-in, and adds no mandatory latency to builds. Teams that enable it get a free expert consultation on every failed scan.</p><p><em>If you found this useful or have questions about the implementation, feel free to reach out. We’re always interested in how other teams are approaching security automation in their pipelines.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=786336740ce5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/building-an-ai-powered-container-scan-analyzer-into-our-ci-cd-pipeline-786336740ce5">Building an AI-Powered Container Scan Analyzer into our CI/CD Pipeline</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Compilation, Linking, and Loading Work on iOS (and Why Your Previews Sometimes Crash)]]></title>
            <link>https://medium.com/syngenta-digitalblog/how-compilation-linking-and-loading-work-on-ios-and-why-your-previews-sometimes-crash-eaaecc4df387?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/eaaecc4df387</guid>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[2026]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rafael Augusto Pena]]></dc:creator>
            <pubDate>Wed, 30 Sep 2026 20:39:37 GMT</pubDate>
            <atom:updated>2026-09-30T20:39:36.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How Compilation, Linking, and Loading Work on iOS (and Why Your Previews Sometimes Crash)" src="https://cdn-images-1.medium.com/max/1024/1*9A2SHXedB0rY--cCBim_2w.png" /></figure><p>You wrote some code that imports a library. You hit Build, the IDE thought for a moment, and a few seconds later, your app was running. Most of the time, that’s all you need to know. But every so often, something goes wrong. SwiftUI Previews crash on a view that has nothing to do with the stack trace, an SDK breaks the second time it’s used during a hot reload, or your release build aborts at startup with a stack trace full of C++ symbols you’ve never seen before.</p><p>These failures happen at the seams between your source code and your running app. To understand them, you need a model of what happens at those seams: which files are produced, what they’re for, how iOS connects everything, and where the design decisions that make each step possible create risks of their own.</p><p>This article builds that model from scratch. It assumes no prior knowledge of compilers or linkers. By the end, you’ll have the vocabulary and intuition to debug a whole class of problems that cut across these layers.</p><h4><strong>Part 1: What Happens When You Compile</strong></h4><p>You write source code. The CPU doesn’t speak Swift, C++, or Objective-C. Compilation is the process of translating your source code into something the CPU can execute.</p><p>Three players are involved:</p><ul><li><strong>The compiler</strong> takes one source file at a time and turns it into machine code, but only the parts that are self-contained. References to things defined elsewhere, such as functions in other files or library calls, are left as placeholders.</li><li><strong>The linker</strong> takes those translated pieces and resolves the placeholders. “This file says call foo. foo is defined in that other file, so fix the placeholder to point there.”</li><li><strong>The loader</strong> comes later, at runtime. It takes the final program and gets it ready to run in memory.</li></ul><p>The compiler’s output for a source file is called an <strong>object file</strong>: MyClass.o. It isn’t executable on its own. It has unresolved references and no entry point. It’s an intermediate file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyGQ6GC2YVyBscen__8WxQ.png" /><figcaption>Compilation and linking (image 01)</figcaption></figure><p>Each .o knows what it provides (its <strong>defined symbols</strong>, the functions, variables, and classes it contains) and what it needs from elsewhere (its <strong>undefined symbols</strong>). A symbol is just a name with an address: myFunction is a symbol, and kDefaultTimeout is a symbol.</p><p>The linker is the chef who puts the dish together. It looks at all the .o files, matches each undefined symbol with one defined somewhere else, and writes the final binary.</p><p>That’s the whole pipeline. Compile each file separately, then link them all together. Real builds add caching, parallelism, and optimization passes, but the underlying flow is exactly this.</p><h4><strong>Part 2: The Three Types of Final Output</strong></h4><p>Here’s where things branch out. The linker doesn’t always produce the same kind of binary. Depending on the flags you pass, it produces one of three different types. The differences between them are where everything that follows begins.</p><pre>+--------------------+-----------------------+-----------------------+<br>|     EXECUTABLE     |    STATIC LIBRARY     |    DYNAMIC LIBRARY    |<br>|    (MH_EXECUTE)    |         (.a)          |       (.dylib)        |<br>+--------------------+-----------------------+-----------------------+<br>| Has main()         | No main()             | No main()             |<br>| Runs on its own    | Cannot run alone      | Cannot run alone      |<br>| The OS launches it | Must be linked into   | Needs a process to    |<br>| directly           | an executable         | load it at runtime    |<br>+--------------------+-----------------------+-----------------------+</pre><h4><strong>Executable</strong></h4><p>An executable is something the operating system can launch directly. It has a function called main() (or the language’s equivalent), a defined entry point, and a Mach-O header saying, “I’m a program, type MH_EXECUTE.”</p><p>When you tap an app icon or run ./MyApp in a terminal, the kernel finds the entry point and starts executing from there.</p><p>The main binary of your iOS app is an executable. Without one, nothing runs.</p><h4><strong>Static Library</strong></h4><p>A static library is a <strong>package of object files bundled together</strong>, with the extension .a (for “archive”). Think of it as a .zip containing .o files, except the format is older (ar, from the 1970s) and the linker knows how to read it.</p><pre>SomeLibrary.a<br>├── audio_decoder.o<br>├── video_decoder.o<br>├── network_client.o<br>└── … (one .o per library source file)</pre><p>An .a has no entry point, no main(), and no header saying, “I’m a program.” It doesn’t run on its own. <strong>Static libraries exist only to be linked into something else.</strong></p><p>When the linker is producing your app binary, you tell it, “Link SomeLibrary.a too.” The linker opens the archive, pulls out the .o files you need, and <strong>copies their bytes into your app binary</strong>. After linking, the .a is no longer needed at runtime. Its bytes live inside your app.</p><pre>BUILD TIME<br><br>SomeLibrary.a         App object files          Final MyApp binary<br>┌──────────────┐       ┌──────────────┐          ┌──────────────────┐<br>│ aud.o        │       │ MyApp.o      │          │ MyApp code       │<br>│ video.o      │───────┤ …            ├─► linker │ + aud.o          │<br>│ network.o    │       │              │ ───────► │ + video.o        │<br>└──────────────┘       └──────────────┘          │ + network.o      │<br>                                               └──────────────────┘<br>                                                Bytes copied inside</pre><h4><strong>Dynamic Library</strong></h4><p>A dynamic library is a <strong>standalone binary that contains code and data, with a header saying, “I’m a library, type </strong><strong>MH_DYLIB.”</strong> Its extension is .dylib (for “dynamic library”). It has the same structure as an executable, including symbol tables and code segments, but no main() and no entry point.</p><pre>SomeLibrary.dylib<br>├── Mach-O header (MH_DYLIB)<br>├── Exported symbol table (what I provide)<br>├── Imported symbol table (what I need from others)<br>├── Code segment<br>└── Data segment</pre><p>A .dylib doesn’t run on its own either. <strong>It needs a process, provided by an already-launched executable, to host it.</strong> That process can then load the .dylib into its memory and start calling its functions.</p><h4><strong>The Key Thing They Have in Common</strong></h4><p>Both static and dynamic libraries are <strong>just code</strong>. Neither runs on its own. Both need an executable, a binary with main(), to provide a process they can live in.</p><p>The difference is <strong>when</strong> they connect to the executable: static libraries have their bytes copied into the executable at build time. Dynamic libraries are loaded into the executable’s memory at runtime.</p><pre>+-------------------------+---------+-------------+-------------------------------+<br>| Artifact                | main()? | Runs alone? | When code connects            |<br>+-------------------------+---------+-------------+-------------------------------+<br>| Executable              | Yes     | Yes         | It is the executable.         |<br>+-------------------------+---------+-------------+-------------------------------+<br>| .a (static library)     | No      | No          | At link time. Bytes copied    |<br>|                         |         |             | into the executable.          |<br>+-------------------------+---------+-------------+-------------------------------+<br>| .dylib (dynamic         | No      | No          | At runtime. Loaded by a       |<br>| library)                |         |             | running process.              |<br>+-------------------------+---------+-------------+-------------------------------+</pre><h4><strong>Part 3: The Wrapper Formats</strong></h4><p>Apple platforms distribute libraries inside larger “bundle” directories, which add metadata and resources around the raw binary. These bundles are just folders with a specific layout. The actual binary inside is still an .a or a .dylib.</p><h4><strong>.framework</strong></h4><pre>SomeLibrary.framework/<br>├── SomeLibrary ← actual binary (no extension)<br>├── Headers/<br>│   └── SomeLibrary.h<br>├── Modules/<br>│   └── module.modulemap<br>├── Info.plist<br>└── Resources/</pre><p>A .framework packages the binary together with its headers (so the compiler can see the types) and resources (images, models, and plists the library uses). It can wrap either a static or a dynamic binary. To find out which, use file:</p><pre>$ file SomeLibrary.framework/SomeLibrary<br>Mach-O 64-bit dynamically linked shared library ← dynamic<br># or<br>current ar archive ← static</pre><h4><strong>.xcframework</strong></h4><pre>SomeLibrary.xcframework/<br>├── ios-arm64/SomeLibrary.framework/<br>├── ios-arm64-simulator/SomeLibrary.framework/<br>└── macos-arm64/SomeLibrary.framework/</pre><p>An .xcframework is a bundle for multiple architectures: one .framework per platform and architecture combination. It exists because, even on Apple Silicon, where both the iPhone and the simulator are arm64, the binaries are compiled differently and need to be distributed separately.</p><h4><strong>.bundle</strong></h4><p>Less common, but useful to know: a .bundle is a directory shaped like a .framework that doesn’t expose a library for linking. It’s used for plugins loaded at runtime, code discovered dynamically, or bundles that contain only resources.</p><h4><strong>Part 4: How an iOS App Starts</strong></h4><p>When you tap an app icon, this is the sequence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDPK9sm299h73pQUQv7hFA.png" /><figcaption>iOS app startup (image 02)</figcaption></figure><p>In words:</p><p>1. <strong>The kernel locates the executable</strong> inside the .app bundle and tells the process scheduler to run it.<br>2. <strong>The kernel maps the executable into memory</strong> and reads its Mach-O header. The header lists every dynamic library this executable needs (Foundation.framework, UIKit.framework, and your own dynamic frameworks).<br>3. <strong>The kernel hands control to </strong><strong>dyld</strong>, the dynamic loader, a special program shipped by Apple. dyld handles all the dynamic library work.<br>4. <strong>dyld loads each dependency.</strong> For every .dylib listed in the header, dyld finds it on disk, maps it into the process’s memory, and reads its own Mach-O header (which may list more dependencies). dyld loads everything recursively.<br>5. <strong>dyld resolves symbols.</strong> Your executable says, “I need the function foo.” dyld finds foo’s memory address in one of the loaded libraries and fixes the reference.<br>6. <strong>dyld runs static initializers.</strong> Each loaded binary may have code that runs automatically when it’s loaded (more on this in Part 7). dyld walks the dependency graph and runs these initializers in order.<br>7. <strong>dyld calls </strong><strong>main().</strong> Your app’s code starts running.</p><p>All this initialization takes tens to hundreds of milliseconds for a typical app. The dyld pass is what “loads” your app. Without it, your executable is just bytes on disk with no way to find UIKit.</p><p><strong>dlopen: Loading on Demand</strong></p><p>There’s also a runtime API, dlopen(&quot;library.dylib&quot;,…), that lets your already running code ask dyld to load a new dynamic library <strong>after</strong> startup. Common uses include:</p><p>- Plugins loaded into the current process<br>- Optional features are loaded only when the user reaches them<br>- Hot reload tools that inject new code into a live process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNHHSlPRwHZb6LiDxD2p_w.png" /><figcaption>Loading a dynamic library on demand (image 03)</figcaption></figure><p>When dlopen runs, dyld performs steps 4 through 6 above for the new arrival. The library appears in the live process, ready to be called.</p><p>This is the mechanism behind SwiftUI Previews, which we’ll look at next.</p><h4><strong>Part 5: Static vs. Dynamic and When to Use Each</strong></h4><p>Now that you know what each format is, the question becomes: which should you use?</p><pre>STATIC                                DYNAMIC<br>┌──────────────────────────┐          ┌──────────────────────────┐<br>│ ┌──────────────────────┐ │          │ ┌──────────────────────┐ │<br>│ │ MyApp executable     │ │          │ │ MyApp                │ │<br>│ │                      │ │          │ │ references SomeLib   │ │<br>│ │ (my code)            │ │          │ └──────────┬───────────┘ │<br>│ │ + SomeLib code       │ │          │            │             │<br>│ └──────────────────────┘ │          │            ▼             │<br>│                          │          │ ┌──────────────────────┐ │<br>│ One large file.          │          │ │ SomeLib.dylib        │ │<br>│ Loads fast.              │          │ │ (separate)           │ │<br>│ No identity for SomeLib. │          │ └──────────────────────┘ │<br>│                          │          │                          │<br>│                          │          │ Two files.               │<br>│                          │          │ dyld loads both.         │<br>│                          │          │ SomeLib has an identity. │<br>└──────────────────────────┘          └──────────────────────────┘</pre><p><strong>Static libraries</strong>: bytes copied into your executable.</p><pre>+--------------------------------------+-----------------------------------------+<br>| Pros                                 | Cons                                    |<br>+--------------------------------------+-----------------------------------------+<br>| Fast launch (nothing extra to load)  | Larger app binary                       |<br>+--------------------------------------+-----------------------------------------+<br>| No risk of “library not found” at    | Duplication if multiple consumers       |<br>| runtime                              | statically link the same library within |<br>|                                      | one process                             |<br>+--------------------------------------+-----------------------------------------+<br>| Simpler distribution (one file)      | Updates require rebuilding consumers    |<br>+--------------------------------------+-----------------------------------------+<br>| No symbol resolution overhead at     | Identity isn’t preserved after linking  |<br>| startup                              |                                         |<br>+--------------------------------------+-----------------------------------------+</pre><p><strong>Dynamic libraries</strong>: separate files loaded into the process.</p><pre>+--------------------------------------+-----------------------------------------+<br>| Pros                                 | Cons                                    |<br>+--------------------------------------+-----------------------------------------+<br>| Multiple consumers share one copy in | Slower launch (dyld needs to load each  |<br>| memory                               | one separately)                         |<br>+--------------------------------------+-----------------------------------------+<br>| Identity is preserved (this matters  | Must be in the right place on disk at   |<br>| in Part 9)                           | runtime                                 |<br>+--------------------------------------+-----------------------------------------+<br>| Smaller binary per consumer          | More moving parts to coordinate         |<br>+--------------------------------------+-----------------------------------------+<br>| Can be updated without rebuilding    | Possible version drift between          |<br>| consumers                            | consumers                               |<br>+--------------------------------------+-----------------------------------------+</pre><p>The guidance has changed a few times over the years:</p><p>- <strong>iOS before 2018</strong>: prefer static linking. dyld was slower, and Apple recommended keeping the number of dynamic frameworks down to reduce launch time.<br>- <strong>iOS 2018 to 2023</strong>: more nuanced. dyld got faster, and the rule became “static for small code where performance matters, dynamic for shared code that holds state.”<br>- <strong>iOS 2023 onward</strong>: <strong>mergeable libraries</strong> (Xcode 15) offer a hybrid that resolves the trade-off in most cases.</p><p>The extra cost of one or two dynamic frameworks is small: tens of milliseconds on a cold start. “Death by a thousand cuts” happens in apps with dozens of small dynamic frameworks, each adding overhead.</p><p><strong>Today’s rule of thumb</strong>: use static linking for utility code without state and pure Swift modules. Use dynamic linking for libraries that hold state within the process, have heavy initialization, or may be used by hot reload tools.</p><h4><strong>Part 6: How SwiftUI Previews Work</strong></h4><p>SwiftUI Previews are a hot reload feature: you can see your UI update in real time as you edit code, without rebuilding and relaunching the app. To understand the magic, and the bugs, you need to know the architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFQveTmpx7TfZYDE9WlXbw.png" /><figcaption>SwiftUI Preview hot swapping (image 04)</figcaption></figure><p>When you open a SwiftUI Preview, Xcode does this:</p><ol><li><strong>Compiles your app</strong> as a normal executable. The app is installed in a hidden simulator and launched.</li><li><strong>Watches your source files.</strong> When you edit a file, Xcode recompiles only that file into a new .o, then <strong>links a small dynamic library</strong> (a “preview thunk”) containing:<br><strong>a.</strong> The newly recompiled .o<br><strong>b.</strong> All your app’s other .o files (cached from the original build, not recompiled)<br><strong>c.</strong> All the static libraries the app depends on (also already on disk)</li><li><strong>Loads the thunk with </strong><strong>dlopen</strong> into the running app process.</li><li><strong>Tells the Swift runtime</strong> to redirect calls to the changed functions from the old code to the new code inside the thunk. This is called “dynamic replacement.”</li><li><strong>SwiftUI renders the canvas again</strong> with the new behavior.</li></ol><p>The whole cycle from saving to updating the canvas typically takes 2 to 5 seconds. Compare that with 20 to 40 seconds for a normal “Build and Run.” That’s what makes Previews useful.</p><p>The clever part is that <strong>the app keeps running</strong>. UIKit initialization, framework loading, simulator boot. All of that was paid for once, at the start of the Preview session. Each edit just gives the live process a little nudge.</p><h4><strong>What Ends Up Inside the Thunk</strong></h4><p>The preview thunk is a .dylib, not an .app. It can’t be launched on its own. It needs a host process to load it with dlopen.</p><p>For the edited function in the thunk to compile and link, the linker needs to resolve every symbol that function references. So when Xcode links the thunk, it uses <strong>the same linker settings as the app</strong>. Every dependency the app declares, including static libraries, is linked into the thunk too.</p><p>That means the thunk is almost a clone of the app at the byte level. The same .o files. The same static libraries. The only new pieces are the one or two files you edited. The build artifact can be hundreds of megabytes per thunk. That’s the price Apple paid for this hot reload model.</p><p>Most of the time, that’s fine. The duplicated bytes just sit there, unused. When dynamic replacement redirects calls to the new code, the old code in the host app becomes unreachable.</p><p>Sometimes it isn’t fine. That’s where we’re heading.</p><h4><strong>Part 7: The Hidden Timing of Static Initializers</strong></h4><p>C and C++ have a feature that Swift doesn’t: <strong>static initializers</strong>. Code that runs <strong>automatically when a binary is loaded</strong>, before main(), before any of your code touches the library.</p><pre>// At the top of a C++ file, outside any function:<br>__attribute__((constructor))<br>static void initialize_my_module() {<br> registry.Register(&quot;audio_decoder&quot;, make_audio_decoder);<br>}</pre><p>You never call initialize_my_module. dyld calls it for you, automatically, the moment the binary containing that function lands in memory.</p><p>C++ goes further: any global object with a nontrivial constructor effectively has a hidden static initializer.</p><pre>// All of these run silently when the library loads:<br>MyClass globalInstance;<br>std::map&lt;string, Factory&gt; registry = build_registry();<br>NetworkClient defaultClient(kDefaultEndpoint);</pre><p>That’s the machinery at load time. Step 6 in the startup sequence, “dyld runs static initializers,” means going through every loaded binary and triggering these constructors.</p><p><strong>A Swift detail</strong>: Swift doesn’t have static initializers in the C++ sense. Swift globals (let x = expensiveInit()) are lazy by default. They run the first time something touches them, rather than when the binary loads. This makes pure Swift libraries immune to the problems described next. C, C++, and Objective-C libraries aren’t.</p><h4><strong>Part 8: The Global Registry Pattern</strong></h4><p>A common design in C++ libraries is the <strong>global registry</strong>. Components in a library announce themselves to a central catalog as they load. The catalog is queried later to find the right component for each job.</p><pre>class ComponentRegistry {<br>public:<br>  static void Register(string_view name, Factory f) {<br>    if (entries.contains(name)) {<br>      LOG(FATAL) &lt;&lt; &quot;Duplicate registration: &quot; &lt;&lt; name;<br>    }<br>  entries[name] = f;<br> }<br>};</pre><p>Each component file registers itself through a static initializer:</p><pre>// In audio_decoder.cc:<br>__attribute__((constructor))<br>static void register_audio_decoder() {<br>  ComponentRegistry::Register(&quot;audio_decoder&quot;, make_audio_decoder);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8GIika9mWMqUx-dujMa1Q.png" /><figcaption>Static initializers and the global registry (image 05)</figcaption></figure><p>When the library loads, the initializer in each component file runs, each component registers itself, and the catalog is complete. Nicely decoupled: adding a new component is just a matter of adding a new source file.</p><p><strong>When this works beautifully</strong>: the library is loaded once per process. Each component registers exactly once. Everyone’s happy. That’s the design assumption behind every large C++ library from Google: gRPC, TensorFlow Lite, MediaPipe.</p><p><strong>When this is fatal</strong>: the library is loaded twice in the same process.</p><p>The Register function aborts on duplicates. The library’s author treated duplicate registration as a programming error. In a server context, where you initialize once at startup, that assumption works. In a mobile context with hot reload tools, it’s a landmine.</p><h4><strong>Part 9: The Collision Between Static Linking and Hot Reload</strong></h4><p>When does a library get loaded twice in the same process?</p><p>When it’s <strong>statically linked into two binaries that share a process</strong>.</p><p>Static linking destroys identity. After link time, the library’s bytes live inside the host binary, indistinguishable from any other code. dyld has no way to know, “This came from SomeLibrary.” As far as dyld is concerned, it’s just code inside MainApp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rv3-zyIeMQM4rIBf92ISRg.png" /><figcaption>Duplicate initialization with static linking (image 06)</figcaption></figure><p>Step by step:</p><p>1. MainApp is built with SomeLibrary statically linked. SomeLibrary’s bytes are embedded in MainApp. The app launches. dyld runs its initializers (including SomeLibrary’s). The registry is populated. Everything is working.</p><p>2. A preview thunk is built. Because the thunk uses the same linker settings as the app, SomeLibrary is <strong>also statically embedded in the thunk</strong>. The thunk file on disk contains its own copy of SomeLibrary’s bytes.</p><p>3. dlopen(thunk.dylib) is called. dyld loads the thunk into the running process. Its static initializers fire, including register_audio_decoder. But &quot;audio_decoder&quot; has already been in the registry since step 1. LOG(<strong>FATAL</strong>) fires. The process aborts.</p><p>The library ran twice because its <strong>bytes</strong> exist in two binaries within one process, and the runtime has no way to know they’re the same thing.</p><p><strong>Why Dynamic Linking Solves This</strong></p><p>Dynamic libraries preserve identity. dyld tracks loaded libraries in a process table indexed by file path. When MainApp loads SomeLibrary.dylib, dyld records, “SomeLibrary is at address X.” Later, when the thunk references SomeLibrary, dyld checks the table, sees “already loaded,” and reuses the existing copy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m_sNw_RA83uvNFGVAJoFUQ.png" /><figcaption>Dynamic library reuse in Previews (image 07)</figcaption></figure><p><strong>The rule</strong>: dyld deduplicates dynamic libraries per process. It can’t deduplicate static libraries because they have no identity to deduplicate.</p><h4><strong>Part 10: Mergeable Libraries as the Modern Compromise</strong></h4><p>Xcode 15 introduced <strong>mergeable libraries</strong>. The idea is to preserve the identity that dynamic linking provides without paying its launch cost.</p><p>A mergeable library is <strong>built</strong> as a dynamic framework, with full metadata and exported symbols, ready for dyld. But during <strong>the app’s final link</strong>, the linker has a special mode that <strong>embeds the framework’s bytes in the app binary</strong>, as if it had been static all along.</p><p>The clever part is the timing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iK0fdG0BGNQ-p3kNWLs2PQ.png" /><figcaption>Mergeable libraries in Debug and Release (image 08)</figcaption></figure><p>- <strong>Debug builds</strong>: merging is skipped. The framework stays dynamic. dyld deduplicates it. Hot reload tools see it as a dynamic library. Its static initializers can’t be duplicated this way.<br>- <strong>Release builds</strong>: merging happens. The shipped app gets launch performance similar to static linking.</p><p>The best of both worlds. The catch is that the framework’s author needs to opt in at build time. Precompiled .xcframework binaries generally aren’t distributed as mergeable unless the vendor explicitly chose to do so.</p><h4><strong>Part 11: Rules to Take With You</strong></h4><p>You don’t need to remember every detail. A few rules cover most cases.</p><p><strong>As a Library Consumer</strong></p><p>Before adding a dependency, ask:<br>1. Does it use static initializers? (Most pure Swift libraries don’t. Most C++ libraries do.)<br>2. Does it hold global state through registries or singletons?<br>3. Does it abort or warn on duplicate state, or is it idempotent?</p><p>If the answer is yes to all three and you’re using static linking with hot reload tools, you have a crash waiting to happen. Either wrap the library in a dynamic framework you control, or ask the vendor to distribute it as mergeable.</p><p><strong>As a Library Author</strong></p><p>- Prefer idempotent initialization. If Register is called twice with the same key, do nothing or overwrite the entry instead of aborting.<br>- Use dispatch_once (Apple) or std::call_once (C++) for any setup that should happen only once. All callers must use the same token or flag, separate copies allow separate initializations.<br>- Document linking expectations: “Designed for dynamic linking. Static linking may cause duplicate initialization issues.”<br>- If you need to distribute a static library, expose an explicit initialize() function. Let consumers control the timing.</p><p><strong>When Debugging a Launch Crash</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*dzR3PUJug1g5c-vZT0FPgg.png" /><figcaption>Debugging a launch crash (image 09)</figcaption></figure><p>- Look for _GLOBAL__SUB_I_* symbols in the crash stack. These are C++ static initializers. The suffix usually identifies the source file.<br>- Check your .app/Frameworks/ directory and main binary for duplicate symbols (nm, otool -L, objdump).<br>- If you suspect a library, look through the stack for its registration functions (Register(, RegisterFactory(, and so on). That’s typically where the duplicate is caught.</p><h4><strong>Closing Thoughts</strong></h4><p>You started this article without knowing what an .o file was. Now you have a mental model that covers compilation, linking, loading, and the runtime hot reload tools built on top of all that. This model lets you debug a whole class of problems that stay invisible if all you know is “I imported the library and it didn’t work.”</p><p>The main idea is that <strong>every artifact in this pipeline exists at a specific layer for a specific reason</strong>. Compilers produce separate translations. Linkers assemble them, choosing between static linking (copying bytes) and dynamic linking (recording references). The loader brings everything to life in a process, deduplicating by identity where identity is preserved.</p><p>When something breaks, ask: <strong>at which layer did the assumption fail?</strong> Most strange build, launch, or preview failures come from an assumption in one layer spilling into another. Once you know the layers, you know where to look.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eaaecc4df387" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/how-compilation-linking-and-loading-work-on-ios-and-why-your-previews-sometimes-crash-eaaecc4df387">How Compilation, Linking, and Loading Work on iOS (and Why Your Previews Sometimes Crash)</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Let AI Run Our Delivery Pipeline — Here’s What Actually Happened]]></title>
            <link>https://medium.com/syngenta-digitalblog/we-let-ai-run-our-delivery-pipeline-heres-what-actually-happened-5e6e7ae8900f?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/5e6e7ae8900f</guid>
            <category><![CDATA[2026]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Brett Johnsen]]></dc:creator>
            <pubDate>Thu, 28 May 2026 14:50:22 GMT</pubDate>
            <atom:updated>2026-05-28T14:53:14.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>We Let AI Run Our Delivery Pipeline — Here’s What Actually Happened</h3><p><em>How one mobile team used Claude to eliminate a 30+ PR backlog, automate code review triage, and ship to production with a single Slack button</em></p><figure><img alt="We Let AI Run Our Delivery Pipeline — Here’s What Actually Happened" src="https://cdn-images-1.medium.com/max/720/1*LthMQuSjkEVzkhDMGJqw-g.png" /></figure><p>About six weeks ago, I looked at our team’s pull request queue and felt overwhelmed. We had more than thirty open PRs. Not thirty total. Thirty waiting for review. Some had been sitting for over a week. Our sprint velocity was fine. Engineers were writing good code. The code just wasn’t moving.</p><p>That moment is what pushed us to do something we’d been talking about but hadn’t committed to: use AI not just as a coding assistant, but as an active participant in our delivery process.</p><p>We’re the Horizon team at Syngenta, building a Kotlin Multiplatform mobile app called Cropwise Protector for field agronomists who use it offline in actual fields. Our monorepo spans iOS (SwiftUI), Android (Jetpack Compose/MVI), and a shared KMP core called ProtectorCore. Fifteen engineers, one main branch, a codebase where a bad merge can break a field user’s offline sync.</p><p>Over the past two months, we built three tools that fundamentally changed how we work. None of them is magic, none of them replaced human judgment, but together they changed our throughput in ways that are hard to argue with.</p><h3>The Problem Wasn’t Code Quality. It Was Flow.</h3><p>Before getting into the tools, it’s worth naming the actual problem precisely. Leaders often reach for “we need to write better tickets” or “we need faster reviews” as solutions, but those are symptoms. The root cause was friction at every handoff point.</p><p><strong>Ticket creation.</strong> When a new epic landed, whoever picked it up would spend 30–60 minutes writing Jira tickets: one iOS story, one Android story, and a KMP technical debt ticket for each feature. This wasn’t optional. Our KMP architecture means you genuinely can’t ship a feature on one platform without touching shared logic. The tickets were inconsistently structured, though. New team members wrote them differently than veterans. Acceptance criteria were either too vague or too prescriptive. Nobody wanted to push back on a teammate’s tickets in sprint planning, so the inconsistencies shipped downstream.</p><p><strong>PR review bottleneck.</strong> We had no formal triage. Every PR got the same treatment: a full human review. A 15-line config change sat in the same queue as a 900-line KMP schema migration. Senior engineers were the bottleneck, context-switching between a 12-line chore PR and a 600-line architecture change back-to-back.</p><p><strong>Release promotion.</strong> Getting a staging build to production required a release engineer to coordinate across Slack, find the right CircleCI pipeline, and manually trigger an approval. It wasn’t hard, just manual, easy to forget, and it required someone to own it. When that person was stuck in meetings, the build sat.</p><p>These three friction points weren’t individual problems. They were a system. Fix one, and the others constrain you. Fix all three, and something shifts.</p><h3>Tool One: The Horizon Jira Ticket Writer</h3><p>The first tool we built was the simplest conceptually, but had an outsized impact on sprint planning quality.</p><p>We created a Claude skill, a structured prompt that lives in our repo as a versioned file. It generates platform-paired Jira tickets from an epic description and an optional Figma link. You invoke it in Cowork or directly in Claude, describe the epic, and it produces a complete set: an iOS Story, an Android Story, and a KMP Technical Debt ticket, all formatted to our team’s established template.</p><p>Each ticket follows a consistent structure: a Background section explaining why it matters, a User Story in “As a / I want to / So that” format, a Design section with Figma links when available, Scope of work, and Acceptance Criteria written as plain scenario statements rather than vague requirements.</p><p>The key design decision was baking our conventions directly into the skill prompt. The AI doesn’t guess what a good Jira ticket looks like for our team. It knows that KMP tech debt tickets should call out the UseCase/Repository interface split. It knows acceptance criteria should describe user outcomes, not implementation details. It knows we pair iOS and Android stories, so nothing ships lopsided.</p><p>The impact was quieter than the other tools. There’s no dramatic before/after metric for “ticket quality”, but sprint planning meetings got shorter. Engineers started arriving with tickets ready to estimate, not those that needed 20 minutes of collaborative editing before anyone could point. The floor on ticket quality went up, and the variance went down.</p><h3>Tool Two: Horizon Review — Automated PR Triage</h3><p>This is the one that moved the needle on the queue, and the design philosophy here is as interesting as the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNwFxzKEAElp2VHLRdfyJQ.png" /><figcaption><em>The full triage flow — from PR event to verdict label. T1 PRs with zero blockers get HORIZON APPROVED; everything else routes to a human.</em></figcaption></figure><p>Horizon Review is a GitHub Actions workflow that triggers on every pull request event: opened, updated, and marked ready for review. When a PR gets the <strong>READY FOR REVIEW</strong> label, the workflow wakes up, runs an AI review using Claude, and posts a structured summary as a sticky comment on the PR. A label gets applied automatically: either <strong>HORIZON APPROVED</strong> or <strong>DEEP DIVE REQUIRED</strong>.</p><p>The goal wasn’t to replace human reviewers. It was to stop asking the question “Does this PR even need a human reviewer right now?”</p><h3>The tier system</h3><p>Every PR is classified as T1 (low risk), T2 (standard), or T3 (high risk). This is defined directly in the review prompt:</p><pre>- Tier 1 (low-risk): Docs, refactor, style-only, config/CI-only,<br>  small bugfix, &lt; 200 LOC changed<br>- Tier 2 (standard): Feature, bugfix, 200-800 LOC changed<br>- Tier 3 (high-risk): Schema change, public KMP API modification,<br>  new architecture pattern, &gt; 800 LOC changed</pre><p>Tier isn’t just LOC, though. A 50-line public KMP API change is T3 regardless of size, because it affects both iOS and Android consumers simultaneously, and that’s a human judgment call. The tier then locks the risk level and constrains the verdict. T1 PRs with no blockers are eligible for auto-merge. T2 and T3 always need a human. No exceptions.</p><h3>The confidence threshold</h3><p>Before any issue gets reported, it gets scored on a 0–100 confidence scale. From the prompt:</p><pre>- 0: False positive, doesn&#39;t hold up to scrutiny<br>- 25: Might be real, but could be a false positive<br>- 50: Real issue, but minor, a nitpick unlikely to matter<br>- 75: Verified real issue that will impact functionality<br>- 100: Confirmed real issue, evidence directly proves it<br><br>Only report issues scoring 80 or higher.</pre><p>The false-positive examples in the prompt are exhaustive: pre-existing issues not introduced in this PR, anything a linter would catch, internal logging strings mistakenly flagged as hardcoded user-facing strings, partial implementations in a PR explicitly labeled Part 1 of a multi-part series.</p><p>This matters for trust. The fastest way to kill an automated review tool is to have it cry wolf. Engineers stop reading the comments after the third false alarm. The 80+ threshold exists specifically to protect signal-to-noise. We’d rather miss a real issue occasionally than train the team to ignore the tool.</p><h3>What it checks — and explicitly doesn’t</h3><p>The review is scoped to things linters can’t catch. The prompt includes an explicit exclusion list:</p><pre>DO NOT REVIEW (already enforced by Detekt/SwiftLint in CI — commenting<br>on these is noise):<br>- Code formatting, indentation, line length, whitespace<br>- Import ordering<br>- Function/variable naming conventions<br>- Cyclomatic complexity, method length, parameter count<br>- Magic numbers<br>- File length</pre><p>Instead, it looks for: public KMP APIs not returning the correct result wrapper type, offline-first violations (data not persisted before entering the sync queue), broken MVI or MVVM-C patterns, missing four-state screen handling, and TODO comments without ticket references. The kinds of things that require understanding intent, not just syntax.</p><h3>The prompt lives in the repo, not the workflow</h3><p>This is a small architectural decision with large practical consequences. The entire review prompt lives in a versioned file at .claude/skills/horizon-review/SKILL.md. The GitHub Actions workflow loads it at runtime, strips the YAML frontmatter, and passes it to Claude:</p><pre>- name: Load Horizon prompt<br>  id: load-prompt<br>  run: |<br>    SKILL=.claude/skills/horizon-review/SKILL.md<br>    # Strip YAML frontmatter: emit everything after the second `---` line.<br>    # awk exits non-zero if fewer than two `---` delimiters are found,<br>    # so a malformed skill file fails the step instead of silently<br>    # producing an empty prompt.<br>    PROMPT=$(awk &#39;<br>      /^---$/ { if (++n == 2) { printed = 1; next } }<br>      printed<br>      END { exit(n &gt;= 2 ? 0 : 1) }<br>    &#39; &quot;$SKILL&quot;)<br>    {<br>      echo &#39;content&lt;&lt;HORIZON_PROMPT_EOF&#39;<br>      echo &quot;&lt;!-- CI_CONTEXT: PR_NUMBER=${{ github.event.pull_request.number }} --&gt;&quot;<br>      printf &#39;%s\n&#39; &quot;$PROMPT&quot;<br>      echo HORIZON_PROMPT_EOF<br>    } &gt;&gt; &quot;$GITHUB_OUTPUT&quot;</pre><p>A developer who wants to test a prompt change doesn’t need to push to CI. They edit the file and run the skill locally. The review logic is code-reviewable like any other code. If we change our MVVM-C patterns or add a new rule toCLAUDE.md, we update one file, and it&#39;s live on the next PR.</p><h3>The machine-readable verdict</h3><p>The review summary ends with a hidden JSON marker that the downstream workflow reads to decide which label to apply:</p><pre>&lt;!-- horizon-verdict: {&quot;tier&quot;:1,&quot;verdict&quot;:&quot;auto-merge&quot;,&quot;blockers&quot;:0} --&gt;</pre><p>A separate decide-auto-merge.yml workflow triggers on Horizon Review completion and parses this marker. It applies HORIZON APPROVED or DEEP DIVE REQUIRED accordingly, with a belt-and-suspenders check: even if the summary says zero blockers, it independently queries GitHub&#39;s GraphQL API to count unresolved BLOCKER-prefixed inline threads:</p><pre>VERDICT=$(echo &quot;$JSON&quot; | jq -r &#39;.verdict // &quot;human-review&quot;&#39;)<br>TIER=$(echo &quot;$JSON&quot;    | jq -r &#39;.tier    // 3&#39;)<br>BLOCKERS=$(echo &quot;$JSON&quot; | jq -r &#39;.blockers // 99&#39;)</pre><pre>[[ &quot;$VERDICT&quot; != &quot;auto-merge&quot; ]] &amp;&amp; set_human_review &quot;Horizon verdict: $VERDICT&quot;<br>[[ &quot;$TIER&quot; != &quot;1&quot; ]]             &amp;&amp; set_human_review &quot;Tier $TIER&quot;<br>[[ &quot;$BLOCKERS&quot; != &quot;0&quot; ]]         &amp;&amp; set_human_review &quot;$BLOCKERS blocker(s)&quot;</pre><p>The fail-closed defaults (tier: 3, blockers: 99) mean that if Claude&#39;s output is malformed or a step errors, the workflow routes to human review. Never to auto-merge.</p><h3>The gate: only run when it matters</h3><p>Before any checkout or Claude invocation, a Gate step inspects the current PR state via API and bails early if any of these are true: it’s a dependabot PR, the label being added isn’t READY FOR REVIEW, the PR is a draft; it has a DEPENDENCY or DRAFT label, or it already has DEEP DIVE REQUIRED backed by an existing Horizon sticky comment.</p><p>That last condition is a one-way door. Once a human has reviewed and the DEEP DIVE REQUIRED label is backed by a real Horizon comment, Horizon stops re-running on that PR. The human’s judgment stands.</p><h3>Tool Three: The Slack Release Pipeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulya2np7ixN_qdEtkN7k_A.png" /><figcaption><em>Five steps from merged PR to production. The human’s only decision is: read the Slack message, verify the PR list, click the button.</em></figcaption></figure><p>The third piece isn’t AI-driven. We built it with AI assistance, and it completed the flywheel.</p><p>When a PR is merged with #rc in the branch name, a CircleCI pipeline automatically kicks off a staging build. When that build is ready, a Slack notification is sent to our team channel with the build version, the list of merged PRs since the last release, and a single <strong>Promote to Production</strong> button.</p><p>One click. One CircleCI approval step. Production.</p><p>The Slack button triggers a CircleCI approval job via webhook. The approval is tracked, auditable, and reversible. But for a normal release, the release engineer’s entire job is: read the Slack message, check the PR list looks sane, and click the button.</p><p>We went from “remember to check CircleCI and find the right pipeline and manually trigger the approval” to “a Slack message finds you.”</p><p>The impact on release cadence was immediate. We went from roughly one production release every two weeks to two per week. The bottleneck wasn’t technical. It was the coordination overhead of finding the right person and the right pipeline at the right moment. Removing that overhead unlocked the velocity we already had.</p><h3>The Numbers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gP8TbGWiL9sseAB-nPC5Q.png" /><figcaption><em>PR queue over six weeks. The deployment marker shows when Horizon Review went live — the queue cleared within two weeks, and week four saw 67 PRs merged.</em></figcaption></figure><p>I’ll be honest about the limitations here. We didn’t run a controlled experiment, and multiple changes happened simultaneously. But the directional story is clear enough.</p><p>At peak, we had 30+ PRs waiting for review. Today, we run with 8 or fewer open at any given time, a reduction of more than 70%. In the week after we fully deployed Horizon Review, the team merged 67 PRs. That’s not a fluke week, it reflects a queue that cleared and a team that started trusting the triage layer. Release frequency went from once every two weeks to twice a week. And all 15 engineers are contributing regularly, with no single reviewer creating a chokepoint.</p><h3>What Engineering Leaders Should Take Away</h3><p>A lot of AI tooling stories are about individual productivity: “I wrote this feature 3x faster with Copilot.” That’s real, but it’s not the most interesting lever available to a team. The more interesting lever is system-level productivity, removing friction from handoffs, eliminating wait states, and raising the floor on consistency.</p><p>The tools we built didn’t make any individual engineer faster. They made the team faster by eliminating the places where work sat idle.</p><p>A few things shaped our approach that I think generalize:</p><p><strong>Build trust with conservative defaults.</strong> The 80-confidence threshold, the T1-only auto-merge path, and the one-way door on DEEP DIVE REQUIRED once a human has reviewed. All of it is designed to fail conservatively. When the AI is uncertain, it defers to humans. Engineers accepted the tool more quickly because they could see it wasn’t trying to replace their judgment, just to route work more efficiently.</p><p><strong>Treat the prompt like production code.</strong> Version it. Review it. Test it. Give it a clear interface and make it auditable. The moment we moved the review prompt into the repo and out of a config field in a YAML file, the quality and maintainability of the system improved dramatically. That awk snippet stripping frontmatter and loading the prompt is doing more architectural work than it looks like, it makes the prompt a first-class artifact that any engineer can read, review, and improve.</p><p><strong>Measure the system, not the tool.</strong> Don’t ask, “Is the AI review accurate?”. Ask “has our PR cycle time improved? Are engineers spending more time on high-leverage work?”. The tool is a means. The delivery system is the end.</p><p><strong>Start with the highest-friction handoff.</strong> We could have started anywhere, but we started with the PR review bottleneck because it was the most visible constraint. Once that was cleared, the release pipeline bottleneck became visible. Fixing bottlenecks in sequence beats optimizing everything at once.</p><p><strong>Fail closed, always.</strong> Every piece of automation we built lands on the conservative outcome when something goes wrong. A cancelled Claude run doesn’t apply HORIZON APPROVED, it leaves the PR alone. A missing verdict marker defaults to {&quot;tier&quot;:3,&quot;blockers&quot;:99}. A build with no release engineer around doesn&#39;t ship, it waits for the button. This isn&#39;t timidity. It&#39;s what lets you trust the automation enough to actually use it.</p><h3>What’s Next</h3><p>We’re not done. The tools we have are working, but they’re v1.</p><p>Smarter tier calibration is on the list. Right now, tier is determined by LOC and content signals at review time. We’re looking at whether historical merge data can help. Some modules have historically had higher defect rates, and that signal could influence tier assignment upstream.</p><p>We’re also looking at closing the loop on false positives. When an engineer dismisses a Horizon Review inline comment, we lose that signal. A lightweight mechanism for marking comments as false positives would let us tune the confidence thresholds over time.</p><p>And the skill library keeps growing. The Jira ticket writer and PR reviewer are two of several skills we’ve shipped. We’ve since added ones for TestRail case generation, LaunchDarkly flag lifecycle management, and localization sync. The pattern generalizes: find a high-friction, repetitive workflow, encode your team’s conventions into a skill prompt, and wire it into the places engineers already work.</p><p>The most important thing we learned isn’t really a technical lesson. The teams that get the most from AI tooling aren’t the ones who hand everything to the AI. They’re the ones who figure out exactly where human judgment is irreplaceable, protect those decision points fiercely, and automate everything else.</p><p>We have more human judgment in our process now than we did six weeks ago, because the humans aren’t spending it on the wrong things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e6e7ae8900f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/we-let-ai-run-our-delivery-pipeline-heres-what-actually-happened-5e6e7ae8900f">We Let AI Run Our Delivery Pipeline — Here’s What Actually Happened</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Rebuilt Our Data Platform from Scratch — The Hardest Part Wasn’t the Tech]]></title>
            <link>https://medium.com/syngenta-digitalblog/we-rebuilt-our-data-platform-from-scratch-the-hardest-part-wasnt-the-tech-9079ac617f8b?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/9079ac617f8b</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[2026]]></category>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Jacques Sa]]></dc:creator>
            <pubDate>Mon, 04 May 2026 13:51:51 GMT</pubDate>
            <atom:updated>2026-05-04T13:58:28.622Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Take a look behind the scenes at how our team moved from multiple copy-and-paste monolithic ETL pipelines to a modern Delta Lakehouse, and how a cultural change was the key to getting us there.</em></p><figure><img alt="We Rebuilt Our Data Platform from Scratch — The Hardest Part Wasn’t the Tech" src="https://cdn-images-1.medium.com/max/720/1*lWSMzXfUSNfUTIp9KNUxtA.jpeg" /></figure><p>Every team eventually realizes that the system they built with care can’t keep up. For us at Syngenta Digital, that moment came when our daily data pipeline took more than 24 hours to complete. Yes, our daily job couldn’t even be completed in a single day.</p><p>I&#39;ll tell you a story of how we got there, what went wrong, and how we turned things around.</p><h3>Where It All Started</h3><p>Our data platform started with a simple goal: to bring together agricultural data from multiple source APIs, including organizations, properties, and field observations, into a single central data warehouse for business teams to use for analytics and dashboards. That is pretty much how many data analytics pipelines are born everywhere: on the left, you have data available via APIs, and on the right, many hungry stakeholders for data that the APIs can’t deliver, at least not in the time, format, and volume they need.</p><p>To speed things up, we chose Pentaho Data Integration (aka Kettle) as our ETL engine at that time. It followed the classic Extract-Transform-Load pattern: pulling data from source APIs, applying transformations, and loading the results into a data warehouse. Its visual, codeless features made it attractive to solve the problem at that time. The pipeline ran daily, processing data farm by farm.</p><p>And for a while, it worked great.</p><figure><img alt="ETL pipeline diagram showing four agricultural data sources (farm fields, crops, observations, and other APIs) being extracted, transformed, and loaded into a PostgreSQL data warehouse, which feeds Power BI and Qlik dashboards." src="https://cdn-images-1.medium.com/max/936/1*GX9_EYsQFVPhSvkJXXH-MA.png" /></figure><h3>The Cracks Begin to Show</h3><p>The APIs weren’t designed for bulk data extraction; their main purpose was to deliver transactional data to customers via web and mobile apps. For that reason, each ETL process was designed around farm-specific data, usually retrieved via its specific IDs, e.g.:</p><ul><li>Field observations by property and field ID</li><li>Phenology and phenological stage by crop and season IDs</li><li>Field annotations by scouter and field IDs</li><li>etc.</li></ul><figure><img alt="ETL pipeline diagram showing three separate per-company lanes (C1, C2, and others), each independently extracting and transforming the same data entities (Org, Fields, Cropzones, Monitoring, etc.) before loading into a shared PostgreSQL data warehouse and dashboards. Caption notes that each lane is custom-built for its source API’s quirks." src="https://cdn-images-1.medium.com/max/936/1*GEXbqsKX0x9dda6Eas8H-w.png" /></figure><p>As our platform grew and more companies joined, it became more complex, bringing a wide range of data entities, including organizations, properties, fields, crop zones, notes, monitoring indicators, scouting reports, tracking data, phenology records, and more. Besides, this was not an automatic process: each company&#39;s ID had to be manually added to a list to be considered for the next batch execution; otherwise, nothing would appear on the company-related dashboards. Additionally, if a backfill was necessary, someone had to manually trigger the ETL process during the day.</p><p>What once took minutes started taking hours. The sequential, farm-by-farm processing model didn’t scale as volumes grew. Besides, new stakeholders emerged with different requirements — such as the need for more frequent data updates — bringing additional challenges (e.g., legal concerns around PII and contractual access controls).</p><p>So, the issues started piling up:</p><ol><li>How do we incorporate more companies and load historical data effectively?</li><li>How do we handle stakeholders who need data updates more frequently?</li><li>Does it make sense to run the full ETL for a company during non-seasonal periods when no new data is being generated?</li><li>How do we keep the total processing time under control?</li></ol><p>The answer seemed obvious: <strong>scalability</strong>. But the real question was <em>how</em> to achieve it.</p><h3>A Shortcut, In Hindsight</h3><p>We considered the usual solutions, such as adding more computing power or automatically spreading the load across multiple machines. However, to keep the lights on, we went with the fastest fix: copy-and-paste.</p><p>We manually multiplied the Data Warehouse and the ETL pipeline to improve parallelism and reduce race conditions while enforcing privacy and contractual access controls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*IE3SeFb0bE7-2ern89G05w.png" /></figure><p>The result was a fragmented landscape of isolated ETL instances and data warehouses, each maintained separately, with its own quirks and manual configurations. It was a maintenance nightmare. Every bug fix had to be applied in multiple places. Every schema change rippled across disconnected systems.</p><p>We had traded one problem for a dozen.</p><h3>The Big Change</h3><p>Marshall Goldsmith, a world-renowned executive coach, educator, and bestselling author, quoted something that summed up what we needed to realize: <em>“What got you here won’t get you there.”</em></p><p>We realized the transformation had to happen on two fronts: <strong>mentality</strong> and <strong>technology</strong>.</p><p>We had to move away from the old data warehousing paradigm, where everything is extracted, fully transformed, and loaded into a relational database in one big batch. Instead, we needed to focus on incremental changes, event-driven data flows, and separating concerns.</p><p>On the technology side, we leaped into <strong>Databricks</strong> and the <strong>Delta Lakehouse</strong> architecture.</p><h3>The New Architecture</h3><p>The new platform changed our approach from ETL to <strong>ELT:</strong> Extract, Load, then Transform.</p><p>Here’s what changed:</p><p><strong>Data ingestion became incremental and happened more often.</strong> Instead of pulling all datasets every day, farm-by-farm, we used “delta” APIs and the existing event bus to capture only the changes as they happened. We also considered creating data-ingestion-tailored event buses and implementing an outbox pattern to ensure atomic, reliable message delivery across them all, though this initiative wasn&#39;t pursued. Anyways, what we&#39;ve done so far has eliminated unnecessary processing and enabled the pipeline to respond directly to real data activity.</p><p><strong>The Delta Lakehouse replaced our old data warehouse.</strong> Built on S3 object storage, it gives us the flexibility of a data lake and the reliability of ACID transactions. Now, we don’t have to worry about disk space because storage is virtually unlimited.</p><p><strong>Transformations happen after loading.</strong> By decoupling the load and transform stages, we were able to tailor transformations to specific business needs without affecting the ingestion pipeline.</p><p><strong>Compute now scales up and down as needed. Rather than</strong> keeping resources running all the time, the platform starts from zero, grows to meet demand, and then scales back down when the work is finished. This change alone made a big difference in cost efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*Rp7v_-4_Z3We5sVhU86EWw.png" /></figure><h3>Why Databricks? The Cloud-Native Advantage</h3><p>Choosing Databricks wasn’t just about finding a better ETL tool. It was about adopting a platform designed for cloud-native scalability.</p><p>At its core, Databricks runs on your cloud provider’s infrastructure (for us, AWS). The architecture separates the <strong>control plane,</strong> which hosts job orchestration, metadata management, and user interfaces, from the <strong>compute plane</strong>, where data processing runs on Apache Spark clusters in our own cloud account. This separation is key because it lets us keep full control over our data while using a managed service for orchestration and processing.</p><p>The compute layer is where scalability really happens. Databricks automatically creates and scales Spark clusters based on each workload. When a pipeline runs, the platform starts the needed compute resources, processes the data, and then shuts them down. During off-hours or non-seasonal periods, which are common in agriculture, costs drop to almost zero. This is a big change from our old setup, where servers and ETL machines ran continuously, even when no data was moving.</p><p>Below the compute layer, all data is stored in S3 using the <strong>Delta Lake</strong> format. This open-source storage framework adds ACID transactions, scalable metadata handling, and supports both batch and streaming workloads on top of standard Parquet files. This forms the foundation of the <strong>lakehouse</strong> approach, which combines the low-cost, flexible nature of a data lake with the reliability and performance of traditional data warehouses.</p><p>The new platform also offers a strong ecosystem for collaboration. Data engineers work in shared notebooks that support Python, SQL, Scala, and R. Pipelines are versioned in GitLab repositories and deployed via GitLab CI/CD pipelines. For analytics, Databricks SQL provides a fast query layer directly on top of the lakehouse, so our business teams can run analytics without needing a separate data warehouse.</p><p>This close integration with cloud-native services such as elastic compute, object storage, managed networking, and IAM enables us to scale both technically and economically. We only pay for what we use, and the platform manages the complexity of resource provisioning in the background.</p><h3>Laying the Groundwork for Data Mesh</h3><p>Beyond the immediate technical benefits, our move to Databricks also aligns with a broader strategic direction: evolving toward a <strong>Data Mesh</strong> architecture.</p><p>Data Mesh, a concept originated by Zhamak Dehghani — author of <em>Data Mesh: Delivering Data-Driven Value at Scale (</em>O’Reilly, 2022) <em>— </em>is based on four main principles: domain-driven data ownership, treating data as a product, self-serve infrastructure, and federated computational governance. It’s not something you buy; it’s an organizational approach. To make it work, you need a platform that is flexible enough to support distributed ownership while maintaining consistent governance.</p><p>Our previous architecture was the opposite of this vision. Monolithic ETL pipelines, centralized warehouses, and copy-pasted environments for different clients created tight coupling and bottlenecks. Every new data consumer depended on a central team to set up, configure, and maintain their pipelines. There was no self-service, no clear domain ownership, and governance was ad hoc at best.</p><p>The Databricks Lakehouse provides a strong foundation for Data Mesh principles. Workspaces can be set up by domain, each with its own ownership and access controls, but all share a common infrastructure. <strong>Unity Catalog</strong> offers centralized metadata management and fine-grained access control across all workspaces, enabling federated governance. Domain teams can own their data products while following consistent organizational policies. <strong>Delta Sharing</strong> also lets us securely share data across domains and regions, and even with external partners, without duplicating it. This is especially important as we grow across different locations and business units.</p><p>We’re still on our way to a full Data Mesh. But every architectural decision we make today, from how we set up workspaces to how we define data ownership, follows these principles. Our goal is to build a platform where domain teams can easily publish, find, and use data products, while the platform team provides the support and infrastructure to keep everything running smoothly.</p><p>The roadmap items we mentioned (governance guardrails, catalog discoverability, and onboarding new teams) are all stepping stones on this path.</p><h3>The Numbers Speak</h3><p>The improvements were dramatic. To name a few:</p><ul><li><strong>Processing time</strong> — Before: ~20 hours. After: ~3 hours.</li><li><strong>Adding new companies</strong> — Before: manual and limited. After: automatic.</li><li><strong>Historical data capacity</strong> — Before: limited by disk. After: virtually unlimited (S3).</li><li><strong>Analytics performance</strong> — Before: constrained by DB resources. After: optimized for OLAP workloads.</li><li><strong>Resource utilization</strong> — Before: always on (24/7). After: elastic, scales to zero.</li></ul><p>That reduction in processing time from 20 hours to 3 is not just a nice metric — it means our business teams get fresher data, and we have headroom to grow.</p><h3>What’s Next</h3><p>We’re not done yet. Our roadmap has three phases:</p><p><strong>In the near term</strong>, we’re focused on decommissioning the remaining Pentaho workloads — closing the chapter on the old architecture for good.</p><p><strong>Midterm</strong>, we’re investing in community and governance: launching Data Talk sessions and workshops, establishing platform guidelines and guardrails, onboarding new teams, and connecting dashboards directly to Databricks.</p><p><strong>Longer term</strong>, we’re pushing into data quality, catalog discoverability, broader adoption across Cropwise products, and expanding the set of ingestion tools and techniques available on the platform.</p><h3>Lessons Learned</h3><p>If there’s one takeaway from this journey, it’s this: <strong>The most effective path forward is the one that embraces change</strong>. The traditional scaling mechanisms felt like progress, but they only delayed the reckoning. The real breakthrough came when we accepted that the architecture that served us well in the early days had reached its limits.</p><p>Building a modern data platform isn’t just about choosing the right tools. It’s about building the right habits: thinking incrementally, automating ruthlessly, and designing for the scale you’ll need tomorrow, not just the one you have today.</p><p><em>This article is based on an internal presentation shared with the Syngenta Digital team.</em></p><p><em>Special thanks to the team behind the platform: Andy Jenkinson, Elcio Abrahão, Bruno Cavalcanti, Edson Lourenço, Hugo Pedra, Leonardo Carvalho, Mauricio Coproscki, Rafael Rosa, Thalis Duarte, and me.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9079ac617f8b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/we-rebuilt-our-data-platform-from-scratch-the-hardest-part-wasnt-the-tech-9079ac617f8b">We Rebuilt Our Data Platform from Scratch — The Hardest Part Wasn’t the Tech</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does your team speak their minds?]]></title>
            <link>https://medium.com/syngenta-digitalblog/does-your-team-speak-their-minds-0d5db454a0ec?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/0d5db454a0ec</guid>
            <category><![CDATA[psychological-safety]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[2025]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[postmortem]]></category>
            <dc:creator><![CDATA[Rômulo R. Contini]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 20:55:11 GMT</pubDate>
            <atom:updated>2025-09-10T20:20:12.783Z</atom:updated>
            <content:encoded><![CDATA[<p><em>If not, as a leader, you should be worried.</em></p><figure><img alt="Does your team speak their minds? If not, as a leader, you should be worried." src="https://cdn-images-1.medium.com/max/720/1*owIHq1S7vMAEMbbhuUMRpw.png" /></figure><p>I was once in the middle of what sounded like a never ending conflict involving different teams of different areas. It felt like retaliation was all over the place, and opinions were not listened to. I recall telling people our teams were looking like the infamous “finger guns” scene from The Office. I couldn’t sleep, I was stressed and having to go to the office was giving me anxiety. At one point, I would rather attend meetings from my car than interact with people at the office. Things were falling apart. I was burnt out.</p><p>At some point, someone came up with a proposal: “Would you meet and speak frankly with everyone regardless of their position, no matter what?”. So there we were. It was intense, tough, and stressful. Everyone’s nerves were on edge. But it was also really inspiring and resolute. We came out of it stronger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2EhD-rdgJjwy4GeA3nB9g.png" /></figure><p>Being able to say what’s on your mind, candidly, is not as easy as it sounds. I bet you have had second thoughts a couple of times out of fear of looking stupid or even of retaliation. How did you feel? Anxious?! Is that what you want your team to experience? Pause for a moment and ask yourself what your team could have achieved if you had spoken up.</p><blockquote><em>“Team members who are not genuinely open with one another about their mistakes and weaknesses make it impossible to build a foundation for trust.”</em></blockquote><blockquote><em>Patrick M. Lencioni</em></blockquote><p>The absence of trust is at the foundation of Lencioni’s 5 dysfunctions of a team and sets the tone for the second dysfunction: fear of conflict. Without trusting each other, team members will rarely have meaningful debate of ideas. Research demonstrated that psychological safety is critical for team effectiveness, with positive impact on performance, innovation and retention. One of the most famous research projects on the topic is <a href="https://rework.withgoogle.com/en/guides/understanding-team-effectiveness#introduction">Google’s Project Aristotle</a>.</p><p>If you think your team is afraid of sharing their opinion and their mistakes, I advise you to embark on a journey to foster a safe place. There’s no silver bullet nor a single action you could take. It’s an ongoing investment built through consistent actions.</p><p>Below, you can find strategies I have used successfully. Start small, being a role model, then expand with authority and influence until it becomes rooted.</p><h3>Be Vulnerable</h3><p>If you want your team to come up with new ideas, they must feel they’re heard and that no new proposal is silly. The same is true if you seek for improvements. Mistakes happen, it’s in our nature as human beings. You are missing a great opportunity to grow if you’re not discussing them. How does your team deal with errors? Do they proactively talk about them and share the lessons learned? If not, think of the last time you admitted in front of your team, or to a bigger audience, what you have missed. After all, it all starts with you. Don’t ask your team to do something you would not do yourself.</p><h4>Go ahead and be the first</h4><p>Some time ago, one of my teams was at the frontline of a critical project about to be commercially launched after a couple rounds of internal validations and beta testing. It was such a project with dependencies all over the globe, with teams in South and North America, Europe, and India. For it to succeed, all moving pieces had to do their magic. However, the spell fizzled. Error handling was not good and wasn’t guiding users to what was happening, forcing them to open more support tickets, even for basic misconfiguration stuff. Same dependent services were using different versions across the solution. The product’s reputation was crumbling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUmHw7EamNPD7ZmMj6-rqw.png" /><figcaption><a href="https://www.youtube.com/watch?v=y8OnoxKotPQ">Microservices youtube video by KRAZAM</a></figcaption></figure><p>Being the leader accountable for the user-facing product, I knew I had to do something. I had to make teams acknowledge their flaws so they could work together on fixing them. Inspired by <a href="https://thisislean.com/">This Is Lean, Resolving the Efficiency Paradox</a>, by Niklas &amp; Pär, I then asked to share the project mistakes to all global organizations. Not only did it put the issue in the spotlight, but it also created a bias for action. To win, all players, from all positions, must always know what’s happening in all directions. Communication improved, cross-teams groups were created and collaboration strengthened between all the departments.</p><h4>Are you open to discussing your own performance?</h4><p>At most companies, managers are responsible for their team’s performance evaluation at least once a year. A good performance review usually has achievements for the period and also some skills to be improved. It is not unusual to see a performance rating, following the Nine Box tool.</p><blockquote><em>“a manager’s output is the sum of the output of his organizations and the output of the neighboring organizations under his influence”</em></blockquote><blockquote><em>Andrew S. Groove</em></blockquote><p>But how to do performance review is not the intent of this article. What I would challenge you to do is to share your feedback with your team, highlighting what you need to improve. In the end, your team’s performance is somehow your own performance and they should know what’s happening. What’s impeding you from doing that?</p><h3>Postmortems</h3><p>At this point, there’s no excuse for not having postmortems. There are a bunch of templates, of all flavors, available out there. From simple, to robust, time consuming detailed ones. Just make sure it has the root cause and action items to avoid the issue from happening again. Just choose one and start making your team write.</p><p>What best worked for me, when no postmortem culture is in place, was to be the first. Put yourself as the incident commander and make sure you write a comprehensive, clear, actionable postmortem. Share it broadly and follow up comments. Schedule a meeting with stakeholders and the team, and present it. Ensure all action items are executed. Own the whole process.</p><p>Once you have established a baseline for postmortems, start using your authority as a manager and delegate. “Delegate until it hurts”, Michael Lopp. Ask your team to write postmortems for the incidents you spot. Follow them up. Comment and demand no less what you would have done personally. Repeat until it becomes natural.</p><h3>Spotlight Mistakes</h3><p>Probable the most energetic and demanding strategy to make your team speak what is in their minds is to put everyone in the same room for at least an hour, once in a while, for them to present what has happened and, most important, the fixes they did, so the rest of the team can discuss deeper on the topic. Was the fix definitive, or just a band-aid solution? Could the issue be fixed in a different way?</p><p>At first, you, as the leader, might have to use your authority to nominate which errors will be presented, by who. Another tip to foster meaningful discussions is to set the right expectations: it is performance expected that the most senior people in the room ask questions and share different perspectives of the solution. One improvement to the process we did over time was to have the author of the bug, peer reviewers, and whoever solved it presenting the mistake. You’ll eventually see that, after a few repetitions, people will want to be the ones presenting, without you having to point fingers.</p><p>By doing this, I could achieve significant discussions on practices, team’s deficiencies and technical solutions, having even improved some confusing business rules, poor user experience and team interactions. If your team is suffering from recurrent issues and a high opening bugs rate, you should definitely try this one!</p><p>A safe place is all about trust. And trust takes time to build, but falls apart in the blink of an eye. Once you’re there, don’t fool yourself. Keep going! Cheers.</p><p>First published at <a href="https://romulocontini.substack.com/p/does-your-team-speak-their-minds?r=wxht2">https://romulocontini.substack.com/p/does-your-team-speak-their-minds</a>. Subscribe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d5db454a0ec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/does-your-team-speak-their-minds-0d5db454a0ec">Does your team speak their minds?</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Rest API Documentation Using GenAI Tools]]></title>
            <link>https://medium.com/syngenta-digitalblog/automating-rest-api-documentation-using-genai-tools-a-developers-guide-54cb1c8664ee?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/54cb1c8664ee</guid>
            <category><![CDATA[2025]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <dc:creator><![CDATA[Shrisom]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 14:06:00 GMT</pubDate>
            <atom:updated>2025-09-10T17:55:35.271Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating Rest API Documentation Using GenAI Tools: A Developer’s Guide</h3><figure><img alt="Automating Rest API Documentation Using GenAI Tools: A Developer’s Guide" src="https://cdn-images-1.medium.com/max/720/1*PRxXQNe6QvJv360BmCw75g.png" /></figure><h3>Introduction</h3><p>API documentation is crucial for software development, yet it often becomes an afterthought. This guide demonstrates how to automate API documentation using GitHub Copilot, making the process seamless and maintainable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*2EgRCfH5EWQiXWVhAfFuaQ.jpeg" /></figure><h3>The Challenge</h3><ul><li>Manual documentation is time-consuming</li><li>Documentation often becomes outdated</li><li>Developers prioritize feature development over documentation</li><li>Inconsistent documentation standards across teams</li></ul><h3>Solution Overview</h3><p>We’ll implement an automated documentation pipeline using:</p><ol><li>GitHub Copilot for generating documentation comments</li><li>Swagger/OpenAPI for API specification</li><li>Husky for pre-commit hooks</li><li>Custom script for auto-documentation generation</li></ol><h3>Prerequisites</h3><ul><li>Node.js (v14 or higher)</li><li>npm or yarn</li><li>GitHub Copilot extension</li><li>Express.js project (for demonstration)</li></ul><h3>Step 1: Setting Up the Project</h3><p>First, let’s install the necessary dependencies:</p><pre>npm init -y<br>npm install swagger-jsdoc swagger-ui-express husky --save-dev</pre><h3>Step 2: Creating the Documentation Generator Script</h3><p>Create a new file generateDocs.js:</p><pre>const swaggerJsdoc = require(&#39;swagger-jsdoc&#39;);<br>const fs = require(&#39;fs&#39;);</pre><pre>const options = {<br>  definition: {<br>    openapi: &#39;3.0.0&#39;,<br>    info: {<br>      title: &#39;API Documentation&#39;,<br>      version: &#39;1.0.0&#39;,<br>      description: &#39;Automatically generated API documentation&#39;,<br>    },<br>  },<br>  apis: [&#39;./src/routes/*.js&#39;, &#39;./src/dto/*.js&#39;], // Path to the API docs<br>};</pre><pre>const specs = swaggerJsdoc(options);</pre><pre>fs.writeFileSync(&#39;swagger.yml&#39;, JSON.stringify(specs, null, 2));<br>console.log(&#39;Documentation generated successfully!&#39;);</pre><h3>Step 3: Using GitHub Copilot for Documentation</h3><h3>For Route Files</h3><p>Example route file (users.js): <strong>These swagger comments are auto-generated using Co-pilot</strong></p><pre>/**<br> * @swagger<br> * /api/users:<br> *   get:<br> *     summary: Retrieve a list of users<br> *     description: Returns a list of all users in the system<br> *     responses:<br> *       200:<br> *         description: A list of users<br> *         content:<br> *           application/json:<br> *             schema:<br> *               type: array<br> *               items:<br> *                 $ref: &#39;#/components/schemas/User&#39;<br> */<br>router.get(&#39;/users&#39;, userController.getUsers);</pre><h3>For DTO Files</h3><p>Example DTO file (UserDTO.js): <strong>These swagger comments are auto-generated using Co-pilot</strong></p><pre>/**<br> * @swagger<br> * components:<br> *   schemas:<br> *     User:<br> *       type: object<br> *       required:<br> *         - id<br> *         - email<br> *       properties:<br> *         id:<br> *           type: string<br> *           description: The auto-generated id of the user<br> *         email:<br> *           type: string<br> *           description: The user email<br> *         name:<br> *           type: string<br> *           description: The user name<br> */<br>class UserDTO {<br>    // DTO implementation<br>}</pre><h3>Step 4: Setting Up Husky Pre-commit Hook</h3><ol><li>Initialize Husky:npx husky install</li><li>Create .husky/pre-commit file:</li></ol><pre>#!/bin/sh<br>. &quot;$(dirname &quot;$0&quot;)/_/husky.sh&quot;</pre><pre>ts-node generateDocs.js<br>git add swagger.yml</pre><h3>Step 5: Integrating with Express</h3><p>Add this to your main app.js:</p><pre>const swaggerUi = require(&#39;swagger-ui-express&#39;);<br>const YAML = require(&#39;yamljs&#39;);<br>const swaggerDocument = YAML.load(&#39;./swagger.yml&#39;);</pre><pre>app.use(&#39;/api-docs&#39;, swaggerUi.serve, swaggerUi.setup(swaggerDocument));</pre><h3>Best Practices</h3><ol><li><strong>Consistent Documentation Format</strong></li></ol><ul><li>Use standardized OpenAPI 3.0 specifications</li><li>Follow a consistent comment structure</li></ul><p><strong>2. Regular Updates</strong></p><ul><li>Make documentation updates part of your Definition of Done</li><li>Review the generated documentation regularly</li></ul><p><strong>3. Version Control</strong></p><ul><li>Include swagger.yml in version control</li><li>Review documentation changes during code reviews</li></ul><h3>Integration with Backstage</h3><p>Add this to your catalog-info.yaml:</p><pre>apiVersion: backstage.io/v1alpha1<br>kind: API<br>metadata:<br>  name: your-api<br>  description: Your API Description<br>spec:<br>  type: openapi<br>  lifecycle: production<br>  owner: team-name<br>  definition:<br>    $text: ./swagger.yml</pre><h3>Viewing Documentation</h3><ul><li>Local Development: &lt;http://localhost:3000/api-docs&gt;</li><li>Backstage: Available in the APIs section</li></ul><h3>Troubleshooting</h3><p>Common issues and solutions:</p><ol><li>Missing documentation generation</li></ol><ul><li>Ensure Husky hooks are properly installed</li><li>Check file paths in generateDocs.js</li></ul><p>2. Incorrect documentation</p><ul><li>Validate swagger.yml using Swagger Editor</li><li>Review the route and the DTO comments format generated by AI</li></ul><h3>Conclusion</h3><p>This automated approach:</p><ul><li>Reduces documentation overhead</li><li>Ensures up-to-date API documentation</li><li>Improves developer experience</li><li>Maintains consistency across the project</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54cb1c8664ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/automating-rest-api-documentation-using-genai-tools-a-developers-guide-54cb1c8664ee">Automating Rest API Documentation Using GenAI Tools</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluating Kotlin Multiplatform for Our Next-Gen Mobile App]]></title>
            <link>https://medium.com/syngenta-digitalblog/evaluating-kotlin-multiplatform-for-our-next-gen-mobile-app-a-journey-1247fb5508f2?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/1247fb5508f2</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[2025]]></category>
            <dc:creator><![CDATA[Jader Barbosa]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 21:22:39 GMT</pubDate>
            <atom:updated>2025-08-01T21:42:47.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Evaluating Kotlin Multiplatform for Our Next-Gen Mobile App: A Journey" src="https://cdn-images-1.medium.com/max/720/1*buAC83tCVkNWEWTfy2m8SA.jpeg" /></figure><p>As a senior software engineer at Syngenta Digital, I recently participated with our team in evaluating Kotlin Multiplatform (KMP) for one of our new mobile applications. This article describes our process — from proposal and assessment to final decision — to share helpful information for other teams considering similar technology changes.</p><h3>The Context: Laying Out Our Motivation</h3><p>From one of our company’s ADRs (Architectural Decision Records), it was decided that we would develop a new mobile application that would eventually replace two other existing apps. The existing apps support Android and iOS; one utilizes hybrid technology (React Native), while the other is developed using native Android and iOS technologies. The new App will also support both Android and iOS platforms, and one of the decisions from the ADR was that it would utilize native iOS and Android technologies (the context and motivation for this decision will not be explored in this article).</p><p>A new team was created to proceed with this decision. Then, one question arose in our team: What if we could have the advantages of native Android and iOS projects while also benefiting from some of the advantages of using a cross-platform technology? That’s where KMP (Kotlin Multiplatform) entered the stage!</p><p>Kotlin Multiplatform is an open-source technology by JetBrains that allows you to create cross-platform apps (not only mobile but also desktop and web). Its main appeal is flexibility, allowing you to choose precisely what to share between the different platforms. You can keep all the benefits of native programming; only the portion you decide to share will be cross-platform. KMP essentially adds a shared library to your native projects, and the library can either include all app logic (even UI), a shared data access layer, or even just a small layer of shared business rules.</p><h3>The Proposal: Setting the Stage for Innovation</h3><p>We started with a proposal to conduct a Proof of Concept (PoC) for using KMP in our new mobile App. Our App is a mission-critical application that will deal with vast amounts of local data, needs to work even when fully offline, and interacts with numerous native APIs and hardware integrations, such as GPS, camera, and other sensors. Data consistency, integrity, performance, and stability are key for this App.</p><p>Given our needs, the team proposed to keep the UI, presentation layer, and integration with native APIs/SDKs (like GPS, camera, etc.) fully native. We aimed to assess whether KMP could meet our expectations for creating a shared data access layer (remote and local) and shared business rules logic. Given that, we defined some key goals for the PoC:</p><ol><li><strong>Assess KMP for networking:</strong> Evaluate if shared networking logic can effectively handle REST API calls with support for asynchronous and concurrent operations within our data access layer.</li><li><strong>Assess KMP for local data storage: </strong>Determine if KMP can provide a reliable shared database implementation with good performance, data integrity, and asynchronous operation support for our data access layer.</li><li><strong>Assess KMP for shared business logic: </strong>Even if we could not have a shared data access layer, we could still benefit from having shared business logic between Android and iOS.</li><li><strong>Assess KMP’s support for code quality checks and automation: </strong>Verify that KMP allows us to maintain our current standards for code quality enforcement and measurement, with full integration into our existing CI/CD pipelines.</li><li><strong>Assess KMP’s generated library performance</strong>: Confirm that shared code will not cause performance or stability issues such as UI thread blocking, memory leaks, retain cycles, or limited concurrency support.</li><li><strong>Assess KMP Developer experience (DevEx):</strong> Evaluate the learning curve, tooling support, debugging capabilities, and overall productivity impact of adopting KMP for our development team compared to native development approaches.</li></ol><h3>The PoC: A Deep Dive into KMP</h3><p>After identifying our goals, we needed to determine which specific features to implement and establish a timeframe to secure stakeholder approval for the Proof of Concept (PoC). As an AgTech company, our applications typically face challenges managing large volumes of geospatial data (such as farm field boundaries) and functioning with limited or no Internet connectivity. We proposed a 4-week timeline to develop a PoC that would include the following key capabilities:</p><ol><li><strong>OAuth 2.0 authentication</strong>: Implement secure authentication with data flow between native platforms and the KMP shared code. OAuth flow needs to interact with Android and iOS native components (like Chrome Custom Tabs and Safari View Controller), and the authentication result is later used on the shared network layer to communicate with our APIs.</li><li><strong>Fetching and displaying farm fields’ boundaries data</strong>: Integrate with our REST APIs, fetch, and store geospatial data. Also, process and render the data on a map screen with native UI.</li><li><strong>Offline data mutation and syncing</strong>: Mutate and store data locally and later synchronize it using the integration with our REST APIs, handling network errors and ensuring no data loss.</li><li><strong>Comprehensive code quality checks</strong>: Add unit tests for the KMP shared code and integrate with static code analysis tools. Check for coverage measurement and mocking libraries. Automate the quality checks with a CI/CD pipeline and consolidate reports.</li></ol><p>By implementing these capabilities into our PoC, the team believed we could achieve the defined goals and have a solid base for deciding whether or not KMP would become part of the tech stack for our new application. The team presented this proposal, and with stakeholder approval secured, we began an intensive 4-week development sprint, documenting our findings and paying close attention to performance, memory management, and developer experience.</p><h3>The Results: Promising Outcomes with Some Caveats</h3><p>After four weeks of reading documentation, conducting library comparisons, and developing and testing, we compiled our results.</p><h4>Networking</h4><p>We implemented the networking logic with the <a href="https://ktor.io/">Ktor</a> library. It’s developed and supported by JetBrains and was the only mature library for KMP that the team found, fully supporting both Android and iOS.</p><p>Highlights:</p><ul><li>First-class coroutine/concurrency support</li><li>It is easy to integrate and offers many plugins to cover things like authorization, intercepting requests, logging, serialization/deserialization, retries, etc.</li><li>No memory leaks detected (*)</li><li>Provide an HTTP client mocking library for simulating requests, which helps create good-quality unit tests.</li><li>The performance of data serialization/deserialization for requests was good.</li></ul><p>(*) At the beginning of the PoC, the team found some memory issues on the iOS side. These were later solved after updating libraries to the latest version and using some third-party compilation plugins to improve code interoperability with Swift (extra info on the DevEx section).</p><h4>Local data Storage</h4><p>For local storage, we considered the <a href="https://developer.android.com/kotlin/multiplatform/room">Room</a> library (well-known by Android developers) and the <a href="https://sqldelight.github.io/sqldelight/2.1.0/multiplatform_sqlite/">SQLDelight</a> library (well-established in the KMP community). They use kind of opposite approaches: While Room generates SQL from Kotlin code, SQLDelight generates Kotlin code from SQL. During PoC execution, Room support for KMP was in Alpha, and having SQL as the source of truth for the local storage logic was something that the team found interesting, so the decision was to follow up with SQLDelight as the local storage library.</p><p>Highlights:</p><ul><li>Support for coroutines is limited. If you want to ensure that a database call doesn’t block the main thread, you must ensure that the code runs on the right coroutine dispatcher yourself.</li><li>CRUD operations performance was comparable to native solutions</li><li>It requires that developers be comfortable writing SQL for everything database-related.</li><li>Provides a Gradle task to check the database schema and migrations. It can be integrated into the CI/CD pipeline to ensure no broken database logic goes to production.</li><li>Provide an IDE plugin to help manage the SQL files.</li></ul><h4>Business Logic</h4><p>Just pure Kotlin code here, no external libraries. Mapping between different models, coordinating network, local storage calls, etc.</p><p>Highlights:</p><ul><li>Reduced code duplication; the native projects were responsible only for state management and UI logic.</li><li>KMP support for Android and iOS is considered stable, but some commonly used APIs may eventually still be experimental. In our case, some examples were creating UUIDs and epoch time stamps. Both APIs worked well in our tests, but were still marked as experimental, so there’s a risk for behavior changes and/or broken backward compatibility in future Kotlin version releases.</li></ul><h4>Quality Checks and Automation</h4><p>The team chose <a href="https://github.com/Kotlin/kotlinx-kover">Kover</a> for test coverage, <a href="https://github.com/detekt/detekt">Detekt</a> for static code analysis, and <a href="https://mokkery.dev/">Mokkery</a> for test mocks.</p><ul><li>d running unit tests works fine, test coverage measurement is not yet available for the iOS source set on the KMP project. With our approach of keeping UI and native APIs integration on the native projects side, we don’t expect to have any representable amount of code on the Android and iOS source sets on the KMP project, so this was not a big issue. Also, even though not knowing the coverage status is a bummer, being able to write and run unit tests is still valuable; it’s not the metric that drives us, but rather the value that testing brings to the software quality.</li><li>No limitation found for static code analysis</li><li>It was no problem automating the tasks into our CI/CD pipelines, but with our project structure approach, extra work was necessary to coordinate KMP, Android, and iOS builds. Getting coverage measurements for all three projects merged into a single Sonar project was also a bit of a challenge.</li></ul><h4>DevEx</h4><p>The team’s approach to the project structure was a monorepo with three fully independent projects: the Android project, the iOS project, and the KMP project. The KMP project builds an AAR library for Android and an XCFramework for iOS, and the native projects reference them like any other external library without anything to tell that they were built from a KMP project.</p><p>Highlights:</p><ul><li>rstanding how memory is managed on Android/Kotlin (garbage collector) and iOS/Swift (ARC — Automatic Reference Counting), and how they play together on KMP, can be decisive in writing code that doesn’t cause a retain memory cycle on the iOS side.</li><li>Debugging on the Android/Android Studio side was fully functional, like when your project uses any third-party library. There were some limitations on the iOS/Xcode side; the stack traces were not as easy to read, and setting breaking points on the KMP code was impossible unless using a tool like <a href="https://github.com/touchlab/xcode-kotlin">xcode-kotlin</a>.</li><li>Because KMP generates Objective-C and not Swift code (direct interoperability with Swift is under development, but may take a long time until it is stable), some commonly used Kotlin features like suspend methods, sealed classes, and generics don’t work well when used on the iOS side. The issues with the suspend methods and generics were particularly problematic for us. The lack of proper cancellation support for the suspend methods on the iOS side was even the cause of some memory usage issues. Problems were only solved after updating libraries to the latest version and adding the <a href="https://skie.touchlab.co/">Skie</a> third-party plugin to improve interoperability with Swift code.</li></ul><h3>Team’s Recommendation: Moving Forward with KMP</h3><p>After analyzing the PoC results, the benefits and challenges the team faced, and weighing everything, the team proposed following up with the adoption of KMP for our core layer while keeping native UI development.</p><p>Some advantages highlighted by the team:</p><ol><li>he debug process, for example, can be better streamlined between both platforms.</li><li>Shared complex logic across platforms. No need to implement complex logics twice, and improvements to business logic can be immediately available for both platforms.</li><li>Fostered a “one team” mindset. Knowledge transfer is encouraged, and Android and iOS members need to interact a lot more when compared to traditional mobile teams. This fosters the mentality that Android and iOS apps are the same product and that everyone on the team is responsible.</li><li>Keeping UI and state management native means that we can maintain the applications’ native look and feel while avoiding issues caused by differences in how screens’ lifecycles are managed in Android and iOS. It also enables us to adhere to the best practices for state management of each platform.</li></ol><p>However, we also acknowledged potential challenges:</p><ol><li>Learning curve for developers. While it is always fun to learn new things, the cognitive load on team members does increase.</li><li>Some debugging complexities, especially on iOS.</li><li>Dependency on third-party libraries for optimal iOS integration. Without using third-party libraries and plugins and spending time on implementing internal tooling, the usage of KMP at scale can be challenging.</li><li>Availability and maturity of third-party libraries. While growing strong, they are limited when compared to what we have for the native technologies.</li></ol><h3>The Approval: Green Light for KMP</h3><p>The team presented our findings and recommendations, the risks and mitigation plans, and finally, we received approval to proceed with KMP for our new mobile App. The management was convinced by the potential for code sharing, improved team collaboration, and successful PoC outcomes. The team then documented the decision in a new ADR — Architectural Decision Record — and was ready to move on.</p><h3>Current Status: Full Steam Ahead</h3><p>As of now, we’re actively developing our new application, with KMP at its core. Our team is excited about the possibilities this new architecture brings, and we’re continuously learning and optimizing our processes while we face new challenges.</p><p>We’re paying special attention to:</p><ul><li>Ramping up team knowledge on KMP and cross-platform development.</li><li>Refining our debugging and testing processes.</li><li>Closely monitoring performance and memory management.</li><li>Continuously improving the Developers’ experience.</li></ul><p>Our journey with KMP has been enlightening and promising. While challenges exist, the benefits of code sharing, improved architecture, and team collaboration far outweigh the hurdles. As we move forward, we’re confident that KMP will play a crucial role in the future of our mobile application development.</p><p>For teams considering KMP, we advise conducting a thorough PoC, focusing on your specific use cases and requirements. The technology is mature enough for production use but requires careful planning and a willingness to adapt and learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1247fb5508f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/evaluating-kotlin-multiplatform-for-our-next-gen-mobile-app-a-journey-1247fb5508f2">Evaluating Kotlin Multiplatform for Our Next-Gen Mobile App</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flooded with Sentry and Datadog Issues?]]></title>
            <link>https://medium.com/syngenta-digitalblog/flooded-with-sentry-and-datadog-issues-here-is-what-to-do-abfdcf623f47?source=rss----d9fa09ecf14---4</link>
            <guid isPermaLink="false">https://medium.com/p/abfdcf623f47</guid>
            <category><![CDATA[sentry]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[datadog]]></category>
            <category><![CDATA[syngenta-digital]]></category>
            <category><![CDATA[2025]]></category>
            <dc:creator><![CDATA[Luan Nunes]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 19:04:37 GMT</pubDate>
            <atom:updated>2025-07-24T19:05:56.869Z</atom:updated>
            <content:encoded><![CDATA[<h4>Here is what to do!</h4><figure><img alt="Flooded with Sentry and Datadog Issues? Here is what to do!" src="https://cdn-images-1.medium.com/max/720/1*cHHOm0n6cD0Osto20tMwJA.png" /></figure><p>In November 2024, Syngenta Digital faced a significant challenge having one of their Digital Products, with over <strong><em>1000</em></strong> Jira Issues reported through Datadog and Sentry without analysis. To overcome this problem, we set up a dedicated team that developed and followed a methodology for analyzing and solving the tickets, categorizing and filtering the reported bugs, improving the alert generation process to reduce false positives and noise, and implementing a systematic method for fixing and prioritizing identified problems. Additionally, the team established a standardized ticket lifecycle to ensure consistent analysis and execution across Sentry and Datadog work streams. This strategy aimed to not only resolve the current backlog of bugs but also to enhance the overall quality and efficiency of the bug reporting and resolution process of our Digital Product.</p><h4>What and How to Prioritize?</h4><p>In an ocean of problems, it’s easy to drown if you don’t know where to swim. Therefore, the first stage of the process consisted of segmenting and classifying open tickets to decide which items to prioritize and act on.</p><p>The tickets created by the Datadog Monitors integration didn’t have much relevant information for complete segmentation. However, most of them had the <strong><em>Service name</em></strong>, the <strong><em>Datadog Issue UUID</em></strong>, and the <strong><em>Error kind,</em></strong> so we decided to use these parameters as a starting point.</p><p>The process began by extracting this metadata from Jira tickets using the Jira API and then categorizing them by service. To refine the previous result, we created a script that uses <strong><em>SynGPT </em></strong>(our internal AI model)<strong><em> </em></strong>to analyze and group tickets by error patterns within each service, providing a clearer view of recurring issues.</p><p>With tickets grouped by service and error type, we developed a script to prioritize ticket groups based on three main criteria:</p><ul><li>Groups with more recently created tickets: More recent tickets are more likely to be impacting the end user and to have their logs and traces still available;</li><li>Number of tickets in the group: Groups with many tickets indicate that they likely have the same root cause and therefore their solution has a greater impact;</li><li>Error type: Errors with common words like “<em>connection</em>” and “<em>server</em>” are indicative of communication errors with other services. We deprioritized them to focus on more specific and potentially impactful issues.</li></ul><p>This resulted in an organized list of groups ranked by priority, offering a strategic guideline for addressing the most critical issues first.</p><p>On the other hand, tickets generated by the integration with Sentry only had information about the type of error, as they all come from the same application, which is our web interface. In this case, we categorize them by title, grouping similar summaries and prioritizing groups with a higher volume. Specific title patterns, such as <strong><em>TypeError </em></strong>and <strong><em>SyntaxError </em></strong>related issues, are flagged as potential bugs for increased prioritization. Conversely, keywords like <strong><em>Unauthorized</em></strong> and <strong><em>NetworkError</em></strong> were deprioritized as they may represent external problems, such as communication instability. This structured approach aimed to streamline issue management, reduce ticket duplication, and ensure that development efforts were focused on the most impactful and frequent problems.</p><h4>How to Control the Backlog?</h4><p>Acting directly on tickets drastically reduced our backlog, but it didn’t prevent us from getting back to the same level within a few months. In order to keep our backlog balanced and manageable, our teams had to work together, adjusting some internal processes and maintaining the flow of incoming tickets.</p><p>An interesting way to visualize this problem is to imagine that our backlog is a water tank with two taps: one representing the entry of tickets and the other the exit after analysis. As long as the tap that fills the tank has a higher flow rate than the outlet tap, our backlog will continue to grow indefinitely. To correct this problem, it is necessary to reduce the entry rate or increase the exit rate — which in our case involved resource allocation, that is naturally the more costly path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*9SSJJuVSe6wvK3BvBJQc6w.png" /></figure><p>In this context, we work directly on integrations so that they only create relevant tickets, reducing our opening rate and keeping our backlog relevant. On the Datadog side, we adjusted the Issues evaluation window, and the minimum frequency rate for ticket generation to ignore spurious cases or tests in production. Furthermore, we also filter errors from HTTP communication libraries, since most of our services have retries, and these individual errors ended up generating many false positives.</p><p>On the Sentry side, many of the errors we saw were false positives or did not directly impact the user, which did not make sense to be alerted. Therefore, we decided to change the alert configuration to not generate tickets if the error was in a specific list of errors, in addition to ignoring all events that did not have a custom <strong><em>crashScreen </em></strong>tag created by the team. That allowed us to check whether the error caused a crash on the screen, impacting the end user. Other errors are still generating alerts that need to be investigated, but as they did not have a significant impact, they can be acted upon as much as possible.</p><h4>Result</h4><p>Regarding tickets opened by the integration with Datadog, we started our analysis with a backlog of 601 open tickets, and throughout the initiative 223 more were opened. Ultimately, only 23 tickets remained without analysis, and 811 were analyzed in total. During the process, we worked directly on 62 tickets and fixed several problems in different services, such as direct access to possibly null attributes, implementation/correction of retries mechanisms, implementation errors in business rules and others. Additionally, we gathered several tickets that had the same root cause and transformed them into technical debts for the teams to act on.</p><p>Conversely, concerning Sentry, we started our analysis with a backlog of 424 open tickets, and throughout the initiative 78 more were opened. Ultimately, only 12 tickets remained without analysis, and 490 were analyzed in total. During the process, we worked in different areas of our web application to improve its usability and quality. By comparing some traces and the frequency of some alerts, we also optimized the performance of a region selection component used in several application parts, reducing the selection response time by more than 85%.</p><p>During the process we also took the initiative to reclassify tickets according to their impact/priority. This way, at the end of the initiative it was possible to understand how much the identified issues really affected the end user and what the sense of urgency was regarding them. The result, as seen in the graphs below, indicates that a large part of the issues were in fact lower priority bugs, often identified incorrectly and generating practically no impact on the user. This corroborated the maintenance we performed on the alerts to ignore spurious errors or filter low-frequency issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*f4RnGYqvgzX2sl-zPTtMCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*mz7H4nWVjXJnzH2qCXVa3w.png" /><figcaption>In this classification, P1s are the most impactful bugs while P4 are the least impactful</figcaption></figure><p>On the other hand, since tickets have been sitting unattended for a long time, it is natural to think that few really priority issues would be found, since when blocking customers, they would have been previously identified by some other method (a customer opening a ticket or an alert, for example). Even so, we had some examples of issues that were still occurring, mainly on the Datadog side, and we had the opportunity to fix them before they reached the end customer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abfdcf623f47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/syngenta-digitalblog/flooded-with-sentry-and-datadog-issues-here-is-what-to-do-abfdcf623f47">Flooded with Sentry and Datadog Issues?</a> was originally published in <a href="https://medium.com/syngenta-digitalblog">syngenta-digitalblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>