<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Richard Whitney on Medium]]></title>
        <description><![CDATA[Stories by Richard Whitney on Medium]]></description>
        <link>https://medium.com/@rb1whitney?source=rss-b8600242692a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fYQoMrj4qM8LoAE3</url>
            <title>Stories by Richard Whitney on Medium</title>
            <link>https://medium.com/@rb1whitney?source=rss-b8600242692a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:57:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rb1whitney/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Your Terraform Ports. Your Secrets Don’t.]]></title>
            <link>https://medium.com/@rb1whitney/your-terraform-ports-your-secrets-dont-2cff14cf4886?source=rss-b8600242692a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cff14cf4886</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <dc:creator><![CDATA[Richard Whitney]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 23:55:36 GMT</pubDate>
            <atom:updated>2026-11-14T23:55:36.468Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why I treat HashiCorp Vault configuration as code, and the controller pattern that makes it work.</em></p><p>The hardest part of moving a system to a new region isn’t the Terraform. It’s the secrets and the configuration. Infrastructure code ports. Secrets that someone typed into a cluster by hand don’t.</p><p>The reason is how each one gets created. Terraform is easy to abstract because you decide how every resource is made. Some secrets work that way too: a service account or an AWS role is just another resource your own infrastructure mints. But many secrets are issued on someone else’s terms, like an API key for a SaaS logging platform or a client certificate from a partner’s certificate authority. You don’t choose how those are created, so you can’t abstract them the way you abstract infrastructure.</p><p>The usual advice is to use Vault as little as possible, and that’s right. But you can’t get to zero, so the Vault you do run deserves the same investment as the rest of your infrastructure code: everything declared in Git, nothing changed by hand, every cluster reproducible anywhere in the world.</p><p>The pattern that has worked for us is a declarative controller with one simple contract. You describe any Vault API call as YAML, encrypt the secrets in place with Vault’s Transit engine, and let a privileged actor (person/pipeline) apply it. Anyone can encrypt. Only certain processes can decrypt. Vault becomes something every team can contribute to without becoming a Vault expert.</p><h3>Minimize Vault first</h3><p>Secret management was one of the first problems I was brought in to solve at my company, and Vault has been the right answer. The service runs the same on-premises, in Google Cloud, or in AWS, and Vault handles dynamic and static secrets on one platform.</p><p>It’s still a cornerstone of the industry. HashiCorp reported more than 4,300 enterprise customers in 2023, before IBM acquired the company in 2024. Its open source fork, OpenBao, now governed under the OpenSSF, has picked up <a href="https://itbrief.com.au/story/nvidia-sap-back-openbao-as-secrets-tool-gains-ground">backing from NVIDIA, SAP, GitLab and Broadcom</a>, and Broadcom has built it into VMware Cloud Foundation 9.0 (<a href="https://www.techtarget.com/it-infrastructure/news/366644831/Nvidia-adopts-OpenBao-open-source-fork-of-HashiCorps-Vault">TechTarget</a>). Whichever one you run, they largely share the same API, and the operating problem is the same.</p><p>But the best secret is one you never have to store. Before reaching for Vault:</p><ul><li>Use cloud IAM and workload identity instead of raw service accounts and API tokens.</li><li>Use the PKI engine for short-lived certificates, or integrate with an enterprise tool like Venafi to rotate on demand.</li><li>Prefer dynamic secrets over static ones wherever the target system supports them.</li></ul><h3>But you still have to run it</h3><p>Even after all of that, you still run clusters. You still manage auth methods, mounts, and policies. Vault and OpenBao keep evolving underneath you.</p><p>And many secrets will never be dynamic. They’re API keys an engineer has to fetch by logging into a vendor portal with no usable API. Sometimes they need someone to walk to an offline HSM and sign something. No amount of new tooling removes those steps.</p><p>So the goal isn’t to avoid Vault. It’s to make sure no one ever changes it by hand. Every cluster setting and every secret should be replicated from code, because that’s what lets you move around the world.</p><h3>Vault is for everyone, so make it easy to contribute to</h3><p>This isn’t new territory. A while back, I gave a <a href="https://youtu.be/K2HrZUC8UTY">public lightning talk</a> making the case that Vault is for everyone, not just the security team, and we showed how we ran Terraform and Vault as self-service in a <a href="https://www.hashicorp.com/en/events/webinars/unlocking-the-cloud-operating-model-with-clover">HashiCorp webinar</a>. It’s still true, and the way to make it true is infrastructure as code.</p><p>The Python client <a href="https://github.com/hvac/hvac">hvac</a> is excellent. It’s tried and true, it has a great community, and it handles the imperative work well: initializing clusters, unsealing, rekeying.</p><p>But imperative scripts have a cost. Every new mount, auth method, or policy means another script to write and maintain, and everyone touching it has to understand Vault. What we wanted was something opinionated: a contract where you can read HashiCorp’s API documentation and immediately declare the change, with no new code.</p><p>The obvious question is why not use Terraform’s own Vault provider. For cluster configuration, you could. But secrets are a Day-2, every-team problem. Asking every app team to write HCL and run applies to change an API key is the same mistake as handing them infrastructure repositories they’ll never operate. And Terraform has no equivalent of the Transit workflow below: a way for a developer to contribute a secret they can encrypt but never decrypt.</p><p>That contract is three fields. Every Vault HTTP API call is an api_path, an api_action, and an api_payload. Here&#39;s a team declaring its own KV mount and a least-privilege policy:</p><pre># cloud-boot-app/_secret_engines.yaml<br>api_paths:<br>  - api_path: v1/sys/mounts/cloud-boot-app<br>    api_action: post<br>    api_payload:<br>      type: kv-v2<br>      description: &quot;KV v2 secrets engine for cloud-boot-app&quot;<br>      config:<br>        default_lease_ttl: &quot;30m&quot;</pre><pre># cloud-boot-app/_acl_policies.yaml<br>api_paths:<br>  - api_path: v1/sys/policy/cloud-boot-app-policy<br>    api_action: post<br>    api_payload:<br>      path:<br>        &quot;cloud-boot-app/data/*&quot;:<br>          capabilities: [&quot;read&quot;]<br>        &quot;transit/encrypt/cloud-boot-app&quot;:<br>          capabilities: [&quot;update&quot;]</pre><p>If it’s in the API docs, you can declare it. That’s why having a controller pattern like this one means platform teams barely needed to change the underlying code underneath teams while the things it manages keep growing.</p><p>Under the hood, it’s still hvac. The reference controller uses hvac’s native methods where Vault operations are standard: logging in, checking health, unwrapping tokens, decrypting Transit. For the declarative contract, it skips the engine-specific wrappers and sends each validated payload through hvac’s generic request adapter. Any /v1/ endpoint works without new Python code, while hvac still handles TLS, namespace headers, tokens and sessions. hvac already lets you call any path; the controller turns that one call into a contract every team can use.</p><p>One honest trade-off: this is declared, not reconciled. Every run applies what’s in Git, so the same files always produce the same result. But removing an entry from a file doesn’t remove it from Vault; that takes a deliberate delete using this framework, or a rebuild from Git. That’s one more reason to rebuild regularly.</p><h3>Secrets in Git: anyone can encrypt, only the privileged process can decrypt</h3><p>Configuration in Git is the easy part. The real question is how to put secrets there too. The answer is Vault’s Transit engine, which separates encrypting from decrypting. That separation gives you three roles:</p><ul><li><strong>Secret writer (app developer):</strong> encrypts with the team’s Transit key and opens a pull request. Can’t decrypt anything or write to the secret path directly.</li><li><strong>Privileged deployer (CI/CD or a release engineer):</strong> decrypts in memory and writes to the secret path. Can’t bypass review; it only deploys merged, validated YAML.</li><li><strong>Runtime application:</strong> reads its own secrets with its own identity. Can’t encrypt, decrypt, or write secrets.</li></ul><p>A developer writes the secret locally in plaintext, then encrypts it in place:</p><pre>vault-ctl secrets encrypt \<br>  --name example_vault \<br>  --namespace orders \<br>  --transit-key orders-key \<br>  --path ./config/example_vault/orders/kv/vendor-api.yaml \<br>  --auth-method ldap</pre><p>The plaintext values become Transit ciphertext, and the file is now safe to commit:</p><pre># orders/kv/vendor-api.yaml<br>_namespace: orders<br>api_paths:<br>  - api_path: v1/kv/data/vendor-api<br>    api_action: post<br>    api_payload:<br>      data:<br>        api_key: &quot;vault:v1:7xK9mQ2...&quot;<br>        webhook_secret: &quot;vault:v1:pL4nR8v...&quot;<br>    transit_engine: &quot;transit&quot;<br>    transit_key: &quot;orders-key&quot;</pre><p>After review and merge, that namespace’s pipeline authenticates with its own cloud identity and deploys. It decrypts in memory, writes to Vault, and redacts the payload from its logs. The plaintext never touches Git history, CI logs, or the runner’s disk.</p><p>The point isn’t one locked-down pipeline. It’s many. Give every app its own namespace, with its own Transit engine, its own deployer identity, and CODEOWNERS on its directory. Then copying ciphertext gets you nothing. Lift another team’s secret into your own namespace, and your pipeline can’t decrypt it, because the key that encrypted it lives in theirs. The only way to reuse a secret is from inside the same namespace, through the same process that’s allowed to decrypt it, and that’s a boundary the platform controls. And if one namespace is compromised, you know exactly what to rotate: that key, that identity, and the secrets behind them, and nothing else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1sB4_J5h4KTbBNDG53QwA.png" /></figure><p>A new region needs one thing before its first deploy: the Transit key, either replicated from an existing cluster or with the files re-encrypted under the new cluster’s key. After that, standing up the region is a deploy, not an archaeology project. Rotation works the same way. Rotate the key as often as you like, but rewrap the ciphertext in Git with Transit’s rewrap endpoint before you raise the minimum decryption version, or the next deploy breaks.</p><h3>Guardrails before anything touches Vault</h3><p>A contract this open needs guardrails, and they run before any network call. The controller validates every payload’s structure, then applies domain rules. In the reference repo, it:</p><ul><li>Rejects path traversal in api_path.</li><li>Caps lease TTLs on new mounts.</li><li>Requires each file’s _namespace to match the directory it lives in.</li><li>Blocks targeting the root namespace.</li><li>Refuses tenant policies that mix read and write capabilities.</li></ul><p>Those are the mistakes a reviewer misses at the end of a long day. Catching them in validation means review can focus on intent, not syntax.</p><p>The same controller runs identically on a laptop and in a pipeline. Authentication is pluggable: a developer uses a token or LDAP, and CI/CD uses AppRole or AWS or GCP workload identity. One tool, one contract, everywhere.</p><h3>Where it’s going</h3><p>We keep building on top of this. Crossplane generates secrets automatically where an API exists. Platform scaffolding binaries create the Vault structure for every microservice and the core monolith in one pass.</p><p>But the new tools sit on top of the contract; they don’t replace it. The vendor key still comes from a portal, and the HSM signature still needs a person. What the contract guarantees is that once that secret exists, it lands in Git as ciphertext and reaches Vault through the same reviewed path as everything else. No manual secret changes. No one-off vault commands.</p><h3>Give Vault a little love</h3><p>It’s tempting to treat Vault as the thing you tolerate while you adopt something newer. But the secrets and configuration inside it are what actually decide whether your platform can move. Terraform gets you the infrastructure; Vault, managed as code, gets you a system that runs.</p><p>I’ve published a reference implementation of the pattern, built on hvac: <a href="https://github.com/rb1whitney/vault_controller">github.com/rb1whitney/vault_controller</a>. Repo covers the declarative contract, Transit encryption, validation, and pluggable auth.</p><p>How are you managing Vault configuration and the secrets that no API will generate for you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cff14cf4886" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Platform Failed Our App Teams. The Other Failed Us.]]></title>
            <link>https://medium.com/@rb1whitney/one-platform-failed-our-app-teams-the-other-failed-us-97cfcbd92f0b?source=rss-b8600242692a------2</link>
            <guid isPermaLink="false">https://medium.com/p/97cfcbd92f0b</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[crossplane]]></category>
            <category><![CDATA[platform-architecture]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <dc:creator><![CDATA[Richard Whitney]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 16:14:27 GMT</pubDate>
            <atom:updated>2026-10-25T16:14:27.097Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two platforms, two opposite failures, and one model: draw abstraction boundaries around what each team actually cares about.</em></p><p>Platforms are built with people, not just code. Platform teams and application teams each have their own domain problems to solve, and when a platform’s boundaries ignore what a team cares about, it doesn’t scale for that team.</p><p>We learned this twice, in opposite directions. Our Terraform platform was built around the maintainers and failed the app teams: we gave teams their own repositories, and half never touched them. Our Kubernetes platform was built around the app teams and failed the maintainers: teams owned everything, until the platform couldn’t change at all.</p><p>Both stories converged on one model: domain-level abstraction, drawn around responsibility and the things each team actually cares about. The hardest part was never the technology.</p><h3>Story one: Terraform failed the app teams</h3><h4>The real problem was consistency</h4><p>Ours had grown across several regions, each with its own mix of application, database, Kubernetes, compliance, and legacy tiers. The original region had already been broken into layers and projects, which gave it room to scale. The newer regions had not; each sat in small regional centralized Terraform Workspaces. That gave us speed. But the real problem wasn’t the monolith itself; it was inconsistent automation code.</p><p>Teams trampled each other in the obvious way. Terraform Enterprise handled CI/CD, but everyone worked in the same layer. One hurried change or failed terraform apply backed up the entire layer.</p><p>That hid the deeper trampling. We had hundreds of Terraform modules, but the organization couldn’t control the “extra” value-adds or the names passed into them. Small naming problems like app-kms-key in one place and app_kms_key in another. All it takes is one overworked engineer making a bad call and a reviewer who isn&#39;t checking against standards to create small differences that keep getting bigger. Environments diverged, and engineers spent their time untangling unintended differences between them.</p><h4>We broke it apart on purpose</h4><p>Then came the constraint: the business needed a new region’s staging environment on a tight deadline. We could hand-build staging to hit the date and repeat the work for production. Instead, we used the deadline to fix consistency.</p><p>We broke the estate apart by resource domain and team, and put one abstraction in front of all of it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*vVGu8JVNrBLGc6qX3HHJdA.png" /><figcaption>Domain Driven Model Separated By Workspaces</figcaption></figure><p>This wasn’t decomposition for its own sake. We wanted smaller blast radii, clearer reviews, independent release cycles, and direct ownership. An application team could change the platform without waiting on the platform team that owned the shared VPC. A Kubernetes team could upgrade clusters without touching every virtual machine in the region.</p><p>The abstraction starts with a platform seed workspace. It creates every Terraform Enterprise workspace, plus the network, projects, and base IAM, so every environment is built the same way from the same source. The compliance-scoped stack became a variant, not a separate tier copied into each region. Both variants get a global project workspace (for resources like service accounts, and KMS) and one regional workspace per region, with app, database, and Kubernetes domains on top.</p><p>We created each “standard” environment one at a time from the same template, using its tfvarsfile (flat variable configuration file in Terraform) to control the differences:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*k7qb6BI8mtO8-8sNI-YPmw.png" /></figure><p>A template change plans in every workspace; a *.tfvars change plans only on its own. The environment file holds only what differs:</p><pre># production.tfvars<br>environment = &quot;prod&quot;<br>variant     = &quot;compliance&quot;<br>regions     = [&quot;region-a&quot;, &quot;region-b&quot;]<br>domains     = [&quot;app&quot;, &quot;db&quot;, &quot;k8s&quot;]</pre><p>A module fix now applied to every environment, and each environment kept its own state. That carried real deadline risk. We landed just inside the deadline. Staging went live, production followed quickly, and every later environment got cheaper and, most importantly, consistent. Teams were forced to abstract once, and learn to face their domain problems. Or did they?</p><h4>Half the teams never touched it</h4><p>Unfortunately, we ended up with dozens of team-level repositories, each used by a few people. Roughly half the teams stepped up and owned theirs. The other half didn’t.</p><p>That was our miscalculation, not theirs. An app team’s view is scoped to its product. From there, provisioning an environment looks enormous and foreign: cross-project IAM reviews, cross-region dependencies bringing a new region online. None of that is what they care about, so ignoring it was the rational choice. We split the repositories without taking that burden off the teams. We distributed the code without distributing the work.</p><p>What most teams wanted wasn’t ownership but flexibility: the ability to change what mattered to them without operating everything underneath. A solution that only works when the top-performing teams run it doesn’t fly. Everyone else ships late or never, because “urgent” work always wins. The platform was built around what we cared about, not what they did.</p><h3>Story two: Kubernetes failed the maintainers</h3><p>At the same time, Kubernetes failed the opposite way. App teams had full control there, and it launched fast. They could only order a few platform resources, but the logic lived almost entirely in their own repositories.</p><p>In Terraform, ownership went unused. In Kubernetes, it was used so thoroughly that the platform couldn’t change anything.</p><p>Take ingress. Every application repository carried its own routing YAML, written for Istio:</p><pre># Copied into every application repository<br>apiVersion: networking.istio.io/v1beta1<br>kind: VirtualService<br>metadata:<br>  name: orders-api<br>spec:<br>  hosts:<br>    - orders.example.com<br>  gateways:<br>    - istio-system/public-gateway<br>  http:<br>    - route:<br>        - destination:<br>            host: orders-api<br>            port:<br>              number: 8080</pre><p>Then we decided to move from Istio Ingress to Traefik, which handled the Ambassador pattern better for our needs. Every route in every repository had to become something like this:</p><pre>apiVersion: traefik.io/v1alpha1<br>kind: IngressRoute<br>metadata:<br>  name: orders-api<br>spec:<br>  entryPoints:<br>    - websecure<br>  routes:<br>    - match: Host(`orders.example.com`)<br>      kind: Rule<br>      services:<br>        - name: orders-api<br>          port: 8080</pre><p>The YAML wasn’t the problem. Rewriting it takes an afternoon. The problem was everything around it:</p><ul><li><strong>Every team had to make the change</strong>, across hundreds of repositories, competing with its own roadmap.</li><li><strong>Every change needed a reviewer who understood ingress</strong>, and most reviewers were app engineers who had never needed to.</li><li><strong>Every team added to the migration opened new lines of communication</strong>: questions, exceptions, meetings, rollbacks. Those paths grow far faster than the number of teams.</li></ul><p>The same is true of every cross-cutting change: a new API gateway, a TLS policy, a header standard. Getting every team to make it is impossible. Getting everyone to review and understand it is harder still. The platform served the app teams and failed the people who maintained it.</p><h3>Where the two stories converged</h3><p>Both platforms failed for the same reason: their boundaries ignored what one group cared about. App teams care about their application: what it needs, where it runs, how it changes the business. Platform teams care about how it gets built: modules, workspaces, credentials, ordering, policy, and upgrades. A domain-level abstraction draws the line between those two concerns.</p><h4>Terraform: we took options away</h4><p>We reversed the team-repository model. A small team did the rework: one track rewrote the shared modules while the other migrated thousands of state files, each with one owner. We went from dozens of repositories to a handful of project-level ones owned by one team, and app teams change thetfvars files only.</p><p>What stayed with teams became a thin application layer in the spirit of the Open Application Model. App teams lost some freedom; ad hoc changes stay possible, but one team owns the logic.</p><p>Every fast-food menu has burgers; almost none has hot dogs. A short menu is how kitchens stay fast, and platforms work the same way: the common path is fast and fixed, and the rare request stays possible without slowing everyone else down.</p><h4>Kubernetes: we pulled the logic back</h4><p>We brought in Crossplane and replaced the boilerplate with claims. A team now declares what it needs, not how it’s wired:</p><pre>apiVersion: platform.example.com/v1alpha1<br>kind: ServiceEndpoint<br>metadata:<br>  name: orders-api<br>spec:<br>  host: orders.example.com<br>  port: 8080<br>  public: true</pre><p>The platform’s composition turns that claim into whatever the ingress layer needs: an Istio VirtualService yesterday, a Traefik IngressRoute today. When we swap the gateway, we change one composition and review it once, and every team’s claim stays the same. We migrated Helm resources behind the same layers. App teams kept the choices that matter to them, and the platform team got back the ability to change the platform.</p><h4>One model, three layers</h4><p>Both platforms ended up with the same three layers, and each layer maps to the team that cares about it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*T-Or7aOZjyfDWV_pdokeJA.png" /><figcaption>Bringing it Together</figcaption></figure><p>This isn’t a return to the monolith. Foundations still have to be created in a coordinated sequence, but the difference is easy to miss:</p><ul><li>A monolith consolidates code, state, and lifecycle.</li><li>A platform consolidates the user journey while keeping intentional lifecycle boundaries.</li></ul><p>This is centralization, of a specific kind: centralizing undifferentiated operational complexity while decentralizing product delivery. The results: a stack stands up in any region in days. And far fewer repositories means less to own, less to forget, and fewer places for drift.</p><h3>The ultimate test: secrets</h3><p>Victory felt like ours, but the overall business configuration effort had only partly come down. On the latest launch, the platform was done quickly. Then we lost several times as long to secrets and application config.</p><p>Secrets are where both stories meet. They’re foundational: the platform needs them to build anything, and every application needs them to boot. If any domain was going to test the model, it was this one.</p><p>Both earlier failures showed up again. Where apps owned their own secret wiring, changing the secret backend or the rotation policy meant touching hundreds of repositories, just like the ingress migration. Where nothing was declared, apps didn’t think about secrets until they crashed. The core application monolith failed on the first missing secret, so discovery was serial: one crash, one fix, one redeploy, repeated until the service came up. That’s story one in miniature: work outside a team’s view, ignored until it breaks.</p><p>So we applied the same split. In Kubernetes, a claim is the natural way to do it: the app declares what it needs, and the platform fulfills it.</p><pre>apiVersion: platform.example.com/v1alpha1<br>kind: SecretContract<br>metadata:<br>  name: orders-api<br>spec:<br>  secrets:<br>    - name: database-password<br>      source: generated<br>    - name: signing-key<br>      source: hsm<br>    - name: vendor-api-token<br>      source: vendor</pre><p>For many secrets, that’s all it takes. When an API can generate the secret, a composition creates and stores it, and the app boots. Fail-fast boot enforces the contract either way: the application validates every declared secret and config value at startup and reports every gap in one pass.</p><p>But claims only reach as far as Kubernetes. Our serverless and compute layers needed the same contract, and that’s where the harder question surfaces: who actually generates each secret?</p><p>Sometimes it’s an API. Often it’s a person. Some secrets need an engineer to walk to an offline HSM and sign them. Some only exist after a vendor generates them in a portal with no API. And when it’s a person, it’s usually someone on the platform team, who then has to store the secret, raise the PR, get it reviewed, and tell the app team it’s ready. No controller can reconcile its way past a business decision that requires a person in a server room.</p><p>This is where the model of who does what has to hold, precisely because an API can’t. For some secrets, a claim is the perfect interface. For the rest, you need something extra. Ours was a thin, portable Go binary that works inside and outside Kubernetes:</p><ul><li>Creates every secret it can through Vault/OpenBao.</li><li>Turns every secret that needs a human into a named, owned step, so everyone knows who is doing what before launch day, not after the crash.</li><li>Renders the environment configuration for each service.</li></ul><p>The same binary runs on a developer laptop or in the orchestrators we already use (GitHub Runners, Airflow, Jenkins). It’s glue, not a product. A few teams own the secrets and the boot contract, so launches stop waiting on hand-offs.</p><h3>The tool was never the point</h3><p>In the end, Terraform and Crossplane solved the same problem in two places. Terraform builds the foundation: cloud projects, networks, IAM, databases, and clusters. Crossplane abstracts the resources that live in Kubernetes. Both sit behind the same contract: teams describe what they need, and the platform decides how it gets built. The tool mattered less than the layer.</p><p>That’s why adopting a new feature like Terraform Stacks doesn’t solve this on its own. Stacks may organize components and state more cleanly, but this was never a technology problem. It was an organizational, domain-driven one: who cares about each layer, and who is prepared to operate it. Some of it, like a secret signed on an offline HSM, is a business process that automation can only make visible.</p><p>And none of it happens on a clean sheet. The 747 is often already built and flying, carrying the business. Engineers have to fix this problem in the air to match the new airplane being built on the ground.</p><p>Two platforms failed in opposite directions and converged on one model. Platform boundaries must follow responsibility and what each team actually cares about, not an idealized org chart:</p><ul><li>Give a service its own repository and state when it has an independent lifecycle.</li><li>Use shared code with tfvars and claims when the same capability repeats across environments.</li><li>Consolidate foundational workflows when resources share a lifecycle and must be deployed together.</li><li>Keep separate state where failures and replacement cycles differ.</li><li>Put a platform in the middle that owns the mechanics of creation.</li></ul><p>Code rots and people leave. A process that isn’t run regularly fails when you need it; a process that runs all the time scales. We didn’t fail because we broke things apart. We learned where the real boundary was: not at the repository, but where one team’s concerns end and another’s begin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97cfcbd92f0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taming Multi-Agent Workflows]]></title>
            <link>https://medium.com/@rb1whitney/taming-multi-agent-workflows-7eec951375cf?source=rss-b8600242692a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7eec951375cf</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[openai-codex]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Richard Whitney]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 18:57:55 GMT</pubDate>
            <atom:updated>2026-09-27T18:57:55.266Z</atom:updated>
            <content:encoded><![CDATA[<p><em>One agent file, three security postures across Claude Code, Antigravity, and Codex</em></p><p>The industry is treating standardized formats like SKILL.md and protocols like MCP as proof that agent workflows are portable. They aren’t. We have an <strong>illusion of portability</strong> and engineers have design trade-offs to solve it.</p><p>The syntax differences are trivial. The killer is that the same agent definition produces three different security postures depending on which harness runs it: one fails open, one fails closed, and one has no tool permissions at all, just a sandbox.</p><p>Prompt standards won’t save you from runtime defaults. Here’s the simplest test: take one subagent file, leave out the tools line, and hand it to three harnesses:</p><ul><li><strong>Claude Code fails open.</strong> Omit tools and the agent inherits every tool available to subagents. Misspell one and it&#39;s silently dropped; launch fails only if nothing resolves.</li><li><strong>Antigravity fails closed.</strong> Omit tools and the agent gets nothing. Misspell one and the subagent may hang, a documented known issue.</li><li><strong>Codex has no tool list.</strong> The agent inherits the parent’s sandbox, whatever that happened to be.</li></ul><p>Tool names differ too. Claude Code says Read, Antigravity says view_file, and Codex has no tool list at all, just a sandbox mode. That part is annoying but mechanical, and a lookup table fixes it. The defaults are the real problem. Notice the failure modes, too. They range from silent to stuck. None of them is a nice red error that says “you meant Read.&quot;</p><p>Delegation has a default too. Claude Code lets a subagent spawn its own subagents up to three layers deep, unless you take the Agent tool away or lower CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH. Antigravity&#39;s ceiling is ten levels. A stuck agent that can delegate will, and every layer spends its own tokens.</p><h3>How I found out</h3><p>I hit this porting a multi-agent workflow from Claude Code to teammates on Antigravity and Codex. Strip it down and it’s two roles most teams already have: a read-only agent that investigates, and an engineer that writes code and runs tests. In Claude Code, the most permissive of the three, both looked fine.</p><p>I expected the pain to be spread evenly. It wasn’t.</p><ul><li><strong>AGENTS.md</strong> survived. Plain prose travels.</li><li><strong>Skills</strong> mostly survived. I symlinked them from .claude/skills/ into .agents/skills/ and swapped &quot;use Read&quot; for &quot;read the file.&quot;</li><li><strong>MCP servers</strong> survived for free. Registering them didn’t: JSON in .mcp.json, TOML in Codex&#39;s config.toml, and Antigravity&#39;s own config.</li><li><strong>Subagents</strong> fell apart.</li></ul><p>The port also exposed a bug in my own design. My read-only recon agent was supposed to write STRATEGIC_RECON.md. In Codex, sandbox_mode = &quot;read-only&quot; means exactly that, so the contradiction surfaced immediately. Claude Code had let me get away with it.</p><h3>The angles I considered</h3><p>There’s an option zero: make everyone use one harness. If your engineer department can do that, stop reading. Mine can’t, and I suspect yours can’t either.</p><p><strong>Angle 1: Skills only.</strong> Put the whole state machine in the skill and drop the agent files. Most portable, but this approach throws away isolation and enforcement, and a read-only agent that <em>can</em> write files eventually will.</p><p><strong>Angle 2: Everything behind MCP.</strong> The servers port for free, but registration, approvals, and schema bloat stay per harness. MCP standardizes the transport, not who’s allowed to use it.</p><p><strong>Angle 3: Lean gateway agents.</strong> Keep agent files to just the permission envelope and let skills carry the logic. Right idea, but that envelope is exactly what differs per harness, and three agent file copies drift.</p><p><strong>Angle 4: An adapter.</strong> Write each agent once in a canonical format and generate the harness files. More upfront work, but it keeps enforcement without an engineer memorizing three schemas.</p><p>Angle 3 tells you <em>what</em> to put in the files. Angle 4 is <em>how</em> to keep them honest. I ended up with both.</p><h3>Six patterns for cross-harness agents</h3><p>My first version of the adapter was a find-and-replace for tool names. That was the wrong job. Translating Read to view_file is easy. The adapter&#39;s real job is to refuse to let defaults decide anything.</p><p>These aren’t specific to my setup. They’re what any team sharing agents across harnesses needs:</p><ol><li><strong>Declare capabilities, not tool names.</strong> Canonical files say read, search, write, shell, web, delegate, and a map translates them per harness.</li><li><strong>Explicit or nothing.</strong> No capability list, no agent. Nothing ever falls back to a harness default.</li><li><strong>Fail loud.</strong> Claude Code drops unknown tools silently and Antigravity may hang, so the generator exits non-zero on anything unmapped.</li><li><strong>Label what isn’t enforced.</strong> Codex can’t block web access per agent, so that rule goes into the instructions, marked advisory.</li><li><strong>Treat subagents as pure functions.</strong> Read-only roles return text. Only the orchestrator writes to disk or spawns other agents. That keeps “read-only” true everywhere and stops recursive delegation.</li><li><strong>Compile configs as build artifacts.</strong> Generated files carry do-not-edit headers, and CI fails on any diff from the canonical source.</li></ol><p>Here’s a canonical read-only recon agent, the Scout from my setup. Notice there’s no harness in it:</p><pre># .agent/agents/swarm-scout.yaml<br>name: swarm-scout<br>description: Read-only reconnaissance. Maps blast radius before planning.<br>tier: fast<br>capabilities: [read, search]   # no write, shell, web, or delegate<br>skills: [skill-ddd, skill-codebase-recon, skill-context-master]<br>returns: STRATEGIC_RECON.md      # the supervisor writes it<br>prompt: |<br>  Map the blast radius of the requested change using the semantic graph.<br>  Report dependencies and risks. Do not propose fixes.</pre><p>Skills and returns are structured fields on purpose. The adapter layers them around the prompt in whatever form each harness understands. That keeps the prompt to a few lines, and that’s the contract: skills do the heavy lifting, and the agent file only says what you may touch and what you hand back.</p><p>The harness knowledge lives in one map, so there’s one file to update when a vendor changes something:</p><pre># .agent/adapters/map.yaml<br>capabilities:<br>  claude:<br>    read: [Read]<br>    search: [Grep, Glob]<br>    write: [Edit, Write]<br>    shell: [Bash]<br>    web: [WebFetch, WebSearch]<br>    delegate: [Agent]<br>  antigravity:<br>    read: [view_file]<br>    search: [grep_search, list_dir]<br>    write: [replace_file_content]<br>    shell: [run_command]<br>    web: [read_url_content, search_web]<br>  codex:                 # no tool list; capabilities pick a sandbox<br>    read-only: [read, search]<br>    workspace-write: [write, shell]<br>tiers:<br>  fast: {claude: sonnet, antigravity: flash, codex: gpt-6-luna}<br>  deep: {claude: opus,   antigravity: pro,   codex: gpt-6-sol}</pre><h3>Applied to a real swarm</h3><p>My actual workflow has more roles than a scout and an engineer. A supervisor runs a domain-driven conductor loop, and each phase runs as a subagent with its own context, model tier, and tool limits:</p><ul><li><strong>Scout</strong> does read-only reconnaissance. Rather than grepping raw files, the subagent queries a semantic graph of the repo (the AST approach from <a href="https://medium.com/@rb1whitney/stop-dumping-raw-code-into-llms-why-semantic-graphs-lead-to-scalable-ai-agents-707c9c3220b0">my last article</a>) to map the blast radius and call dependencies. It hands that map back to the supervisor as STRATEGIC_RECON.md.</li><li><strong>Architect</strong> turns the recon into a test-first plan and designs the team that will carry it out. It splits the work into bounded pieces, picks the skills each piece needs, and writes a brief for each engineer. It never writes implementation code. Output: EXECUTIVE_PLAN.md.</li><li><strong>Engineers</strong> are spawned on demand, one per piece of the plan, and work in parallel. Each gets a narrow slice of the codebase, only the skills the Architect chose, and a red-green-refactor loop. They can write files and run tests, but they can’t spawn other agents or rewrite the plan.</li><li><strong>Auditor</strong> verifies the combined result in a clean context that never saw any engineer’s conversation. Output: CERTIFICATION_REPORT.md.</li></ul><p>The Architect designs the engineers but never grants their permissions. Every engineer spawns from the same envelope (read, write, run tests, no delegation), and only the supervisor spawns. Bounded slices keep parallel engineers from colliding, and overlapping pieces each get their own worktree.</p><p>Here’s how the skills hang off each agent. Every agent also preloads skill-ddd, the protocol that sequences the phases.</p><pre>.agent/agents/<br>├── swarm-supervisor      spawns agents, writes the artifacts<br>│   └── skill-swarm<br>├── swarm-scout           read + search<br>│   ├── skill-codebase-recon<br>│   └── skill-context-master<br>├── swarm-architect       read + search, plans and designs engineers<br>│   ├── skill-architecture<br>│   └── skill-terraform<br>├── swarm-engineer ×N     spawned on demand, one bounded slice each<br>│   ├── skill-terraform   (skills picked per task by the Architect)<br>│   └── skill-github<br>└── swarm-auditor         read, run tests, no edits<br>    ├── skill-review-suite<br>    └── skill-terraform</pre><p>Look at skill-terraform. It shows up in the Architect, the engineers, and the Auditor, and it&#39;s the same skill every time: same conventions, same module rules. What changes is the envelope around it. The Architect plans with it, an engineer acts on it, and the Auditor checks against it.</p><p>That’s the split I care about. Skills carry knowledge. Agents carry permission. Every phase starts from a written artifact, and an Auditor that never watched the implementation is the whole point of having one.</p><p>Run the four canonical agents through the map and this is what comes out:</p><ul><li><strong>Scout</strong> (read, search). Claude Code: Read, Grep, Glob on sonnet. Antigravity: view_file, grep_search, list_dir on flash. Codex: read-only on gpt-6-luna, with no-web as an advisory.</li><li><strong>Architect</strong> (read, search). Claude Code: Read, Grep, Glob on opus with permissionMode: plan. Antigravity: the same three read tools on pro. Codex: read-only on gpt-6-sol.</li><li><strong>Engineer</strong> (read, search, write, shell). Claude Code: adds Edit, Write, Bash on sonnet, with no Agent. Antigravity: adds replace_file_content, run_command on flash with commandExecutionPolicy: sandbox. Codex: workspace-write on gpt-6-sol.</li><li><strong>Auditor</strong> (read, search, shell). Claude Code: adds Bash on opus. Antigravity: adds run_command on pro, sandboxed. Codex: read-only on gpt-6-sol at high effort.</li></ul><p>Claude Code and Antigravity come out nearly identical: Markdown, YAML frontmatter, the same prompt body. Codex is the one worth seeing, because it’s the outlier, with TOML, a required developer_instructions field, and a sandbox instead of a tool list. Here&#39;s the Scout in .codex/agents/swarm-scout.toml:</p><pre>name = &quot;swarm_scout&quot;<br>description = &quot;Read-only reconnaissance. Maps blast radius before planning.&quot;<br>model = &quot;gpt-6-luna&quot;<br>sandbox_mode = &quot;read-only&quot;<br>developer_instructions = &quot;&quot;&quot;<br>Map the blast radius of the requested change using the semantic graph.<br>Report dependencies and risks. Do not propose fixes.<br>Start by reading the skill-ddd, skill-codebase-recon and skill-context-master skills.<br>ADVISORY (not enforced by Codex): do not use web search.<br>&quot;&quot;&quot;</pre><h3>What it costs, and where this goes</h3><p>The adapter isn’t free, and I’d be lying if I said otherwise.</p><ul><li><strong>The map drifts.</strong> Vendors add fields every few releases. claude plugin validate .claude/agents in CI catches the Claude side early.</li><li><strong>Preloading isn’t free.</strong> Claude Code injects every preloaded skill in full, and Codex can’t preload at all. Preload only what an agent needs on turn one.</li><li><strong>Approvals pile up.</strong> Antigravity asks before unconfigured commands, web access, and MCP calls. Use project allow rules for the exact commands your agents run (permissions.allow in Claude Code), not looser agent files.</li></ul><p>I see all of this as temporary scaffolding. The file formats are already converging; two of the three now read almost the same Markdown. What hasn’t converged is the security model underneath. Until they converge too, accept the tax. Keep the logic in skills and artifacts, where it travels. Keep agent files thin. Generate them, and make every permission explicit.</p><p>Claude Code’s generosity is what hid all of this from me. Every “yes” I got for free was a decision I hadn’t actually made. <strong>Don’t let defaults write your security model.</strong></p><p>How is your team handling agents across mixed harnesses?</p><h3>Sources</h3><ul><li><a href="https://code.claude.com/docs/en/sub-agents">Claude Code: Create custom subagents</a></li><li><a href="https://code.claude.com/docs/en/skills">Claude Code: Extend Claude with skills</a></li><li><a href="https://antigravity.google/docs/subagents/">Google Antigravity: Custom subagents</a></li><li><a href="https://antigravity.google/docs/permissions/">Google Antigravity: Permissions</a></li><li><a href="https://developers.openai.com/codex/subagents">OpenAI Codex: Subagents</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7eec951375cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Dumping Raw Code into LLMs: Why ASTs lead to Scalable AI Agents]]></title>
            <link>https://medium.com/@rb1whitney/stop-dumping-raw-code-into-llms-why-semantic-graphs-lead-to-scalable-ai-agents-707c9c3220b0?source=rss-b8600242692a------2</link>
            <guid isPermaLink="false">https://medium.com/p/707c9c3220b0</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[semantic-graph]]></category>
            <category><![CDATA[local-agent]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Richard Whitney]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 03:53:20 GMT</pubDate>
            <atom:updated>2026-09-06T05:30:18.615Z</atom:updated>
            <content:encoded><![CDATA[<p>Following a discussion on Hacker News around frontier models expanding their context windows, I realized a lot of us treat LLMs as expensive crutches. When did we abandon decades of computer science to just dump raw, 1,500-line files into probabilistic models, hoping they guess the architecture?</p><p>I know I did.</p><p>Clever engineers solved code topology years ago when compiling was expensive. But when compute got cheap, organizations threw those lessons out the window. Harnesses have evolved, but good engineers can still give coding agents a helping hand by fundamentally changing the payload.</p><p>Rather than relying on generic search commands built into most agent harnesses, users need to swap out raw text dumps for a lightweight semantic skeleton. Here is what coding agents are fighting against when they rely on generic raw-text searches:</p><ul><li><strong>Attention Dilution &amp; Hallucinations:</strong> Even if an LLM can “fit” a massive monolith in its context window, it spends its attention budget parsing syntactic noise rather than evaluating architectural trade-offs, leading to phantom dependencies and missed transaction boundaries.</li><li><strong>The Context Caching Trap:</strong> AI researchers will point out that Prompt Caching makes dumping 1,500-line files cheap and fast. That is true for cost, but it ignores the cognitive overload. Just because a model <em>can</em> read a million cached tokens instantly doesn’t mean it accurately extracts the cross-file business logic buried within them.</li><li><strong>High Latency in Multi-Agent Loops:</strong> Brute-force context stuffing makes multi-step agentic reasoning slow. An agent iterating over a complex problem needs tight, deterministic feedback loops, not endless streams of boilerplate.</li></ul><h3>Why Agents Still Miss the Mark</h3><p>One might consider: <em>Wait, don’t modern coding tools already use ASTs?</em></p><p>Yes, they do. But it is how coding agents use them that creates the bottleneck. As we push deeper into frontier models and agentic frameworks, the industry is still treating massive context windows as the primary hammer for every problem.</p><p><strong>The Agentic CLI Approach (Claude, etc.)</strong></p><p>When users run agentic tools from the command line, the agent is primarily equipped with standard bash utilities: ls, grep, find, and cat. While the reasoning model is incredibly sharp, its methodology is exactly what we are trying to avoid: it uses grep to find a keyword, and then uses cat to dump a raw 1,500-line file into its context window. It relies on massive token limits to absorb the noise. It is still brute-forcing the read.</p><p><strong>The Modern IDE Approach (Copilot, etc)</strong></p><p>Good IDEs and AI coding assistants do run AST (Abstract Syntax Tree) parsers (like Tree-sitter) constantly in the background. However, they use them strictly for retrieval and chunking, not for structural mapping. When a user asks a question, the assistant uses the AST to find clean boundaries for related code chunks. But once found, the system still grabs the raw text of those chunks and injects them into the prompt. It is a highly optimized text dump, but it is still a text dump.</p><p>The LLM is never given the larger architectural map. What the agent needs is a query-driven graph of relationships between classes, methods, and objects. Think of the tree like a connected web of Java interfaces: an agent finds its starting point with a simple<strong> </strong>lscommand, and then easily traverses the nodes to see exactly how the architecture connects without the noise of the underlying implementation<strong>.</strong></p><p>Senior engineers constantly warn juniors to step back and look at the big picture rather than getting stuck in the weeds of the implementation. Yet, with current AI tools, we risk shoving our agents headfirst into the weeds and hoping they deduce the architecture.</p><h3>The Structural Payload Difference: Why ASTs Get Us 90% of the Way There</h3><p>Compiler purists will argue that an AST isn’t enough. Tree-sitter is purely syntactic. The tree will know a function is called, but not necessarily what file it lives in. Using a heavy, compiler-grade indexer to map a codebase accurately is better. But in practice, forcing a full setup for every agent interaction often requires a more involved solution that many engineers won’t actually use. A fast, lightweight AST parser gets users 90% of the way.</p><p>By front-running our repositories with tools like Tree-sitter and dumping that syntax into a local graph, we extract deterministic symbol skeletons before ever calling an LLM. Think of it like looking at a satellite image of two cities. If your goal is to drive from one city to the other, you only need a map of the roads connecting them. You don’t need a high-resolution photo of every tree, house, and cloud along the way. Raw code is the photo full of trees; an AST is just the map of the roads.<strong> </strong>Java, Python, Go, Terraform, and Kubernetes metadata files all have a language, and we can model them efficiently to understand relationships quickly. Take this rough analogy:</p><p><strong>Raw Java Source Dump (Brute Force)</strong></p><ul><li><strong>Payload Size:</strong> ~1000s of tokens per class</li><li><strong>Noise Level:</strong> High (imports, formatting, implementation logic)</li><li><strong>Reliability:</strong> Probabilistic (LLM guesses relationships)</li><li><strong>Cost &amp; Speed:</strong> High latency, burns context limits</li></ul><p><strong>AST Structural Catalog (Tree-sitter)</strong></p><ul><li><strong>Payload Size:</strong> ~Couple of Hundred tokens per class</li><li><strong>Noise Level:</strong> Zero (only interfaces, members, signatures, calls)</li><li><strong>Reliability:</strong> Deterministic (Compiler-verified ground truth)</li><li><strong>Cost &amp; Speed:</strong> 95%+ token reduction, near-instant inference</li></ul><p>Break away a class, and the architecture is clear:</p><pre>PaymentOrchestrator [@Service]<br>├── Fields (Injected Members)<br>│   ├── gatewayClient: PaymentGatewayClient<br>│   └── auditLogger: AuditLogger<br>└── Methods<br>    └── processTransaction(PaymentRequest) -&gt; PaymentResult [@Transactional]<br>        ├── Calls: auditLogger.logAttempt()<br>        ├── Calls: gatewayClient.validate()<br>        └── Calls: gatewayClient.charge()</pre><p>Instead of burning tokens on boilerplate, the agent tracks down a likely filename and then traverses the AST graph. This isn’t just theoretical. Projects like <a href="https://github.com/jjdelorme/graphdb-skill">graphdb-skill</a> are already demonstrating how equipping agents with local graph databases built from syntax trees fundamentally shifts how they navigate codebases. When an agent can query a graph instead of running grep, it traces end-to-end architecture and flags missing transaction boundaries with zero guesswork.</p><p>Dumping raw code into an LLM instead of using an AST graph is like running a Bubble Sort when the solution demands a Tree Sort. Engineers grinded LeetCode algorithms to get hired, so why are we throwing fundamental computer science out the window and allowing AI agents to get away with subpar solutions? A mentor of mine once told me, “just because a solution works doesn’t mean it is right.”</p><h3>The Real Power: Downstream Impact and Infrastructure</h3><p>When we give Agent Harnesses an AST map instead of an endless stream of file reads, they stop generating generic guesses. Ask an agent to evaluate a change using a graph query, and <em>it can output a highly accurate blast radius:</em></p><pre>&gt; Give me a full architecture understanding of the Data Service. <br>&gt; Use the AST to query its downstream impact.</pre><pre>▸ Thought: Data Service | Goal: Obtain full architecture understanding <br>▸ Running: semantic_query.py --graph relationship_graph.json trace-dep...</pre><pre>### AST Blast Radius &amp; Downstream Impact Matrix                  <br> Component Modified    | Immediate AST Impact      | Downstream Dependent Files &amp; Blast Radius<br>───────────────────────┼───────────────────────────┼───────────────────────────────────────<br> DataDTO.java          | Field additions/renames   | 1. DataController.java (API contracts)<br>                       |                           | 2. DataService.java (convertToEntity)<br>                       |                           | 3. DataServiceControllerTest.java <br>───────────────────────┼───────────────────────────┼───────────────────────────────────────<br> Data.java             | Column definitions,       | 1. DataService.java <br>                       | constraints, relations    | 2. DataRepository.java<br>                       |                           | 3. db.changelog-master.yaml <br>───────────────────────┼───────────────────────────┼───────────────────────────────────────<br> DataService.java      | Method signatures &amp;       | 1. DataController.java<br>                       | return types              | 2. DataServiceControllerTest.java</pre><p>This solution scales. This example with a simple Java application works exactly the same on a massive monolith with millions of lines of code. ASTs allow us to map relationships when the connections are unclear. I quickly generated my AST logic off the logic from Hacker News examples in Python, and immediately started getting better results everywhere.</p><p>That is because this solution scales beautifully beyond application code into platform code. If you are using Terraform to manage cloud infrastructure, one of the biggest challenges with large workspaces is mapping nested modules directly to their source control in the .terraform cache directory. An AST approach brings the true structure of your infrastructure code to the LLM (even if its buried away in nested modules or private repos). By parsing HCL and Kubernetes manifests into relationship trees, we can link the underlying implementations across several deeply nested structures.</p><p>The LLM is then grounded in reality rather than making up implementations or blindly searching an entire repository for context. No fluff, just stuff. Once you give an LLM a deterministic map of the relationships and the language used, the sky is the limit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*XT4gqsC8pJtM2L2UQGugpQ.png" /></figure><p><strong>Control the input; don’t compensate with prompt size.</strong></p><p>Treat context preparation as a first-class software engineering discipline, not a prompt engineering hack. Don’t ask probabilistic neural networks to solve deterministic problems like AST parsing, symbol indexing, and call graphing. Give them a map, and let them do the driving.</p><ul><li>Hacker New Article: <a href="https://news.ycombinator.com/item?id=47367129">https://news.ycombinator.com/item?id=47367129</a></li><li>Copilot Analysis: <a href="https://gist.github.com/intellectronica/97187d7ea3b59405daa37cd5967582be#31-context-gathering-mechanisms">https://gist.github.com/intellectronica/97187d7ea3b59405daa37cd5967582be#31-context-gathering-mechanisms</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=707c9c3220b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>