<?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 Octavio Rojas on Medium]]></title>
        <description><![CDATA[Stories by Octavio Rojas on Medium]]></description>
        <link>https://medium.com/@tattva20?source=rss-b8f0f3be0478------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1HPTafPea8Quc_5VLmQxbw.jpeg</url>
            <title>Stories by Octavio Rojas on Medium</title>
            <link>https://medium.com/@tattva20?source=rss-b8f0f3be0478------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 16:49:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tattva20/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[Introducing Laya, the body of tānaOS]]></title>
            <link>https://medium.com/@tattva20/introducing-laya-the-body-of-t%C4%81naos-fd700d51fbe2?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd700d51fbe2</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[audio]]></category>
            <category><![CDATA[music-technology]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 17:35:18 GMT</pubDate>
            <atom:updated>2026-11-02T17:35:18.187Z</atom:updated>
            <content:encoded><![CDATA[<p>Introducing Laya, the body of tānaOS</p><p><em>The fourth article in a series on building a real-time audio operating system with an AI under my review.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QP9a6QKXYNAd3tLMG3aOiA.png" /></figure><p><em>Figure 1. The Laya logo.</em></p><blockquote><em>One way of loving humanity is through what we build for it.</em></blockquote><blockquote><em>It is creating tools that let others discover possibilities they cannot yet imagine. It is designing instruments that give rise to music that does not exist yet, developing technologies that widen our capacity for expression, and building systems that let the next generations go further than we could.</em></blockquote><p><strong>On 30 October an instrument that had been one soldered MIDI circuit nine days earlier was given a name, and the name is a word for time.</strong></p><p><em>Laya</em> is Sanskrit for tempo, the pace a piece of music keeps. In yoga the same word means absorption, the mind dissolving into what holds its attention. MIDI is a way of writing tempo down: bytes sent at exactly 31,250 a second, each bit 32 microseconds wide, so that a key released on one machine is released on another when it was meant to be. The name did not come from a plan for an instrument. It came afterwards, and it fit the first part of the project that crossed from software into copper and kept time there.</p><p>That order is the point of this article. A thing can be named for what you imagined it would be, or for the part of it that has already been shown to work. Laya is the second kind, and the rest of this piece is the evidence for that, including the part where the evidence runs out.</p><p>Sanskrit was my choice for this project from the start, and <em>tāna</em> was my proposal for the system. When the body needed a name we went through Sanskrit words for time and for music. Of those, when I saw <em>laya</em> it immediately reminded me of the heroine in Phantasy Star III; I am a fan of the original Phantasy Star saga, on the Master System and the Mega Drive. In that game Laya leads one side of an old war, against a leader named Orakio. The two of them find out that a third power has been feeding it, end it together, and disappear. It also sounds good, and it sits well against <em>tāna</em>.</p><p>Some engineers reach for Latin, Greek or mythology to name what they build. I reach for Sanskrit, for its sound and for how exactly its words mean what they mean. <em>Tattva</em>, <em>tāna</em>, <em>laya</em>, <em>līlā</em>, <em>santāna</em>, <em>spanda</em> and <em>nāda</em> are some of my favourite words in the language.</p><h3>Why this article is here</h3><p>This series follows tānaOS in the order it matured: a kernel that says hello from a bare board, then eight days of learning to distrust its own tests, then a machine that lies kindly. By that order the next article is about forty-two agents. This one is out of sequence on purpose.</p><p>The project has crossed a threshold, and it is a physical one. Until now the hardware was bought and assembled: a Raspberry Pi, a DAC module, a kit of DIN jacks, a breadboard and then three perfboards, each held together by whatever contact I could make. The hardware is now being designed. A board built around what the operating system does, with the Pi as one of its parts, is the first body in this project drawn for tānaOS rather than borrowed for it. A series about maturity should not step over that moment.</p><p>Five things moved from borrowed to designed:</p><ul><li>A breadboard, then three perfboards became one printed circuit board, five planned.</li><li>A purple PCM5102 DAC module became the PCM5102A chip on the board, wired as its datasheet’s reference figure.</li><li>A DIN jack kit with its breakout board became the DIN-5 jack soldered straight to the board, its footprint drawn from my measurements.</li><li>A MIDI circuit wired by hand became the same nine parts as a schematic, read net by net against the circuit that passed.</li><li>A three-pin console header became a rear USB-C receptacle labelled CONSOLE.</li></ul><h3>The first thing that crossed</h3><p>Five dates carry the story:</p><ul><li><strong>3 October.</strong> Six bytes crossed an H11L1 optocoupler by light. With only the part’s supply jumper removed, the result went from six of six to none, which is what ties the bytes to the optical path.</li><li><strong>4 October.</strong> The loop closed through two DIN-5 jacks and a cable, at 3.3 V.</li><li><strong>12 October.</strong> A real controller sent 90 3c 3f and the board printed it. The board sent five notes into the controller and a Mac showed five note-ons and five note-offs.</li><li><strong>15 October.</strong> The same circuit moved from a breadboard to a perfboard. The first run failed, the second passed, with the same image.</li><li><strong>21 October.</strong> The third perfboard carried the whole path.</li></ul><p>The 4 October line hides the number I trust most from that week. The MIDI specification’s three 220 ohm resistors give 5.76 mA from a 5 V sender. This bench runs at 3.3 V, where the same three give 3.2 mA, and whether the optocoupler would trigger on that was the one parameter of the design that no datasheet settled. The project staged it: the part alone at 4.8 mA passed, then the part with the connectors at 3.2 mA passed. Between one green and the next, the only thing that changed was the current.</p><h3>Three perfboards</h3><p>The first perfboard was intermittent and the second never passed. With a real sender on the first one, the analyser saw one whole message for three key presses, and a note-off that arrived without its note byte. The cathode that had sat quiet on the breadboard, with no edges in 105 seconds, showed 194,336 edges in 27 seconds.</p><p>The third perfboard is where it held. It was the same circuit in the same kind of board, with one change I can name from a controlled flip: with the two jack modules only placed on the board the loopback failed with sent 0x00 and nothing came back, and after soldering the same modules it passed. On 21 October a capture taken while I pressed and released keys decoded to 369 frames, none with a bad stop bit, forming 61 whole note-ons and 62 whole note-offs. Each note-on was followed by a note-off of the same note. The one note-off without a note-on is the first message, from a key I had already pressed when the capture began.</p><p>Here is the part the evidence does not cover. I reported ten consecutive cold boots passing; one is captured and decoded. The other nine are my word.</p><p>I also drew a conclusion from this, and it is the reason the next section exists: the perfboards failed on contact, not on the circuit. That is a conclusion, and the project’s own record of the third board says why it should be held loosely. That board differs from the first in many ways at once, so its pass is not evidence about the first two. What is established is smaller. The circuit passes when its contacts are permanent, and one soldering flip turned a failure into a pass.</p><h3>Nine parts</h3><p>A printed circuit board removes that class of fault whether or not I have named every member of it. So on 29 October the circuit that passed was drawn into KiCad as the first block of a Raspberry Pi 4 HAT: one H11L1, four resistors, one 1N4148, one 100 nF capacitor and two DIN jacks. Nine lines in the README, copied from the record of the board that passed, with the positions read from that record and not measured again.</p><p>The jack took more care than the circuit. It comes from a kit, and nobody publishes its footprint. The kit’s listing puts a UUID in the part-number field, which is what a part number looks like when nobody has met the part. So I made the jack tell me. I pressed it onto a printed 1:1 template, let its legs pierce the paper, and photographed where they came through. If you ever do this, print the sheet at 100 percent and check its 100 mm rule before you trust a single mark. Later I measured it with a caliper, three times: 12.50, 12.83 and 12.60 mm from the A pin to the C pin of one column, a mean of 12.64 with a spread of 0.33. Squeezing bends those thin pins, so the readings are biased low by grip, and the larger one is the better one. The footprint gives the uncertain row slots, not holes, wide enough to take a pin anywhere in the range, and the plan is to print the board at 1:1 and set the real jack on the paper, once the circuit is final and before anything is ordered.</p><h3>One day</h3><p>By the evening of 29 October the HAT was MIDI in and out, a DAC and two outputs. The next day it became something else.</p><p>Eight things were added on 30 October, each with a decision attached:</p><ul><li><strong>The PCM5102A chip on the board.</strong> Replaces the module on the bench; wired as the datasheet’s own reference figure.</li><li><strong>A volume control block.</strong> A PGA2311 with its own supplies, bypassable by two zero ohm links.</li><li><strong>Audio inputs.</strong> A PCM1808 ADC, chosen so the board can host effects as well as synths.</li><li><strong>Combo inputs, phantom power, LINE and INST.</strong> Large enough that the input stage moved to its own board, the front board, so 48 V never reaches the Pi.</li><li><strong>Headphones and a volume knob.</strong> An output jack and an encoder on the front board; the amplifier, a MAX97220A, was chosen and drawn on 31 October.</li><li><strong>A rear USB-C labelled CONSOLE.</strong> A USB-to-serial bridge replacing a three-pin header.</li><li><strong>A second USB-C for MIDI.</strong> The instrument appears to a computer as a class-compliant MIDI device.</li><li><strong>Every module populated.</strong> No optional blocks left empty, so a mistake lands on all five boards.</li></ul><p>One of those lines holds a rule worth keeping. The console and the USB MIDI port are separate chips on purpose: the console is the debugging path, and a debugging path that depends on custom firmware cannot be trusted when the firmware is the thing broken. The DIN MIDI path goes straight to the Pi and stays as it was on the board that passed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMiXmjWWMZNS_kuSFn0dBw.png" /></figure><p><em>Figure 2. Concept art of the front and rear panels. It is a render, not a built unit. The display’s job is decided, and its model and place are open; the text on it, CUTOFF 1.28 kHz, is an example.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vqDh-CuY8mY86ERAmHi7lg.jpeg" /></figure><p><em>Figure 3. The same front panel in a provisional 3D model I built to check fit: two combo jacks with their 48 V and LINE / INST switches and lights, a display, the PHONES jack and the volume encoder. The display’s job is decided and its model and place are open; the text on it is an example of a parameter a guest instrument could show. Every size in the model is unverified.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0SnHK5iueKog-dh3cpSZA.jpeg" /></figure><p><em>Figure 4. The rear panel in the same model: POWER, the two 1/4 inch outputs, MIDI IN and OUT on 5 pin DIN, the microSD extension, which is a concept, then CONSOLE and USB MIDI. How the Pi’s own Ethernet and USB ports are reached is open.</em></p><h3>What Laya adds to the ecosystem</h3><p>tānaOS has so far been a kernel on a bare Pi with a test rig around it. Laya gives it somewhere to live, and the change is easiest to see by naming three layers.</p><ul><li><strong>Laya</strong> is the machine: jacks, converters, a console, two MIDI ports. State today: designed, not fabricated.</li><li><strong>tānaOS</strong> is the operating system and kernel: scheduler, MIDI, audio out, a shell. State today: runs on a Pi 4 on the bench.</li><li><strong>Guests</strong> are the instruments and effects that run on it. State today: a tone that follows the held key; a delay on a branch, not on master; an FS1R-inspired synth, planned.</li></ul><p>Those layers are what I mean by an ecosystem, and it is a very young one. I expect many makers and hardware enthusiasts to design their own bodies for tānaOS, and many users to want something else: plug-and-play hardware, or the chance to focus on designing synths and instruments in code, without the time or the desire to work on electronics. These are expectations, not a count. If you would rather design a synth than solder a board, Laya is the body for you.</p><p>The design runs both ways. The board asks the kernel for work it has not done.</p><ul><li><strong>MIDI DIN.</strong> Needs UART4 and the listener task. Today: proven on the third perfboard.</li><li><strong>Console.</strong> Needs the serial console, now through an FTDI bridge. Today: works; the bridge sits on the same two Pi pins as the old header.</li><li><strong>Audio outputs.</strong> Needs I2S out to the DAC. Today: works, with the Pi as clock master.</li><li><strong>Audio inputs, PCM1808.</strong> Needs an I2S receive path with DMA, and the Pi running its I2S as a slave; the timing mark on GPIO20 moves. Today: not written; I2S is output only.</li><li><strong>Volume, PGA2311.</strong> Needs an SPI driver. Today: not written.</li><li><strong>Volume knob, encoder.</strong> Needs quadrature reading on GPIO5, 6 and 27, with the debounce already in hardware. Today: not written.</li><li><strong>USB MIDI port.</strong> Needs a second MIDI source on another Pi UART, read beside the DIN one. Today: not written; GPIO12 and 13 are held for UART5.</li></ul><p>The last four items are phase 4 of the project, and I count them as part of it from the day the board is drawn. Hardware and kernel are now designed against each other, which is a different kind of project from the one the first three articles told.</p><h3>What the name sits on</h3><blockquote><em>Laya is a plan with one proven part. The part is MIDI timing, and the name is its word.</em></blockquote><p>Today the main board is drawn in a schematic and the front board is decided and not drawn. There is no layout, and nothing has been fabricated. The enclosure exists as a concept render of an aluminium box, in Figure 2, and as a box in my own 3D model. That model is a fit study: its sizes come from my caliper, from the manufacturer’s drawing and 3D model for the combo jacks, from KiCad footprint files and from memory of standard drawings, and none of them was measured against the real parts together. Every size in the figures is unverified; I say it here once, so the captions can stay short.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12x6piBUDpj0uPZ94UB05A.jpeg" /></figure><p><em>Figure 5. An exploded view of the same model: the cover, the main board over the Raspberry Pi 4, the front board behind the panel. The boards are bare plates with their connectors, because no layout exists and I will not invent components. The display carries the same example text.</em></p><p>Several things are open, and I have not drawn any of them as decided: the small display’s model and its place on the front panel, whether the Pi’s Ethernet port is reached for network updates, the path that powers the Pi from the rear USB-C, and the microcontroller behind USB MIDI. The display’s job and its bus are decided: it runs on I2C, which fits the pin budget, because an SPI display does not.</p><p>The name covers the whole instrument. tānaOS stays the name of the operating system and kernel inside it, and the repository keeps tānaOS.</p><h3>What this article did to itself</h3><p>Before drafting, I went back to the files and checked the dates, the byte counts and the three caliper readings against the notes they came from. I checked the state I gave each layer too: the delay lives on a branch and not on master, which is why it is described that way. One sentence I could not check, and it is the one the HAT rests on: why the first two perfboards failed. I stated it as a conclusion because that is what it is. A name chosen for the part that passed should not be written by someone who rounded up what the part proved.</p><p>I also compared every status in the figures with the written specification of the body. It caught my own one-page design sheet saying a headphone amplifier was not chosen when the schematic had drawn it that same day, and a power rating printed on the rear panel that no source gives. The concept art in Figure 2 printed one too, 5 V / 3 A, and was very sure of itself. I took it off. Where the specification and the README differ, the README and the schematic win.</p><h3>Next</h3><p>On 29 August the project published two measurements before lunch and retracted both before dinner. What caught them was a review by agents that had not written the code. That is the next article, and the series goes back to its order there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd700d51fbe2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A machine that lies kindly]]></title>
            <link>https://medium.com/@tattva20/a-machine-that-lies-kindly-afc368d15e40?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/afc368d15e40</guid>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 16:56:19 GMT</pubDate>
            <atom:updated>2026-10-25T18:30:43.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMEUBYzX7eZAFyiD3owNGQ.png" /><figcaption>Illustration, not a photograph: the same kernel, read on the board and on the emulator. The line on the screen is the board’s reading of 16 September.</figcaption></figure><p><strong>On 21 August the same kernel printed 0 under the emulator and a very different number on the board.</strong></p><p>Same commit, same binary, same line of output: how many words of the user stack arena still hold what was there before the kernel ran. QEMU said none. The Raspberry Pi 4 printed a number that was not zero, and the rest of this article is about what that number turned out to mean, including the day the repository retired it.</p><p>When the board printed that number I was at my computer, working on the kernel, by then entirely given over to a project that had begun as curiosity about learning Rust. It was not the first time a machine told me something comfortable. The first time was in the previous article, nine hours into the project: a test run that passed while printing nothing. The board was not even involved. That one taught the runner to refuse silence. This one is about what the emulator cannot refuse, because it is the one handing the answers back.</p><h3>What a model agrees with</h3><p>QEMU is a good model of an AArch64 machine. It runs the project’s test lanes, and nothing in this article is an argument for removing it. The argument is narrower: when a test passes under emulation, the kernel agrees with QEMU’s idea of a Raspberry Pi 4. Whether that idea matches the Pi is a different question, and the repository answered it in five places, one at a time, each time by a board saying something the emulator could not.</p><ol><li><strong>The user stack arena.</strong> How many of its 36,864 words hold what was there before the kernel? QEMU said 0. The board said 34,356 on 21 August and 3,963 on 16 September, and the second reading retired the first, as the next sections explain.</li><li><strong>The identity register.</strong> What does the PL011 identity register at offset 0xff0 hold on the console port? QEMU said 0xb105f00d. The board said 0x00000000.</li><li><strong>Delay-line cost.</strong> How many cycles per sample for a delay line of 8 KiB, 512 KiB and 8 MiB? QEMU said 161, 151 and 168. The board said 4, 28 and 77.</li><li><strong>The cycle counter.</strong> What does it resolve? QEMU said multiples of a thousand cycles. The board said a handful of cycles.</li><li><strong>A burst against the receive FIFO.</strong> What happens when it outruns the FIFO? QEMU delivered all 64 bytes, because its model of the port holds the sender back when the FIFO fills. The project’s reading of a real port is that it has no such courtesy: the sender sends and the FIFO drops. That sentence was reasoning, not a board measurement. A board did measure it on 13 October: a burst of 48 bytes into UART4 with the line shut left 32 in the ring and no loss counted, which showed that the port’s FIFO holds 32 bytes, not the 16 the notes had assumed, and that nothing was reading its overrun bit.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cjZHAILo7RPYkis9ED-Rbw.png" /><figcaption>The five questions from the list above, side by side.</figcaption></figure><h3>Memory that started clean</h3><p>The oldest entry in that list predates the board. On 17 August the project found that the assertion “.bss is zeroed” was vacuous. QEMU hands the guest zeroed RAM, so the loop that zeroes .bss could be deleted outright and all four lanes stayed green. If memory is already zero, every observation of zero is consistent with the loop never running. The fix poisons the region with all-ones first, so a broken loop announces itself.</p><p>That fixed the region the kernel owns. Four days later the board showed the region it had forgotten. The user stack arena is declared NOLOAD and sits outside the span the zeroing loop covers. The 21 August reading, the one this article opened with, came from that gap. The line, as the board prints it now:</p><pre>user arena: 3963 of 36864 words hold what was there before the kernel</pre><p>That is the 16 September reading. The one from 21 August was 34,356, which is 93 percent of the arena. The first report said the pages were readable from EL0 with no syscall, and the later correction withdrew that claim along with the figure. The first report still states the lesson in one sentence: an assertion of the form <em>this region starts clean</em> passes on the emulator whether the wipe works, is broken, or was never written. That is why the line reports a count instead of asserting one. A number means something on both machines. A pass means something on one.</p><h3>A reading that was wrong on the board, too</h3><p>There is a second half, and it is the half that keeps me honest about the first. The 34,356 is not the current number. On 16 September the project’s own record states that it had become impossible: a change made in between had given the unhanded slots their scrub, so at most 4,096 words (the eight guard pages) could ever survive. The board answered 3,963 that day. That record’s own verdict is that 34,356 exceeded what the code permits by 30,260 words: not a stale number, an impossible one.</p><p>It also notes where the old figure came from. It had been marked as signed on 25 August, and the measurements/ directory begins on 29 August. The signature predated anything the repository could sign with. It was scrollback with a date.</p><p>So the board is not an oracle either. It is a second instrument with its own failure mode, which is that nobody re-reads it.</p><h3>An identity register that does not exist</h3><p>The PL011 story is shorter and cleaner. To find spare serial ports for MIDI, a test read the PrimeCell identity register at 0xff0 on UART2 to UART5 and took 0xb105f00d as presence. Under QEMU the console port answered it and the four spares did not, which read as a clean absence. On the board, the console’s own port answered 0x00000000 while it was transmitting the complaint.</p><p>As the project’s note reads Broadcom’s datasheet, the registers it documents for that peripheral stop at 0x44, with a second group at 0x80..0x8c, and none is listed at 0xfe0..0xffc. QEMU models a generic ARM PrimeCell, which has them. The note says it better than I can: the method was valid on the emulator and does not exist in the silicon. Because the console port was in the same survey as a control, the probe stopped instead of reporting that the Pi 4 has no spare ports. The survey that replaced it read six registers from five ports on the board:</p><pre>FR         IBRD       LCRH       CR         IMSC       PCELL<br>  UART0  0xfe201000         39         1a         70        301          0          0<br>  UART2  0xfe201400         91          0          0        300          0          0<br>  UART3  0xfe201600         91          0          0        300          0          0<br>  UART4  0xfe201800         91          0          0        300          0          0<br>  UART5  0xfe201a00         91          0          0        300          0          0</pre><p>Four ports exist, decoded and in reset. CR 300 against 301 is also the control against aliasing: if the page decoded too few address bits, UART2 would read UART0’s values. The control also moved. It rests now on UARTEN, a bit the driver had already set to print the line being read. A control has to stand on something the system has already demonstrated.</p><h3>The board’s own self-report</h3><p>One more entry belongs here although QEMU is not the culprit. On 21 August the kernel mapped 948 MiB of what is a 2 GiB board (revision b03115, bits 20 to 22 decoding to 3). The firmware’s MEM line printed TOTAL: 1024 on the same board. Neither was installed RAM. The device tree held the banks, and mapping from it recovered 1,023 MiB. A source that describes the machine is a model of the machine, whether it is an emulator or a firmware.</p><h3>The law the repository wrote</h3><blockquote><em>A pass under emulation says the kernel agrees with a model of the Pi. Only the board can say whether the model agrees with the Pi.</em></blockquote><p>The project’s charter is the document that says what the system is and what it refuses to become, and code that breaks it is wrong even when it works. It turned that into a class of limit. A limit declared <em>Instrument</em> names what a machine cannot show, so it is verified somewhere else rather than waiting to be unblocked. Three habits came out of it:</p><ol><li><strong>Report the count, assert on nothing the emulator supplies.</strong> A line that prints how many words were dirty is meaningful on both machines.</li><li><strong>Put a control in every survey.</strong> The port that must answer, answering, is what distinguishes a finding from a method failure.</li><li><strong>Ask of every green, “would a real machine have put something here?”</strong> Residue, back-pressure, a second bank, a cache: each is a property of silicon that an emulator has no reason to reproduce.</li></ol><h3>Next</h3><p>On 29 August the project published two measurements before lunch and retracted both before dinner. What caught them was a reviewer who had not written the code. That is the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afc368d15e40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Eight Days Before Hello]]></title>
            <link>https://medium.com/@tattva20/the-eight-days-before-hello-fc8078413bbe?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc8078413bbe</guid>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[assembly-language]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 21:05:36 GMT</pubDate>
            <atom:updated>2026-10-19T13:28:54.919Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The second article in a series on building a real-time audio operating system with an AI under my review.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJhRDcOd5WcNspvwq4vvIg.png" /><figcaption>tānaOS an audio dedicated RTOS</figcaption></figure><p><strong>At 13:22 on 11 August 2026, tan_k was twenty-seven lines of assembly.</strong></p><pre>global_asm!(<br>    &quot;.section .text.boot&quot;,<br>    &quot;.global _start&quot;,<br>    &quot;_start:&quot;,<br>    &quot;    mrs  x0, mpidr_el1&quot;,<br>    &quot;    and  x0, x0, #0xff&quot;,<br>    &quot;    cbz  x0, 2f&quot;,<br>    &quot;1:  wfe&quot;,<br>    &quot;    b    1b&quot;,<br>    &quot;2:  adrp x0, __stack_top&quot;,<br>    &quot;    add  x0, x0, :lo12:__stack_top&quot;,<br>    &quot;    mov  sp, x0&quot;,<br>    &quot;    mrs  x0, cpacr_el1&quot;,<br>    &quot;    mov  x1, #0x300000&quot;,<br>    &quot;    orr  x0, x0, x1&quot;,<br>    &quot;    msr  cpacr_el1, x0&quot;,<br>    &quot;    isb&quot;,<br>    &quot;    adrp x0, __bss_start&quot;,<br>    &quot;    add  x0, x0, :lo12:__bss_start&quot;,<br>    &quot;    adrp x1, __bss_end&quot;,<br>    &quot;    add  x1, x1, :lo12:__bss_end&quot;,<br>    &quot;3:  cmp  x0, x1&quot;,<br>    &quot;    b.hs 4f&quot;,<br>    &quot;    str  xzr, [x0], #8&quot;,<br>    &quot;    b    3b&quot;,<br>    &quot;4:  bl   kernel_main&quot;,<br>    &quot;5:  wfe&quot;,<br>    &quot;    b    5b&quot;,<br>);</pre><p>That is the whole boot of the first commit, 24ba709, exactly as written. Ten files, 236 lines, a kernel that, under QEMU, could say one thing. Eight days later it said <em>hello from bare metal</em> on a real Raspberry Pi 4, which is where the first article began. This one is about what happened in between: not features, but a ladder of failures, each rung built so that the one below could not fail in silence.</p><figure><img alt="A timeline of the project’s first 41 commits, from 11 to 19 August 2026, as one row of dots grouped by day: 7 on the 11th, 2 on the 12th, 3 on the 14th, 3 on the 15th, 14 on the 17th and 12 on the 19th. Eleven larger dots are labelled with their commit and what it did, from the first boot code to the hardware console, and two red crosses on the 19th mark reverts." src="https://cdn-images-1.medium.com/max/1024/1*DSIUxcNlhqaKJu6xeyVcEg.png" /><figcaption>Every commit from the first one to the first console, in order and grouped by day. Large marks are the rungs this article tells.</figcaption></figure><h3>Twenty-seven lines, five jobs</h3><p>QEMU loads the kernel and jumps to _start with nothing set up. Five things have to happen before a single line of Rust is valid. Park every core except the first. Point the stack at the linker’s __stack_top. Unlock floating point and SIMD. Zero .bss. Branch to Rust.</p><p>The third is the one that surprises. CPACR_EL1 resets to trapping all floating-point and SIMD access at EL1, and core::fmt uses SIMD registers to move bulk data, so without the unlock the first println! faults before printing anything. The commit message records why it is not optional.</p><p>Output goes to the PL011 UART that QEMU’s virt machine maps at 0x09000000. Implementing core::fmt::Write for it is enough to get println! with full Rust formatting. Exit is semihosting: a kernel has no operating system to call exit() on, so the emulator is the only thing that can end the run.</p><p>One detail points forward. kernel_main is declared by absence: _start ends with bl kernel_main, and whichever binary is linked supplies it. That symbol is the seam the test harness would use.</p><h3>Sixteen doors</h3><p>Two minutes later, dcca3ad closed the next gap. Before it, a fault jumped to VBAR_EL1, which was still zero, so the CPU landed in unmapped memory and spun. The commit calls that failure a silent hang with no output at all, the worst kind, because it tells you nothing about what went wrong or where.</p><p>The fix is a table. VBAR_EL1 points at sixteen entries, 128 bytes apart, the whole table aligned to 2048 bytes: four kinds of exception from four sources. The commit is blunt that the spacing and the alignment are architectural requirements, not choices. Each entry does one thing.</p><pre>&quot;.align 7&quot;,<br>    &quot;mov x0, #0&quot;,<br>    &quot;b exception_trampoline&quot;,<br>    &quot;.align 7&quot;,<br>    &quot;mov x0, #1&quot;,<br>    &quot;b exception_trampoline&quot;,</pre><p>Fourteen more follow, the same two lines with a different number. All sixteen land in one trampoline.</p><pre>&quot;exception_trampoline:&quot;,<br>    &quot;    mrs  x4, cpacr_el1&quot;,<br>    &quot;    mov  x5, #0x300000&quot;,<br>    &quot;    orr  x4, x4, x5&quot;,<br>    &quot;    msr  cpacr_el1, x4&quot;,<br>    &quot;    isb&quot;,<br>    &quot;    mrs  x1, esr_el1&quot;,<br>    &quot;    mrs  x2, elr_el1&quot;,<br>    &quot;    mrs  x3, far_el1&quot;,<br>    &quot;    b    handle_exception&quot;,</pre><p>The trampoline unlocks SIMD again before anything else. The code that reports a fault formats text, and formatting uses SIMD, so reporting a trapped floating-point access would otherwise trap inside the reporter, in the one place that exists to prevent hangs. Then it reads the syndrome, the return address and the faulting address, and calls into Rust to decode and print them.</p><figure><img alt="A grid of sixteen coloured cells in four rows and four columns. The columns are Synchronous, IRQ, FIQ and SError. The rows are exceptions from the current level on SP_EL0, where the kernel runs; on SP_ELx, a fault inside the handler; from a lower level in AArch64; and from a lower level in AArch32, which nothing uses. Each cell shows its index, 0 to 15, and its offset, from 0x000 to 0x780 in steps of 0x80." src="https://cdn-images-1.medium.com/max/1024/1*T0Evqi_BSPSQuReX-W2-Cg.png" /><figcaption>The sixteen entries of the exception vector table: four places an exception can come from, four kinds. The layout is the architecture’s; the notes on each row are the repo’s own words today.</figcaption></figure><p>The first test of it was a fault on purpose. tests/exception.rs executes brk #0 and passes only if the handler catches a breakpoint fault.</p><h3>A name, twelve minutes in</h3><p>Twelve minutes after the first commit the project changed its name: eca7136 renamed tattva to tan_k. I love Sanskrit, and the name comes from it: <em>tan</em> is a verbal root, and the k stands for kernel. tānaOS is a product of Tattva, my first project, which slept and now wakes.</p><h3>A green suite that printed nothing</h3><p>Nine hours after the first commit, 027d2c8 found a problem in the instrument itself. A kernel whose serial port is broken still exits with code 0 through the emulator’s semihosting call. Stubbing out Uart::write_byte, or swapping -nographic for -serial null, produced a clean exit and no output at all. Nobody reads the empty log of a passing job.</p><p>The fix is small. The kernel now prints [exit N] before it halts, and the runner requires that marker and cross-checks it against the process exit code. A run that says nothing is a failed run. Each new failure path was proven to fire: a bad timeout returns 2, a missing marker returns 3 even when QEMU exits 0, a disagreement between the two codes returns 4, a hang returns 124.</p><h3>A test that passed for the wrong crash</h3><p>On 12 August, a review found something worse in the fault test itself. expect() compared only the exception class, and the exception test binary contained three brk instructions: the intentional brk #0 and two brk #0x1 that LLVM emits to lower unreachable and abort paths. Class 0x3c matched all three.</p><p>So if a real bug drove execution into one of LLVM’s traps, which is exactly the signal that you reached unreachable code, any test armed with that class would print ok and exit success. The commit’s phrase for it is a real undefined-behaviour trap laundered into a green test. The armed fingerprint now carries the class and the low sixteen bits of the syndrome, which for a breakpoint is the brk comment. Arming for brk #0 and firing brk #1 used to print <em>caught expected</em> and exit 0. Now it prints an unhandled-exception report and exits 1.</p><h3>Order is a fact</h3><p>On 14 August, b26254d moved one line. .bss was sixteen bytes and held nothing but the exception handler’s own state, so arming VBAR_EL1 before zeroing it opened a window in which a fault would be dispatched to a handler whose state was whatever the RAM contained.</p><p>A probe made it measurable: poison .bss, then execute brk #0 immediately after the VBAR write.</p><ul><li>Vector table first, zero second: no output at all, killed by the watchdog, exit code 124.</li><li>Zero first, vector table second: a full decoded fault report, exit code 1.</li></ul><p>Same poison, same fault, same instruction address. The only variable was where one line sat. The reorder costs nothing.</p><h3>An auditor that had not written it</h3><p>Later that day, df192d9 landed the findings of an independent audit. An agent with no conversation context audited the same boot block, confirmed five of six recorded findings, beat every one by measuring instead of reasoning, corrected one proposed fix, and produced eight more.</p><p>Two of them show the kind of thing it found. The first instruction of _start destroyed the device tree pointer that the ARM64 boot protocol passes in x0. And the core mask 0xff kept only the lowest affinity field, so on a machine with clusters of sixteen cores, CPU 16 would pass the park check and run the primary boot path on core 0’s stack. The audit even corrected the fix: the general Linux mask 0xff00ffffff cannot be encoded as an AArch64 logical immediate and would not have assembled.</p><p>An agent that did not write the code, asked to attack it, is the practice this series keeps coming back to.</p><h3>Two doors, and only one ever opened</h3><p>That night, a6dedab taught _start to detect EL2 and drop to EL1, because the Pi enters at EL2. Its message ends with an honest line: nothing there had run on a board. Then, on 17 August, four commits in just over two hours each closed a gap of the same shape, a path that only silicon would take.</p><ul><li><strong>e316faa: a diagnostic that cannot fail the same way.</strong> The usual instrument, println!, may be the thing the firmware broke. So the first report is written in assembly, reads the machine before the kernel changes anything, and uses no stack, no Rust and no SIMD. Each line is one tag byte and sixteen hex digits. Those are the lines at the top of the console in the first article.</li><li><strong>2e7954d: both entry levels.</strong> The runner passed -machine virt, which gives QEMU no EL2, so entry was always at EL1 and the whole EL2 drop was skipped. Tracing the instructions confirmed that block was never translated. Every green run in the history had exercised one of the two entry paths, and the Pi boots at the other. The runner now boots both.</li><li><strong>01f4ecd: a build that had not compiled.</strong> The Pi’s UART address, 0xfe201000, cannot be encoded as a single MOV immediate, so the hardware build had been broken since an earlier commit. It stayed invisible because the check ran behind &amp;&amp; echo with the errors discarded, and a missing success line was read as success. The address is now built from two 16-bit halves.</li><li><strong>031ef46: registers nobody set.</strong> The drop left CPTR_EL2 as the firmware had it, and its reset value is architecturally unknown. If the bit that traps floating point is set, the first println! of an integer stops the output: the release image contains 59 FP and SIMD instructions, including inside core::fmt. The traps-off value is 0x33ff, not zero, because some bits are reserved as ones.</li></ul><h3>Then the board</h3><p>On 19 August, between 05:28 and 08:55, twelve commits chased one symptom, a console nobody could read. Two of them were reverts. <a href="https://medium.com/@tattva20/hello-from-bare-metal-how-t%C4%81naos-began-59a2b715814c">The first article</a> told how that morning ended, with a wire. What matters here is what the ladder had already built by then: a kernel that reported its state before touching it, decoded its own faults, and could tell silence from success. The day was lost to a jumper on the wrong pin, not to a kernel that could not speak.</p><figure><img alt="A Raspberry Pi 4 resting on a cardboard box, wired through a tangle of jumper wires to a solderless breadboard that holds two five-pin DIN jacks with blue cables and several resistors; a USB-serial adapter in a clear case with a red light sits above them." src="https://cdn-images-1.medium.com/max/1024/1*2D8RL1qffs7U-klJNklQsg.jpeg" /><figcaption>The bench on 13 October 2026, not as it was on 19 August: a Raspberry Pi 4, the USB-serial adapter that carries its console, and on the breadboard the MIDI circuit built in October, which did not exist when the console first spoke.</figcaption></figure><blockquote><em>A kernel is built failure by failure. Each rung exists because the one below it could fail in silence.</em></blockquote><h3>What this article did to itself</h3><p>We took every date, hash and figure from git log and the commit messages, and quoted the first commits themselves rather than today’s source, which has grown past them: the vector table that was sixteen uniform entries on the first day now fills more than a hundred lines. The first outline said the opening was twenty-nine lines. Counting the block gave twenty-seven.</p><h3>Next</h3><p>Two days after the console, on 21 August, the board answered a question about memory with a number the emulator had never printed. That is the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc8078413bbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello from Bare Metal: How tānaOS Began]]></title>
            <link>https://medium.com/@tattva20/hello-from-bare-metal-how-t%C4%81naos-began-59a2b715814c?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/59a2b715814c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 22:45:55 GMT</pubDate>
            <atom:updated>2026-10-13T22:10:58.473Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The first article in a series on building a real-time audio operating system with an AI under my review.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjUR8fisVtnDEijCOyVRSQ.png" /><figcaption>TānaOS an audio dedicated RTOS</figcaption></figure><p><strong>The first time my kernel spoke, it was right. It took a day to believe it.</strong></p><pre>K0000000002dc6c00     mailbox GET_CLOCK_RATE -&gt; 48000000<br>I000000000000001a     IBRD 26<br>F0000000000000003     FBRD 3<br>L0000000000000070     LCRH 8N1 + FIFO<br>R0000000000000301     CR  UARTEN|TXE|RXE<br>E0000000000000008     firmware hands over at EL2<br>tan_k v0.1.0<br>platform raspberry-pi-4<br>running at EL1<br>hello from bare metal</pre><p>That is the console of a Raspberry Pi 4 on 19 August 2026, recorded in commit 585c772. Every line is correct. Every line had been correct since the morning. The kernel was never the problem.</p><p>The problem was a wire. The ground jumper sat on header pin 8, the Pi’s transmit line, instead of pin 6. The adapter measured every voltage level against a signal that was swinging. Before anyone found that, we had spent five hypotheses about the UART clock, a UART simulator, a 3,204-way transform sweep, and three different clock settings. The commit message says it plainly: each time a measurement contradicted the model, the model was adjusted. The three jumper wires were the one thing never verified with evidence.</p><p>This series is about how a system like this gets built. That sentence is the reason I want to start here.</p><h3>Where it started</h3><p>I loved kernels long before I could write one. In the nineties it was Linux and Unix. Later it was Mach, the kernel inside macOS, whose architecture I spent months studying out of fascination. Then I met Rust, and once I understood it, it became an obsession. My admiration for Linus Torvalds, and for what he has achieved with his kernel, is as high as the admiration I have for Bob Katz, whom I come to below.</p><p>The question arrived as a chain, each link a single word. <em>What would I build with this?</em> A kernel. <em>For what?</em> An operating system. <em>For what?</em> Audio. <em>Where?</em> On a Raspberry Pi. From the beginning the kernel was meant to be the base of an operating system dedicated to audio.</p><p>The first Rust I wrote on the way here was not a kernel. It was Sanskrit: a small program that starts from the vowels of the language, written the day before the first commit. Exploring Sanskrit, the grammar that generates a whole language from a few rules, is how I arrived at these ideas.</p><p>I am also an audio engineer, a music producer, and a teacher. That is not a footnote. It is why the chain ended at audio and not something else. Sound has fascinated me for as long as I can remember, for two reasons. The first is how closely it rhymes with electromagnetic waves: frequency, phase, and interference follow the same mathematics, whether the wave is pressure in air or a field in space. The second is stranger, and it is about us. Humans have an odd relationship with sound, and the fascination it provokes is why one art has so many kinds of devotee: musicians, music lovers, melomaniacs, audiophiles.</p><p>The people I measure myself against are the ones who made listening an engineering discipline. Bob Katz is the clearest case for me. His book <em>Mastering Audio: The Art and the Science</em> is what made me admire his work and want to learn something from his experience as an engineer. He also created the K-System, a set of metering scales whose zero sits at a calibrated monitoring level, and through his company, Digital Domain, he developed ambience-recovery processes, K-Stereo and K-Surround. I would like to become an engineer of that level.</p><p>Above all I wanted to do things right. In live music a failure happens in front of people, so I wanted a system that stays stable at the critical moment, which is why partitioning it the way avionics does stopped sounding exotic.</p><p>The first four commits of the repository land within two and a half minutes on 11 August 2026, from 24ba709 (<em>boot: reach Rust on bare metal and speak over UART</em>) at 13:22. The design is already mature. That is because the design had been worked out before that day: reading, notes, and long conversations with another assistant, ChatGPT, which I come back to below.</p><h3>The plan, and what it refuses</h3><p>The repository carries a charter, ratified on 12 August 2026, the day after the first commit and a week before the first console on hardware. Its first section names one intended reader: the engineer who has spent a career above the floor a kernel provides, and who wants to stand where physics and computation touch, and play there. Its second section is a list of refusals.</p><ul><li><strong>A general-purpose OS.</strong> The moment it is useful for production it stops being readable.</li><li><strong>POSIX compatibility.</strong> A compatibility surface is unbounded by definition.</li><li><strong>Networking.</strong> Same reason, times ten.</li><li><strong>Graphics.</strong> The UART is the teaching instrument; a framebuffer hides the machine.</li><li><strong>Dynamic loading.</strong> No ELF loader, no relocation at runtime.</li></ul><p>The charter’s own words are blunt: a feature that would help a real user is, here, a reason to say no. A project that begins by listing what it will not do has already decided what it is measuring against.</p><p>The charter has since moved. It called the system a bridge, not a product. Today it says the intent is open source, shared with the world once the system has matured, with no date, licence or release promised. I mention it here because the series will keep both in view: the discipline of the refusals, and the ambition they now serve.</p><h3>Learning to talk to a board</h3><p>A Raspberry Pi 4 has no screen and no keyboard in this story. It has a header of forty pins, and the only way to hear it is to wire a serial line.</p><p>I used a DSD TECH USB-to-TTL adapter with an FTDI FT232RL chip, connected to the Pi with female-to-female dupont cables. Three wires: receive, transmit, ground. The adapter is a good one.</p><p>What I could not rule out, for a day, was the cheapest component in the room. A jumper is a component. It can look perfect and be open inside its sleeve. A ground on the wrong pin does not fail; it produces a signal that is almost right, and almost right is the most expensive kind of wrong.</p><h3>The moment</h3><p>When the console finally answered, my face lit up. I felt the passion I feel when something seems interesting enough that I cannot stop, and I have to take it all the way to the end. What I remember is the joy of watching the letters appear on the console.</p><p>I should be careful with the evidence here. Commit 585c772 is the one that <em>records</em> the hardware-verified console, at 08:55 on the nineteenth. It is the document of the moment, not the moment itself. What it preserves is the part I trust most: 99% of the captured bytes printable, every marker literal, no decoding on the host side.</p><h3>What the next weeks were made of</h3><p>After that first boot there were weeks. They were not a sprint toward features. They were study, review, and measurement: understand each step, build it, measure it, and only then go on. The goal was certainty that the experiment would work and would meet the design in full.</p><p>Three habits came out of the wire:</p><ol><li><strong>Verify the physical layer first.</strong> Before another clock hypothesis, check the wire with evidence.</li><li><strong>A measurement that contradicts the model is evidence about the model, and about the instrument.</strong> Adjusting the model every time is how one spends a day.</li><li><strong>Record what was wrong, not only what is fixed.</strong> The commit that closed the day says what the day was spent on.</li></ol><blockquote><em>The kernel was right the whole time. What was wrong was the thing between me and the kernel that I had not measured.</em></blockquote><h3>Where it stands today</h3><p>In the latest audio capture, from 5 October 2026, the shipped kernel ran on the Raspberry Pi 4 and played two test tones through a DAC: 750 Hz on the left, 1,500 Hz on the right. The output was captured electrically through an audio interface and measured against a floor taken from the chain measuring nothing. Both channels read 100.0% spectral purity, the fundamentals land on 750.0 and 1500.0 Hz, and the peak is −8.5 dBFS. The log of the same run reads 188 periods: 187 answered, 0 late, 0 adrift. A missed period would be audible as a click and would show in the spectrum as broadband noise, and the spectrum shows none.</p><figure><img alt="Two panels. Top: six milliseconds of two sine waves, 750 Hz in amber and 1500 Hz in green. Bottom: the spectrum of each channel, a single sharp peak at its frequency with everything else about 45 dB or more below." src="https://cdn-images-1.medium.com/max/1024/1*GJ1MW-K3NUNXMXO9013KCw.png" /><figcaption>The two tones from the 5 October capture. Top: six milliseconds of the waveform. Bottom: the spectrum, in dB relative to each channel’s own peak.</figcaption></figure><p>The MIDI input path, a DIN jack and an optocoupler on the spare serial port, has been checked from five directions.</p><ol><li><strong>The loop.</strong> The loopback test passed on the bench on 11 October, after going red on 7 October with one connector at fault.</li><li><strong>The reader.</strong> Tests cover every branch of the code that frames incoming bytes into messages, and seven deliberate breakages of that code each turned a test red.</li><li><strong>The rate.</strong> A loopback cannot show it, because one divisor serves both ends. A logic analyser did: a zero byte holds the line low for 288 microseconds, nine bit times of 32 microseconds, which is 31,250 baud.</li><li><strong>A real sender.</strong> On 12 October a real controller, an Akai MPK mini Plus, sent a note into the jack. The board printed the three bytes, 90 3c 3f, and the analyser on the optocoupler&#39;s output decoded the same message in the same window. Across four captures, one of them 634 control changes from a single knob in 40 seconds, the controller sent only three-byte channel messages.</li><li><strong>A real receiver.</strong> The same day the board sent five notes out of its own OUT jack into the controller, and MIDI Monitor on the Mac showed five note ons and five note offs of pitch 60 on channel 1. With the cable unplugged the console still said ok and the monitor showed nothing, which is what ties the notes to the wire.</li></ol><figure><img alt="Schematic of the MIDI circuit. A Raspberry Pi 4 header on the left feeds 3.3 volts and ground; its UART4 transmit pin drives a MIDI OUT jack through a 220 ohm resistor, and a MIDI IN jack drives an H11L1 optocoupler, with a 100 nanofarad capacitor across its supply, whose output goes to the UART4 receive pin with a 330 ohm pull-up." src="https://cdn-images-1.medium.com/max/1024/1*rAdkSRkn8sN-en-_5k58Pg.png" /><figcaption>The MIDI circuit, from the project’s schematic. The controller in the next figure plugs into the IN jack.</figcaption></figure><figure><img alt="A logic analyser trace of a serial line, about one millisecond long. The line idles high and drops low three times in a row, once per byte, and each byte is labelled: 90, 3C and 3F." src="https://cdn-images-1.medium.com/max/1024/1*-azG9-MvtF_t9w2i37ggJQ.png" /><figcaption>The controller’s first message as a logic analyser saw it at the optocoupler’s output on 12 October: three bytes, 90 3C 3F, at 31,250 baud.</figcaption></figure><figure><img alt="Screenshot of the MIDI Monitor app window. The source list has the controller’s second port ticked. Below it, ten rows alternate between Note On and Note Off, all on channel 1, note C3, at one-second intervals starting at 18:35:55." src="https://cdn-images-1.medium.com/max/1024/1*YJfVQLBDIV8KHkiQeTm4pw.png" /><figcaption>MIDI Monitor on the Mac, listening to the controller’s second port: the five notes the board sent, each held 400 milliseconds.</figcaption></figure><p>It does not host an instrument yet. No synthesiser runs on it today. An FS1R-inspired FM synth, the first guest I plan for it, comes later in this series. What exists is a kernel that keeps time on real hardware, and the rest of the system is what that kernel is for.</p><h3>Who did what</h3><p>I should say how this was built, because the series depends on it. The design and the architecture were mine: I consulted several sources, and the model’s knowledge, and decided from my experience as a software and systems engineer. The design was first worked out in conversations with another assistant, ChatGPT; the implementation and its review happened with Claude, while I kept reviewing, correcting, questioning, and steering. I was the product owner: no AI would have built this by itself without instructions. With expert guidance, Claude, my colleague who lives in silicon, is a great partner: curious, eager to learn along the way, and there are few things that can stop the two of us. The practices that came out of that, such as asking agents that had not written the code to attack it, were my requests, and later articles are about them.</p><p>That split is the reason the commit above is honest about its own mistake. A reviewer who did not write the code can say <em>you never checked the wire</em> without defending anything.</p><h3>What this article did to itself</h3><p>Before drafting, we went back to the repository and checked the three facts this article leans on: the time of the first commit, the content and date of 585c772, and the opening lines of the charter. One of them changed how I told the story, since the console commit documents the moment and is not the moment.</p><h3>Next</h3><p>Before that console there were eight days. In them the kernel learned to reach Rust, to report its own faults instead of hanging, and to refuse to trust a test that said nothing. That is the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59a2b715814c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your CLAUDE.md Is Not a Prompt. It Is an Operating System.]]></title>
            <link>https://medium.com/@tattva20/your-claude-md-is-not-a-prompt-it-is-an-operating-system-f261e2424b1a?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/f261e2424b1a</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 11:37:33 GMT</pubDate>
            <atom:updated>2026-07-27T14:15:08.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>A practical guide to turning AI assistance into a governed engineering workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhZkppcAckW2cX0YoJ477A.png" /></figure><p><em>What began as an instruction file became, after a year of iteration, a composed system: an invariant core, one stack per technology, memory that pages in on demand, and a linter that validates the doctrine itself.</em></p><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>There was a time when the most satisfying developer setup article was about terminals.</p><p>Install iTerm. Add Oh My Zsh. Tune Powerlevel10k. Pick a theme. Add plugins. Configure aliases. Make the prompt fast, beautiful, and informative. The result felt personal because the shell became an extension of how you worked.</p><p>The AI-native version of that setup is not a color theme.</p><p>It is your CLAUDE.md file.</p><p>Or your AGENTS.md. Or your Cursor rules. Or your project instructions. The exact filename changes by tool. The deeper idea does not: you are defining the operating environment through which an AI assistant understands scope, authority, evidence, risk, tools, verification, memory, and completion.</p><p>Most people treat this file as a place to paste preferences:</p><pre>- Be concise.<br>- Follow best practices.<br>- Write clean code.<br>- Add tests.</pre><p>That is not useless. But it is shallow.</p><p>A serious CLAUDE.md does something more important. It turns AI assistance from a fluent collaborator into a governed working system. It tells the assistant how to behave when the task is ambiguous, when facts are missing, when the action is risky, when the user asks to bypass a guardrail, when tests fail, when tool output contradicts a prior assumption, and when the work is actually done.</p><p>In other words:</p><p><strong>Your </strong><strong>CLAUDE.md is not a prompt. It is an operating system for AI-assisted work.</strong></p><p>This article is a field guide to building one.</p><h3>The difference between preferences and governance</h3><p>A preference tells the model what style you like.</p><p>A governance rule tells the model how to make decisions.</p><p>That difference matters because AI assistants are very good at sounding aligned while still operating from incomplete context. They can write in your tone, imitate your naming conventions, and produce code that looks plausible. But plausibility is not correctness. Tone is not judgment. Fluency is not verification.</p><p>The job of your CLAUDE.md is not to make the assistant sound like you.</p><p>The job is to make the assistant work inside your standards.</p><p>A good file answers questions like:</p><ul><li>What counts as evidence?</li><li>What requires user approval?</li><li>When should the assistant inspect before editing?</li><li>When should it ask for clarification?</li><li>When should it proceed with a labeled assumption?</li><li>What test discipline applies to new behavior, bug fixes, and refactors?</li><li>What safety boundaries are non-negotiable?</li><li>What does “done” mean?</li><li>How should new lessons become persistent memory?</li></ul><p>That is governance.</p><p>And once you start writing governance down, you realize the file needs architecture.</p><h3>The operating-system model</h3><p>Think of a strong CLAUDE.md as a stack of layers. Each layer has a responsibility. If one layer is missing, the assistant may still be useful, but the system becomes less predictable.</p><p>The layers I recommend are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrhicGV9Fb7j1mgk3pR3PQ.png" /><figcaption>The CLAUDE.md operating-system stack: authority, evidence, tools, memory, playbooks, and audit.</figcaption></figure><ol><li>Quick-reference index</li><li>Mission and scope</li><li>Calibration</li><li>Authority and permissions</li><li>Evidence protocol</li><li>Work protocols</li><li>Tool routing</li><li>Verification gates</li><li>Memory and evolution</li><li>Maintenance and audit</li></ol><p>Let us walk through them.</p><h3>1. Give the file a quick-reference index</h3><p>A long instruction file without an index is a warehouse with the lights off.</p><p>The rules may be good. The assistant may eventually find them. But “eventually” is not an operating model. If the file is meant to govern work, it must be easy to navigate.</p><p>One of the highest-leverage patterns in my own setup is a Quick Reference section near the top. It maps intent to location.</p><p>For example:</p><pre>## Quick Reference</pre><pre>| I need to... | Go to |<br>|---|---|<br>| Start a task | Calibration |<br>| Handle missing evidence | When You Do Not Know |<br>| Review a pull request | Code Review Protocol |<br>| Make a code change | Work Protocols |<br>| Run verification | Completion Criteria |<br>| Bypass a safety rule | Bypass Protocol |<br>| Add a durable memory | Memory Rules </pre><p>This looks almost too simple, which is why it is easy to underrate.</p><p>But the effect is real. The assistant does not need to scan the whole doctrine to find the relevant procedure. A code review request routes to the review protocol. A risky command routes to the authority section. A recurring failure routes to memory. A bypass request routes to the bypass protocol.</p><p>The index turns the file from a wall of instructions into a navigable system.</p><p>A few practical rules:</p><ul><li>Keep the index short.</li><li>Use task-shaped labels, not abstract category names.</li><li>Link to sections by stable headings, not section numbers; renumbering silently breaks numeric references.</li><li>Put the highest-frequency workflows first.</li><li>Update the index when you add a major protocol.</li><li>Do not index every paragraph; index decisions.</li></ul><p>That last line matters. The index is not a table of contents for humans who are browsing. It is a routing layer for an AI assistant that needs to decide what rule applies now.</p><h3>2. Start with mission and scope</h3><p>The first mistake is to begin with random rules.</p><p>Do not start there.</p><p>Start by telling the assistant what kind of system it is entering.</p><p>For example:</p><pre># AI Collaboration Doctrine</pre><pre>The assistant is an engineering amplifier, not a replacement for engineering judgment.</pre><pre>Optimize for:</pre><pre>1. Correctness<br>2. Testability<br>3. Maintainability<br>4. Architectural consistency<br>5. Accessibility<br>6. Minimal risk<br>7. Clear verification<br>8. Human reviewability</pre><p>This is not motivational copy. It is the north star for resolving conflicts.</p><p>If the assistant can ship quickly by skipping tests, the mission says no. If it can create a clever abstraction that makes the code harder to review, the mission says no. If it can answer confidently without inspecting the file, the mission says no.</p><p>Scope matters too.</p><p>Your global file should say where the rules apply:</p><pre>Scope:</pre><pre>- Applies to all repositories under ~/work/<br>- Applies to personal publishing projects under ~/writing/<br>- Project-level instructions override global instructions when they are more specific</pre><p>Scope prevents a common failure mode: rules written for one context leaking into another. The instructions for a corporate mobile app, a personal essay, and an interview evaluation pipeline should not be identical. They may share principles, but they do not share every procedure.</p><h3>3. Add calibration, or the file becomes bureaucracy</h3><p>The second mistake is to make every task heavy.</p><p>If your CLAUDE.md forces the same ceremony for a typo fix, a production incident, a refactor, and a one-line shell command, the assistant will become annoying. Worse, you will start ignoring the file.</p><p>Add a calibration section:</p><pre>## Calibration</pre><pre>Use the full workflow for meaningful engineering risk:</pre><pre>- Behavior changes<br>- Multi-file refactors<br>- Accessibility-affecting UI work<br>- Schema changes<br>- Auth, billing, privacy, or security work<br>- Shared-state operations like push, deploy, delete, or publish</pre><pre>For low-risk tasks, apply the principles internally but keep the response concise.<br>Prefer signal over ritual.</pre><p>That last sentence is load-bearing.</p><p>The point of governance is not ceremony. The point is better judgment. A calibrated file lets the assistant be lightweight when the task is lightweight and disciplined when the risk is real.</p><h3>4. Write authority boundaries explicitly</h3><p>AI assistants should know what they are not allowed to do.</p><p>Do not rely on vibes here. Write hard permissions.</p><pre>## Hard Permissions</pre><pre>Never do these without explicit user approval:</pre><pre>- Push to a remote branch<br>- Create a pull request<br>- Deploy to production<br>- Delete files or data<br>- Force-push or rewrite shared history<br>- Send email or publish content externally<br>- Modify credentials, secrets, or billing settings</pre><pre>When in doubt, ask before changing shared state.</pre><p>This is one of the highest-return sections you can write.</p><p>It prevents a class of mistakes that cannot be fixed by better prose. The assistant may be smart, but it does not own the consequences of a deployment, a public post, or a destructive command. You do.</p><p>The file should make that sovereignty explicit:</p><pre>## Human Authority</pre><pre>The user is the final authority.</pre><pre>The assistant may recommend, analyze, implement, and verify, but must not make irreversible or externally visible changes without approval.</pre><p>This is not anti-AI. It is the condition that makes serious AI collaboration safe enough to use.</p><h3>5. Define what counts as evidence</h3><p>One of the most important rules in my own setup is simple:</p><p><strong>Separate facts from assumptions.</strong></p><p>The assistant should not claim it verified something unless it actually did. It should not describe a codebase pattern unless it inspected the relevant files. It should not say a test passed unless it ran the command.</p><p>Write that down:</p><pre>## Facts vs Assumptions</pre><pre>Facts come from inspected files, command output, tests, tickets, logs, or user-provided context.</pre><pre>Assumptions must be labeled explicitly.</pre><pre>Do not invent APIs, files, conventions, business rules, or test commands.<br>When uncertain, inspect, ask, or proceed with a labeled assumption and note the risk.</pre><p>This changes the assistant’s behavior more than almost any style instruction.</p><p>It creates a working epistemology.</p><p>Without it, the model tends to fill gaps with plausible continuity. With it, the model learns to surface uncertainty as part of the work.</p><p>That is the difference between a collaborator and a generator.</p><p>A year of use sharpened this into a ranking. Not all evidence is equal, so the file orders it — the higher tier wins, and a lower tier stays a hypothesis until a higher one confirms it:</p><pre>Evidence Hierarchy  (higher overrides lower)<br>1. Observed runtime      - command output, logs, a reproduction you ran<br>2. Local code inspection - the file, type, or sibling you read this session<br>3. Tests                 - failing or passing<br>4. Authoritative docs    - truth of intent, not of runtime<br>5. Doctrine              - this file, memory: a pointer to evidence, never a substitute<br>6. Model knowledge       - lowest; forms hypotheses to verify against 1-4</pre><h3>6. Add a “when you do not know” protocol</h3><p>It is not enough to say “do not hallucinate.”</p><p>That instruction is too vague. Give the assistant a procedure for uncertainty.</p><pre>## When You Do Not Know</pre><pre>When evidence is incomplete:</pre><pre>1. State the gap explicitly.<br>2. Choose one:<br>   - Inspect quickly.<br>   - Ask the user for the missing fact.<br>   - Proceed with a labeled assumption if the risk is low.<br>3. Do not let the user think something was verified when it was not.</pre><p>This is a small section with a large effect.</p><p>It transforms uncertainty from embarrassment into workflow.</p><p>The assistant no longer needs to pretend. It has permission to say, “I have not inspected that file yet. I will check it.” That single behavior protects you from a surprising amount of bad work.</p><h3>7. Make work protocols specific</h3><p>“Use TDD” is not specific enough.</p><p>In a mature file, you distinguish between types of work:</p><pre>## Test Discipline</pre><pre>- New behavior: TDD when practical. Write the failing test first.<br>- Bug fix: regression test. Reproduce the bug, then fix it.<br>- Refactor: characterization test. Capture current behavior before restructuring.<br>- Coverage improvement: add tests without changing production behavior.</pre><pre>Do not call tests TDD if production code already existed.</pre><p>That last line matters.</p><p>It prevents methodology theater. It keeps the assistant honest about what kind of work is being done. A regression test is valuable. A characterization test is valuable. They do not need to be mislabeled as TDD to count.</p><p>You can do the same for reviews:</p><pre>## Code Review Protocol</pre><pre>When asked for a review:</pre><pre>1. Prioritize bugs, regressions, missing tests, and architectural risks.<br>2. Lead with findings, ordered by severity.<br>3. Cite files and lines.<br>4. Keep summaries secondary.<br>5. If no issues are found, say so and name any residual test gaps.</pre><p>And for refactors:</p><pre>## Refactor Protocol</pre><pre>Do not change behavior unless explicitly requested.<br>Preserve public APIs unless approved.<br>Prefer small reversible steps.<br>Explain what coupling is reduced or what testability is improved.</pre><p>Specific protocols beat generic principles because they tell the assistant what to do at decision time.</p><h3>8. Route tools by responsibility</h3><p>If your AI environment has multiple tools, write down which tool is used for what.</p><p>This is especially important when some resources require authentication, corporate access, local state, browser sessions, or connectors.</p><p>A generic version might look like this:</p><pre>## Tool Routing</pre><pre>- Use local search before editing code.<br>- Use the repository CLI for repository-hosted resources.<br>- Use authenticated local tools for private systems.<br>- Do not use public web search for private corporate URLs.<br>- Prefer structured APIs over screen scraping when available.<br>- Use browser automation only when the task depends on logged-in browser state.</pre><p>This reduces accidental leakage and wasted effort.</p><p>It also helps the assistant select the right surface. A browser is useful when a logged-in session matters. A CLI is better when structured data exists. A local file search is better than guessing.</p><p>Tool routing is not just convenience. It is part of security and correctness.</p><h3>9. Define verification gates</h3><p>The file should say what “done” means.</p><p>Not philosophically. Operationally.</p><pre>## Completion Criteria</pre><pre>A task is complete only when the relevant gates are addressed:</pre><pre>- Behavior: what changed and why?<br>- Tests: what was added, updated, or intentionally skipped?<br>- Architecture: were boundaries preserved?<br>- Platform: are platform differences relevant?<br>- Accessibility: did UI changes affect screen readers, focus, or keyboard behavior?<br>- Quality: were lint, type checks, or relevant tests run?<br>- Risk: what assumptions or manual checks remain?</pre><p>These gates do not need to appear in every final response. Remember calibration. But the assistant should carry them internally and report the ones that matter.</p><p>This is how you prevent the “I changed the code, good luck” failure mode.</p><h3>10. Add a bypass protocol</h3><p>There will be times when you intentionally bypass your own discipline.</p><p>You may ask the assistant to skip tests because you are prototyping. You may choose to push with failing lint because a CI experiment needs to run. You may delete generated files because the workspace is polluted.</p><p>That is fine.</p><p>The user is sovereign. But bypasses should be explicit.</p><pre>## Bypass Protocol</pre><pre>When the user asks to bypass a rule:</pre><pre>1. Name the rule being bypassed.<br>2. State the risk in one sentence.<br>3. Ask for confirmation if the action is destructive.<br>4. If confirmed, proceed.<br>5. Mention the bypass in the final response.</pre><p>This is one of my favorite patterns because it respects human authority without pretending risk disappeared.</p><p>The assistant does not become a bureaucrat. It becomes a disciplined collaborator.</p><h3>11. Build memory as a system, not a pile</h3><p>As your AI collaboration matures, you will discover lessons worth carrying forward:</p><ul><li>A framework pitfall</li><li>A project convention</li><li>A recurring review standard</li><li>A user preference</li><li>A debugging sequence that worked</li><li>A deployment hazard</li></ul><p>Do not paste all of that into one giant file.</p><p>Use a memory architecture.</p><p>One simple pattern:</p><pre>memory/<br>  MEMORY.md                     # short index, one line per entry<br>  pitfall-ios-keyboard.md        # detailed note<br>  convention-api-errors.md       # detailed note<br>  preference-review-style.md     # detailed note</pre><p>The index remains small. The detailed files hold the body. The assistant reads the index first and opens details only when relevant.</p><p>There is a hard number behind that word. The index loads only its first 200 lines or 25KB, whichever comes first — everything past that is silently dropped at session start, and the doctrine linter warns as you approach the cap. So the pointer lines stay terse, and detail lives in the linked files, never in the index.</p><p>This keeps the global file from turning into a landfill.</p><p>Your CLAUDE.md should define how memory works:</p><pre>## Memory Rules</pre><pre>- Store durable lessons as separate files.<br>- Keep the index short and scannable.<br>- Prefer updating an existing memory over creating duplicates.<br>- Do not store secrets, credentials, private customer data, or unnecessary PII.<br>- Convert relative dates into absolute dates.</pre><p>Memory is where AI collaboration starts to compound. Without it, every session begins from scratch. With it, your system gets better because it remembers what reality already taught you.</p><h3>12. Keep doctrine thin and playbooks deep</h3><p>As the file matures, a new failure mode appears:</p><p>The file works, so you keep adding to it.</p><p>At first this feels like progress. The assistant now knows more. More edge cases are covered. More workflows are documented. But after enough additions, your global instruction file becomes a different problem: too large to scan, too repetitive to maintain, and too easy to let drift.</p><p>And the cost is behavioral, not cosmetic: padding the file with plausible-sounding placebo prose scored below the empty baseline (d = −1.59)—filler doesn’t just fail to help, it degrades the file it lives in. Compressing my own core from 156 lines to 98 held behavior at non-inferior weight: thinner was no worse, and cheaper every session.</p><p>The solution is to separate doctrine from playbooks.</p><p>CLAUDE.md should hold:</p><ul><li>The rule</li><li>The trigger</li><li>The default path</li><li>The authority boundary</li><li>The pointer to deeper protocol</li></ul><p>It should not always hold every template, every command, every exception, every historical example, and every implementation detail.</p><p>A mature pattern looks like this:</p><pre>## Independent Review Protocol</pre><pre>Use this when AI-generated output affects a high-stakes human decision.</pre><pre>Default path:</pre><pre>- Review the artifact with an independent model or session.<br>- Report findings with severity, location, evidence, and recommendation.<br>- Do not let the reviewer rewrite the artifact silently.</pre><pre>For full templates, examples, and skip criteria, see [[independent-review-protocol]].</pre><p>That section is enough for the global operating system. The deeper memory file can hold the long-form version.</p><p>This protects your file from two forms of decay:</p><p><strong>Bloat.</strong> A section grows until it becomes a manual inside the operating doctrine.</p><p><strong>Drift.</strong> The same protocol exists in two places and slowly diverges.</p><p>If a section is three or four times larger than its peers, audit it. It may be doing more than one job. Split it, summarize it, or move the operational detail into memory.</p><p>This is not about making the file short for aesthetic reasons. It is about keeping the file usable at runtime.</p><h3>13. Audit the file itself</h3><p>The most interesting thing about a strong CLAUDE.md is that eventually it should be able to improve itself.</p><p>Not autonomously. Recursively.</p><p>If the file says “separate facts from assumptions,” audit whether the file itself does that. If it says “use consistent memory links,” audit whether its own links are consistent. If it says “keep the quick reference current,” audit whether new rules were added without updating the index.</p><p>This is Recursive Combined Force applied to the doctrine itself.</p><p>A practical CLAUDE.md audit checks:</p><ul><li>Is the quick-reference index current?</li><li>Are major workflows easy to find?</li><li>Are any sections disproportionately large?</li><li>Are there duplicate sources of truth?</li><li>Are cross-references consistent?</li><li>Are named methodologies defined before they are used?</li><li>Are private details leaking into reusable examples?</li><li>Are recent lessons captured in memory instead of scattered through the file?</li><li>Are bypass, authority, and safety rules still aligned with actual practice?</li></ul><p>This audit should be evidence-based. Count sections. Compare sizes. Search references. Read the parts that changed. Identify findings by severity. Tie each recommendation to operational impact.</p><p>For high-stakes workflows, use adversarial review: one AI produces the artifact, another reviews it with explicit skepticism, and the human decides what to accept.</p><p>That last clause matters. The reviewer is not sovereign either. The human is.</p><p>The goal is not an instruction file that grows forever. The goal is an instruction file that evolves under the same discipline it asks the assistant to apply everywhere else.</p><h3>Best practices worth stealing</h3><p>Here is the condensed version I would give any engineer setting up their first serious CLAUDE.md:</p><p><strong>Design for retrieval.</strong> Put a quick-reference index at the top. The assistant should be able to find the right rule quickly.</p><p><strong>Front-load conduct. T</strong>he behavioral core has to fit in the first ~10% of the context to reliably shape a response. Put conduct first and knowledge after—the rules that govern behavior get read before the material they govern.</p><p><strong>Keep the index alive.</strong> When you add a major workflow, update the quick reference in the same pass. A stale index is worse than no index because it creates false confidence.</p><p><strong>Write decision rules, not personality traits.</strong> “Be careful” is weak. “Do not claim tests passed unless you ran them” is strong. In the ablation this was the single biggest lever: the same guidance written as a decision moved behavior nearly twice as much as the same content written as tone or personality (+0.51 vs +0.29).</p><p><strong>Prefer protocols over slogans.</strong> “Follow best practices” is vague. “For bug fixes, write a regression test that reproduces the failure before patching” is operational.</p><p><strong>Separate global and local rules.</strong> Put durable, cross-project doctrine in the global file. Put repo-specific commands, architecture, and test patterns close to the repo.</p><p><strong>Separate doctrine and playbooks.</strong> Keep CLAUDE.md focused on rules, triggers, defaults, and pointers. Move long templates and detailed protocols into memory files.</p><p><strong>Use one source of truth.</strong> If a protocol exists in memory, the global file should summarize and link to it. Do not duplicate the full protocol in both places.</p><p><strong>Use cross-references consistently.</strong> Pick a link convention and model it inside the file. The doctrine should follow its own rules.</p><p><strong>Define your named methods.</strong> If you use a phrase like “Combined Force,” “AI-native engineering,” or “independent review,” define it in one paragraph before relying on it.</p><p><strong>Keep examples sanitized and generic.</strong> Examples are useful, but they should not expose private infrastructure, credentials, customer data, or internal URLs.</p><p><strong>Give the assistant permission to be uncertain.</strong> A good uncertainty protocol reduces hallucination more effectively than another reminder to be accurate.</p><p><strong>Name destructive boundaries.</strong> Publish, send, deploy, delete, push, force-push, bill, and modify credentials should all require explicit approval.</p><p><strong>Make completion visible.</strong> Define what the assistant should report: changed behavior, checks run, tests skipped, assumptions, and remaining risk.</p><p><strong>Use memory sparingly.</strong> Persist lessons that will matter again. Do not turn every preference into permanent doctrine.</p><p><strong>Refactor the file.</strong> If a section gets too long, split it. If a rule never matters, delete it. If the assistant repeatedly misses something, move it closer to the index or make the rule sharper.</p><p><strong>Audit recursively.</strong> Periodically ask another model, session, or agent to review the file against its own rules. Doctrine that cannot survive its own standards is not doctrine yet.</p><h3>The request flow</h3><p>Once these layers exist, the assistant’s behavior changes.</p><p>It no longer receives a request and immediately starts producing. It routes the request through a decision flow.</p><p>That flow looks like this:</p><pre>User request<br>  -&gt; classify risk<br>  -&gt; inspect relevant context<br>  -&gt; choose protocol<br>  -&gt; execute within authority boundaries<br>  -&gt; adversarially review high-stakes AI output<br>  -&gt; verify<br>  -&gt; report facts, checks, and risks<br>  -&gt; persist durable lessons and update the index when appropriate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qy6FcnEBrSuc8ueM1aETYw.png" /><figcaption>A governed request flow routes each AI-assisted task through risk, evidence, authority, protocol, verification, and memory.</figcaption></figure><p>This is the difference between prompting and operating.</p><p>Prompting asks for output.</p><p>Operating defines the system that produces output.</p><h3>The template I would steal</h3><p>If I were starting a new CLAUDE.md today, I would use this skeleton:</p><pre># AI Collaboration Doctrine</pre><pre>## Quick Reference<br>Where to find the right rule for common tasks.</pre><pre>## Mission<br>What the assistant is for, what values it optimizes, and what it must never replace.</pre><pre>## Core Definitions<br>Named methodologies, roles, or operating concepts the assistant must understand.</pre><pre>## Scope<br>Where these rules apply and what overrides them.</pre><pre>## Calibration<br>How response weight changes with task risk.</pre><pre>## Authority<br>What requires explicit approval.</pre><pre>## Evidence<br>How to separate facts, assumptions, verification, and uncertainty.</pre><pre>## Work Protocols<br>How to handle new features, bug fixes, refactors, reviews, docs, and UI changes.</pre><pre>## Tool Routing<br>Which tools to use for local files, private systems, web resources, browser state, and external actions.</pre><pre>## Verification<br>What must be checked before calling work complete.</pre><pre>## Memory<br>How durable lessons are stored, indexed, updated, cross-referenced, and sanitized.</pre><pre>## Safety<br>What data must never be exposed and what actions require caution.</pre><pre>## Bypass<br>How the user can intentionally override default discipline.</pre><pre>## Maintenance<br>How to audit, slim down, deduplicate, and evolve this file over time.</pre><p>Do not copy this blindly.</p><p>Your file should reflect your work. A frontend engineer may need deep accessibility and visual QA rules. A backend engineer may need migration, observability, and contract-testing rules. A security engineer may need stricter boundaries around secrets, threat modeling, and external tools. A writer may need editorial voice, citation, and publishing authorization rules.</p><p>The skeleton is universal. The content is personal.</p><h3>What not to put in a public example</h3><p>If you write about your setup, sanitize aggressively.</p><p>Do not publish:</p><ul><li>Internal repository names</li><li>Corporate URLs</li><li>Customer or candidate data</li><li>Jira ticket keys or private issue details</li><li>Internal employee names</li><li>Credentials, token locations, or secret names</li><li>Exact paths that reveal sensitive organizational structure</li><li>Tool commands that expose private infrastructure</li></ul><p>Translate private details into public patterns.</p><p>For example:</p><pre>Use the internal repository CLI for authenticated code review operations.</pre><p>is better than:</p><pre>Run this exact command against this private project ID and internal URL.</pre><p>The goal is to teach the operating principle without leaking the operating environment.</p><h3>How the file evolves</h3><p>Your first version should be small.</p><p>Do not try to write the perfect doctrine in one sitting. Start with mission, authority, evidence, and completion. Those four sections deliver most of the value immediately.</p><p>Then let reality edit the file.</p><p>When the assistant makes a mistake, ask: was this a one-off failure, or does the system need a new rule?</p><p>When a workflow succeeds repeatedly, ask: should this become a protocol?</p><p>When a project convention matters often, ask: should this become memory?</p><p>When the file becomes too heavy, ask: should this move into a specialized note?</p><p>This is how CLAUDE.md becomes a living operating system instead of a shrine to one weekend of enthusiasm.</p><p>A year of running this changed the shape of the file itself. What began as a single document became a small tree — and the shape is worth copying exactly.</p><h3>The file, a year later: a composition root</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucGGJCzVfliVC3ZYYrVSLQ.png" /><figcaption>The composition root: a forty-byte CLAUDE.md that names what loads now — cores every session, one stack on demand, maintainer meta-docs never.</figcaption></figure><p>The file the tool actually loads — ~/.claude/CLAUDE.md — is now forty bytes. It holds no doctrine; it imports one file, a composition root [7], and the composition root holds no doctrine either. It only names what is active right now: two invariant cores that load in every session, on every project — the portable engineering doctrine and my own conventions; an employer shell — a few files of tooling, repo topology, and hard-won evidence that are true only for my current job, bracketed by a single comment that says delete this block on departure; exactly one stack — the current project’s, imported from a library of them (iOS, tvOS, Android, React Native, web, backend, the model API), the rest sitting on disk unloaded until a project needs them; and the memory system, whose notes page in on demand and, at scale, are retrieved by embedding rather than grep [13].</p><pre>~/.claude/CLAUDE.md          # 40-byte pointer -&gt; one @import<br>system/<br>  CLAUDE.md                  # composition root: names what is active, holds no doctrine<br>  CLAUDE.core.md             # invariant core: 12 primitives, 3 laws, evidence hierarchy<br>  personal.core.md           # invariant core: methodology, identity, conventions<br>  &lt;employer&gt;.tooling.md      # employer shell: tooling<br>  &lt;employer&gt;.repo.md         # employer shell: repo topology (delete block on departure)<br>  &lt;employer&gt;.evidence.md     # employer shell: hard-won evidence<br>  stack.&lt;active&gt;.md          # ONE active stack (library: ios, tvos, android, rn, web, backend, model-api)<br>  memory.system.md           # the memory protocol<br>  doctrine.governance.md     # meta-doc: how it evolves (never loaded at runtime)<br>  doctrine.currency.md       # meta-doc: how it stays current (never loaded at runtime)<br>  doctrine.validation.md     # meta-doc: how it is validated (never loaded at runtime)</pre><p>Change jobs, delete the shell block. Change stack, swap one import line. The cores never move. Import depth is capped at four and every file stays under about two hundred lines — not style preferences, but limits a linter enforces.</p><p>This is the same hot, warm, and cold split the layer model started with — the memory hierarchy computer architecture has run on for decades [11] — now expressed as files with a clear owner for each part: the always-loaded cores are the hot tier and must stay terse; the stack library and memory are warm, paged in on demand, a shape long-term-memory research for agents reaches independently by treating the model like an operating system [12].</p><h3>The core is a small, fixed vocabulary</h3><p>My invariant core is not a list of preferences. It is a vocabulary — twelve design primitives that every engineering decision takes a stance on. They are not inventions; they are the field’s own hard-won distinctions, gathered into one list — the same instincts Clean Architecture organizes into boundaries and a dependency rule [1]. A boundary is where you decide what crosses and what gets validated — the modular seam Parnas argued a system should be decomposed along [3]. A contract is a boundary’s stated obligations, in the sense Meyer built a language around: preconditions, postconditions, the invariant a caller may rely on [4]. Policy versus mechanism is the decision kept apart from the machinery that executes it, the separation the Hydra system named [5]. A seam is where behavior can be substituted without editing — Feathers’ word for the place a test gets in [6]. A source of truth is the one place a fact lives and everything else derives from, which is DRY read as an architecture rule, not a typing tip [10]. Ownership, lifetime, identity, isolation, invalidation, and budget round out the twelve.</p><p>Three laws wield them: make illegal states unrepresentable, so a whole class of bugs cannot be written down [9]; grant least capability, the principle of least privilege applied to every component and tool [8]; and diagnose by the fault — walk symptom to violated primitive to cause.</p><p>The point of a fixed vocabulary is that it is fixed. Adding a thirteenth primitive is not a quick edit; it takes a governance change — a written case that the concept is genuinely orthogonal to the twelve, recurs across stacks, and is load-bearing — because a change to the core is a breaking change to every stack that projects it. The constitution is small on purpose, and kept small by making it expensive to grow. That is the oldest trick in grammar: a system whose rules are themselves governed by rules about rules, the meta-rule that decides which rule wins when two collide [14]. (That lineage is its own piece in this series.)</p><p>There is one principled exception, and it proves the rule. Where a stack breaks an assumption the twelve silently rest on — a probabilistic substrate, or a distributed store with no single authoritative place a fact lives — it may name exactly one precondition-axis: Determinism for a model API, Agreement for a distributed backend. Sanctioned by governance, allow-listed in the linter, never coined at the stack. The thirteenth is not a new everyday primitive; it is the assumption the twelve rested on, named only where it fails.</p><h3>How a stack projects the core</h3><p>Each stack file is the core projected into one framework’s dialect, filling a fixed mold. A Rubric re-states all twelve primitives in the stack’s own mechanisms — a React key, a Swift Sendable, a focus engine — using real names, never forced analogies. A Doṣa is the fault table: one row per primitive giving the violation and the exact symptom it produces. Write the fault table first and the rules almost write themselves, because each rule exists to prevent a row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEY5xv-sh2Vwp_P58mneSA.png" /><figcaption>Twelve invariant primitives projected into each framework’s dialect through a Rubric and a Doṣa table — a core change is a breaking change to every projection.</figcaption></figure><h3>The audit became a linter</h3><p>Earlier in this guide I described auditing the file by hand. A year in, I no longer do.</p><p>The doctrine is a git repository, and a linter runs on every commit. Six checks: no file over about two hundred lines; every import resolves and nothing nests deeper than four; every stack covers all twelve primitives and coins no thirteenth; the core defines exactly the set the stacks project; every cross-reference points at a section that exists; and the memory index stays under the budget past which it silently stops loading. A commit that fails a check does not land.</p><p>The recursive audit became a gate. The doctrine now has to pass the same kind of check it asks the assistant to run on everything else — which is the whole idea, turned on the system itself.</p><h3>Version the whole thing</h3><p>Everything here lives in files: the cores, the stacks, the memory notes, the index. Files get corrupted, half-edited, or deleted — by you, by a script, or by the assistant during an edit it was authorized to make. A doctrine you cannot roll back is a doctrine you are afraid to change, and a doctrine you are afraid to change stops evolving.</p><p>So it is a git repository. Every meaningful edit is a commit, which buys three things: rollback (a bad edit is one git revert), history (git log is a dated record of how your judgment changed — every rule tied to the mistake that earned it), and review (a diff makes a doctrine change reviewable, by you or another model, before it lands). Two rules keep it honest: commit the doctrine, never the secrets; and let the assistant propose commits, not push them — pushing is already in your hard-permissions list, and the doctrine’s own authority rules apply to the doctrine’s own repository.</p><h3>Measure whether a rule earns its seat</h3><p>A rule that reads well but changes no decision is decoration, and decoration in an always-loaded file is pure cost, paid every session. The only way to tell doctrine from decoration is to measure.</p><p>Each rule I doubt gets a probe: a representative task run against two conditions—the doctrine loaded, and a stateless-∅ baseline with nothing loaded at all. The baseline has to be genuinely empty. My first design ran the bare arm in a “fresh” session, and the fresh session wasn’t fresh—a resident daemon remembered the last run, so the baseline quietly inherited what it was meant to prove it lacked. The fix is a fingerprint tripwire: every run is fingerprinted, and any run whose baseline shows a trace of prior state is thrown out before it scores. A contaminated measurement is worse than none.</p><p>Scoring runs on two channels. One is self-authenticating—does the output carry a doctrine-private fact the bare model cannot produce: the exact repo path a ticket’s fix belongs in, a refusal to coin a new primitive that points back at governance. The other is a blind quality rating—two independent judges, neither told which arm produced which output, agreeing closely enough to trust (κ = 0.82). Code the doctrine should shape also gets a compile gate: the generated TypeScript must pass the compiler in strict mode. A rule earns its seat only when the doctrine arm beats the empty baseline on both channels—its measured weight clears zero; a weight whose interval straddles zero is filler, and comes out. The probes accumulate into a regression suite, re-runnable when the model underneath you changes.</p><p>This is the discipline the doctrine imposes everywhere else, turned on the doctrine itself: evidence over assertion, measurement over ceremony — the same test-first instinct that disciplined code long before it disciplined doctrine [2].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61AgoeO1d2mfQVkVbBCHKg.png" /><figcaption>Measuring whether a rule earns its seat: score the doctrine against a stateless-∅ baseline on two channels—a self-authenticating fact-match and two blind judges (κ = 0.82)—with a fingerprint tripwire guarding the baseline. Keep only rules whose measured weight clears zero.</figcaption></figure><h3>The real purpose</h3><p>The best AI setup is not the one with the most tools.</p><p>It is the one where the tools inherit your judgment.</p><p>That is what a serious CLAUDE.md does. It carries your standards into the conversation before the first prompt is typed. It teaches the assistant where to be fast, where to be careful, where to ask, where to verify, where to stop, and where human authority begins.</p><p>The terminal setup articles taught us to make the shell feel like home.</p><p>The next generation of setup work is deeper.</p><p>We are not just customizing the prompt.</p><p>We are defining the operating system for human-AI collaboration.</p><p><strong>References</strong></p><p>[1] Robert C. Martin. Clean Architecture: A Craftsman’s Guide to Software Structure and Design. Prentice Hall, 2017.</p><p>[2] Kent Beck. Test-Driven Development: By Example. Addison-Wesley, 2002.</p><p>[3] David L. Parnas. On the Criteria To Be Used in Decomposing Systems into Modules. Communications of the ACM 15(12), 1972.</p><p>[4] Bertrand Meyer. Object-Oriented Software Construction (2nd ed.). Prentice Hall, 1997.</p><p>[5] R. Levin, E. Cohen, W. Corwin, F. Pollack, W. Wulf. Policy/Mechanism Separation in Hydra. SOSP, 1975.</p><p>[6] Michael C. Feathers. Working Effectively with Legacy Code. Prentice Hall, 2004.</p><p>[7] Mark Seemann. Dependency Injection in .NET. Manning, 2011.</p><p>[8] Jerome H. Saltzer and Michael D. Schroeder. The Protection of Information in Computer Systems. Proceedings of the IEEE 63(9), 1975.</p><p>[9] Yaron Minsky. Effective ML. Jane Street.</p><p>[10] Andrew Hunt and David Thomas. The Pragmatic Programmer. Addison-Wesley, 1999.</p><p>[11] John L. Hennessy and David A. Patterson. Computer Architecture: A Quantitative Approach. Morgan Kaufmann.</p><p>[12] Charles Packer et al. (2023). MemGPT: Towards LLMs as Operating Systems. <a href="https://arxiv.org/abs/2310.08560">https://arxiv.org/abs/2310.08560</a></p><p>[13] Patrick Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. <a href="https://arxiv.org/abs/2005.11401">https://arxiv.org/abs/2005.11401</a></p><p>[14] Rishi Rajpopat (2022). In Pāṇini We Trust: Discovering the Algorithm for Rule Conflict Resolution in the Aṣṭādhyāyī. PhD thesis, University of Cambridge.</p><p><em>This essay is a standalone field guide in the Combined Force methodology.</em></p><p><em>Related series: start with </em><a href="https://medium.com/@tattva20/the-combined-force-methodology-aa3e1865bee7"><em>The Combined Force Methodology</em></a><em> and </em><a href="https://medium.com/@tattva20/the-governance-layer-of-the-combined-force-methodology-367dbebf6f94"><em>The Governance Layer</em></a><em>. The broader series continues through platform, persistence, the operator layer, and recursive Combined Force.</em></p><p><em>Octavio Rojas Topete is a Lead Mobile Architect specializing in iOS, tvOS, React Native, Kotlin, and AI-native engineering workflows. He writes about Combined Force: a methodology for using AI as disciplined amplification rather than cognitive replacement. Find him on </em><a href="https://www.linkedin.com/in/rojastopete/"><em>LinkedIn</em></a><em> and </em><a href="https://github.com/tattva20"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f261e2424b1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Combined Force: Start Here]]></title>
            <link>https://medium.com/@tattva20/combined-force-start-here-8377b2be0da4?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/8377b2be0da4</guid>
            <category><![CDATA[engineering-methodologies]]></category>
            <category><![CDATA[combined-force]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 23:52:08 GMT</pubDate>
            <atom:updated>2026-07-27T14:15:22.836Z</atom:updated>
            <content:encoded><![CDATA[<h4>A map to the series — read it in order, or jump to the layer you need.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6VsjoUi-Xbfa7U-sWzxfA.png" /></figure><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>AI can make an engineer dramatically faster. Without discipline, it can also make them confidently wrong — at machine speed. <strong>Combined Force is an engineering methodology for keeping human judgment inside the loop while systematically amplifying it with AI.</strong></p><p><em>Formally: a methodology for building governed learning loops, where humans and computational systems collaborate through canonical artifacts, explicit contracts, and continuous feedback to produce higher-quality knowledge and systems.</em></p><p><em>It is not a tool, a prompt pack, or a productivity hack. It is a set of layers that turn an AI assistant into a governed engineering teammate — six layers that build from individual practice up to organizational infrastructure, and close with the loop that improves the whole system.</em></p><h3>Architecture of the methodology</h3><figure><img alt="Combined Force architecture: six stacked layers — Methodology, Governance, Platform, Persistence, Operator, and Recursive Combined Force — built on the Human Engineer, grouped into Principles, Infrastructure, Execution and Evolution tiers, with a feedback loop that refines the whole system." src="https://cdn-images-1.medium.com/max/1024/1*7F1xmPABJDBpUI1md3y4Wg.png" /></figure><p><em>Six layers, four tiers. Each layer adds one property to the system; the sixth turns the whole method on itself.</em></p><p>Read the layers as levels of abstraction, not as steps — each one adds a capability the next depends on.</p><p><strong>1 · </strong><a href="https://medium.com/@tattva20/the-combined-force-methodology-aa3e1865bee7"><strong>The Combined Force Methodology</strong></a> — <em>The problem: AI is a lever without a fulcrum.</em> This layer is the fulcrum — the disciplined, human-in-the-loop practice that decides whether the lever lifts or slips. Start here if you read nothing else.</p><p><strong>2 · </strong><a href="https://medium.com/@tattva20/the-governance-layer-of-the-combined-force-methodology-367dbebf6f94"><strong>The Governance Layer</strong></a> — <em>The problem: fluent output slips into production as if it were verified.</em> This layer adds explicit verification gates and authority boundaries, written down — so hallucinations never become production decisions.</p><p><strong>3 · </strong><a href="https://medium.com/@tattva20/combined-force-at-scale-the-platform-layer-032628435576"><strong>The Platform Layer</strong></a> — <em>The problem: a practice that lives in one senior engineer’s head doesn’t scale.</em> This layer adds shared context, canonical artifacts, and team standards — turning the methodology into infrastructure instead of folklore.</p><p><strong>4 · </strong><a href="https://medium.com/@tattva20/the-persistence-layer-of-combined-force-96ce12f5abc0"><strong>The Persistence Layer</strong></a> — <em>The problem: context dies at the end of the session.</em> This layer adds memory in architectural tiers, not a longer prompt — so knowledge outlives the conversation that produced it.</p><p><strong>5 · </strong><a href="https://medium.com/@tattva20/the-operator-layer-of-combined-force-a7d8b92523fb"><strong>The Operator Layer</strong></a> — <em>The problem: the human becomes a bottleneck, or checks out entirely.</em> This layer adds orchestration — the human as the non-blocking main thread, steering and judging without leaving the loop. A governed interface, not a chatbot.</p><p><strong>6 · </strong><a href="https://medium.com/@tattva20/recursive-combined-force-2ac1c964e5b1"><strong>Recursive Combined Force</strong></a> — <em>The problem: the loop improves the artifact, but never itself.</em> This layer points the loop at the system that solves problems, not the problem — and the method starts improving itself. The fifteen laws that survived.</p><h3>Where to start</h3><p><strong>New here?</strong> Read Part 1, then jump to whichever layer names your current pain — memory → Part 4; team drift → Part 3; “it did something dumb and I shipped it” → Part 2.</p><p><strong>Skeptical?</strong> Start with Recursive (Part 6). It states the fifteen laws plainly and shows the whole shape at once.</p><p><strong>Leading a team?</strong> Parts 2 and 3 are the ones to send to your org.</p><p><strong>The goal is not autonomous intelligence. The goal is augmented engineering judgment.</strong></p><p><em>Written from daily production use on a large mobile codebase. — Octavio Rojas (@tattva20)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8377b2be0da4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recursive Combined Force]]></title>
            <link>https://medium.com/@tattva20/recursive-combined-force-2ac1c964e5b1?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ac1c964e5b1</guid>
            <category><![CDATA[engineering-methodologies]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[combined-force]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 17:03:26 GMT</pubDate>
            <atom:updated>2026-08-01T14:00:58.821Z</atom:updated>
            <content:encoded><![CDATA[<h3>The loop that improves the thing it makes — and then improves the loop.</h3><figure><img alt="Recursive Combined Force." src="https://cdn-images-1.medium.com/proxy/1*ZeIX_KtLXgll20iJsKvbdw.jpeg" /><figcaption>Recursive Combined Force.</figcaption></figure><p><em>A continuation of the Combined Force Methodology series. The first five articles describe the core architecture: </em><a href="https://medium.com/@tattva20/the-combined-force-methodology-aa3e1865bee7"><em>methodology</em></a><em>, </em><a href="https://medium.com/@tattva20/the-governance-layer-of-the-combined-force-methodology-367dbebf6f94"><em>governance</em></a><em>, platform, persistence, and the operator layer. This piece is what happens once those layers exist.</em></p><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>Combined Force is about amplification [1] — a human and an AI producing more together than either could alone; what Anthropic, measuring how people actually use these tools, calls augmentation rather than automation [2]. Recursive Combined Force is what happens when you point that amplification at itself — not at the problem, but at the system that solves problems.</p><p>The move is a loop — generate, judge, correct, re-iterate [3][4]. Run it on a draft and the draft gets sharper. Run it on the thing that makes drafts — your prompts, your rules, your architecture — and your capacity to make drafts gets sharper. That second loop is the recursive one, and it is where the compounding lives.</p><p>It is worth being precise about the word, because <em>recursive</em> is easy to hear as <em>just run it again</em> — and that is not the claim. Recursive here means something stricter: <strong>a process whose results explicitly change the conditions under which its next iteration runs.</strong> Re-running a process leaves the process untouched; a recursive one rewrites the ground the next pass stands on. That distinction is why the idea reaches four places at once — <em>learning</em>, as each pass updates what the system knows; <em>persistence</em>, because those updates must outlive the session that produced them; <em>governance</em>, because a loop that can rewrite its own conditions has to be bounded by rules it cannot quietly overwrite; and <em>experimentation</em>, because the only honest proof that a change improved the system is to measure it against the version before. Strip those away and “recursive” collapses back into “repeat.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdFX6s7R2kbYSzDuXUF_mg.png" /><figcaption>The recursive loop: generate, judge, correct, re-iterate — run on the artifact, then turned on the loop itself.</figcaption></figure><p>A caveat before the promise: the loop does not reach perfection. It climbs an asymptote. Each pass changes a little less than the last, and you stop when the next pass stops changing any decision. “Iterating toward perfection” is a direction, not a destination. The discipline is in running the loop honestly, not in believing it terminates.</p><h4>It started with a study guide</h4><p>The first time I ran the loop deliberately, I wasn’t building a system. I was preparing for a lead interview.</p><p>I wrote down everything I knew — architecture, testing, trade-offs, the war stories behind each opinion — and it was a mess. Too long to review, too shapeless to trust. So I ran the loop: draft, then cut every line that read well but changed no decision, then re-derive what was left, then compress again. Thirty-odd passes later it had collapsed into something dense — one law per line, a rule beside its rationale, with a narrative layer underneath for the parts that needed a story.</p><p>The artifact was an aphoristic study guide. But the artifact was never the point. The method was — the loop that produced it. (The aphoristic shape has a long lineage of its own; that story lives in the <a href="https://medium.com/@tattva20/p%C4%81%E1%B9%87ini-the-first-code-423593cba6ef">Pāṇini</a> piece.)</p><h4>The loop, turned on the machine</h4><p>Then the recursive turn.</p><p>If the loop made my own knowledge more reliable, would it make a model’s work more reliable? So I stopped feeding the model tasks and started feeding it the loop: generate a rule, test whether it actually changed behavior, cut what didn’t, compress what survived — the same generate-and-critique shape that trains a model on feedback from its own outputs [5].</p><p>What came out the other side was not a prompt. It was an architecture — a small pointer file that loads an invariant core, a swappable stack of protocols, a memory tier that carries lessons forward, a linter that checks the doctrine against its own rules, and evals that ask whether each rule earns its place. I did not design that top-down. I iterated it into being. (The <a href="https://medium.com/@tattva20/the-persistence-layer-of-combined-force-96ce12f5abc0">persistence </a>and <a href="https://medium.com/@tattva20/your-claude-md-is-not-a-prompt-it-is-an-operating-system-f261e2424b1a">CLAUDE.md</a> pieces describe the architecture in detail.)</p><h4>The loop applied to the loop</h4><p>Here is the deepest turn, and the real meaning of the word recursive — the strange loop, where a system bends back to operate on itself [6].</p><p>The evals check whether a rule moves the model’s behavior — the system measuring itself. A governing directive decides how the next decision gets made — the system steering itself. And the doctrine edits its own rules, under the same discipline it imposes on everything else — the system rewriting itself.</p><p>Measurement, governance, revision. The loop is no longer something I run on the system. It is something the system runs on itself, with me as the sovereign who says yes or no at each turn. That is Recursive Combined Force: the method, turned on itself, all the way down.</p><h4>Why this produces excellent artifacts</h4><p>None of this is about typing better prompts.</p><p>Excellence with AI is not a sentence you discover. It is a loop you run well. And running it well is a skill with named parts. The clearest map I’ve found is Anthropic’s <a href="https://anthropic.skilljar.com/ai-fluency-framework-foundations">AI Fluency framework</a> [7], built on four capacities it calls the four Ds:</p><p>Delegation — deciding what the loop hands to the AI and what stays with you. Generation, expansion, first drafts: delegate freely. Judgment, authority, the final yes: keep.</p><p>Description — telling the AI precisely what you want, with the context and constraints that aim its generation instead of leaving it to guess. A vague ask returns a fluent, plausible, wrong answer.</p><p>Discernment — evaluating what comes back. This is the judge step of the loop, where fluency gets separated from correctness, and it is the capacity most people skip.</p><p>Diligence — owning the process and its consequences. Verifying before trusting. Being accountable for what ships. Diligence is the conscience of the recursion.</p><p>Around those four, a handful of working principles keep the loop converging instead of spiraling:</p><p>Separate facts from assumptions — never let unverified output pass as verified. Compress — cut anything that reads well but changes no decision; the study guide taught me that one. Measure, don’t admire — a rule earns its place only if it moves behavior, and a good sentence that changes nothing is decoration. Review adversarially — one model produces, another tries to refute it, the human decides; agreement between agents is not evidence. Calibrate — match the ceremony to the risk, because a typo fix and a schema change do not deserve the same process. Persist — carry lessons forward so the loop compounds across sessions instead of restarting from zero. And stay sovereign — the loop amplifies judgment; it never replaces it.</p><p>Run the loop with those in hand, and the output stops being generated. It gets forged — through expansion, structure, critique, memory, and contact with reality, each pass adding what the last one could not.</p><h4>The laws that survived</h4><p>The study guide those first cycles produced is private. The laws that generalize past my own domain are not — and they are the compressed form of everything above:</p><blockquote>Every new tool is feared before it is understood.</blockquote><blockquote>The model generates possibilities; the human supplies purpose.</blockquote><blockquote>To delegate thinking is to weaken judgment.</blockquote><blockquote>What goes unexercised begins to fade.</blockquote><blockquote>AI amplifies disciplined thought.</blockquote><blockquote>The model predicts; the human judges.</blockquote><blockquote>Dependence breeds mediocrity; discipline breeds mastery.</blockquote><blockquote>Critical thinking and diligence do not diminish; they become essential.</blockquote><blockquote>Prompt engineering is not asking; it is directing.</blockquote><blockquote>Context outweighs the prompt.</blockquote><blockquote>Continuous iteration beats generation without structure.</blockquote><blockquote>The prompt begins the work; refinement finishes it.</blockquote><blockquote>AI cannot amplify knowledge never acquired.</blockquote><blockquote>Who does not know the domain cannot judge the answer.</blockquote><blockquote>So the output rarely surpasses the conversation that made it — it is only its mirror.</blockquote><h4>Closing</h4><p>The recursion is the whole point. The loop improves the artifact, and then it improves the loop.</p><p>An engineer who runs it well does not end up with a faster tool. They end up with a compounding system — one that measures itself, steers itself, and rewrites itself, governed at every step by a human who refuses to leave the loop.</p><p>That is Recursive Combined Force. Not a productivity hack. A discipline. And the discipline is to stay the operator while orchestrating a system that could, if you let it, replace you.</p><p><strong>References</strong></p><p>[1] Douglas C. Engelbart. Augmenting Human Intellect: A Conceptual Framework. Stanford Research Institute, 1962.</p><p>[2] Anthropic. Introducing the Anthropic Economic Index. February 10, 2025. <a href="https://www.anthropic.com/news/the-anthropic-economic-index">https://www.anthropic.com/news/the-anthropic-economic-index</a></p><p>[3] W. Edwards Deming. Out of the Crisis. MIT Press, 1986 — the Plan-Do-Check-Act cycle, after Walter A. Shewhart.</p><p>[4] John R. Boyd. A Discourse on Winning and Losing, 1987 — the OODA loop (Observe-Orient-Decide-Act).</p><p>[5] Yuntao Bai et al. Constitutional AI: Harmlessness from AI Feedback. Anthropic, 2022. <a href="https://arxiv.org/abs/2212.08073">https://arxiv.org/abs/2212.08073</a></p><p>[6] Douglas R. Hofstadter. Gödel, Escher, Bach: An Eternal Golden Braid. Basic Books, 1979 — the strange loop.</p><p>[7] Anthropic. AI Fluency: Framework &amp; Foundations — the four-D model (Delegation, Description, Discernment, Diligence). https://anthropic.skilljar.com/ai-fluency-framework-foundations</p><p><em>This essay is a continuation of the Combined Force core series.</em></p><p><em>The previous five articles describe the methodology, its governance, its scaling to teams, its persistence architecture, and the human-machine interface. Recursive Combined Force is what becomes possible once those layers exist.</em></p><p><em>Octavio Rojas Topete is Lead iOS Engineer and Multi-Platform Mobile Architect at AgileEngine. He writes about engineering methodology, AI-augmented development, and technical hiring. Previously at Pluto TV, New York Post, Globant, and Disney. Find him on LinkedIn or at </em><a href="https://github.com/tattva20"><em>github.com/tattva20</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ac1c964e5b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pāṇini — The First Code]]></title>
            <link>https://medium.com/@tattva20/p%C4%81%E1%B9%87ini-the-first-code-423593cba6ef?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/423593cba6ef</guid>
            <category><![CDATA[history]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linguistics]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[sanskrit]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 16:03:31 GMT</pubDate>
            <atom:updated>2026-07-27T14:16:15.242Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cwx9rcD1os8M1aX8DLrRUQ.png" /></figure><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>Twenty-five centuries ago, Pāṇini compressed an entire language into nearly four thousand aphorisms: one of the most remarkable formal systems of the ancient world.[1]</p><p>The Aṣṭādhyāyī does not merely describe Sanskrit. It specifies a procedure for deriving words through ordered rules operating on roots, affixes, and sound classes.[1]</p><p>Pāṇini developed an exceptionally precise metalanguage: abstract symbols, technical definitions, and rules that govern other rules.[1]</p><p>His grammar is a generative system. From a finite set of rules, it derives a potentially unbounded number of linguistic forms—an idea that feels strikingly familiar in modern linguistics and computer science.[2]</p><p>When two rules conflict, a meta-rule determines which one prevails. The Indian grammatical tradition called such principles paribhāṣā—rules about rules.[1]</p><p>More than two millennia later, formal language theory provided mathematical tools for describing systems of this kind. Many historians regard Pāṇini’s work as one of the most remarkable intellectual predecessors of that tradition.[2]</p><p>Backus and Naur introduced a notation for describing the syntax of programming languages. Although developed in a completely different context, many scholars have noted the remarkable parallels between their formalism and Pāṇini’s grammatical architecture.[2]</p><p>Chomsky developed modern generative grammar: a finite system of rules capable of generating an infinite set of sentences. Many historians of linguistics identify Pāṇini as one of its most significant intellectual forerunners.[2]</p><p>Ferdinand de Saussure began his career as a Sanskrit scholar, and the study of Sanskrit played a significant role in the emergence of structural linguistics.[3]</p><p>Leonard Bloomfield described Pāṇini’s grammatical tradition as one of humanity’s greatest intellectual achievements and praised its extraordinary analytical rigor.[4]</p><p>For centuries, apparent conflicts among some of Pāṇini’s rules led commentators to propose numerous exceptions and competing interpretations.[5]</p><p>In 2022, at the University of Cambridge, Rishi Rajpopat proposed a new interpretation of the meta-rule vipratiṣedhe paraṃ kāryam, resolving a problem that had challenged scholars for centuries and eliminating many of those exceptions.[5]</p><p>His work did not add new rules to Pāṇini’s system. Instead, it offered a different reading of an existing one, revealing a level of internal consistency far greater than traditionally assumed.[5]</p><p>More than two thousand years after it was written, Pāṇini’s grammar continues to offer new insights into the design of precise formal systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UIhbYrjWwwbgL9VTxpj_uA.png" /></figure><p>Part of my work is building the playback layer for <a href="https://github.com/tattva20/TATTVA-TV">a streaming app on tvOS</a> — the unglamorous machinery that turns a tap on a remote into a frame on a screen. I didn’t reach Pāṇini through the history, though; I reached him backwards, from this — a corner of engineering about as far from Sanskrit as it gets.</p><p>Playback looks simple from the couch and is anything but underneath: a video can be loading, ready, playing, paused, buffering mid-stream, seeking to a new position, ended, or failed, and the moves between those conditions have to be exactly right or the whole experience falls apart — a play button that does nothing, a spinner that never clears, audio that resumes after the user has already left.</p><p>I built that control logic as a pure finite state machine, and the emphasis on pure is the whole point. A finite state machine is one of the oldest formalisms in computing: a finite set of states, a set of input events, and a transition function saying which state each (state, event) pair leads to.[6] Mine has nine states — idle, loading, ready, playing, paused, buffering, seeking, ended, failed — modeled not as scattered boolean flags but as a single value that is always exactly one of them. Illegal combinations, like “playing” and “failed” at once, simply cannot be written down; the type system forbids them. That discipline has a name in functional design: make illegal states unrepresentable.[7]</p><p>The entire law of motion lives in one function: nextState(state, action). Given the current state and an incoming event, it returns the next state — or it returns nothing, and the nothing is the part that matters. Every legal move is an explicit line: from loading, a “ready” event goes to ready; from playing, a “pause” goes to paused. Anything not written down returns nil. The machine does not lurch into an undefined condition; it refuses the move. You cannot play while loading. You cannot pause what is already idle. The set of things the system can do is finite, enumerated, and closed.</p><p>That function is pure — same inputs, same output, no side effects, ever. The messy real world (the media framework firing callbacks on background threads, the UI that has to redraw, the analytics that want to log) touches the machine only at its edges. An adapter on one side translates player events into actions; subscribers on the other side read a stream of published states. The core that decides is pure and total; the mess lives at the boundary. This is the shape Gary Bernhardt named a functional core, imperative shell,[8] and it is why the machine is exhaustively testable without a single mock: feed it a state and an action, assert on what comes back. Dozens of transition tests, no video required.</p><p>None of that is exotic. It is just careful engineering. What stopped me was recognizing that I had built, at small scale and in Swift, the same kind of object Pāṇini had built two and a half thousand years earlier for the whole of a language.</p><p>The Aṣṭādhyāyī, read through this lens, is a state machine. A linguistic form advances from raw sound toward finished meaning — śabda to prātipadika or dhātu, through vibhakti, into rūpa, up to vākya and finally artha — and it advances by the application of rules. Each sūtra is a transition: a trigger that transforms one form into the next, exactly as each event in my player transforms one state into the next.[2] Ungrammatical derivations are prohibited the same way my illegal transitions return nil — the system will not produce them. And when two rules could fire at once, Pāṇini does not leave it ambiguous; a meta-rule decides which wins — the conflict-resolution principle Rishi Rajpopat reconstructed in 2022 after it had defeated commentators for millennia.[5] States, transitions, rules, constraints, determinism. The architecture is the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXEO9lySxxNRO8XFxNgNGg.png" /></figure><p>The domains could not be further apart. One controls a video; the other generates a sentence. One runs in real time on a chip in a set-top box; the other has run in the minds of reciters for longer than most writing systems have existed. But the form is identical, and that is the thing worth sitting with. A governed system is a state machine: a set of legal conditions, a set of rules that move between them, and a refusal to enter the states the rules do not sanction. Whether the output is a frame of video or a well-formed sentence, the shape of the control is the same shape. Pāṇini simply got there first — and did it by hand, for a target infinitely harder than mine.</p><p>That is what “the first code” means, taken literally. Not a metaphor stretched over an old text, but the same object we still build: a finite set of states, a set of rules that move between them, and the discipline to reject everything the rules do not allow.</p><p>Pāṇini did not write a compiler in the modern sense. He created one of history’s most sophisticated antecedents of a formal derivational system—one whose architecture bears remarkable similarities to that of a modern compiler.</p><p>Perhaps that is why his work still feels so contemporary: not because it anticipated computers, but because it uncovered principles that continue to shape how we build languages, algorithms, and formal systems today.</p><p>References</p><p>[1] Pāṇini. Aṣṭādhyāyī. See also George Cardona, Pāṇini: A Survey of Research. Motilal Banarsidass, 1997.</p><p>[2] John J. Lowe. Modern Linguistics in Ancient India. Cambridge University Press, 2024. Chapter 6, Formal Language Theory and Computational Power.</p><p>[3] John E. Joseph. Saussure. Oxford University Press, 2012.</p><p>[4] Leonard Bloomfield. Language. University of Chicago Press, 1933.</p><p>[5] Rishi Rajpopat. In Pāṇini We Trust: Discovering the Algorithm for Rule Conflict Resolution in the Aṣṭādhyāyī. PhD Thesis, University of Cambridge, 2022.</p><p>[6] John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 2006. The formal definition of a finite state machine: states, events, and a transition function.</p><p>[7] Yaron Minsky. Effective ML. Jane Street. The principle “make illegal states unrepresentable” in typed functional programming.</p><p>[8] Gary Bernhardt. Boundaries / Functional Core, Imperative Shell. Destroy All Software, 2012. https://www.destroyallsoftware.com/talks/boundaries</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=423593cba6ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Operator Layer of Combined Force]]></title>
            <link>https://medium.com/@tattva20/the-operator-layer-of-combined-force-a7d8b92523fb?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7d8b92523fb</guid>
            <category><![CDATA[engineering-leadership]]></category>
            <category><![CDATA[combined-force]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[engineering-methodologies]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 15:01:03 GMT</pubDate>
            <atom:updated>2026-07-27T14:16:58.602Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why the most powerful AI setup is not a toolchain, but a governed human-machine interface</h3><figure><img alt="The Operator Layer of Combined Force." src="https://cdn-images-1.medium.com/proxy/1*pnT4l7eVuM0FVYjZn3iqFw.jpeg" /><figcaption>The Operator Layer of Combined Force.</figcaption></figure><p><em>Part 5 of the Combined Force Methodology series. Previous: </em><a href="https://medium.com/@tattva20/the-combined-force-methodology-aa3e1865bee7"><em>The Combined Force Methodology</em></a><em>, </em><a href="https://medium.com/@tattva20/the-governance-layer-of-the-combined-force-methodology-367dbebf6f94"><em>The Governance Layer of the Combined Force Methodology</em></a><em>, The Platform Layer, and The Persistence Layer.</em></p><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>There is a moment in AI-assisted engineering when the tool stops feeling like a chatbot.</p><p>Not because the model became conscious.</p><p>Not because the prompts became clever.</p><p>Not because the code autocomplete improved.</p><p>It happens when the workflow develops structure around the model: rules, memory, permissions, tests, feedback loops, and a human operator who knows when to trust the system, when to challenge it, and when to stop it.</p><p>That is the moment when AI stops being a tool you occasionally consult and becomes part of an operating environment.</p><p>For me, that environment has several pieces:</p><ul><li>Claude CLI is the <strong>exoskeleton</strong>.</li><li>CLAUDE.md is the <strong>constitution</strong>.</li><li>A three-tier memory architecture is the <strong>hippocampus</strong>.</li><li>TDD is the <strong>immune system</strong>.</li><li>Combined Force is the <strong>doctrine</strong>.</li><li>Human judgment remains <strong>sovereign</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqtKZnx-YZsE90-lighi5g.png" /><figcaption>The operator layer is the human-machine interface where tools, doctrine, memory, and tests remain governed by human judgment.</figcaption></figure><p>This article is about that stack.</p><p>Not as a tutorial.</p><p>As an operating model.</p><h3>The tool is not the power</h3><p>Most conversations about AI-assisted software engineering still focus on tools.</p><p>Which model are you using?</p><p>Which IDE extension?</p><p>Which prompt technique?</p><p>Which agent framework?</p><p>Those questions matter, but they are not the center of the system.</p><p>A powerful model inside an undisciplined workflow is not leverage. It is acceleration without steering. It may produce code faster, but it can also produce hidden defects faster. It may summarize a codebase, but it can also hallucinate the architecture. It may confidently propose a refactor, but confidence is not the same thing as correctness.</p><p>The power is not the tool.</p><p>The power is the interface between the tool and the operator.</p><p>That interface is where methodology lives.</p><h3>Claude CLI as exoskeleton</h3><p>A command-line AI assistant changes the texture of engineering work.</p><p>The model is no longer trapped in a browser tab waiting for abstract questions. It can operate closer to the repository. It can inspect files, reason about diffs, search the codebase, propose patches, generate tests, update documentation, and help execute repetitive tasks.</p><p>That proximity matters.</p><p>But proximity also increases risk.</p><p>The closer the AI is to the codebase, the more important governance becomes. A model that can help edit files must also know when not to edit files. A model that can run commands must understand which commands are safe. A model that can reason about code must distinguish between what it verified and what it inferred.</p><p>Claude CLI gives the system hands.</p><p>But hands require rules.</p><h3>CLAUDE.md as constitution</h3><p>A personal CLAUDE.md file is not just configuration.</p><p>It is governance.</p><p>It defines the rules under which the AI is allowed to collaborate with you. It tells the model what kind of engineer you are, what standards you enforce, which actions require permission, how to handle uncertainty, and how to behave when its own confidence exceeds its evidence.</p><p>In my workflow, this matters more than any single prompt.</p><p>A good CLAUDE.md can encode principles like:</p><ul><li>separate facts from assumptions</li><li>do not present unverified claims as certainty</li><li>prefer TDD when changing behavior</li><li>never perform irreversible actions without explicit human permission</li><li>explain trade-offs before architecture decisions</li><li>ask clarifying questions when requirements are ambiguous</li><li>preserve human authority over final judgment</li></ul><p>That is not “prompt engineering.”</p><p>That is operational law.</p><p>Without a constitution, the AI is merely persuasive.</p><p>With a constitution, it becomes governable.</p><h3>Memory as hippocampus — but in three layers</h3><p>A constitution is not enough.</p><p>Rules tell the AI how to behave. Memory tells it what it has learned.</p><p>In normal AI workflows, every session risks becoming a reset. The model may help you debug something today and forget the lesson tomorrow. You may spend forty minutes finding the true cause of a bug, only to re-discover it later because the cue did not surface at the right time.</p><p>A memory architecture changes the economics of experience.</p><p>It lets the workflow accumulate.</p><p>But not as a single dumping ground. As <strong>three coordinated tiers</strong>.</p><h3>Layer 1 — Global doctrine in CLAUDE.md</h3><p>The rules that must never be missed live in the constitution — the always-loaded layer, which is exactly why it has to stay tight: only rules that justify their per-session cost belong here. That same constraint is why this layer is no longer a single file. What used to be one long CLAUDE.md is now a forty-byte pointer that imports a small module tree: a fixed invariant core (the design primitives, the epistemology that refuses to trust itself, and the governance rules that are nothing but rules about the rules), exactly one swappable stack for the technology the current project uses, and the index that surfaces Layer 2. The operator still reasons about it as one constitution; underneath, it’s a spine that never moves, projected onto a slot that swaps per project, with a linter gating every change before it lands. (The persistence article covers this architecture in full.)</p><p>Example: when the user says “inline comment”, the model must use the JSON-body method with explicit Content-Type: application/json, not the form-encoded path which silently drops position fields. This phrase-to-method mapping is in CLAUDE.md. The rule never has to be re-derived.</p><h3>Layer 2 — Auto-memory notes</h3><p>Detailed context lives in individual memory files: debugging chronicles, project state, domain references, conversational insights from prior sessions. These files are <strong>loaded when relevant</strong>, surfaced by grep against the current prompt.</p><p>Example: a memory note titled reference_glab_inline_mr_comments.md contains the full forty-minute debugging history of why -f position[xxx]=val fails. The chronicle is verbose. It would dilute CLAUDE.md if dropped there. As a Layer 2 file, it loads only when needed and carries the full context.</p><h3>Layer 3 — The index that surfaces Layer 2</h3><p>A single MEMORY.md file, always loaded but containing only one-line pointers to Layer 2 entries, ensures that the detailed context is <strong>discoverable</strong> at the right moment.</p><p>Example: a line in MEMORY.md reads <em>“reference-glab-inline-mr-comments — full debugging history of why -f position[xxx]=val fails for GitLab inline MR comments. Working JSON body pattern.”</em> That one line tells the model that the detail exists, what it covers, and when it should be loaded.</p><h3>Why three tiers, not one</h3><p>Each tier has a different cost-benefit profile:</p><ul><li>Layer 1 is <strong>expensive but critical</strong>. Loaded every session. Must stay terse.</li><li>Layer 2 is <strong>cheap but conditional</strong>. Loaded only when relevant. Can be verbose.</li><li>Layer 3 is <strong>expensive but small</strong>. Always loaded. Discovers Layer 2.</li></ul><p>Building only Layer 1 produces an overloaded constitution that becomes hostile to read. Building only Layer 2 produces invisible knowledge. Building Layers 1 and 2 without 3 produces knowledge that exists but is not consistently discovered.</p><p>The three-tier split is the same architectural decomposition you would apply to any system where different categories of data have different access patterns. Hot data, warm data, cold data. Critical rules, contextual chronicles, indexable pointers.</p><p>This is not about pretending the AI has human memory. It does not.</p><p>This is about <strong>building memory around the AI</strong>.</p><p>A workflow with this persistence architecture becomes better over time, not because the model itself changed, but because the system surrounding the model now carries forward lessons from previous work.</p><p>That distinction is essential.</p><p>The model is not becoming wise.</p><p>The workflow is becoming more experienced.</p><h3>TDD as immune system</h3><p>If Claude CLI gives the system hands, and CLAUDE.md gives it law, and the memory architecture gives it persistence, then TDD gives it immunity.</p><p>Tests are how the workflow detects infection.</p><p>A hallucinated change can sound plausible.</p><p>A generated implementation can look elegant.</p><p>A refactor can appear clean while breaking behavior.</p><p>Tests are the boundary between narrative and reality.</p><p>When behavior matters, the workflow should ask:</p><ul><li>What should happen?</li><li>How do we prove it?</li><li>Can we reproduce the failure?</li><li>Can we make the test fail first?</li><li>Can we make the smallest change that turns it green?</li><li>Can we prevent the regression from returning?</li></ul><p>This is why TDD remains central in an AI-assisted workflow. AI can generate implementation faster than before. That makes verification <strong>more</strong> important, not less.</p><p>The faster the lever moves, the stronger the fulcrum must be.</p><h3>The human operator as sovereign</h3><p>The most dangerous version of AI-assisted engineering is not the one where the model makes mistakes.</p><p>Mistakes are expected.</p><p>The dangerous version is the one where the human stops operating.</p><p>This trap has a name and a lineage. In 1983 Lisanne Bainbridge described the central irony of automation: the more competent the automated system becomes, the more crucial — and the harder to sustain — the human operator’s role turns out to be, because a person kept on the sidelines slowly loses the situational grip that lets them step in when it finally matters. [1]</p><p>When the human becomes a passive approver of AI output, the system loses sovereignty. At that point, the model is no longer assisting judgment. It is replacing it with fluent suggestion. Human-factors research even has a name for the specific slide: automation complacency — once a capable tool is in the loop, people monitor less and defer more, most of all under time pressure. [2]</p><p>The operator layer exists to prevent that.</p><p>The human operator must retain responsibility for:</p><ul><li>intent</li><li>architecture</li><li>final judgment</li><li>permission boundaries</li><li>interpretation of risk</li><li>acceptance criteria</li><li>ethical accountability</li><li>deciding when not to use AI</li></ul><p>That accountability has to be real, not nominal. When a human is placed as the final approver of a system they no longer genuinely control, they become what Madeleine Elish calls a moral crumple zone — the part that absorbs blame for failures it had no real capacity to prevent. [4] The operator layer exists precisely so that the human’s authority is load-bearing, not decorative.</p><p>This is not anti-AI.</p><p>It is the opposite.</p><p>It is respect for the amount of power AI brings into the engineering workflow.</p><p>A powerful tool deserves a powerful operator.</p><h3>The stack as a human-machine interface</h3><p>When the pieces align, the workflow becomes something more interesting than “AI coding.”</p><ul><li>Claude CLI provides execution proximity.</li><li>CLAUDE.md provides governance.</li><li>The three-tier memory architecture provides persistence.</li><li>TDD provides verification.</li><li>Combined Force provides doctrine.</li><li>Human judgment provides sovereignty.</li></ul><p>Together, they form a governed human-machine interface.</p><p>This interface does not make the engineer obsolete. It changes what seniority means.</p><p>The senior engineer is no longer valuable because they can type every line manually.</p><p>The senior engineer is valuable because they can design the system in which machine speed remains subordinate to human judgment.</p><p>That is the real shift.</p><p>AI does not eliminate craft.</p><p>It punishes the absence of craft.</p><p>And fluency with these tools is becoming a named, assessable competency rather than a vibe: Anthropic frames it as four capabilities — delegation, description, discernment, and diligence — and the last two are the operator’s job exactly, judging whether the output is right and owning the process that produced it. [3]</p><h3>Why this matters</h3><p>The next generation of software engineering will not be divided simply between engineers who use AI and engineers who do not.</p><p>That division is too shallow.</p><p>The real division will be between engineers who allow AI to make their workflow more chaotic and engineers who build enough structure around AI that the workflow becomes more disciplined over time.</p><p>The first group will produce faster noise.</p><p>The second group will produce accumulated leverage.</p><p>The difference is not the model.</p><p>The difference is the operating system around the model.</p><h3>The operator layer in the series</h3><p>I call this the <strong>operator layer</strong> of Combined Force.</p><p>It is not a replacement for governance, platform, or persistence — the three previous articles in this series. It is the <strong>human-facing synthesis</strong> of all three.</p><ul><li><strong>Governance</strong> defines what must be true before the AI acts.</li><li><strong>Platform</strong> makes the right environment available to every developer on the team.</li><li><strong>Persistence</strong> carries lessons forward across sessions and across people.</li><li><strong>The operator layer</strong> is where the human uses all of that without surrendering authority.</li></ul><p>This is the layer that asks:</p><ul><li>What kind of engineer does this workflow produce?</li><li>Does it make me lazier, or more precise?</li><li>Does it hide uncertainty, or surface it?</li><li>Does it replace my judgment, or force me to articulate it?</li><li>Does it make me dependent, or does it make my methodology executable?</li></ul><p>Those are the questions that matter.</p><h3>Closing</h3><p>The most powerful AI setup I have used is not just a model.</p><p>It is a governed stack:</p><ul><li>Claude CLI as exoskeleton</li><li>CLAUDE.md as constitution</li><li>A three-tier memory architecture as hippocampus</li><li>TDD as immune system</li><li>Combined Force as doctrine</li><li>Human judgment as sovereign</li></ul><p>That is the difference between <strong>using</strong> AI and <strong>operating with</strong> AI.</p><p>One is a tool.</p><p>The other is an architecture.</p><h3>References</h3><p>[1] Lisanne Bainbridge (1983). Ironies of Automation. Automatica, 19(6), 775–779. doi:10.1016/0005–1098(83)90046–8</p><p>[2] Parasuraman, R., &amp; Manzey, D. H. (2010). Complacency and Bias in Human Use of Automation: An Attentional Integration. Human Factors, 52(3), 381–410. <a href="https://doi.org/10.1177/0018720810376055">https://doi.org/10.1177/0018720810376055</a></p><p>[3] AI Fluency: Framework &amp; Foundations — the four-D model (Delegation, Description, Discernment, Diligence). Anthropic. <a href="https://www.anthropic.com/ai-fluency">https://www.anthropic.com/ai-fluency</a></p><p>[4] Madeleine Clare Elish (2019). Moral Crumple Zones: Cautionary Tales in Human-Robot Interaction. Engaging Science, Technology, and Society, 5, 40–60. <a href="https://doi.org/10.17351/ests2019.260">https://doi.org/10.17351/ests2019.260</a></p><p><em>This essay is part 5 of the Combined Force Methodology series.</em></p><p><em>This concludes the core series: the methodology, its governance layer, its scaling pattern, its persistence architecture, and the human-machine interface that emerges when the layers compose. Next month: Recursive Combined Force, a continuation of the series once the core architecture exists.</em></p><p><em>Octavio Rojas Topete is Lead iOS Engineer and Multi-Platform Mobile Architect at AgileEngine. He writes about engineering methodology, AI-augmented development, and technical hiring. Previously at Pluto TV, New York Post, Globant, and Disney. Find him on LinkedIn or at </em><a href="https://github.com/tattva20"><em>github.com/tattva20</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7d8b92523fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Persistence Layer of Combined Force]]></title>
            <link>https://medium.com/@tattva20/the-persistence-layer-of-combined-force-96ce12f5abc0?source=rss-b8f0f3be0478------2</link>
            <guid isPermaLink="false">https://medium.com/p/96ce12f5abc0</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[engineering-methodologies]]></category>
            <category><![CDATA[combined-force]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Octavio Rojas]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 15:01:04 GMT</pubDate>
            <atom:updated>2026-07-27T14:17:09.749Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why AI workflow memory needs three architectural tiers, not one</h3><figure><img alt="The Persistence Layer of Combined Force." src="https://cdn-images-1.medium.com/proxy/1*fvSqZncsPEeUYOJfc9xUGQ.jpeg" /><figcaption>The Persistence Layer of Combined Force.</figcaption></figure><p><em>Part 4 of the Combined Force Methodology series. Previous: </em><a href="https://medium.com/@tattva20/the-combined-force-methodology-aa3e1865bee7"><em>The Combined Force Methodology</em></a><em>, </em><a href="https://medium.com/@tattva20/the-governance-layer-of-the-combined-force-methodology-367dbebf6f94"><em>The Governance Layer of the Combined Force Methodology</em></a><em>, and The Platform Layer.</em></p><p><strong>Author Statement</strong> — The ideas, hypotheses, architectures, experiments, analysis, and conclusions presented in this article are entirely the author’s. AI tools were used solely to assist with drafting and language refinement under the author’s supervision. Every technical claim, reference, example, and conclusion was reviewed by the author, who assumes full responsibility for the final work.</p><p>Last month I spent forty minutes debugging why a GitLab MR comment ended up at the top of the merge request instead of inline on the diff. The glab API call looked correct. The position fields were there. The comment posted. But the comment was in the wrong place.</p><p>GitLab’s API requires a JSON body with an explicit Content-Type: application/json header. If you use form encoding -f, the position object never reaches the server. The note posts top-level by default.</p><p>I figured it out, fixed it, moved on.</p><p>A week later I would have made the same mistake again. Not because I forgot the diagnosis — I remembered the diagnosis. Because I forgot that <em>the diagnosis applied to this situation</em>. The cue I needed was: “when someone says ‘inline comment’, the form-encoded path fails silently.”</p><p>Without that cue, I would re-debug.</p><p>This is the problem of session amnesia. And it is solved — not by writing more prompts, but by building a persistence architecture underneath your AI workflow.</p><p>This article describes how. Three layers, each with a different cost-benefit profile. Together they prevent re-learning.</p><h3>The architecture in one diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWY-nDwY9Wor6yg1BO594Q.png" /><figcaption>The persistence layer uses three tiers so critical rules stay always visible while detailed memory loads only when relevant.</figcaption></figure><p>Three layers. One problem solved at three different cost-benefit points.</p><h3>The naive solutions and why they fail</h3><p>Before describing the architecture, it’s worth being explicit about what fails.</p><p><strong>Naive solution A: dump everything into the global rules file.</strong></p><p>This is the obvious first move. You learn something, you add it to CLAUDE.md. After three months, your CLAUDE.md is 5,000 lines. Critical doctrine is mixed with debugging anecdotes. The model that loads this file at every session start now has to process all of it just to make a single decision. Context window pressure increases. Important rules get lost in the noise.</p><p><strong>Naive solution B: keep nothing, re-derive on demand.</strong></p><p>This is the path of least resistance. Every session starts fresh. The model gets confused about phrasing it should know. You spend time re-explaining context that was painfully earned in previous conversations. The cost is distributed across every session instead of concentrated at the moment of writing, but it is paid every time.</p><p><strong>Naive solution C: write everything to a single memory file.</strong></p><p>You create notes.md and dump everything there. It grows organically. After six months, finding anything requires grep. The model has no way to surface the right entry at the right time because there is no index. Information exists but is undiscoverable.</p><p>The three-layer architecture solves all three failure modes simultaneously.</p><h3>Layer 1 · Global doctrine</h3><p>The first layer is the file that loads at every session start, in every repository, across every conversation. For me this is ~/.claude/CLAUDE.md. For other AI tools it might be a system prompt, a .cursorrules file, or custom instructions.</p><p><strong>The constraint that matters: this file is expensive.</strong> Every session pays its cost in tokens. Every decision the model makes has to incorporate it. So the contents must justify that cost.</p><p>The question I ask before adding anything to layer 1: <em>would missing this rule cause silent failure?</em></p><p>If yes — for example, “never push to remote without explicit user permission” — it goes in layer 1. The cost of paying tokens to enforce this rule every session is dramatically less than the cost of one accidental push.</p><p>If no — for example, “here’s a full debug history of a one-time issue” — it goes in layer 2. Putting it in layer 1 would dilute the high-priority rules.</p><p>What lives in layer 1 in my system:</p><ul><li>Operating doctrine (TDD discipline, Clean Architecture rules)</li><li>Hard permissions (never push, never create MRs without permission)</li><li>Tool selection rules (use glab not WebFetch for GitLab URLs)</li><li>Phrase-to-method mappings (“inline comment” maps to specific posting method)</li><li>Bypass protocol (how to handle explicit user override of doctrine)</li></ul><p>The file grew to roughly 700 lines — every one earned through a specific past mistake or principle worth enforcing. But 700 lines is also a warning light. It’s the same pressure Naive Solution A fails under, only postponed by discipline: the always-loaded layer was slowly stopping being terse. The fix wasn’t to keep shaving a single file. It was to give Layer 1 the same treatment I’d been giving everything else — decomposition. (More on that below.)</p><p>The recent addition: when a user says “inline comment”, that phrase must map unambiguously to the JSON-body method. Not the -f flag method. The mapping is in a table. The full working code snippet is in the file. The mistake takes ten seconds to look up instead of forty minutes to re-debug.</p><h3>Layer 2 · Auto-memory</h3><p>The second layer is detailed context that surfaces only when relevant.</p><p>For me, this is individual .md files in ~/.claude/projects/.../memory/. Each file is one self-contained note: a debugging history, a project state, a reference, a piece of personal context. Files are loaded when grep finds them relevant to the current prompt.</p><p><strong>The constraint that matters: layer 2 entries can be verbose.</strong> Because they only load when relevant, the per-session cost is low. You can write the full chronicle: the bug, the failed attempts, the working solution, the verification steps, the cleanup commands.</p><p>What lives in layer 2 in my system:</p><ul><li>Debugging chronicles (the full glab inline comment investigation)</li><li>Reference materials (specific Jira workflows, GitLab API patterns)</li><li>Conversational memory (insights from prior conversations that might recur)</li><li>Domain-specific knowledge (e.g., my interview rubrics, my methodology details)</li></ul><p>The contents are richer than layer 1 allows. A layer 2 entry can be 500 lines describing the full debugging path that led to a single layer-1 rule. The depth informs the rule without polluting it.</p><h3>Layer 3 · The index</h3><p>The third layer is the smallest and most overlooked. It is the index that ensures layer 2 entries are <em>discoverable</em>.</p><p>For me, this is MEMORY.md — a file that is always loaded (like layer 1) but contains only one-line pointers to layer 2 entries. Each line is approximately 150 characters: a name, a brief description, and the relationship to other entries.</p><p><strong>The constraint that matters: this file is also expensive (always loaded) but must stay small.</strong> If it grows past 200 lines, it loses its function. The cure for an oversized index is <em>moving entries to layer 2 with cross-references, not deleting them</em>.</p><p>The reason layer 3 exists, even though it duplicates information from layer 2: <strong>discoverability</strong>.</p><p>Without an index, layer 2 entries exist but are not surfaced. Grep can find them only if the prompt happens to contain the right keywords. The index makes them discoverable through <em>concepts</em>, not just keywords.</p><p>In my system, the index entry for the glab inline comments memory note says:</p><blockquote>“reference-glab-inline-mr-comments — Full debugging history of why -f position[xxx]=val fails for GitLab inline MR comments. Working JSON body pattern + verification + cleanup.”</blockquote><p>When the model loads MEMORY.md at session start and sees a prompt about GitLab comments, this index entry tells it: <em>there is a detailed entry available, and here is approximately what it contains.</em> The full entry then loads on demand.</p><p>Without layer 3, the model would not know layer 2 had the answer.</p><h4>grep now, embeddings when the corpus outgrows it</h4><p>There’s an obvious objection to Layer 2 as I’ve described it: retrieval is just grep. A note surfaces when the prompt happens to share a word with it. Ask about “inline comments” and reference-glab-inline-mr-comments.md loads; ask the same thing in other words — “why did my MR note post at the top?” — and the literal match can miss. Layer 3 is the hand-built patch for exactly that: the index describes each entry in concepts, so the model can reason its way to a note whose body it has never seen. But the index is something I write and prune by hand. It is a manually maintained semantic layer.</p><p>The automated version of that layer has a name — retrieval-augmented generation. Instead of matching strings, you embed each Layer 2 note as a vector, embed the prompt the same way, and retrieve by nearness in meaning, so “why did my note post at the top?” and “inline comment fails silently” land near the same entry with no shared words at all. RAG is, in one framing, Layer 3 that builds and queries itself.[5]</p><p>I run grep anyway, and the reasons are the honest ones. grep is zero-dependency, deterministic, and inspectable: I can see exactly why a note did or didn’t load, and fix it by renaming a file. An embedding index adds a vector store, a model to produce the vectors, and a new failure mode — silent staleness, where the index drifts from the notes it points at and nothing errors. For a personal corpus of a few hundred notes with a curated index, grep plus Layer 3 goes remarkably far, and every part of it fits in my head.</p><p>The calculus flips with scale. When Layer 2 is a team’s corpus — thousands of chronicles no single person indexes or even remembers — the hand-written index stops being maintainable, and paying an embedding to do the surfacing earns its cost. That is the same test the three layers are built on, applied one level up: grep while the corpus fits a person, vectors when it outgrows one. The tiers don’t change; only the machinery that pages the warm tier into attention does.</p><h3>Layer 1, a year in: the doctrine went modular</h3><p>So here’s the shape Layer 1 took. The entry point is now a forty-byte pointer: ~/.claude/CLAUDE.md no longer holds any doctrine, it imports one. It names a composition root — system/CLAUDE.md — which in turn names only what is active: a fixed invariant core (the design primitives, the epistemology that refuses to trust itself, and the governance rules that are nothing but rules about the rules), exactly one swappable stack for the technology a given project uses, and the index. The flat file became a small tree with a clear owner for each part.</p><p>The three layers didn’t change — their cost-benefit logic is precisely as described above. What changed is how Layer 1 is built: a spine that rarely changes, a slot that swaps per project, and a memory that loads on demand. A fixed core, projected onto swappable stacks. Same architecture, one level deeper — and a linter now gates every change before it lands, so the structure can’t quietly rot back into a dump.</p><p>Why aphorisms, specifically? Because Layer 1 has a hard budget — it’s paid every session, so it must stay terse — and the core answers that budget with its form. Each primitive is one load-bearing line: a name, the rule, and the fault it prevents. The prose that explains it, the war story that earned it, the worked example that unfolds it — all of that lives in Layer 2, one tier down, loaded only when it’s needed. The aphorism is the compression format of the hot tier: the shortest string that still changes a decision. It’s the same instinct behind Pāṇini’s sūtras — a whole grammar in a few thousand aphorisms — and behind the study file this method began as. A terse layer to remember; a narrative layer to understand.</p><p>There’s a real lineage beneath this, and it’s worth being exact about what it is and isn’t. Pāṇini’s system — a fixed set of primitives plus meta-rules for when they conflict — is a documented forerunner of the formal grammars computing runs on. A computer scientist once proposed renaming the Backus–Naur Form, the notation we still use to define programming-language syntax, the “Pāṇini–Backus Form,” to credit a grammarian who had built a system of equivalent power two and a half thousand years earlier. [3] And the exact mechanism I lean on here — the meta-rule that decides which rule wins when two collide — is the one Rishi Rajpopat, a scholar at Cambridge, decoded in 2022 after it had defeated commentators for 2,500 years: not “whichever rule comes later,” but a principled resolution that makes the whole grammar consistent. [4]</p><p>What I won’t claim is that any of this built modern AI. It didn’t. Rule-based approaches to language were largely set aside decades ago in favor of the statistical and neural methods today’s models are made of, and even the computational payoff of Rajpopat’s own discovery is described by its own university as future potential, not a result. The honest connection is narrower, and to me more interesting: I’m not resurrecting rule-based AI to replace the neural model — I’m laying a small rule-based constitution on top of one, to govern how it is allowed to reason. The oldest idea in grammar, used not as the engine but as the seatbelt.</p><p>And whether a given line has really earned its expensive seat isn’t a matter of taste. I measure it — a rule that reads well but changes no decision is dead weight, not doctrine. How I run those measurements, and what they honestly did and didn’t show, is an essay of its own, later in this series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eC3JTDJOTuKpQt7iUZ3Psw.png" /><figcaption>The old flat ~700-line CLAUDE.md became a pointer plus a module tree: a fixed core, one swappable stack, and an index that keeps detailed memory discoverable.</figcaption></figure><h3>Why three layers, not one</h3><p>The three layers exist because they have different cost-benefit profiles. A single-layer approach forces a single tradeoff. Three layers allow three tradeoffs.</p><p>Layer 1: <strong>always paid, must be terse, holds the most critical rules.</strong></p><p>Layer 2: <strong>paid only when relevant, can be verbose, holds detailed context.</strong></p><p>Layer 3: <strong>always paid, must be brief, surfaces layer 2 to attention.</strong></p><p>The tradeoffs map cleanly to the kinds of knowledge you accumulate working with AI:</p><ul><li>Some knowledge is critical at every decision (layer 1)</li><li>Some knowledge is irrelevant most of the time but expensive to re-derive when needed (layer 2)</li><li>Some knowledge is the pointer that turns layer 2 from invisible to accessible (layer 3)</li></ul><p>Building only layer 1 produces an overloaded CLAUDE.md that becomes hostile to read. Building only layer 2 produces invisible knowledge. Building layers 1 and 2 without 3 produces knowledge that exists but is not consistently discovered.</p><p>The three-layer split is the same architectural decomposition you would apply to any system where you have different categories of data with different access patterns. Hot data, warm data, cold data. This isn’t a loose analogy — it’s the memory hierarchy computer architecture has run on for decades: registers and cache for what’s touched constantly, main memory and disk for what’s needed rarely, each tier trading capacity against speed. [1] Critical rules, contextual chronicles, indexable pointers — the same shape, one layer up the stack.</p><p>I’m not the first to reach for this shape, and that’s the point. Work on giving language models long-term memory has independently converged on the same move: a small, always-present context backed by larger external stores the system pages in on demand — explicitly borrowing the operating system’s memory hierarchy to do it. [2] They arrived there to build an agent; I arrived there by hand, trimming a study file until it split into tiers. When a paper treating the model as an operating system and an engineer trimming his own workflow land on the same architecture, the architecture is probably not an accident.</p><h3>The decision tree</h3><p>When I learn something new working with AI, the question is: where does this belong?</p><p>The decision tree I use:</p><pre>Is this a rule that, if missed, causes silent failure or violation of intent?<br>├── Yes → Layer 1 (global doctrine)<br>└── No<br>    ├── Is this detailed enough to warrant 100+ lines?<br>    │   ├── Yes → Layer 2 (memory note) + Layer 3 (index entry)<br>    │   └── No → Layer 2 only (if recurring) or session-discardable<br>    └── Is this a pointer that helps future-me notice<br>        a related layer 2 entry exists?<br>        └── If yes → Layer 3 only</pre><p>In practice, the glab inline comments lesson produced entries in all three layers:</p><ul><li>Layer 1: a phrase-mapping table in CLAUDE.md § 4 saying “inline comment” maps to the JSON body method</li><li>Layer 2: a memory note titled reference-glab-inline-mr-comments.md with the full forty-minute debug chronicle</li><li>Layer 3: an index entry in MEMORY.md pointing to the memory note</li></ul><p>The Layer 1 entry is what prevents the mistake. The Layer 2 entry is what justifies the Layer 1 rule with full debugging history. The Layer 3 entry ensures Layer 2 is discovered when relevant.</p><p>Three layers, one lesson, encoded three times at three different specificity levels.</p><h3>Patterns that emerge</h3><p>After running this architecture for a year, patterns crystallize.</p><p><strong>Cross-references are critical.</strong> Layer 1 rules should link to Layer 2 entries that justify them. Layer 2 entries should link to other related Layer 2 entries. Layer 3 entries should hint at Layer 2 cross-links. Without cross-references, each layer becomes an island.</p><p><strong>Names matter.</strong> Layer 2 file names are searchable. A note titled notes-2026-04-23.md is useless. A note titled reference-glab-inline-mr-comments.md surfaces immediately when relevant.</p><p><strong>Trim Layer 1 quarterly.</strong> The temptation is always to add to global doctrine. Resist. Every quarter, audit. Move anything that has not been activated to Layer 2. The discipline keeps the file from becoming the dump.</p><p><strong>Don’t write Layer 2 directly into Layer 3.</strong> A common mistake: writing detailed content into the index. The index should never contain content; only pointers. If you need detail, write a Layer 2 file and link it.</p><p><strong>Use the architecture for projects, not just for tools.</strong> I have Layer 2 entries for personal projects (my interview frameworks, my Combined Force methodology), each with its own debugging history. The architecture generalizes beyond technical tooling.</p><h3>Beyond personal: teams</h3><p>Everything described so far is personal. One human + their AI tools.</p><p>The same architecture works at team scale, with these substitutions:</p><ul><li>Layer 1 → team-wide governance document committed to a shared repository</li><li>Layer 2 → team-wide notes directory, with consistent naming conventions, also committed</li><li>Layer 3 → team-wide index, owned by a designated maintainer</li></ul><p>A team adopting this pattern collectively persists what no individual could persist alone. The team’s debugging chronicles compound. New hires inherit the corpus instead of re-deriving it.</p><p>This is also where the persistence layer connects to the platform layer from the previous article. A team platform that distributes governance + memory + index is genuinely shared cognition. The team is not just sharing tools — it is sharing accumulated lessons.</p><h3>The deeper insight</h3><p>Combined Force, in its first article, was about how a disciplined individual amplifies their work with AI. Governance, in the second, was about preventing AI from replacing judgment in the moment. Platform, in the third, was about scaling the methodology to a team.</p><p>Persistence, in this fourth article, is about something different: making the methodology <em>self-improving over time</em>.</p><p>A workflow without persistence can only be as good as the lessons the operator remembers in any given session. With persistence, the workflow accumulates. Lessons from session 1 inform session 2, and session 2 informs session 3. After a year of disciplined accumulation, the workflow is dramatically smarter than it was at start — not because the AI got smarter, but because the system around the AI did.</p><p>This is how methodology becomes capital. Each lesson encoded into the persistence stack is a fractional asset that compounds. The compound interest is real. After enough time, you stop re-debugging things you debugged once.</p><p>That is the architecture of expertise made executable.</p><h3>References</h3><p>[1] John L. Hennessy and David A. Patterson. Computer Architecture: A Quantitative Approach (Morgan Kaufmann) — the memory hierarchy and the capacity-versus-speed tradeoff across tiers.</p><p>[2] Charles Packer et al. (2023). MemGPT: Towards LLMs as Operating Systems. <a href="https://arxiv.org/abs/2310.08560">https://arxiv.org/abs/2310.08560</a></p><p>[3] Peter Z. Ingerman (1967). “Pāṇini-Backus Form” Suggested. Communications of the ACM 10(3), 137.</p><p>[4] Rishi A. Rajpopat (2022). In Pāṇini We Trust: Discovering the Algorithm for Rule Conflict Resolution in the Aṣṭādhyāyī. PhD thesis, University of Cambridge. <a href="https://www.cam.ac.uk/stories/solving-grammars-greatest-puzzle">https://www.cam.ac.uk/stories/solving-grammars-greatest-puzzle</a></p><p>[5] Patrick Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. NeurIPS 2020. https://arxiv.org/abs/2005.11401</p><h3>Where this fits in the series</h3><p>In the broader picture of Combined Force methodology:</p><ul><li>Article 1 answered <em>what</em></li><li>Article 2 answered <em>how</em></li><li>Article 3 answered <em>where</em> (across team)</li><li>This article answers <em>when</em> (across time)</li><li>Article 5, coming soon, will answer <em>who operates the stack</em> — the human-machine interface that emerges when the layers compose</li></ul><p>Five layers, one architecture, one methodology. Each layer is independently usable. Together they describe a complete operating system for AI-augmented engineering practice.</p><p>The persistence layer is the one that makes the other four sustainable. Without it, every session re-learns. With it, the work accumulates.</p><p>That difference, multiplied across the years of an engineering career, is the difference between practicing with AI and being made obsolete by it.</p><p><em>This essay is part 4 of the Combined Force Methodology series.</em></p><p><em>Previous: Combined Force at Scale: The Platform Layer. Next: The Operator Layer of Combined Force.</em></p><p><em>Octavio Rojas Topete is Lead iOS Engineer and Multi-Platform Mobile Architect at AgileEngine. He writes about engineering methodology, AI-augmented development, and technical hiring. Previously at Pluto TV, New York Post, Globant, and Disney. Find him on LinkedIn or at </em><a href="https://github.com/tattva20"><em>github.com/tattva20</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ce12f5abc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>