<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://mjoyufull.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mjoyufull.github.io/" rel="alternate" type="text/html" /><updated>2026-08-27T14:56:52+00:00</updated><id>https://mjoyufull.github.io/feed.xml</id><title type="html">Ikai</title><subtitle>I talk about stuff</subtitle><author><name>Rikona</name></author><entry><title type="html">Linux Needs A Universal Back Action</title><link href="https://mjoyufull.github.io/2026/08/19/linux-nav-back.html" rel="alternate" type="text/html" title="Linux Needs A Universal Back Action" /><published>2026-08-19T00:00:00+00:00</published><updated>2026-08-19T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/08/19/linux-nav-back</id><content type="html" xml:base="https://mjoyufull.github.io/2026/08/19/linux-nav-back.html"><![CDATA[<p>Android got “Back” right.</p>

<p>You can be four pages deep in Settings, reading something in Firefox, inside a chat history, whatever. then swipe from either edge and the current thing goes back. You don’t stop to find where that app put its arrow(hmmm hmm ios). You don’t have remember this specific apps shortcut. You just go back.</p>

<p>Linux has all the individual versions of this but no system version really. Firefox has history. File managers have previous locations. Qt and GTK apps have page stacks. Mouse buttons can send Back keys. Then the shell has its own gestures sitting above all of it with no shared way to say the user wants the current thing to go back.</p>

<p>I think there should be one (or two lmxp).</p>

<pre><code class="language-text">app knows:
"where does Back go?"

compositor knows:
"the user invoked Back"

protocol connects them
</code></pre>

<p>The exact input is desktop managed, Mobile Linux could use the Android-style edge swipe, a desktop could use a mouse button, keyboard key, trackpad gesture, accessibility control, or some literal Back button in the shell, could be mapped however.</p>

<p>They should all reach the same action.</p>

<p>Let me define the action first because this gets stupid fast if we don’t define Back.</p>

<h2 id="what-back-is">What Back Is</h2>

<p>Back returns to the state that led to the current state.</p>

<p>In Firefox that comes from browser history.</p>

<pre><code class="language-text">Google -&gt; Wikipedia -&gt; article -&gt; current page
                                &lt;- Back
</code></pre>

<p>In Settings it *probably comes from a page stack.</p>

<pre><code class="language-text">Settings -&gt; Network -&gt; Wi-Fi -&gt; My network
                              &lt;- Back
</code></pre>

<p>A file manager already tracks the previous location, a chat app knows the conversation list is under the conversation you opened, and if a menu, dialog, drawer, or temporary page needs to disappear first, the app knows that too.</p>

<p>But The compositor has none of this information. 
we should keep history in the app.
But the compositor still owns the gesture, so there needs to be a crossing point.</p>

<h2 id="the-solution">The solution</h2>

<p>My first thought was a small Wayland protocol. Something like <code>xdg_navigation</code> or <code>ext_navigation</code>, naming bikeshed can come beat me later along with the wayland forums.</p>

<p>The app should tell the compositor whether its active window currently has a Back handler, Then compositor sends Back when the user invokes the shell’s configured action.</p>

<pre><code class="language-text">             APPLICATION
                  |
                  | can_go_back
                  v
        +---------------------+
        | navigation protocol |
        +---------------------+
                  ^
                  |
                  | back
                  |
             COMPOSITOR
</code></pre>

<p>The compositor does not pop anything itself, it just sends the action and the app runs the same handler its own back button already uses.</p>

<p>Linux does have Back key symbols already kinda, GTK exposes <code>GDK_KEY_Back</code>, Qt has <code>Qt::Key_Back</code>, and mouse or keyboard hardware can send that input to the focused apps That part is useful and should feed the same handler.</p>

<p>But a key only says a key happened. It does not tell the shell whether Back is available right now, and it cannot represent a gesture beginning, moving, cancelling, or committing. You can fake <code>Alt+Left</code> too, but then it works in Firefox, probably works in a file manager, then lands in some editor where it moves a cursor or hits a random binding and now the “universal” solution doesn’t work.</p>

<h2 id="the-toolkits-already-have-the-state">The Toolkits Already Have The State</h2>

<p>Qt Quick Controls has <code>StackView</code>. It exposes <code>depth</code> and <code>pop()</code>. Kirigami has page stacks and <code>goBack()</code>. Libadwaita has <code>AdwNavigationView</code>, which already connects navigation state to its own buttons, shortcuts, mouse Back input, touchscreen swipes, and touchpad gestures.</p>

<p>This is not new state.</p>

<p>The toolkit would need a window-level dispatcher because one window can have nested stacks, a dialog, a drawer, maybe a temporary layer over all of it. You cannot grab the first <code>StackView</code> you find and call <code>pop()</code> unless you enjoy debugging UI state at 3 AM.</p>

<pre><code class="language-text">window Back dispatcher
        |
        +-&gt; temporary layer
        +-&gt; active dialog
        +-&gt; inner page stack
        +-&gt; outer page stack
</code></pre>

<p>Topmost active handler goes first. Then the next one.</p>

<p>For most apps, using normal toolkit navigation should be enough. The toolkit advertises Back and routes the event. Apps with custom UI register a handler themselves.</p>

<p>If every app developer has to manually synchronize some Wayland boolean whenever they push a page, this shit is dead on arrival. The toolkit integration is the feature.</p>

<p>Now the layer question.</p>

<h2 id="does-this-belong-in-wayland">Does This Belong In Wayland</h2>

<p>This was the first thing people pushed back on when I brought the idea up.</p>

<p>One response was basically “I like it, not sure this belongs in low-level Wayland.” Another person said they were already doing something similar in Hyprland userspace. Someone else thought it needed a Wayland base and then UI-specific behavior on top.</p>

<p>Fair.</p>

<p>The navigation model is high-level because it lives in an app. The trigger can be low-level because a compositor owns edge gestures and system input policy. A GTK-only solution does not give a Qt desktop a universal action, and a Qt-only solution does nothing for Firefox. The Global Shortcuts portal is aimed at app actions that can fire while the app is unfocused, whilst Back belongs to whichever window is active and changes availability every time its UI moves.</p>

<p>So I keep landing at Wayland for the crossing point.</p>

<pre><code class="language-text">app state -&gt; toolkit -&gt; Wayland -&gt; compositor policy
</code></pre>

<p>I don’t know if that exact placement survives implementation. Thats the part I actually want feedback on. Build one compositor path and one toolkit path, then if the location feels like ass we know what failed instead of making up fifteen theoretical versions of it on a mailing list (hhmmm hmm xdg).</p>

<p>And there are enough ugly cases to test.</p>

<h2 id="where-im-strugglin-a-bit">Where im strugglin a bit</h2>

<p>Wayland does not have one generic focus. Keyboard, pointer, and touch focus can differ. Popups can grab input. Modal child windows exist. One process can own multiple windows and every window can have different navigation state.</p>

<p>So I think the navigation object belongs to a toplevel window, not the whole process. The toolkit handles menus, dialogs, temporary layers, and page stacks inside that scope. Im less sure about grabbed popups and whether the shell dismisses those before Back reaches the toplevel, so yah that needs code.</p>

<p>Rapid input is another problem.</p>

<p>Say the app has one page left and advertises <code>can_go_back = true</code>. The user invokes Back twice before the compositor sees the new state. A fire-and-forget event could pop once and then do something stupid at the root.</p>

<p>The first version may need one outstanding Back at a time.</p>

<pre><code class="language-text">app                         compositor
 |                              |
 | can_go_back = true           |
 |-----------------------------&gt;|
 |                              |
 |&lt;---------------- back(id) ---|
 |                              |
 | handled(id), now false       |
 |-----------------------------&gt;|
</code></pre>

<p>The app handles the event, reports the new state, then another Back can happen. Maybe there is a cleaner Wayland-shaped way to do it, I don’t know yet, but the ordering has to exist somewhere.</p>

<p>Root behavior is separate. When an app cannot go back, a phone shell might return home. A desktop might show an overview, minimize the window, or do nothing. <code>can_go_back = false</code> cannot just mean close the app because ts don’t work.</p>

<p>Also Back is not Up.</p>

<p>If I search Settings and open Wi-Fi details directly, Back returns to the search results because thats where I came from. Up can go to the Wi-Fi category because thats the structural parent.</p>

<pre><code class="language-text">Back: Wi-Fi details -&gt; search results
Up:   Wi-Fi details -&gt; Wi-Fi
</code></pre>

<p>im here to argue about Back. Forward, Up, Home, and the rest can be someone elses problem.</p>

<p>Then after the one-shot action works, the fun version can happen.</p>

<h2 id="predictive-back">Predictive Back</h2>

<p>Android now lets Back act like a gesture lifecycle. Start, progress, commit, cancel.</p>

<pre><code class="language-text">back_begin(id)
back_progress(id, 0.20)
back_progress(id, 0.65)
back_commit(id)
</code></pre>

<p>The current page can follow your finger while the previous page appears under it. If you change your mind, slide back and cancel.</p>

<pre><code class="language-text">back_begin(id)
back_progress(id, 0.40)
back_cancel(id)
</code></pre>

<p>I want that on Plasma Mobile and Phosh badly. It would be nice on desktop trackpads too.</p>

<p>But predictive Back adds gesture identity, ordering, cancellation, frame timing, client stalls, and animation synchronization. Trying to solve all of that in version one is how version one never exists.</p>

<p>So we should start smaller.</p>

<h2 id="the-first-test">The First Test</h2>

<p>a universal way to interface with everything as i have detailed it,
If Wayland is the wrong spot,should become obvious. If the protocol is wrong, same thing. I mostly want to know whether people agree with the split itself.</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[Android got “Back” right.]]></summary></entry><entry><title type="html">AI Standards</title><link href="https://mjoyufull.github.io/2026/06/04/AI_STANDARDS.html" rel="alternate" type="text/html" title="AI Standards" /><published>2026-06-04T00:00:00+00:00</published><updated>2026-06-04T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/06/04/AI_STANDARDS</id><content type="html" xml:base="https://mjoyufull.github.io/2026/06/04/AI_STANDARDS.html"><![CDATA[<blockquote>
  <p>A Manual for Using LLM Agents on Real Projects Without Turning Git History Into a Diary of Model Hallucinations</p>
</blockquote>

<p><strong>Document Version:</strong> 1.7.0<br />
<strong>Last Updated:</strong> 2026-06-04<br />
<strong>Audience:</strong> Future me and anyone using AI on real repos(larpers) — this is a <strong>human</strong> playbook, not a system prompt.<br />
<strong>Scope:</strong> Cross-project standards for AI-assisted planning, implementation, documentation, and (rarely) git operations</p>

<blockquote>
  <p>[!WARNING]
<strong>Examples are illustrative, not prescriptive</strong>
Paths, filenames, and commands in this document (<code>codingprocess.md</code>, <code>phase.md</code>, <code>ref/</code>, <code>.public.txt</code>, <code>.status.txt</code>, <code>cargo test</code>, etc.) are <strong>examples</strong> from real workflows. Your repo may use different names or(prolly) omit files entirely. Follow the <em>rules</em> here; substitute your project’s actual layout and commands.</p>
</blockquote>

<hr />

<h2 id="table-of-contents">Table of Contents</h2>

<ol>
  <li><a href="#philosophy--principles">Philosophy &amp; Principles</a></li>
  <li><a href="#scope--use">Scope &amp; Use</a></li>
  <li><a href="#related-documentation">Related Documentation</a></li>
  <li><a href="#authority-hierarchy--read-order">Authority Hierarchy &amp; Read Order</a></li>
  <li><a href="#planning--internal-documentation">Planning &amp; Internal Documentation</a></li>
  <li><a href="#session-contract-codingprocessmd">Session Contract: <code>codingprocess.md</code></a></li>
  <li><a href="#the-ref-directory">The <code>ref/</code> Directory</a></li>
  <li><a href="#public-surface-publictxt">Public Surface: <code>.public.txt</code></a></li>
  <li><a href="#status-surface-statustxt">Status Surface: <code>.status.txt</code></a></li>
  <li><a href="#public-documentation-voice">Public Documentation Voice</a></li>
  <li><a href="#prompt--task-shape">Prompt &amp; Task Shape</a></li>
  <li><a href="#session-lifecycle">Session Lifecycle</a></li>
  <li><a href="#minimizing-code-churn">Minimizing Code Churn</a></li>
  <li><a href="#engineering-rigor--virtuous-laziness">Engineering Rigor &amp; Virtuous Laziness</a></li>
  <li><a href="#verification--evidence">Verification &amp; Evidence</a></li>
  <li><a href="#git-branches-and-commits">Git, Branches, and Commits</a></li>
  <li><a href="#where-ai-excels">Where AI Excels</a></li>
  <li><a href="#security--trust">Security &amp; Trust</a></li>
  <li><a href="#external-benchmarks">External Benchmarks</a></li>
  <li><a href="#what-not-to-do">What Not To Do</a></li>
  <li><a href="#session-checklist">Session Checklist</a></li>
  <li><a href="#summary">Summary</a></li>
</ol>

<hr />

<h2 id="philosophy--principles">Philosophy &amp; Principles</h2>

<h3 id="core-tenets">Core Tenets</h3>

<ol>
  <li><strong>Contracts beat “vibes”.</strong> Behavior comes from specs and standards, not from chat memory or <code>phase.md</code>.</li>
  <li><strong>Plan before you patch.</strong> Hard work gets roadmaps, direction docs, and status ledgers before large code dumps — then <strong>interplay</strong> in small slices once you know what you are attacking.</li>
  <li><strong>Evidence before “done.”</strong> If tests did not run, say so. If behavior is unknown, record it in <code>idk.md</code>.</li>
  <li><strong>Small, honest slices.</strong> One real improvement beats ten inflated status updates — and beats the rework churn that shows up when AI touches too much at once (see <a href="#minimizing-code-churn">Minimizing Code Churn</a>).</li>
  <li><strong>Internal docs are internal.</strong> Planning, study notes, and <code>ref/</code> material are not public-facing project docs, gang some of yall turn your repos into markdown soup and feed us AI text as if we gone read all dat.</li>
  <li><strong>Short prompts, real verification.</strong> Task text should read like a developer message, not a scraped GitHub issue novel.</li>
  <li><strong>You own git by default.</strong> You and the model edit files; <strong>you</strong> commit unless you explicitly told it it may commit this session.</li>
  <li><strong>Process is mandatory.</strong> <code>codingprocess.md</code> and project standards are constraints, not suggestions.</li>
  <li><strong>Deviation is explicit.</strong> When implementation diverges from plan for good reason, write it down — do not silently rewrite the spec.</li>
  <li><strong>Public copy describes what ships.</strong> No “we will eventually” in README, LICENSE, or operator docs unless status is the point.</li>
  <li><strong>Status docs move with the work.</strong> List living ledgers in <strong><code>.status.txt</code></strong> and update them when your triggers fire — stale <code>phase.md</code> after a green test run is a failed handoff.</li>
  <li><strong>Right mode for the moment.</strong> <strong>Sit-and-plan</strong> when the attack surface is unclear; <strong>interplay</strong> when a direction doc already shows the tree — side panel, skinny prompts, short replies, you stay in the driver’s seat.</li>
  <li><strong>Virtuous laziness, not vanity output.</strong> Models don’t feel time pressure — you do. Use AI to make the system <strong>simpler and easier to maintain</strong>, not to win lines-of-code scoreboards i swear to god some of yall be geekin. (see <a href="#engineering-rigor--virtuous-laziness">Engineering Rigor &amp; Virtuous Laziness</a>).</li>
</ol>

<h3 id="virtuous-laziness-why-small-slices-are-moral-not-timid">Virtuous laziness (why small slices are moral, not timid)</h3>

<p>Larry Wall’s programmer virtue <strong>laziness</strong> is ironic: real laziness is hard work up front — abstractions, simplicity, hammock-driven thinking — so future you (and everyone else) spends less time fighting the system. Your finite time is a <strong>feature</strong>: it forces cognitive load limits and pushes you toward crisp design.</p>

<p>LLMs don’t share that constraint. Work costs them nothing; left unchecked they <strong>grow systems</strong> — duplicate paste, stowaway files, whole subsystems you didn’t ask for — because vanity metrics (lines per day, “still speeding up”) reward bulk, not maintainability. Bryan Cantrill’s <a href="https://bcantrill.dtrace.org/2026/04/12/the-peril-of-laziness-lost/"><em>The peril of laziness lost</em></a> is the clearest statement of the failure mode: <strong>layercake garbage</strong> from false industriousness, corpo’s.</p>

<p>Your job is to supply the laziness the model lacks:</p>

<ul>
  <li><strong>Constraints</strong> — spec, slice boundaries, out-of-scope, churn limits in <code>codingprocess.md</code> and standards</li>
  <li><strong>Curiosity</strong> — read the diff; don’t “vibe” until green (see <a href="#engineering-rigor-vs-vibe-coding">Engineering Rigor</a>)</li>
  <li><strong>Simplicity as success</strong> — fewer moving parts beats a bigger PR; reject “helpful” extras</li>
</ul>

<p>Use AI for the <strong>non-virtuous</strong> grunt (doc tests, pattern replication, tedium) in service of <strong>virtuous</strong> outcomes: simpler surfaces, stronger tests, work you would otherwise never get to — the middle path Oxide folks describe in <a href="https://oxide-and-friends.transistor.fm/episodes/engineering-rigor-in-the-llm-age/transcript">Engineering Rigor in the LLM Age</a>.</p>

<h3 id="design-intent">Design Intent</h3>

<p>These standards exist so AI-assisted work stays:</p>

<ul>
  <li>aligned with my very opinionated <code>PROJECT_STANDARDS.md</code> and <code>CODE_STANDARDS.md</code> when those apply</li>
  <li>traceable across sessions via <code>codingprocess.md</code>, <strong><code>.status.txt</code></strong>, and honestly updated status docs</li>
  <li>safe to resume after context loss</li>
  <li>honest about unknowns instead of guessing semantics</li>
  <li>separated from public-facing prose and licensing</li>
  <li>free of commit spam, co-author theater, and leaderboard optimization</li>
  <li>usable both for long unattended passes <strong>and</strong> for in-editor interplay without the session turning into autopilot</li>
  <li>resistant to <strong>code churn</strong> — short-lived rework, drive-by edits, and oversized diffs that are hard to review and merge</li>
</ul>

<p>This is a standards document, not a prompt cookbook.
If a rule needs to be broken, break it deliberately and document why.</p>

<p>Several rules below are shaped by published work on prompting, long-context use, code-generation security, agent benchmarks, <strong>code churn</strong>, and practitioner essays on rigor (Cantrill, Oxide <a href="https://rfd.shared.oxide.computer/rfd/0576">RFD 576</a>). Primary sources are listed under <a href="#standards-basis">Standards Basis</a> in the Summary — same pattern as <code>CODE_STANDARDS.md</code>.</p>

<hr />

<h2 id="scope--use">Scope &amp; Use</h2>

<p>This document is <strong>not project-specific</strong>.
It is the default AI workflow standard for repos that use the PROJECT_STANDARDS suite unless a project’s <code>codingprocess.md</code> explicitly overrides something.</p>

<h3 id="the-standards-suite">The standards suite</h3>

<table>
  <thead>
    <tr>
      <th>Document</th>
      <th>Governs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="./PROJECT_STANDARDS.md"><code>PROJECT_STANDARDS.md</code></a></td>
      <td>Branches, PRs, releases, <strong>Conventional Commits</strong>, contribution flow</td>
    </tr>
    <tr>
      <td><a href="./CODE_STANDARDS.md"><code>CODE_STANDARDS.md</code></a></td>
      <td>Code structure, testing, style (when the repo uses it)</td>
    </tr>
    <tr>
      <td><a href="./AI_STANDARDS.md"><code>AI_STANDARDS.md</code></a></td>
      <td>How you use AI: planning docs, prompts, git delegation, public/private boundaries</td>
    </tr>
    <tr>
      <td><a href="./DECISION_STANDARDS.md"><code>DECISION_STANDARDS.md</code></a></td>
      <td>D-points, audit markers, how architectural calls are recorded</td>
    </tr>
    <tr>
      <td><a href="./PLANNING_STANDARDS.md"><code>PLANNING_STANDARDS.md</code></a></td>
      <td>Shape of <code>plan.md</code> and planning artifacts</td>
    </tr>
    <tr>
      <td><strong>Per-repo <code>codingprocess.md</code></strong></td>
      <td>Session handoff, read order, non-negotiables for that project</td>
    </tr>
  </tbody>
</table>

<p>If instructions conflict:</p>

<ol>
  <li><strong>Project/spec contract</strong> (<code>SPEC.md</code>, <code>INTENT.md</code>, <code>spec/</code>, etc.) wins on behavior.</li>
  <li><strong><code>codingprocess.md</code></strong> wins on session procedure for that repo.</li>
  <li><strong><code>PROJECT_STANDARDS.md</code></strong> wins on git/PR workflow.</li>
  <li><strong><code>CODE_STANDARDS.md</code></strong> wins on code quality when present.</li>
  <li><strong><code>AI_STANDARDS.md</code></strong> fills gaps for AI-assisted workflow.</li>
  <li>Chat messages do <strong>not</strong> override written standards.</li>
</ol>

<h3 id="start-here">Start here</h3>

<p>Before a substantial AI-assisted slice:</p>

<ol>
  <li>Open the repo’s <strong><code>codingprocess.md</code></strong> (create one if the project is mid-size or larger) and feed or point the model at it.</li>
  <li>Have <strong><code>PROJECT_STANDARDS.md</code></strong> handy if git is in play.</li>
  <li>Have <strong><code>CODE_STANDARDS.md</code></strong> if the project uses it.</li>
  <li>Load authority docs in the <strong>order</strong> <code>codingprocess.md</code> lists (<code>SPEC.md</code>, <code>phase.md</code>, …).</li>
  <li>Check <strong><code>.status.txt</code></strong> when the project uses one — you should know which status files to touch when the slice lands.</li>
  <li>Skim relevant source and tests yourself; don’t outsource orientation to the model.</li>
</ol>

<h3 id="when-this-document-applies">When this document applies</h3>

<ul>
  <li>Any Cursor/Codex/CLI agent session on your repos</li>
  <li>Unattended long passes (“keep going until blocked”)</li>
  <li>Documentation-heavy work (plans, audits, direction, study notes)</li>
  <li><strong>Interplay</strong> — side panel, quick keybinding session, autocomplete top-off, “line this file into <code>main.rs</code>”</li>
  <li>Optional delegated commits (see <a href="#git-branches-and-commits">Git, Branches, and Commits</a>)</li>
</ul>

<p>Small one-off questions do not need a full planning stack.
A multi-file feature, language implementation, or refactor does.</p>

<h3 id="two-workflow-modes">Two workflow modes</h3>

<p>Most of this document describes the <strong>planning pass</strong> playhouse: authority order, gates, <code>.status.txt</code>, honest ledgers, full handoffs. That is the right default for ambiguous or large work.</p>

<p><strong>Interplay</strong> is the other playhouse squeezed into the same rules: you are already in the weeds (Neovim, IDE, terminal), you know the subsystem from a <strong>study</strong> or <strong>direction</strong> doc, and you use AI as a <strong>narrow instrument</strong> — not a second project manager.</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th><strong>Sit-and-plan</strong></th>
      <th><strong>Interplay</strong></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>When</strong></td>
      <td>New subsystem, unclear behavior, big refactor, unattended pass</td>
      <td>Direction doc exists; you know the file tree; one function, one CLI flag, one wiring job</td>
    </tr>
    <tr>
      <td><strong>Planning artifact</strong></td>
      <td><code>plan.md</code>, roadmap, direction doc, gates</td>
      <td><strong><code>implementation-plan</code></strong> for <em>this slice only</em> (chat, scratch file, or <code>impl-&lt;slice&gt;.md</code>)</td>
    </tr>
    <tr>
      <td><strong>Prompt</strong></td>
      <td>Full <a href="#good-task-prompt-shape">contractor shape</a></td>
      <td><a href="#interplay-prompt-skinny">Skinny interplay shape</a></td>
    </tr>
    <tr>
      <td><strong>Reply size</strong></td>
      <td>Full handoff; update status docs</td>
      <td><strong>Short</strong> — what changed, what you do next</td>
    </tr>
    <tr>
      <td><strong>Status docs</strong></td>
      <td>Update <code>.status.txt</code> paths when slice lands</td>
      <td>Often <strong>later</strong> — you merge status when the slice actually closes</td>
    </tr>
    <tr>
      <td><strong>Who drives</strong></td>
      <td>Model can run a slice if you delegated</td>
      <td><strong>You drive</strong>; model tops off, wires, finishes from context</td>
    </tr>
  </tbody>
</table>

<p>Use sit-and-plan until you can name the slice. Then interplay.</p>

<hr />

<h2 id="related-documentation">Related Documentation</h2>

<p>Other suite documents (normative, project-agnostic):</p>

<ul>
  <li><a href="./PROJECT_STANDARDS.md"><code>PROJECT_STANDARDS.md</code></a> — branches, PRs, Conventional Commits</li>
  <li><a href="./CODE_STANDARDS.md"><code>CODE_STANDARDS.md</code></a> — code structure and testing</li>
  <li><a href="./DECISION_STANDARDS.md"><code>DECISION_STANDARDS.md</code></a> — D-points and audit markers</li>
  <li><a href="./PLANNING_STANDARDS.md"><code>PLANNING_STANDARDS.md</code></a> — <code>plan.md</code> shape</li>
</ul>

<p>Illustrative document shapes for planning, session contracts, <code>.public.txt</code> / <code>.status.txt</code>, and boundaries are <strong>in this file</strong> under each section — fictional projects <strong>Harbor</strong> (application) and <strong>Meridian</strong> (language/toolchain). Copy the shapes into your repo; Harbor and Meridian are placeholders, not repos you maintain.</p>

<hr />

<h2 id="authority-hierarchy--read-order">Authority Hierarchy &amp; Read Order</h2>

<p>Models do not reliably use information buried in the middle of a long context window. Liu et al. (<em>Lost in the Middle</em>, TACL 2024) show a U-shaped retrieval curve: relevant text at the <strong>start or end</strong> is used far more reliably than the same text in the middle. A <strong>fixed read order</strong> is worth enforcing in how you prompt — not superstition.</p>

<p>When you prompt:</p>

<ul>
  <li>Put <strong>non-negotiables</strong> (standards, security, “do not invent behavior”) at the <strong>top</strong> of what you send.</li>
  <li>Repeat <strong>done-when, verification commands, and stop conditions</strong> at the end of long prompts or when you ask for a handoff.</li>
  <li>Don’t paste a 400-line file naked — lead with a short index (goal, authority files, done-when).</li>
</ul>

<h3 id="generic-authority-stack">Generic authority stack</h3>

<table>
  <thead>
    <tr>
      <th>Layer</th>
      <th>Typical files</th>
      <th>Role</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Session law</strong></td>
      <td><code>codingprocess.md</code></td>
      <td>Handoff contract you give the model for this repo</td>
    </tr>
    <tr>
      <td><strong>Workflow law</strong></td>
      <td><code>PROJECT_STANDARDS.md</code></td>
      <td>Branches, PRs, commits</td>
    </tr>
    <tr>
      <td><strong>Code law</strong></td>
      <td><code>CODE_STANDARDS.md</code></td>
      <td>Implementation quality</td>
    </tr>
    <tr>
      <td><strong>Behavior contract</strong></td>
      <td><code>SPEC.md</code>, <code>INTENT.md</code>, <code>spec/lang/</code>, …</td>
      <td>What the software must do</td>
    </tr>
    <tr>
      <td><strong>Status / roadmap</strong></td>
      <td><code>phase.md</code>, <code>CODEBASE_AUDIT.md</code>, direction docs (listed in <strong><code>.status.txt</code></strong>)</td>
      <td>What is landed, missing, blocked</td>
    </tr>
    <tr>
      <td><strong>Uncertainty</strong></td>
      <td><code>idk.md</code></td>
      <td>Open behavior questions only</td>
    </tr>
    <tr>
      <td><strong>Deviation</strong></td>
      <td><code>*deviation.md</code>, project-specific name</td>
      <td>Intentional plan/spec drift with rationale</td>
    </tr>
    <tr>
      <td><strong>Planning</strong></td>
      <td><code>plan.md</code>, study docs, phase/direction notes</td>
      <td>How and when to implement — <strong>not</strong> behavior</td>
    </tr>
  </tbody>
</table>

<p><strong>Forbidden promotions:</strong></p>

<ul>
  <li><code>phase.md</code> → behavior spec</li>
  <li>Chat summary → behavior spec</li>
  <li>SWE-bench issue text → task prompt template</li>
  <li>Internal planning prose → public README/LICENSE</li>
</ul>

<h3 id="per-repo-read-order">Per-repo read order</h3>

<p>Every serious project should declare startup order in <strong><code>codingprocess.md</code></strong>. Two common shapes:</p>

<p><strong>Application or service (e.g. fictional “Harbor” deploy tool):</strong></p>

<ol>
  <li><code>CODE_STANDARDS.md</code></li>
  <li><code>SPEC.md</code> — runtime/spec contract</li>
  <li><code>INTENT.md</code> — UX intent / operator model (if split from spec)</li>
  <li><code>phase.md</code></li>
  <li><code>CODEBASE_AUDIT.md</code></li>
  <li><code>idk.md</code></li>
  <li>Relevant <code>src/</code> and tests</li>
</ol>

<p><strong>Language, compiler, or spec-heavy repo (e.g. “Meridian” language):</strong></p>

<ol>
  <li><code>PROJECT_STANDARDS.md</code> and <code>CODE_STANDARDS.md</code></li>
  <li><code>phase.md</code></li>
  <li><code>ACCEPTED.md</code> or equivalent accepted-shape ledger</li>
  <li><code>spec/</code> — normative rules (when written)</li>
  <li><code>DIRECTION.md</code> — implementation direction only</li>
  <li>Relevant compiler/stdlib sources and tests</li>
</ol>

<p>For large edits, ask the model to <strong>say which authority files it read</strong> before it patches — catches skipped <code>SPEC.md</code> / <code>phase.md</code>.</p>

<hr />

<h2 id="planning--internal-documentation">Planning &amp; Internal Documentation</h2>

<p>Hard problems deserve <strong>staged thinking on disk</strong> before code. Wang et al. (<em>Plan-and-Solve Prompting</em>, ACL 2023) show that explicit <strong>plan → execute</strong> beats a bare “think step by step” on multi-step reasoning benchmarks, with fewer missing-step failures. Your <code>plan.md</code>, direction docs, and <code>phase.md</code> queues are that separation applied to engineering — not endless markdown for its own sake.</p>

<p>The split between <code>SPEC.md</code> (behavior), <code>phase.md</code> (status), <code>CODE_STANDARDS.md</code> (implementation law), and <code>codingprocess.md</code> (session procedure) also matches software-engineering work on prompts as <strong>versioned, testable artifacts</strong> (e.g. <em>Promptware Engineering</em>, Casanova et al. 2025; <em>Impromptu</em>, SoSyM 2024): ambiguous natural language needs structure, not one giant blob.</p>

<h3 id="document-types">Document types</h3>

<table>
  <thead>
    <tr>
      <th>Artifact</th>
      <th>Purpose</th>
      <th>Is behavior spec?</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong><code>plan.md</code></strong></td>
      <td>Scope, build order, open decisions (<a href="./PLANNING_STANDARDS.md"><code>PLANNING_STANDARDS.md</code></a>)</td>
      <td>No</td>
    </tr>
    <tr>
      <td><strong><code>phase.md</code></strong></td>
      <td>Status ledger: done / in progress / blocked with evidence paths</td>
      <td>No</td>
    </tr>
    <tr>
      <td><strong>Direction doc</strong></td>
      <td>Implementation direction for a large area (e.g. <code>*direction.md</code>, <code>*languagedirection.md</code>)</td>
      <td>No — cites spec/decided shape</td>
    </tr>
    <tr>
      <td><strong>Study / research note</strong></td>
      <td>Investigation, prior art, tradeoffs (e.g. <code>*study*.md</code>)</td>
      <td>No</td>
    </tr>
    <tr>
      <td><strong>Roadmap / phase planning</strong></td>
      <td>Multi-step release planning (e.g. <code>release-3-planning.md</code>)</td>
      <td>No</td>
    </tr>
    <tr>
      <td><strong><code>idk.md</code></strong></td>
      <td>Unanswered <strong>behavior</strong> questions only</td>
      <td>No — feeds spec/process</td>
    </tr>
    <tr>
      <td><strong>Deviation doc</strong></td>
      <td>Recorded gap between plan/spec and chosen approach</td>
      <td>No — explains intentional drift</td>
    </tr>
    <tr>
      <td><strong><code>CODEBASE_AUDIT.md</code></strong></td>
      <td>Honest map of what exists vs missing</td>
      <td>No</td>
    </tr>
    <tr>
      <td><strong><code>DECISION_STANDARDS</code> D-points</strong></td>
      <td>Architectural forks with IDs</td>
      <td>Decisions, not implementation</td>
    </tr>
    <tr>
      <td><strong>Implementation plan</strong></td>
      <td>Temporary slice plan: files, steps, done-when for <em>one</em> attack</td>
      <td>No — thrown away or archived after the slice</td>
    </tr>
  </tbody>
</table>

<h3 id="implementation-plan-interplay-slice">Implementation plan (interplay slice)</h3>

<p>After a <strong>study</strong> or <strong>direction</strong> doc exists, you already know the tree shape (which crates, which modules, which gates). For one concrete job — fix Clap help output, wire a new file into <code>main.rs</code>, finish a function autocomplete mangled — ask the model for an <strong>implementation-plan</strong>, then execute (yourself, with interplay, or both).</p>

<p>The plan is <strong>narrow</strong>: not a replacement for <code>plan.md</code> or <code>DIRECTION.md</code>.</p>

<p>Example prompt:</p>

<pre><code class="language-markdown">Read `DIRECTION.md` § Checker frontend and `src/cli/args.rs`.
Write an implementation-plan only (no code yet) for: align `--help` with SPEC §2.4 flag table.
List: files to touch, order of edits, test command, done-when.
</code></pre>

<p>Example plan output shape (may live in chat or <code>impl-clap-help.md</code>):</p>

<pre><code class="language-markdown"># Implementation plan — Clap help alignment (Harbor CLI)

**Authority:** SPEC §2.4, `src/cli/args.rs`, `tests/cli_help.rs`
**Out of scope:** subcommand help for `inspect` (separate slice)

## Steps
1. Add missing long flags to `Args` struct; mirror names in `help_template.md` fragment.
2. Regenerate snapshot test `tests/cli_help.rs` if intentional text change.
3. Run `cargo test -p harbor-cli --test cli_help`.

## Done-when
- `cli_help` snapshot green; manual `harbor --help` matches SPEC table ordering.
</code></pre>

<p>Then interplay: spawn side session, skinny prompt, short reply, you keep typing in the main buffer.</p>

<h3 id="when-to-create-or-update-what">When to create or update what</h3>

<table>
  <thead>
    <tr>
      <th>Situation</th>
      <th>Update</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>New large feature or subsystem</td>
      <td><code>plan.md</code> or direction doc + <code>phase.md</code> row</td>
    </tr>
    <tr>
      <td>Behavior unclear</td>
      <td><code>idk.md</code> — <strong>never</strong> guess in code</td>
    </tr>
    <tr>
      <td>Implementation path differs from written plan but still matches spec</td>
      <td>Deviation doc + short note in <code>phase.md</code></td>
    </tr>
    <tr>
      <td>Landed code + tests</td>
      <td>Every path in <strong><code>.status.txt</code></strong> that applies (at minimum <code>phase.md</code>; audit if map changed)</td>
    </tr>
    <tr>
      <td>Accepted semantics change</td>
      <td>Spec / D-point — not only <code>phase.md</code></td>
    </tr>
  </tbody>
</table>

<p>If the repo has <strong><code>.status.txt</code></strong>, treat it as the manifest of <strong>which</strong> status files are in scope — not an optional reminder.</p>

<h3 id="idkmd-rules"><code>idk.md</code> rules</h3>

<ul>
  <li>Entries are <strong>questions</strong>, not implementation guesses.</li>
  <li>If <code>SPEC.md</code> (or equivalent) answers it, close the entry — do not duplicate spec text.</li>
  <li>Add to <code>idk.md</code> when you (or the model) would otherwise have to <strong>guess</strong> behavior.</li>
</ul>

<p>Example entry shape (fictional Harbor project):</p>

<pre><code class="language-markdown">## IDK-3: Remote cache TTL after failed publish

**Status:** open
**Area:** runtime
**Raised while implementing:** `src/sync/publish.rs`
**Question:** After a failed publish, does Harbor retry with the same cache key or rotate TTL?
**Current evidence:** SPEC.md §4.2 says publish is atomic; silent retry behavior not stated.
**Risk if guessed:** Operators see duplicate artifacts or stale cache hits.
**Needed decision:** Maintainer confirms retry + cache contract.
**Resolution:** —
</code></pre>

<h3 id="deviation-document-rules">Deviation document rules</h3>

<p>When mid-implementation you discover a <strong>better</strong> path that still respects the behavior contract:</p>

<ol>
  <li><strong>Do not</strong> silently rewrite <code>phase.md</code> into a new spec.</li>
  <li><strong>Do</strong> append a row or section to the project’s deviation file: what differed, why it is valid, what proof/tests still owe.</li>
  <li>If the change <strong>changes behavior</strong>, stop — that is <code>idk.md</code> or a D-point, not a deviation note.</li>
</ol>

<p>Deviation docs let you fix local mistakes without corrupting the plan/spec stack.</p>

<p>Example deviation row (fictional Meridian proof layer — plan used abstract <code>Step</code>, implementation keeps surface <code>stage</code> names only):</p>

<table>
  <thead>
    <tr>
      <th>Subject</th>
      <th>Normative rule</th>
      <th>Plan / proof treatment</th>
      <th>Why valid</th>
      <th>Still owed</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Surface <code>stage</code> keyword</td>
      <td>Programs use <code>stage</code> for structured concurrency regions.</td>
      <td>Proof core uses abstract <code>Step</code> nodes; no surface <code>stage</code> token in calculus.</td>
      <td>Proof needs named steps without importing full surface syntax.</td>
      <td>Conformance: show <code>stage</code> elaborates to <code>Step</code> without changing region bounds.</td>
    </tr>
  </tbody>
</table>

<h3 id="direction-document-example-header">Direction document (example header)</h3>

<p>For large subsystems, a direction doc records <strong>how</strong> accepted behavior lands — not <strong>what</strong> behavior is.</p>

<pre><code class="language-markdown"># Meridian — Checker Direction

**Status:** Active implementation direction
**Primary authority:** ACCEPTED.md
**Normative authority:** spec/types.md (when extracted)
**Execution roadmap:** phase.md

This file does not decide new semantics. If this file and ACCEPTED.md disagree,
ACCEPTED.md wins until the rule is written in spec/.
</code></pre>

<h3 id="phase-status-row-example">Phase status row (example)</h3>

<pre><code class="language-markdown">| Phase | Status | Last Updated | Notes |
|-------|--------|--------------|-------|
| Harbor remote sync | In Progress | 2026-06-01 | `tests/sync_publish.rs` green; CLI flags pending SPEC alignment |
| Meridian borrow checker | Blocked | 2026-06-01 | Blocked on IDK-3; no spec text for reborrow across `stage` |
</code></pre>

<h3 id="roadmap-planning-snippet-example">Roadmap planning snippet (example)</h3>

<p>Internal note for a future release — <strong>not</strong> a behavior contract. Roadmaps name <strong>goals</strong>, <strong>out of scope</strong>, <strong>done-when</strong>, and <strong>gates</strong>: which global checkpoints from <code>phase.md</code> this release prepares, blocks on, or may close. Do not treat a roadmap slice as complete because code exists — a gate stays open until its done condition in <code>phase.md</code> is satisfied.</p>

<pre><code class="language-markdown"># Release 3 Planning — Harbor

**Status:** Draft planning only — does not override SPEC.md
**Global gates:** defined in `phase.md` § Global Gates (authoritative)

## Goal
Ship read-only remote inspection before write-back publish.

## Out of scope for R3
- Multi-tenant auth (R4)
- Windows agent (deferred)

## Gate map (R3)

| Gate | R3 relationship | Done condition (summary) |
|------|-----------------|---------------------------|
| Gate A — Spec closure for inspect | **Must close** for R3 | SPEC §6 inspect contract frozen; no open `idk.md` on inspect semantics |
| Gate B — Read-only remote path | **Must close** for R3 | `harbor inspect` never mutates remote state; audit tests prove it |
| Gate C — Write-back publish | **Prepares only** | R3 must not claim publish; blocked until Gate C closes in R4 |

**Gating rules for this release:**
- No R3 “shipped” row in `phase.md` until Gates A and B are **closed** with evidence paths.
- Subsystems may run in parallel only when their gate annotations say they are not `BLOCKED_ON_GATE`.
- Saying R3 “closes Gate B” requires the exact Gate B checklist in `phase.md`, not a green unit test alone.

## Done-when (R3 slice)
- `harbor inspect --remote &lt;name&gt;` lists manifests per SPEC §6
- Integration test `tests/remote_inspect.rs` passes on clean VM
- `phase.md` Gate A and Gate B rows show **Closed** with test/doc paths

## Sequencing
1. Close Gate A (spec + `idk.md` clear for inspect)
2. Implement inspect path under Gate B constraints
3. Land tests → close Gate B → then mark R3 complete in `phase.md`
</code></pre>

<h3 id="implementation-stages-workflow">Implementation stages (workflow)</h3>

<p><strong>Sit-and-plan</strong> (mid-to-large):</p>

<pre><code class="language-text">Study / audit (optional) → plan or direction doc → phase/status updates
    → implementation-plan (per slice) → code + tests → verify → status honest → you commit / PR
</code></pre>

<p><strong>Interplay</strong> (in the weeds, slice already named):</p>

<pre><code class="language-text">Direction doc in head → implementation-plan (optional, 30s) → skinny prompt → small edit chunk
    → quick report → you continue → repeat → status docs when slice actually lands
</code></pre>

<p>You can have the model draft planning markdown for big passes.
Don’t let it jump straight to code on “hard think” work because you rushed the chat.
In interplay, insist on a <strong>short report</strong> each chunk — you are mid-edit and need to know what it touched.</p>

<hr />

<h2 id="session-contract-codingprocessmd">Session Contract: <code>codingprocess.md</code></h2>

<p><code>codingprocess.md</code> is the per-repo <strong>handoff you give the model</strong> (same niche as <code>AGENTS.md</code>; this suite uses the name on purpose). Write it <strong>to the model</strong>; keep <code>AI_STANDARDS.md</code> as your manual.</p>

<p>Every repo that gets regular AI development should have one at the repo root or path named in project docs.</p>

<h3 id="minimum-contents">Minimum contents</h3>

<ul>
  <li><strong>Purpose</strong> — what the file is for</li>
  <li><strong>Non-negotiables</strong> — mandatory standards paths</li>
  <li><strong>Startup read order</strong> — numbered list</li>
  <li><strong>Source-of-truth table</strong> — which file answers which question</li>
  <li><strong>Status update matrix</strong> — what to update when work lands (must align with <strong><code>.status.txt</code></strong> when present)</li>
  <li><strong>Status update triggers</strong> — when updates are mandatory (e.g. after tests green, end of slice, subsystem touch, hook-fired)</li>
  <li><strong><code>.status.txt</code> path</strong> — where the manifest lives if not session cwd</li>
  <li><strong>Testing commands</strong> — what to run before claiming done</li>
  <li><strong>Blockers</strong> — when to stop vs continue</li>
  <li><strong>Communication rules</strong> — concise, no cheerleading, list verification</li>
  <li><strong>Interplay rules</strong> (optional) — side-panel behavior, chunk size, when status docs are deferred</li>
</ul>

<p>Example skeleton (fictional Harbor repo — <strong>paste into <code>codingprocess.md</code></strong>, addressed to the model; trim or extend):</p>

<pre><code class="language-markdown"># Harbor — AI Session Contract

**Purpose:** Handoff rules for agents working in this repository.

## Non-negotiables

- `PROJECT_STANDARDS.md`, `CODE_STANDARDS.md`, `AI_STANDARDS.md` (if adopted)
- `SPEC.md` for all behavior
- No git commits unless the user delegated commits this session

## Startup read order

1. This file
2. `.status.txt` (if present at session cwd)
3. `CODE_STANDARDS.md`
4. `SPEC.md`
5. `phase.md`
6. `idk.md`
7. `src/` and `tests/` for the task area

## Status manifest (`.status.txt`)

Living docs listed in `.status.txt` **must** be updated when triggers below fire.
Do not mark a slice done in chat without touching every applicable status file.

| Trigger | Update |
|---------|--------|
| `cargo test` green for a harbor slice | `phase.md` row + evidence path |
| New crate or removed module | `CODEBASE_AUDIT.md` map section |
| Plan path changed, spec still holds | `deviations.md` + `phase.md` note |
| End of session or unattended slice | Re-read `.status.txt`; reconcile all listed files |

Optional: repo hook or CI check that fails if `src/` changed but `phase.md` did not (project choice).

## Source of truth

| Question | File |
|----------|------|
| What must the project do? | `SPEC.md` |
| What is done / blocked? | `phase.md` |
| What is undefined? | `idk.md` — do not guess |
| How to structure code? | `CODE_STANDARDS.md` |

## Verification

    cargo test -p harbor-core
    cargo test -p harbor-cli --test remote_inspect

Report command output or explain why not run.

## Blockers

Stop and ask when: SPEC silent, `idk.md` open on the task, or tests fail after a focused fix attempt.

## Communication

Concise. No cheerleading. List files touched, commands run, blockers.

## Interplay (side panel / quick session)

When the operator is driving in-editor (e.g. leader+g → AI panel):

- Read only what the prompt names + open buffer context; do not reload the whole authority stack unless asked.
- **One slice per invocation** — wire file, finish function, draft scope for upcoming edit.
- Reply in **≤15 lines**: files touched, what changed, next step for the operator, command if run.
- Do **not** refactor adjacent code, update `phase.md`, or narrate philosophy unless asked.
- If behavior is unclear, stop in one sentence and point at `idk.md` — do not guess.
</code></pre>

<p>Point every session at the repo’s <code>codingprocess.md</code> when it exists.
If chat drifts from that file, the file wins — that’s why you maintain it.</p>

<hr />

<h2 id="the-ref-directory">The <code>ref/</code> Directory</h2>

<p>On <strong>mid-to-large</strong> projects, maintain a workspace <strong><code>ref/</code></strong> directory (or equivalent) for material that informs AI work but <strong>is not part of what you ship</strong>.</p>

<h3 id="what-belongs-in-ref">What belongs in <code>ref/</code></h3>

<ul>
  <li>Copies or drafts of standards and <code>codingprocess.md</code> templates</li>
  <li>Example <code>idk.md</code>, deviation, direction, and phase planning docs</li>
  <li>Study notes, market research, internal critiques</li>
  <li>Session exports, benchmark notes, tooling comparisons</li>
  <li>Anything you want in context without polluting the shipping tree</li>
</ul>

<h3 id="what-to-keep-in-mind">What to keep in mind</h3>

<ul>
  <li><code>ref/</code> content is <strong>reference-only</strong> unless a <code>codingprocess.md</code> explicitly promotes a path to authority.</li>
  <li>Do <strong>not</strong> import <code>ref/</code> paths into public docs, runtime strings, or LICENSE files.</li>
  <li>Do <strong>not</strong> treat <code>ref/</code> as automatically committed — see <a href="#git-branches-and-commits">Git</a>.</li>
</ul>

<p>Store <strong>drafts</strong> of the shapes in this document (<code>codingprocess.md</code>, <code>idk.md</code>, deviation tables, direction headers) under <code>ref/</code> while iterating — then promote finished copies to repo-root authority paths.
Do not link <code>ref/</code> from public docs or ship it as public surface unless explicitly listed in <code>.public.txt</code>.</p>

<hr />

<h2 id="public-surface-publictxt">Public Surface: <code>.public.txt</code></h2>

<p><code>.public.txt</code> is a manifest of paths that are <strong>public</strong> (operator-facing, publishable, or license-bound).</p>

<h3 id="placement">Placement</h3>

<p>Put <code>.public.txt</code> at the <strong>top of the working directory where you work with AI</strong>, not only at a distant monorepo root if your session cwd is deeper.</p>

<p>Example: if you work in <code>apps/harbor-cli/</code>, the manifest for that public surface may live <strong>there</strong> so rules apply to the docs you actually edit.</p>

<p>Format: one path per line; directories imply all children public unless excluded in comments.</p>

<p>Example <code>.public.txt</code> (fictional Meridian public language docs):</p>

<pre><code class="language-text"># Public surface — Meridian language (operator + contributor docs only)
README.md
LICENSE
docs/
spec/surface-syntax.md
# Internal: ref/, idk.md, codingprocess.md, phase.md — not listed
</code></pre>

<h3 id="rules">Rules</h3>

<ul>
  <li>Public files <strong>must not</strong> link to, name, or imply non-listed internal paths (<code>ref/</code>, <code>idk.md</code>, internal audits, <code>codingprocess.md</code>, planning dirs).</li>
  <li>Public files <strong>must not</strong> use workstation absolute paths (<code>/home/...</code>, <code>/1tb/...</code>).</li>
  <li>When promoting a file to public, add it to <code>.public.txt</code> in the same change.</li>
  <li>When you or the model edit public docs, <strong>read</strong> <code>.public.txt</code> first when the project uses one.</li>
</ul>

<p>This is how internal instructional docs stay out of README, man pages, and LICENSE.</p>

<hr />

<h2 id="status-surface-statustxt">Status Surface: <code>.status.txt</code></h2>

<p><code>.status.txt</code> is the counterpart to <code>.public.txt</code>: a manifest of <strong>living status documents</strong> you keep aligned when work changes — not behavior specs, but honest maps of what landed, what is blocked, and what drifted.</p>

<p>Without a manifest, models forget <code>CODEBASE_AUDIT.md</code> after fixing <code>phase.md</code>, or ship code while direction docs still describe last month’s plan.</p>

<h3 id="placement-1">Placement</h3>

<p>Same rule as <code>.public.txt</code>: put <strong><code>.status.txt</code> at the session cwd</strong> where you work (repo root or <code>apps/harbor-cli/</code>, etc.), not only at a distant monorepo root.</p>

<h3 id="format">Format</h3>

<p>One path per line. Comments (<code>#</code>) document <strong>triggers</strong> and scope. Directories imply all markdown children are status docs unless excluded.</p>

<p>Example <code>.status.txt</code> (fictional Harbor):</p>

<pre><code class="language-text"># Living status docs — mandatory updates per codingprocess.md
phase.md
CODEBASE_AUDIT.md
deviations.md
# trigger: after cargo test green for harbor-core or harbor-cli
# trigger: when crates/ membership changes
# trigger: end of every slice before you stop for the day
</code></pre>

<p>Example <code>.status.txt</code> (fictional Meridian):</p>

<pre><code class="language-text">phase.md
DIRECTION.md
deviations.md
ACCEPTED.md
# trigger: after dune runtest in meridian-checker
# trigger: when spec/ or proofs/ layout changes
</code></pre>

<h3 id="what-belongs-in-statustxt">What belongs in <code>.status.txt</code></h3>

<table>
  <thead>
    <tr>
      <th>Usually list</th>
      <th>Usually omit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>phase.md</code>, <code>CODEBASE_AUDIT.md</code></td>
      <td><code>SPEC.md</code> (behavior contract, not a ledger)</td>
    </tr>
    <tr>
      <td>Direction docs (<code>DIRECTION.md</code>, <code>*direction.md</code>)</td>
      <td>Static standards (<code>CODE_STANDARDS.md</code>)</td>
    </tr>
    <tr>
      <td>Deviation files</td>
      <td><code>idk.md</code> unless you treat open questions as session status</td>
    </tr>
    <tr>
      <td>Accepted-shape ledgers that track implementation progress</td>
      <td><code>ref/</code> drafts</td>
    </tr>
    <tr>
      <td>Internal roadmaps you want updated when slices land</td>
      <td>Public paths (use <code>.public.txt</code>)</td>
    </tr>
  </tbody>
</table>

<p>Add a file when you or the model repeatedly <strong>forget</strong> to update it after code changes.</p>

<h3 id="wiring-updates-pick-one-or-combine">Wiring updates (pick one or combine)</h3>

<table>
  <thead>
    <tr>
      <th>Mechanism</th>
      <th>What it does</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong><code>codingprocess.md</code> triggers</strong></td>
      <td>Human-readable table: event → which <code>.status.txt</code> paths to touch (required minimum)</td>
    </tr>
    <tr>
      <td><strong>Your default</strong></td>
      <td>You (or the model, if <code>codingprocess.md</code> says so) update listed paths before you call a slice done</td>
    </tr>
    <tr>
      <td><strong>Cursor / git hooks</strong></td>
      <td>Pre-commit or stop hook runs a script: if <code>src/</code> changed, require <code>phase.md</code> diff (project-maintained)</td>
    </tr>
    <tr>
      <td><strong>CI check</strong></td>
      <td>Optional job fails when status files are stale vs listed globs (heavier, good for unattended passes)</td>
    </tr>
  </tbody>
</table>

<p><code>codingprocess.md</code> should <strong>name the triggers explicitly</strong> — vague “keep docs updated” does not survive context loss. Examples:</p>

<ul>
  <li><strong>After verification green</strong> — update <code>phase.md</code> with test path and date</li>
  <li><strong>After tree layout change</strong> — refresh <code>CODEBASE_AUDIT.md</code> section for that area</li>
  <li><strong>After plan-path drift</strong> — append deviation doc + one-line <code>phase.md</code> note</li>
  <li><strong>End of slice / session</strong> — re-read <code>.status.txt</code> and reconcile every listed file</li>
</ul>

<p>Hooks and CI are optional; updating listed status files when triggers fire is not.</p>

<h3 id="in-practice">In practice</h3>

<ul>
  <li>Open <strong><code>.status.txt</code></strong> at the start of a planning pass (right after <code>codingprocess.md</code> is fine).</li>
  <li>Before you call a slice <strong>done</strong>, touch every listed path that applies — or note what you skipped and why.</li>
  <li>Don’t list <code>SPEC.md</code> in <code>.status.txt</code> to justify behavior changes; spec updates follow spec process, not status hygiene.</li>
  <li>Don’t publish <code>.status.txt</code> paths in public docs unless they also appear in <code>.public.txt</code> (they should not).</li>
</ul>

<h3 id="new-status-doc">New status doc</h3>

<p>When you add a moving ledger (e.g. <code>release-3-planning.md</code> becomes active), add it to <code>.status.txt</code> and add a row to <code>codingprocess.md</code>’s status update matrix in the same change.</p>

<hr />

<h2 id="public-documentation-voice">Public Documentation Voice</h2>

<p>AI is strong at drafting docs; it is also strong at <strong>leaking process into public copy</strong>. Separate the two.</p>

<h3 id="default-rule">Default rule</h3>

<p>Public docs describe the software <strong>as it exists for the reader now</strong>, not the team’s internal journey.</p>

<table>
  <thead>
    <tr>
      <th>Write this</th>
      <th>Not this</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>“The CLI supports <code>install</code> and <code>upgrade</code>.”</td>
      <td>“We are implementing install next sprint.”</td>
    </tr>
    <tr>
      <td>“Status: experimental” (if status is the subject)</td>
      <td>“TODO: fix later” scattered in user guides</td>
    </tr>
    <tr>
      <td>Stable API and behavior</td>
      <td>Internal phase names, D-point IDs without local rule text</td>
    </tr>
    <tr>
      <td>Links only to <code>.public.txt</code> paths</td>
      <td>“See <code>release-3-planning.md</code> for details” (internal planning)</td>
    </tr>
  </tbody>
</table>

<h3 id="exceptions">Exceptions</h3>

<ul>
  <li><strong>Explicit status sections</strong> (roadmap, changelog, maturity tables) may describe in-progress work if the document’s job is status.</li>
  <li><strong>CONTRIBUTING / PROJECT_STANDARDS</strong> may describe process — they are not operator manuals.</li>
</ul>

<h3 id="license-and-legal-prose">LICENSE and legal prose</h3>

<ul>
  <li>No AI session narration, no “we might change,” no references to internal planning files.</li>
  <li>Factual, release-aligned, lawyer-readable if applicable.</li>
</ul>

<h3 id="ai-assisted-doc-workflow">AI-assisted doc workflow</h3>

<p>Good uses:</p>

<ul>
  <li>Sync README/USAGE with behavior after a verified change</li>
  <li>Fix examples, typos, formatting (often <code>docs/*</code> PR to <code>main</code> per <code>PROJECT_STANDARDS.md</code>)</li>
  <li>Cross-check public docs against <code>.public.txt</code></li>
</ul>

<p>Bad uses:</p>

<ul>
  <li>Dumping <code>phase.md</code> into README</li>
  <li>Exposing <code>codingprocess.md</code> or <code>ref/</code> to end users</li>
  <li>Future-tense instructions in LICENSE</li>
</ul>

<hr />

<h2 id="prompt--task-shape">Prompt &amp; Task Shape</h2>

<h3 id="why-short-behavior-focused-prompts">Why short, behavior-focused prompts</h3>

<p>Public coding benchmarks often ship <strong>GitHub-issue-shaped</strong> task text: long reproduction steps, implicit file targets, and prescriptive test policy. That is a bad template for day-to-day prompts.</p>

<p>Empirical and audit evidence :</p>

<ul>
  <li><strong>Contamination / memorization:</strong> Yang et al. (<em>The SWE-Bench Illusion</em>, 2025) and follow-on localization studies report models guessing buggy file paths from issue text alone at rates that collapse on held-out repos — leaderboard gains partly reflect <strong>training exposure</strong>, not transferable skill. OpenAI (2026) stopped reporting SWE-bench Verified after finding frontier models reproduce <strong>gold patches</strong> and verbatim problem details.</li>
  <li><strong>False passes:</strong> Yang et al. (<em>SWE-Bench+</em>, 2024) audited “successful” agent runs and found large fractions involved <strong>solution leakage</strong> in issue threads or <strong>weak tests</strong> that accepted wrong patches; filtered resolve rates dropped sharply. OpenAI’s Verified audit found material test/description flaws in a majority of hard cases reviewed.</li>
  <li><strong>Bad prompt + sandbox habits:</strong> DeepSWE benchmark audits (Datacurve, 2026) report SWE-Bench Pro prompts averaging roughly <strong>twice</strong> the character count of their behavior-focused tasks while expecting far <strong>less</strong> code change; Pro templates often tell agents <strong>not</strong> to modify tests, which suppresses self-verification; evaluation containers that retain full <strong>git history</strong> enabled a substantial share of “passes” via reading merged gold commits (<a href="https://github.com/scaleapi/SWE-bench_Pro-os/issues/93">SWE-bench_Pro-os#93</a>).</li>
</ul>

<p><strong>Policy:</strong> Task prompts for your repos should look like a message to a competent contractor — outcome, authority pointers, done-when — not like a scraped issue export. Jimenez et al. (ICLR 2024, SWE-bench) remains useful background that <strong>repo-level</strong> agent work is hard; <strong>Verified percentage is not</strong> a trustworthy scoreboard for picking tools.</p>

<h3 id="good-task-prompt-shape">Good task prompt shape</h3>

<pre><code class="language-markdown">**Goal:** (one paragraph — behavior outcome)

**Authority:** Read `codingprocess.md`, then SPEC.md §X, then `src/foo/`.

**Constraints:** Follow CODE_STANDARDS.md. No git commits unless I said so.

**Done when:** `cargo test -p bar` passes; `phase.md` row N updated with test path.

**Out of scope:** …
</code></pre>

<p>Properties:</p>

<ul>
  <li><strong>Short</strong> — intent + pointers, not a full spec paste</li>
  <li><strong>Behavior-focused</strong> — what should work, not which file to edit first</li>
  <li><strong>Authority links</strong> — where truth lives</li>
  <li><strong>Done-when</strong> — commands and artifacts</li>
  <li><strong>Explicit git policy</strong> — commit or not</li>
</ul>

<h3 id="interplay-prompt-skinny">Interplay prompt (skinny)</h3>

<p>Use when you are <strong>mid-edit</strong> and a direction doc already says <em>where</em> in the tree. Same idea as the contractor shape above, stripped down — paste into a side panel or quick session:</p>

<pre><code class="language-markdown">**Slice:** Wire `src/sync/cache.rs` into `main.rs` re-exports; no behavior change.
**Read:** `src/main.rs`, new file only.
**Do:** minimal diff; run `cargo check -p harbor-cli`.
**Reply:** files changed, what you did, what I should do next (≤15 lines). No commits.
</code></pre>

<p>Good interplay asks:</p>

<ul>
  <li>“Finish this function from selection” / “line up module in <code>lib.rs</code>”</li>
  <li>“Write implementation-plan for SPEC §6 inspect flags only — plan only”</li>
  <li>“Top off error handling for this match arm; I will review before save”</li>
</ul>

<p>Bad interplay asks:</p>

<ul>
  <li>paste entire <code>SPEC.md</code> with no slice</li>
  <li>“refactor the CLI while you are here”</li>
  <li>silent multi-file rewrite with no chunk report</li>
</ul>

<h3 id="dual-work-you--ai-on-one-slice">Dual work (you + AI on one slice)</h3>

<p>When you and the model are <strong>paired</strong> on the same slice (not a fire-and-forget side panel):</p>

<ul>
  <li>Ask for <strong>small chunks</strong> — one logical edit set, then stop and report before the next.</li>
  <li>You review between chunks; don’t let it queue five unrelated tasks in one go.</li>
  <li>Still get an <strong>implementation-plan</strong> if the slice spans more than ~2 files or touches behavior.</li>
  <li>Update status docs and run full verification when the <strong>slice closes</strong>, not after every micro-edit.</li>
</ul>

<h3 id="role-prompts">Role prompts</h3>

<p>Prefer <strong>process roles</strong> (“follow <code>CODE_STANDARDS.md</code>”) over <strong>identity roles</strong> (“you are a world-class Rust genius”).</p>

<p>Role-play can help on some reasoning benchmarks (Xu et al., NAACL 2024), but systematic studies on factual and knowledge-heavy tasks often show <strong>no gain or harm</strong> from generic “expert” personas — and MMLU-style work suggests persona prefixes can push models into instruction-following mode at the expense of recall. For coding and spec work, <strong>constraints and authority files</strong> beat cosplay.</p>

<hr />

<h2 id="session-lifecycle">Session Lifecycle</h2>

<p>Pick a mode first: <a href="#planning-pass-lifecycle">sit-and-plan</a> or <a href="#interplay-lifecycle">interplay</a>. Planning pass is the default for big or fuzzy work. Interplay relaxes how much you load up front and how long replies can be — <strong>not</strong> spec authority and not guessing behavior. Both modes assume <strong>you</strong> yes <strong>you</strong> twin, supply the intelligence (<a href="#engineering-rigor--virtuous-laziness">Engineering Rigor &amp; Virtuous Laziness</a>).</p>

<h3 id="planning-pass-lifecycle">Planning pass lifecycle</h3>

<h4 id="1-before-you-dig-in">1. Before you dig in</h4>

<ul>
  <li>Know cwd and branch (if git is in play).</li>
  <li>Open <code>codingprocess.md</code>, <strong><code>.status.txt</code></strong> (if present), and the authority stack for this slice.</li>
  <li>Tell the model what to read (or paste the read order from <code>codingprocess.md</code>).</li>
  <li>For a named slice, get an <strong>implementation-plan</strong> first if the edit is large.</li>
</ul>

<h4 id="2-work-loop">2. Work loop</h4>

<pre><code class="language-text">Read → implementation-plan (slice) → edit → run tests/commands → update status docs → continue or stop
</code></pre>

<ul>
  <li>Have it <strong>run tools</strong> (read file, test, patch) — don’t accept “done” without output. Yao et al. (<em>ReAct</em>, ICLR 2023) is the research backing for interleaving reasoning and commands.</li>
  <li>Keep slices small; push back on drive-by refactors (<a href="#minimizing-code-churn">Minimizing Code Churn</a>).</li>
  <li>Put unknowns in <code>idk.md</code>; put plan drift in the deviation doc when spec still holds.</li>
  <li>When <strong><code>.status.txt</code></strong> triggers fire, update listed status files before you call the slice done.</li>
</ul>

<h4 id="3-end-of-session-what-you-should-get-back">3. End of session (what you should get back)</h4>

<p>Ask for a handoff that includes:</p>

<ul>
  <li>Files changed (paths)</li>
  <li>Commands run and pass/fail</li>
  <li>Which status docs were updated</li>
  <li>What’s next: <strong>now</strong> / <strong>blocked on you</strong> / <strong>deferred</strong></li>
  <li>Whether it committed (only if you allowed that)</li>
</ul>

<p>Don’t treat the slice as done without verification evidence you can skim.</p>

<h4 id="long-unattended-passes">Long unattended passes</h4>

<p>When you tell it to continue until blocked:</p>

<ul>
  <li>Make it reread <strong><code>.status.txt</code></strong> and listed status docs before it stops.</li>
  <li>It should not quit after one arbitrary milestone if safe work remains (<code>codingprocess.md</code> pattern).</li>
  <li>It should stop on: missing credentials, behavior that needs your call, external dependency, or your explicit stop.</li>
</ul>

<h3 id="interplay-lifecycle">Interplay lifecycle</h3>

<p>Interplay is when you are <strong>already implementing</strong>, a direction doc (or study) answers “where in the tree,” and you only need execution help. Typical setup: editor keybinding → small AI panel (e.g. leader+g in Neovim); Cursor side chat; another terminal tab — tool doesn’t matter, <strong>habit</strong> does. <strong>Not</strong> vibe coding: read the diff, self-review before you ask anyone else to, and don’t wholesale re-generate when review comments arrive.</p>

<h4 id="1-before-a-quick-ask">1. Before a quick ask</h4>

<ul>
  <li>You already know cwd and target files.</li>
  <li>Prompt names <strong>only</strong> what to read plus selection/open buffers — skip reloading the whole authority stack unless behavior is in play.</li>
  <li>Optional: 30-second <strong>implementation-plan</strong> in chat before the first edit on multi-file slices.</li>
</ul>

<h4 id="2-work-loop-1">2. Work loop</h4>

<pre><code class="language-text">You edit → skinny ask → small change → short reply → you continue
</code></pre>

<p>What to ask for in the prompt (put this in <code>codingprocess.md</code> if you want it enforced):</p>

<ul>
  <li><strong>One job per invocation</strong> — wire a module, fix help text, draft a scope block, finish a function from selection.</li>
  <li><strong>Small diffs</strong> — if it needs more than ~3 files or ~80 lines, it should stop and you widen scope or switch to planning pass.</li>
  <li><strong>No silent batching</strong> — you want a chunk report between edit sets, not five files at once with no summary.</li>
  <li>Autocomplete gaps count (“finish this <code>match</code> arm from selection”).</li>
  <li><code>phase.md</code> / audit can wait until <strong>you</strong> close the slice unless you said “update status too.”</li>
</ul>

<p>What you do:</p>

<ul>
  <li>Know interplay vs sit-and-plan; escalate when lost or behavior is undefined.</li>
  <li>Point at direction-doc tree paths (<code>frontend/lexer/</code>, <code>cli/args.rs</code>) instead of re-explaining the repo.</li>
</ul>

<h4 id="3-reply-you-want-back-interplay">3. Reply you want back (interplay)</h4>

<p>Not an essay. <strong>≤15 lines</strong>, roughly:</p>

<pre><code class="language-markdown">**Did:** Added `mod cache` in `main.rs`; re-exported `CachePolicy` from `sync/cache.rs`.
**Ran:** `cargo check -p harbor-cli` (ok).
**You next:** Fill `run()` body in `cache.rs` line 42 — I left `todo!()`.
**Skipped:** `phase.md` (say if you want it updated).
</code></pre>

<p>You stay in flow without reading a transcript.</p>

<h4 id="when-to-leave-interplay">When to leave interplay</h4>

<p>Switch to planning pass when:</p>

<ul>
  <li>behavior needs <code>idk.md</code> or a spec change</li>
  <li>the slice needs gates / roadmap / a new direction doc</li>
  <li>the model whiffed twice on the same small ask</li>
  <li>you are still <strong>discovering</strong> architecture, not executing a known slice</li>
</ul>

<h3 id="choosing-the-mode-quick">Choosing the mode (quick)</h3>

<pre><code class="language-text">Have direction doc + named slice?     → interplay (+ implementation-plan if ≥2 files)
New area / spec silent / gates?     → sit-and-plan
You said "keep going until blocked"? → planning pass only
Side panel / "just wire this"?      → interplay
You + model paired on one feature?  → dual work: short chunks; full handoff when slice closes
</code></pre>

<hr />

<h2 id="minimizing-code-churn">Minimizing Code Churn</h2>

<p><strong>Code churn</strong> here means lines or files that get <strong>re-touched soon after landing</strong> — reverts, drive-by fixes, duplicate paste, or “while I’m here” refactors. With AI in the loop, generation is cheap; <strong>rework and review</strong> are not. The goal is not zero churn — it is <strong>small, reviewable slices</strong> that survive contact with tests and the next session.</p>

<p>This section is why tenet 4 (“small, honest slices”), interplay limits (~3 files / ~80 lines), skinny prompts, and batched commits exist.</p>

<h3 id="what-the-evidence-says">What the evidence says</h3>

<p>Churn is <strong>not</strong> a single headline number — studies disagree on direction but agree on <strong>risk patterns</strong> you can design against.</p>

<table>
  <thead>
    <tr>
      <th>Finding</th>
      <th>Source</th>
      <th>What it means for you</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>AI-associated commits are <strong>smaller per commit</strong> (fewer files, lower line churn at landing) but see <strong>more follow-up edits</strong> at 30–90 days — higher touch frequency and accumulated churn over time</td>
      <td>Mao et al., large-scale repo study (2026)</td>
      <td>Landing a small diff is not the end; <strong>review and test soon</strong> after AI touches code, or you pay later in rework</td>
    </tr>
    <tr>
      <td>Self-admitted GenAI adoption in 151 OSS repos: <strong>no general churn explosion</strong> after adoption (RDD); effects vary by repo; <strong>generation tasks</strong> correlate more with rework than maintenance-style tasks</td>
      <td>Xiao et al., <em>Self-Admitted GenAI Usage in OSS</em> (2025)</td>
      <td>Don’t panic from industry dashboards alone — <strong>monitor your repo</strong>; treat generated code as provisional</td>
    </tr>
    <tr>
      <td>Industry analysis of ~153M changed lines: rising share of lines <strong>reverted or updated within ~2 weeks</strong>; more add/paste vs refactor/move (vendor report, not peer-reviewed)</td>
      <td>GitClear, <em>Coding on Copilot</em> (2024)</td>
      <td>Short-window rework is a real failure mode; <strong>slice size and review discipline</strong> matter even if your project isn’t in their sample</td>
    </tr>
    <tr>
      <td>Merged <strong>agentic PRs</strong> differ structurally from human PRs — notably <strong>commit count</strong> (large effect) and <strong>files touched / deletions</strong> (medium effects)</td>
      <td>Ogenrwot &amp; Businge, MSR ‘26</td>
      <td>Agents can <strong>sprawl across commits</strong> inside one PR; you may want one logical commit per slice when you squash</td>
    </tr>
    <tr>
      <td><strong>Merge conflict rate</strong> rises sharply with PR size (churn = adds + deletes): ~10% for tiny PRs vs ~30%+ as median churn grows</td>
      <td>Ogenrwot &amp; Businge, <em>AgenticFlict</em> (AIware ‘26)</td>
      <td>Big AI dumps are integration tax — keep PRs small per <code>PROJECT_STANDARDS.md</code></td>
    </tr>
    <tr>
      <td>AI assistance did not reliably shorten tasks; friction is <strong>understanding, editing, debugging</strong> generated code</td>
      <td>Vaithilingam et al., CHI 2022</td>
      <td>A 400-line “helpful” diff can cost more than writing 40 lines yourself — <strong>read the diff</strong></td>
    </tr>
    <tr>
      <td>GenAI output is often <strong>provisional</strong> — follow-up fixes, reversions, deletions after generation appear in self-admitted usage</td>
      <td>Xiao et al. (2025), qualitative coding</td>
      <td>Plan an explicit <strong>validate → revise</strong> step after generation, not “ship and forget”</td>
    </tr>
  </tbody>
</table>

<p><strong>Takeaway:</strong> AI can make <strong>first landing</strong> look tidy while <strong>later churn</strong> and <strong>integration pain</strong> still rise if you let scope creep. Process beats hope. Cantrill’s framing: models optimize for <strong>volume</strong> when you optimize for <strong>simplicity</strong> — your review gate is where virtuous laziness lives.</p>

<h3 id="practices-that-actually-cut-churn">Practices that actually cut churn</h3>

<p>These map to sections already in this doc — churn control is not a separate religion.</p>

<p><strong>Scope and prompts</strong></p>

<ul>
  <li><strong>Name the slice</strong> in every prompt — files, behavior, <strong>out of scope</strong> (contractor and <a href="#interplay-prompt-skinny">interplay</a> shapes).</li>
  <li>Get a short <strong>implementation-plan</strong> before multi-file work so the model doesn’t “discover” extra files mid-run.</li>
  <li>Say <strong>no drive-by refactors</strong> in <code>codingprocess.md</code>; reject diffs that touch unrelated modules.</li>
  <li>Prefer <strong>edit-in-place</strong> (“fix this function”, “wire this module”) over “rewrite the crate” unless you meant a refactor slice.</li>
</ul>

<p><strong>Size and review</strong></p>

<ul>
  <li>Interplay guardrails: <strong>~3 files / ~80 lines</strong> then stop — widen scope deliberately or switch to planning pass.</li>
  <li>One <strong>logical slice per PR</strong> (or one squash-ready commit batch); don’t mix unrelated fixes because the model offered them.</li>
  <li><strong>Review the diff while context is fresh</strong> — same session or next day — to catch the 30-day rework pattern Mao et al. report.</li>
  <li>Run <strong>project tests before</strong> you call a slice done; churn often tracks “looked fine” landings that tests would have caught.</li>
</ul>

<p><strong>Git and integration</strong></p>

<ul>
  <li><strong>Batch commits</strong> — not every model save (<code>PROJECT_STANDARDS.md</code> + <a href="#git-branches-and-commits">Git</a>).</li>
  <li>Keep PRs <strong>small enough to review</strong> — conflict rate climbs with churn (AgenticFlict).</li>
  <li>When delegating commits, require a handoff that lists <strong>every path touched</strong> so you can spot scope creep before push.</li>
</ul>

<p><strong>Optional <code>codingprocess.md</code> limits</strong> (paste into the model-facing contract)</p>

<pre><code class="language-markdown">## Churn limits
- Max ~3 files or ~80 lines per interplay invocation unless the prompt widens scope.
- No whole-file rewrites when a localized edit satisfies the slice.
- No formatting-only or rename sweeps unless the slice is explicitly "format/rename".
- If tests fail, stop after one focused fix attempt — do not "fix forward" across the tree.
</code></pre>

<p><strong>When churn is acceptable</strong></p>

<ul>
  <li>Exploratory spikes you <strong>throw away</strong> before merge.</li>
  <li>Mechanical regenerations with <strong>golden tests</strong> you intentionally update (snapshot/help text) — still one slice, one review.</li>
  <li>Large refactors <strong>named as such</strong> in <code>plan.md</code> with their own gate — not smuggled in as a bugfix.</li>
</ul>

<h3 id="churn-smells-check-the-diff">Churn smells (check the diff)</h3>

<table>
  <thead>
    <tr>
      <th>Smell</th>
      <th>Likely cause</th>
      <th>Response</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Same file edited again next session for the same feature</td>
      <td>Slice too big or spec unclear</td>
      <td>Shrink scope; <code>idk.md</code> or spec fix</td>
    </tr>
    <tr>
      <td>Lots of new helpers for a one-line behavior fix</td>
      <td>Model over-engineered</td>
      <td>Revert extras; restate minimal done-when</td>
    </tr>
    <tr>
      <td>Copy-pasted parallel blocks</td>
      <td>DRY collapse</td>
      <td>Refactor slice or hand-fix</td>
    </tr>
    <tr>
      <td>Formatting + logic + rename in one diff</td>
      <td>Unbounded “cleanup”</td>
      <td>Split; interplay rule: no drive-by</td>
    </tr>
    <tr>
      <td>PR touches half the tree</td>
      <td>Missing out-of-scope</td>
      <td>Close; replan with implementation-plan</td>
    </tr>
    <tr>
      <td>Duplicate test harnesses, hello-world apps, empty files in one “feature”</td>
      <td>Model false industriousness</td>
      <td>Reject; restate slice; see <a href="#virtuous-laziness-why-small-slices-are-moral-not-timid">virtuous laziness</a></td>
    </tr>
  </tbody>
</table>

<hr />

<h2 id="engineering-rigor--virtuous-laziness">Engineering Rigor &amp; Virtuous Laziness</h2>

<p>Empirical papers tell you churn and security risks exist. Bryan Cantrill and the Oxide team’s public writing (<a href="https://bcantrill.dtrace.org/">blog</a>, <a href="https://rfd.shared.oxide.computer/rfd/0576">RFD 576 — Using LLMs at Oxide</a>, <a href="https://oxide-and-friends.transistor.fm/episodes/engineering-rigor-in-the-llm-age/transcript">Oxide and Friends on rigor in the LLM age</a>) describe <strong>how to work</strong> when you care about systems that last. This section steals the useful bits — not Oxide’s HR policy, the engineering habits.</p>

<h3 id="the-false-dichotomy">The false dichotomy</h3>

<p>Two bad poles:</p>

<table>
  <thead>
    <tr>
      <th>Pole</th>
      <th>Posture</th>
      <th>Why it fails</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Vibe coding</strong></td>
      <td>Closed loop; regenerate until lucky; no curiosity about the gooey middle</td>
      <td>You can’t maintain or defend what you didn’t understand</td>
    </tr>
    <tr>
      <td><strong>LLM abstinence</strong></td>
      <td>Never use them; moral purity</td>
      <td>You leave rigor on the table — doc tests, migrations, pattern replication you’d skip</td>
    </tr>
  </tbody>
</table>

<p>The productive path is a <strong>large middle</strong>: AI as tool under <strong>your</strong> responsibility, often increasing rigor rather than velocity. Cantrill’s kernel experiment on the podcast is the shape: known design, no closed loop, read block comments, fix subtle issues — <strong>pairing</strong>, not autopilot.</p>

<h3 id="engineering-rigor-vs-vibe-coding">Engineering rigor vs vibe coding</h3>

<p><strong>Vibe coding</strong> (Adam Leventhal’s shibboleth on the podcast): tautological lack of curiosity — if you don’t like the output, run again without opening the diff. Fine for throwaway static-site JS; poison for anything you will live with.</p>

<p><strong>Rigor path:</strong></p>

<ul>
  <li>You know <strong>what good looks like</strong> before the model runs (spec, direction doc, implementation-plan, code examples).</li>
  <li>You <strong>don’t close the loop</strong> on unreviewed output for shipping code — tests and your eyes are the gate.</li>
  <li>You treat model output as <strong>provisional</strong> until verified (Xiao et al. generation-task rework; RFD 576 responsibility).</li>
  <li>You <strong>slow down for quality</strong> when the artifact matters — use saved time for tests, docs, refactors you’d defer otherwise (Rain Paharia: “code that uses LLMs extensively had better be the best code on the planet”).</li>
</ul>

<h3 id="values-adapted-from-oxide-rfd-576">Values (adapted from Oxide RFD 576)</h3>

<p>Use these as a sanity check when deciding how hard to lean on AI for a slice:</p>

<table>
  <thead>
    <tr>
      <th>Value</th>
      <th>For you</th>
      <th>In practice</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Responsibility</strong></td>
      <td>You own merged artifacts</td>
      <td>Self-review before asking anyone else to review; no “the model wrote it”</td>
    </tr>
    <tr>
      <td><strong>Rigor</strong></td>
      <td>AI should sharpen thinking, not replace it</td>
      <td>Spec + tests + written plans; reject generated flotsam</td>
    </tr>
    <tr>
      <td><strong>Empathy</strong></td>
      <td>Humans read your PRs, bugs, docs</td>
      <td>Short diffs; honest bug reports; don’t flood maintainers with slop</td>
    </tr>
    <tr>
      <td><strong>Teamwork</strong></td>
      <td>Trust beats disclosure theater</td>
      <td>Fix review comments yourself; don’t wholesale re-generate the PR (breaks iterative review — RFD 576)</td>
    </tr>
    <tr>
      <td><strong>Urgency</strong></td>
      <td>Speed is real but not supreme</td>
      <td>Faster interplay is good; <strong>direction</strong> and <strong>verification</strong> still come first</td>
    </tr>
  </tbody>
</table>

<h3 id="pattern-first-then-amplify">Pattern-first, then amplify</h3>

<p>One of the highest-signal uses from Oxide’s experience: <strong>you</strong> do the hard thinking once — unsafe core, migration design, API shape — then the model <strong>replicates the pattern</strong> (doc tests across four map types, migration guide applied repo-by-repo). That’s not vibe coding; that’s a <strong>pattern amplification machine</strong> with a human-defined template.</p>

<p>Workflow:</p>

<ol>
  <li>Handwrite or deeply review the <strong>first instance</strong> (the pattern).</li>
  <li>Write the replication rules in a <strong>guide</strong> — direction doc, migration section, or <code>codingprocess.md</code> — clear enough that you and the model can follow them.</li>
  <li>Point the model at <strong>one repo or module</strong>; review; <strong>fix the guide</strong>, not just the code.</li>
  <li>Repeat with verification signals: <strong>compile, tests, diff checks</strong> (OpenAPI diff, golden files, whatever your project uses).</li>
</ol>

<p>English (or your spec language) becomes a programming language for programs too messy for a deterministic tool — but only after <strong>you</strong> did the design work.</p>

<h3 id="self-review-and-the-review-loop">Self-review and the review loop</h3>

<p>From <a href="https://rfd.shared.oxide.computer/rfd/0576#_llms_as_programmers">RFD 576 § LLMs as programmers</a>:</p>

<ul>
  <li><strong>Self-review is mandatory</strong> — don’t ask a human to review code you haven’t read, seriasly.</li>
  <li><strong>Closer to what ships → more care</strong> — experimental scratch OK; core paths get planning pass + tests + your diff line-by-line.</li>
  <li><strong>No wholesale re-generation during review</strong> — address comments surgically; re-prompting the whole file makes review impossible.</li>
  <li><strong>Resist LLM dependency to comprehend the system</strong> — if only the model can explain your repo, you don’t own it and don’t larp like you do. (“gavage geese” — force-fed complexity).</li>
</ul>

<p>Put self-review in <code>codingprocess.md</code> if you delegate anything to unattended passes.</p>

<h3 id="write-things-down-llm-multiplier">Write things down (LLM multiplier)</h3>

<p>Culture that values <strong>written design</strong> pays twice in the LLM age:</p>

<ul>
  <li>Direction docs, migration guides, and RFD-shaped notes give models <strong>texture</strong> (David Crespo: agents pulling repo context beat one-sentence prompts).</li>
  <li>You already maintain <code>phase.md</code>, <code>codingprocess.md</code>, specs — those are leverage, not bureaucracy.</li>
  <li><strong>Don’t let the model write your thinking</strong> for standards, specs, or architecture; let it read what <strong>you</strong> wrote and execute slices.</li>
</ul>

<p>Rain’s advice for early-career engineers: practice writing; feed it to the model and see how it behaves — timeless skill, higher multiplier now.</p>

<h3 id="where-rigor-beats-speed-quick-map">Where rigor beats speed (quick map)</h3>

<table>
  <thead>
    <tr>
      <th>Context</th>
      <th>Lean</th>
      <th>Why</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Core behavior / security / concurrency</td>
      <td>Planning pass, heavy review</td>
      <td>RFD: spiral into nonsense is easy</td>
    </tr>
    <tr>
      <td>Throwaway CLI, one-off script, blog generator</td>
      <td>Interplay OK</td>
      <td>Low blast radius (Adam’s static site)</td>
    </tr>
    <tr>
      <td>Tedious replication after you defined pattern</td>
      <td>Model amplify + tight verification</td>
      <td>Rain’s map APIs / migration guides</td>
    </tr>
    <tr>
      <td>Bug you’d have closed as “stale”</td>
      <td>Model-assisted investigation + <strong>your</strong> judgment</td>
      <td>Podcast SIGTTOU example — rigor you wouldn’t afford manually</td>
    </tr>
  </tbody>
</table>

<h3 id="anti-patterns-cantrill--rfd--podcast">Anti-patterns (Cantrill / RFD / podcast)</h3>

<ul>
  <li><strong>Lines-of-code per day</strong> as success metric — its beyond dumbasf.</li>
  <li><strong>LLM mandates</strong> — use when it helps; not because exec said so (RFD anti-pattern).</li>
  <li><strong>Persona anthropomorphization</strong> — the model isn’t accountable; you are (RFD; aligns with no “world-class expert” prompts here).</li>
  <li><strong>Regenerate the whole PR</strong> to address review — kills teamwork.</li>
  <li><strong>Skip reading</strong> because the summary sounded confident — intellectual fly open (<a href="https://bcantrill.dtrace.org/2025/12/05/your-intellectual-fly-is-open/">Cantrill, 2025</a>).</li>
</ul>

<hr />

<h2 id="verification--evidence">Verification &amp; Evidence</h2>

<p><strong>Done</strong> means artifacts, not adjectives.</p>

<h3 id="correctness-epistemology">Correctness epistemology</h3>

<p>Chen et al. (<em>Evaluating Large Language Models Trained on Code</em>, 2021) established <strong>pass@k</strong> against unit tests as the right measure for code generation: correctness is <strong>binary per test suite</strong>, and multiple samples beat trusting one greedy output. That is why this suite insists on <strong>project test commands</strong> (<code>cargo test</code>, <code>dune runtest</code>, etc.) — not “looks right” and not public leaderboard %.</p>

<p>Where feasible, use <strong>two verification paths</strong> (tests + lint, or tests + targeted manual check). Wang et al. (<em>Self-Consistency</em>, ICLR 2023) show multi-sample agreement improves hard reasoning; in engineering that translates to not declaring green from a single flaky run.</p>

<table>
  <thead>
    <tr>
      <th>Claim</th>
      <th>Required evidence</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Tests pass</td>
      <td>Command output or explicit “not run because …”</td>
    </tr>
    <tr>
      <td>Behavior implemented</td>
      <td>Test path or spec section + code path</td>
    </tr>
    <tr>
      <td>Docs accurate</td>
      <td>Public paths only; match <code>.public.txt</code></td>
    </tr>
    <tr>
      <td>Phase item complete</td>
      <td><code>phase.md</code> cites file/test path — not “mostly done”</td>
    </tr>
    <tr>
      <td>Status hygiene</td>
      <td>All applicable <strong><code>.status.txt</code></strong> paths updated or explicitly deferred with reason</td>
    </tr>
  </tbody>
</table>

<h3 id="generated-code-is-untrusted-by-default">Generated code is untrusted by default</h3>

<ul>
  <li>Pearce et al. (IEEE S&amp;P 2022): ~<strong>40%</strong> of Copilot completions in CWE-oriented scenarios were vulnerable.</li>
  <li>Perry et al. (2023): participants <strong>with</strong> AI assistants wrote <strong>less secure</strong> code than those without, while <strong>believing</strong> they were more secure; more deliberate prompt iteration correlated with fewer vulnerabilities.</li>
</ul>

<p>Review, tests, and explicit constraints are not paranoia — they counter measured failure modes.</p>

<h3 id="human-validation-is-the-bottleneck">Human validation is the bottleneck</h3>

<p>Vaithilingam et al. (CHI 2022) found Copilot did not reliably improve task completion time or success in a controlled study, even though most participants still wanted it — friction was <strong>understanding, editing, and debugging</strong> generated code. Your handoff rules (concise diff summary, commands run, blockers named) target that bottleneck, not cheerleading.</p>

<hr />

<h2 id="git-branches-and-commits">Git, Branches, and Commits</h2>

<h3 id="default-policy-you-commit">Default policy: you commit</h3>

<p><strong>Do not let the model run <code>git commit</code> unless you explicitly allowed commits for that session.</strong></p>

<p>Why:</p>

<ul>
  <li>Commits are attribution and history; you did not type every line.</li>
  <li><code>PROJECT_STANDARDS.md</code> assumes review, branches, and PR flow you actually use.</li>
  <li>Models over-commit (every save) and write essay messages.</li>
</ul>

<p>When commits are <strong>not</strong> allowed:</p>

<ul>
  <li>It edits files; <strong>you</strong> run git.</li>
  <li>A useful model still suggests branch name and Conventional Commit subject in chat.</li>
</ul>

<p>When commits <strong>are</strong> allowed, everything in this section applies.</p>

<h3 id="before-any-commit">Before any commit</h3>

<ol>
  <li><strong><code>git status</code></strong> and <strong><code>git branch --show-current</code></strong> — know where you are.</li>
  <li><strong>Correct branch</strong> per <code>PROJECT_STANDARDS.md</code>:
    <ul>
      <li>Code: <code>feat/*</code>, <code>fix/*</code>, … from <code>dev</code></li>
      <li>Docs-only public: <code>docs/*</code> from <code>main</code> → PR to <code>main</code></li>
    </ul>
  </li>
  <li><strong>New work → new branch</strong> — do not commit unrelated changes on someone else’s feature branch unless asked.</li>
  <li><strong>No destructive git</strong> — no <code>push --force</code>, <code>reset --hard</code>, etc., unless user explicitly requests.</li>
</ol>

<h3 id="when-to-commit-not-every-file-touch">When to commit (not every file touch)</h3>

<table>
  <thead>
    <tr>
      <th>Do commit (batch)</th>
      <th>Do not commit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Logical slice complete (tests green or stated partial)</td>
      <td>After every single file save</td>
    </tr>
    <tr>
      <td>User asked for a commit</td>
      <td>Each internal planning typo</td>
    </tr>
    <tr>
      <td>End of session with delegated commit policy</td>
      <td>“WIP” spam on shared branches without user consent</td>
    </tr>
  </tbody>
</table>

<p>Internal markdown (<code>phase.md</code>, <code>plan.md</code>, <code>ref/</code>, audits, <code>idk.md</code>) accumulates during work — <strong>batch</strong> one <code>docs:</code> or <code>chore:</code> commit per session slice, or leave uncommitted for you to squash.</p>

<p><strong>Never</strong> commit secrets (<code>.env</code>, keys, tokens).</p>

<h3 id="conventional-commits-mandatory-when-committing">Conventional Commits (mandatory when committing)</h3>

<p>Follow <a href="./PROJECT_STANDARDS.md#commit-discipline"><code>PROJECT_STANDARDS.md</code> § Commit Discipline</a> exactly:</p>

<pre><code class="language-text">type(optional-scope): short description

[optional body]

[optional footer]
</code></pre>

<p>Examples:</p>

<pre><code class="language-bash">feat(harbor): add remote manifest diff for publish retries
fix(parser): reject unclosed borrow scope
docs(readme): sync install flags with SPEC
chore: update phase tracker after sync slice
</code></pre>

<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>Use for</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>feat</code></td>
      <td>New behavior</td>
    </tr>
    <tr>
      <td><code>fix</code></td>
      <td>Bug fix</td>
    </tr>
    <tr>
      <td><code>docs</code></td>
      <td>Documentation only</td>
    </tr>
    <tr>
      <td><code>refactor</code></td>
      <td>Behavior-preserving restructure</td>
    </tr>
    <tr>
      <td><code>test</code></td>
      <td>Tests only</td>
    </tr>
    <tr>
      <td><code>chore</code></td>
      <td>Tooling, deps, internal trackers</td>
    </tr>
  </tbody>
</table>

<p><strong>Subject line:</strong> imperative, short, no period.<br />
<strong>Body:</strong> explain <em>why</em>, not play-by-play of every file.<br />
<strong>No</strong> “Applied patch”, “Updated files per user request”, or model self-narration.</p>

<h3 id="co-authored-by-when-the-model-commits">Co-authored-by (when the model commits)</h3>

<p>If the model creates the commit, you did not author every line. Require a footer:</p>

<pre><code class="language-text">Co-authored-by: Cursor Agent &lt;cursoragent@cursor.com&gt;
</code></pre>

<p>Use the tool name the user actually uses (<code>Co-authored-by: Codex …</code>, etc.) if they specify it.
If the project already documents a bot co-author line, use that.</p>

<p>Do not pretend you solo-authored AI-generated patches.</p>

<h3 id="what-to-get-back-when-you-delegated-a-commit">What to get back when you delegated a commit</h3>

<p>In chat, it should state:</p>

<ul>
  <li>Branch name</li>
  <li>Full commit subject (and body if non-trivial)</li>
  <li>That <code>Co-authored-by</code> was included</li>
  <li>What was <strong>not</strong> committed (if anything left unstaged)</li>
</ul>

<h3 id="pr-flow-reminder">PR flow reminder</h3>

<p>Commits on a feature branch are not the end — <code>PROJECT_STANDARDS.md</code> expects PR to <code>dev</code> (or docs PR to <code>main</code>).
Don’t let it merge unless you explicitly said so.</p>

<hr />

<h2 id="where-ai-excels">Where AI Excels</h2>

<p>Use models where they pay rent:</p>

<table>
  <thead>
    <tr>
      <th>Strong fit</th>
      <th>Weak fit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Drafting and restructuring <strong>internal</strong> plans, audits, direction docs</td>
      <td>Inventing behavior without <code>idk.md</code> / spec update</td>
    </tr>
    <tr>
      <td><strong>Public docs</strong> drafts from verified behavior + <code>.public.txt</code></td>
      <td>Public docs from <code>phase.md</code> or vibes</td>
    </tr>
    <tr>
      <td>Boilerplate tests, golden updates after you define the contract</td>
      <td>Security-critical crypto/auth without review</td>
    </tr>
    <tr>
      <td>Refactors with <code>CODE_STANDARDS.md</code> + tests</td>
      <td>“Optimize” without measurement</td>
    </tr>
    <tr>
      <td>Cross-file exploration and status reconciliation</td>
      <td>Trusting SWE-bench % as readiness</td>
    </tr>
    <tr>
      <td><code>idk.md</code> and deviation hygiene</td>
      <td>Commits without explicit permission</td>
    </tr>
    <tr>
      <td><strong>Interplay</strong> top-offs: wire modules, finish functions, skinny implementation-plans</td>
      <td>Interplay without chunk reports or full-repo refactors in a side panel</td>
    </tr>
    <tr>
      <td>Slice <strong>implementation-plans</strong> after direction docs exist</td>
      <td>Implementation-plans that replace <code>SPEC.md</code> or skip gates</td>
    </tr>
    <tr>
      <td>Keeping diffs small and reviewing soon after generation</td>
      <td>Letting the model “clean up” adjacent files every slice</td>
    </tr>
    <tr>
      <td><strong>Pattern replication</strong> after you defined the first instance (doc tests, migrations)</td>
      <td>Vibe-coding the core design you never understood</td>
    </tr>
  </tbody>
</table>

<p><strong>Documentation</strong> is the highest-signal use: AI drafts, you verify against spec and public boundary, then ship via normal docs workflow.</p>

<hr />

<h2 id="security--trust">Security &amp; Trust</h2>

<ul>
  <li>Generated code may be vulnerable by default — review and test.</li>
  <li>Users with AI assistants may write <strong>less secure</strong> code while feeling <strong>more</strong> secure (<a href="https://arxiv.org/abs/2211.03622">Perry et al., 2023</a>).</li>
  <li>More prompt iteration and less blind trust correlates with better outcomes in that study — write constraints down.</li>
</ul>

<p>Don’t let it disable hooks, skip tests, or bypass review unless you explicitly asked for a defined local experiment.</p>

<hr />

<h2 id="external-benchmarks">External Benchmarks</h2>

<p>Do not tune prompts, tools, or internal process to maximize <strong>SWE-bench Verified</strong> (or any single public SWE headline). Use external numbers only with the failure modes in <a href="#prompt--task-shape">Prompt &amp; Task Shape</a> in mind.</p>

<h3 id="what-public-swe-scores-do-and-do-not-mean">What public SWE scores do and do not mean</h3>

<table>
  <thead>
    <tr>
      <th>Use for</th>
      <th>Do not use for</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Arguing repo-level agent tasks are structurally hard (Jimenez et al., ICLR 2024)</td>
      <td>Proving your agent stack or repo is production-ready</td>
    </tr>
    <tr>
      <td>Motivating tests + sandbox discipline</td>
      <td>Picking Cursor vs Codex vs “best model” from a saturated leaderboard</td>
    </tr>
    <tr>
      <td>Explaining why GitHub-issue prompt paste is harmful</td>
      <td>Replacing <code>codingprocess.md</code> + local <code>cargo test</code></td>
    </tr>
  </tbody>
</table>

<h3 id="multi-axis-comparison-when-you-must-compare-vendors">Multi-axis comparison (when you must compare vendors)</h3>

<p><a href="https://artificialanalysis.ai/methodology/coding-agents-benchmarking">Artificial Analysis Coding Agent Index</a> deliberately combines <strong>patch</strong> work (SWE-Bench-Pro-Hard-AA), <strong>terminal</strong> workflows (Terminal-Bench v2), and <strong>repository Q&amp;A</strong> (SWE-Atlas-QnA) with pass@1 and repeated runs — because one task shape does not equal “coding ability.” That is the right <em>culture</em> for external comparison even though Pro-family slices may still carry contamination and harness issues.</p>

<p><strong>Minimum bar for any external claim:</strong> component breakdown + cost/tokens/time + <strong>your repo’s</strong> smoke tests on real branches.</p>

<h3 id="positive-prompt-shape-reference-benchmark-methodology">Positive prompt-shape reference (benchmark methodology)</h3>

<p>DeepSWE (Datacurve, 2026) is a vendor benchmark, not peer-reviewed canon — treat it as <strong>methodology evidence</strong>, not gospel scores. It is still the best recent public articulation of prompt shape this suite endorses:</p>

<ul>
  <li>behavior-focused, developer-register prompts</li>
  <li>shorter mean prompt length than SWE-Bench Pro in their published comparison</li>
  <li>behavior verifiers that accept multiple correct implementations</li>
  <li>no “do not touch tests” clause — strong models write tests more often</li>
  <li>original tasks to reduce pretraining collision</li>
</ul>

<p>Align your prompts and <code>codingprocess.md</code> with <strong>that shape</strong>, not with Pro issue exports.</p>

<hr />

<h2 id="what-not-to-do">What Not To Do</h2>

<ol>
  <li><strong>Commit without permission</strong> or commit on every file change.</li>
  <li><strong>Omit <code>Co-authored-by</code></strong> on model-authored commits you delegated.</li>
  <li><strong>Use non-Conventional Commit</strong> subjects when committing.</li>
  <li><strong>Commit on wrong branch</strong> (e.g. code on <code>main</code>, docs on wrong base).</li>
  <li><strong>Promote <code>phase.md</code> to spec</strong> or implement from roadmap alone.</li>
  <li><strong>Guess behavior</strong> — use <code>idk.md</code> or stop.</li>
  <li><strong>Hide deviation</strong> — update deviation doc when plan path changes.</li>
  <li><strong>Reference internal paths in public docs</strong> or LICENSE.</li>
  <li><strong>Write public docs in future tense</strong> unless status is the document’s job.</li>
  <li><strong>Paste SWE-bench issue templates</strong> as prompts.</li>
  <li><strong>Claim tests passed</strong> without running them or stating why not.</li>
  <li><strong>Inflate status</strong> (“done” without artifact paths).</li>
  <li><strong>Leave <code>.status.txt</code> docs stale</strong> after code or test changes.</li>
  <li><strong>Cheerlead, coach, or narrate</strong> instead of reporting evidence.</li>
  <li><strong>Persona spam</strong> (“world-class expert”) instead of standards references.</li>
  <li><strong>Treat <code>ref/</code> as shippable</strong> public surface.</li>
  <li><strong>Use planning-pass handoffs in interplay</strong> — keep side-panel replies short.</li>
  <li><strong>Batch silent edits</strong> in dual work — report each chunk before the next.</li>
  <li><strong>Interplay without a named slice</strong> when the direction doc does not tell you where in the tree.</li>
  <li><strong>Accept drive-by refactors or whole-file rewrites</strong> when the slice didn’t ask for them — main source of avoidable churn.</li>
  <li><strong>Land large PRs</strong> because generation is fast — conflict rate and review load scale with diff size.</li>
  <li><strong>Skip diff review</strong> because the model “said it passed” — rework shows up days later in churn metrics.</li>
  <li><strong>Vibe-code shipping paths</strong> — regenerate until lucky without reading the middle.</li>
  <li><strong>Brag or optimize for LOC/day</strong> — false industriousness; virtuous laziness is smaller, clearer systems.</li>
  <li><strong>Wholesale re-generate</strong> to address review comments — fix surgically; keep review iterable.</li>
  <li><strong>Ask humans to review</strong> code you haven’t self-reviewed (RFD 576 shape).</li>
</ol>

<hr />

<h2 id="session-checklist">Session Checklist</h2>

<h3 id="planning-pass-before-stopping-or-handing-off">Planning pass (before stopping or handing off)</h3>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Mode: sit-and-plan (not fire-and-forget side panel)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Read <code>codingprocess.md</code> and authority files for this task</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Behavior changes match spec — unknowns in <code>idk.md</code></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Tests/commands run or failure explained</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Read <code>.status.txt</code> when present; all listed status docs updated per triggers</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><code>phase.md</code> / audit / deviation / direction honest (not only <code>phase.md</code> when audit also applies)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Public edits respect <code>.public.txt</code> and present-tense public voice</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Git: only if allowed — correct branch, Conventional Commit, <code>Co-authored-by</code></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />No secrets committed</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Handoff lists files, verification, blockers, remaining work</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Diff size matches the slice — no drive-by files; escalate if scope exploded</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Self-reviewed every line you expect someone else to read; no vibe-merge on core paths</li>
</ul>

<h3 id="interplay-after-each-panel-chunk-or-when-pausing">Interplay (after each panel chunk or when pausing)</h3>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Slice was named; direction doc or implementation-plan covered <em>where</em></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Reply ≤15 lines: did / ran / you next / skipped</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />No drive-by refactors or spec guesses</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Escalate to planning pass if behavior unclear or slice grew past ~3 files</li>
</ul>

<hr />

<h2 id="summary">Summary</h2>

<h3 id="core-references">Core references</h3>

<ul>
  <li>Workflow &amp; commits: <a href="./PROJECT_STANDARDS.md"><code>PROJECT_STANDARDS.md</code></a></li>
  <li>Code quality: <a href="./CODE_STANDARDS.md"><code>CODE_STANDARDS.md</code></a></li>
  <li>Planning shapes: sections above (Harbor / Meridian examples)</li>
</ul>

<h3 id="one-line-policy">One-line policy</h3>

<p><strong>Sit-and-plan when the attack is unclear; interplay in small chunks when direction already shows the tree. Supply the virtuous laziness models lack — simpler systems, not bigger diffs. Maintain <code>codingprocess.md</code> for the model; keep <code>.status.txt</code> honest when a slice lands; verify with commands; you own git unless you delegated commits with Conventional Commits and co-author attribution.</strong></p>

<h3 id="standards-basis">Standards Basis</h3>

<p>Primary references used to shape this document:</p>

<ul>
  <li>Liu et al., <em>Lost in the Middle: How Language Models Use Long Contexts</em> (TACL 2024)<br />
https://arxiv.org/abs/2307.03172</li>
  <li>Wang et al., <em>Plan-and-Solve Prompting</em> (ACL 2023)<br />
https://arxiv.org/abs/2305.04091</li>
  <li>Wei et al., <em>Chain-of-Thought Prompting</em> (NeurIPS 2022)<br />
https://arxiv.org/abs/2201.11903</li>
  <li>Yao et al., <em>ReAct: Synergizing Reasoning and Acting in Language Models</em> (ICLR 2023)<br />
https://arxiv.org/abs/2210.03629</li>
  <li>Chen et al., <em>Evaluating Large Language Models Trained on Code</em> (2021)<br />
https://arxiv.org/abs/2107.03374</li>
  <li>Wang et al., <em>Self-Consistency Improves Chain of Thought Reasoning in Language Models</em> (ICLR 2023)<br />
https://arxiv.org/abs/2203.11171</li>
  <li>Jimenez et al., <em>SWE-bench: Can Language Models Resolve Real-World GitHub Issues?</em> (ICLR 2024)<br />
https://arxiv.org/abs/2310.06770</li>
  <li>Yang et al., <em>SWE-Bench+: Enhanced Coding Benchmark for LLMs</em> (2024)<br />
https://arxiv.org/abs/2410.06992</li>
  <li>Yang et al., <em>The SWE-Bench Illusion</em> (2025)<br />
https://arxiv.org/abs/2506.12286</li>
  <li>OpenAI, <em>Why SWE-bench Verified no longer measures frontier coding capabilities</em> (2026)<br />
https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/</li>
  <li>Datacurve, <em>DeepSWE</em> methodology and audits (2026)<br />
https://deepswe.datacurve.ai/blog</li>
  <li>Artificial Analysis, <em>Coding Agent Index Methodology</em> (2026)<br />
https://artificialanalysis.ai/methodology/coding-agents-benchmarking</li>
  <li>Pearce et al., <em>Asleep at the Keyboard?</em> (IEEE S&amp;P 2022)<br />
https://doi.org/10.1109/SP46214.2022.9833571</li>
  <li>Perry et al., <em>Do Users Write More Insecure Code with AI Assistants?</em> (2023)<br />
https://arxiv.org/abs/2211.03622</li>
  <li>Vaithilingam et al., <em>Expectation vs. Experience</em> (CHI 2022)<br />
https://arxiv.org/abs/2202.07606</li>
  <li>Xu et al., <em>Better Zero-Shot Reasoning with Role-Play Prompting</em> (NAACL 2024)<br />
https://aclanthology.org/2024.naacl-long.228/</li>
  <li>Casanova et al., <em>Impromptu</em> (Software and Systems Modeling, 2024)<br />
https://link.springer.com/article/10.1007/s10270-024-01235-4</li>
  <li>Casanova et al., <em>Promptware Engineering</em> (2025)<br />
https://arxiv.org/abs/2503.02400</li>
  <li>Sarkar et al., <em>What is it like to program with artificial intelligence?</em> (2022)<br />
https://advait.org/publications-web/sarkar-2022-programming-ai/</li>
  <li>Xiao et al., <em>Self-Admitted GenAI Usage in Open-Source Software</em> (2025)<br />
https://arxiv.org/abs/2507.10422</li>
  <li>Mao et al., <em>A Large-Scale Empirical Study of AI-Generated Code in Real-World Repositories</em> (2026)<br />
https://arxiv.org/abs/2603.27130</li>
  <li>Ogenrwot &amp; Businge, <em>How AI Coding Agents Modify Code</em> (MSR ‘26)<br />
https://arxiv.org/abs/2601.17581</li>
  <li>Ogenrwot &amp; Businge, <em>AgenticFlict: Merge Conflicts in AI Agent PRs</em> (AIware ‘26)<br />
https://arxiv.org/abs/2604.03551</li>
  <li>GitClear, <em>Coding on Copilot: Downward Pressure on Code Quality</em> (2024, industry report)<br />
https://www.gitclear.com/coding_on_copilot_data_shows_ais_downward_pressure_on_code_quality</li>
  <li>Cantrill, <em>The peril of laziness lost</em> (2026)<br />
https://bcantrill.dtrace.org/2026/04/12/the-peril-of-laziness-lost/</li>
  <li>Cantrill, <em>Using LLMs at Oxide</em> (RFD 576, 2026)<br />
https://rfd.shared.oxide.computer/rfd/0576</li>
  <li><em>Oxide and Friends</em>, <em>Engineering Rigor in the LLM Age</em> (2026)<br />
https://oxide-and-friends.transistor.fm/episodes/engineering-rigor-in-the-llm-age/transcript</li>
</ul>

<hr />

<p>End of Standard</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[A Manual for Using LLM Agents on Real Projects Without Turning Git History Into a Diary of Model Hallucinations]]></summary></entry><entry><title type="html">bfetch</title><link href="https://mjoyufull.github.io/2026/05/24/Bfetch_Micro_C.html" rel="alternate" type="text/html" title="bfetch" /><published>2026-05-24T00:00:00+00:00</published><updated>2026-05-24T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/05/24/Bfetch_Micro_C</id><content type="html" xml:base="https://mjoyufull.github.io/2026/05/24/Bfetch_Micro_C.html"><![CDATA[<p>This is the microoptimized C version of <code>bfetch</code>.</p>

<p>The point was to see how much real system inspection could be crammed into a one-shot binary before the kernel, and filesystem metadata overhead finally told me to shut the fuck up.</p>

<p>So this version keeps same rules:</p>

<ul>
  <li>no shelling out</li>
  <li>no daemon</li>
  <li>no caching layer pretending to be speed</li>
  <li>no fake per-distro detection shortcuts beyond art selection</li>
  <li>real system checks every run</li>
  <li>one buffered write at the end</li>
</ul>

<p>That is the whole shit.</p>

<h2 id="what-this-file-actually-is">What This File Actually Is</h2>

<p>The C path is centered around <a href="./fetch.c"><code>fetch.c</code></a>.</p>

<p>It is a deliberately aggressive Linux userspace probe with:</p>

<ul>
  <li>raw syscall wrappers</li>
  <li>direct <code>/proc</code> and <code>/sys</code> parsing</li>
  <li><code>getdents64</code> directory walking</li>
  <li><code>mmap</code> where large file scans are worth it</li>
  <li>inline hot paths</li>
  <li>one final buffered output write</li>
</ul>

<h2 id="the-real-enemy-was-never-arithmetic">The Real Enemy Was Never Arithmetic</h2>

<p>At first glance this kind of program looks like it should be “instant”.</p>

<p>And arithmetic-wise, sure, it basically is.</p>

<p>The math for most fields is trivial:</p>

<ul>
  <li>distro: read one small file and grab one string</li>
  <li>kernel: one <code>uname</code></li>
  <li>uptime: parse seconds, do a few integer divisions</li>
  <li>memory: parse <code>MemTotal</code> and <code>MemAvailable</code>, subtract, scale to GiB</li>
  <li>CPU: three CPUID leaves, thread count parse, one frequency read</li>
</ul>

<p>That part is not the wall.</p>

<p>The wall is metadata and kernel-facing book keeping:</p>

<ul>
  <li>opening procfs and sysfs files</li>
  <li>walking package database directories</li>
  <li>scanning Nix manifests</li>
  <li>chasing parent processes for terminal detection</li>
  <li>resolving a pretty GPU model name instead of a generic vendor string</li>
</ul>

<p>So the runtime is better described as:</p>

<pre><code class="language-text">T_total = T_startup + T_syscalls + T_vfs + T_scan + T_format
</code></pre>

<p>Not:</p>

<pre><code class="language-text">T_total = "C is fast so it should be free"
</code></pre>

<p>That distinction matters. A lot.</p>

<h2 id="what-got-optimized">What Got Optimized</h2>

<p>The major pressure points were:</p>

<h3 id="1-output-building">1. Output building</h3>

<p>The renderer builds one buffer in memory and flushes it with a single <code>write</code>.</p>

<p>That matters because once the data is collected, multiple tiny writes are just self-inflicted syscall overhead.</p>

<h3 id="2-package-counting">2. Package counting</h3>

<p>This was and still is one of the biggest exact-work terms.</p>

<p>If you insist on real counts with no caching, then the program has to pay for:</p>

<ul>
  <li>pacman directory enumeration</li>
  <li>flatpak directory enumeration</li>
  <li>nix manifest scanning</li>
</ul>

<p>That is the actual cost of knowing the answer right now.</p>

<h3 id="3-gpu-naming">3. GPU naming</h3>

<p>A generic GPU vendor string is cheap.</p>

<p>An actually nice GPU name is not.</p>

<p>This C version tries hard to keep the expensive part contained, but if you want <code>NVIDIA GeForce RTX 3070 Ti</code> instead of some miserable fallback, you are paying for extra procfs/sysfs and lookup work.</p>

<h3 id="4-tiny-file-reads">4. Tiny file reads</h3>

<p>A lot of this program is “open a tiny virtual file, read a small buffer, parse it, close it”.</p>

<p>None of those individual operations are huge, but when the whole binary is fighting for sub-millisecond execution, they matter as a class.</p>

<h2 id="what-fetchc-is-trying-to-detect">What <code>fetch.c</code> Is Trying To Detect</h2>

<p>The structure in <a href="./fetch.c"><code>fetch.c</code></a> is split by field on purpose so each detector can be reasoned about independently.</p>

<p>At a high level:</p>

<ul>
  <li>distro
    <ul>
      <li><code>/etc/os-release</code></li>
      <li>same read also drives art choice logic</li>
    </ul>
  </li>
  <li>kernel
    <ul>
      <li><code>uname</code></li>
    </ul>
  </li>
  <li>uptime
    <ul>
      <li><code>/proc/uptime</code></li>
    </ul>
  </li>
  <li>memory
    <ul>
      <li><code>/proc/meminfo</code></li>
    </ul>
  </li>
  <li>WM
    <ul>
      <li>environment</li>
    </ul>
  </li>
  <li>terminal
    <ul>
      <li>env first, then parent process inspection</li>
    </ul>
  </li>
  <li>shell
    <ul>
      <li>environment plus basename trim</li>
    </ul>
  </li>
  <li>CPU
    <ul>
      <li>CPUID plus sysfs</li>
    </ul>
  </li>
  <li>GPU
    <ul>
      <li>DRM or NVIDIA-specific live checks</li>
    </ul>
  </li>
  <li>packages
    <ul>
      <li>native filesystem/database inspection, no subprocesses</li>
    </ul>
  </li>
</ul>

<p>That separation is not just code style. It makes benchmarking and blame assignment possible. If one field is expensive, you can isolate it and prove it instead of arguing from vibes.</p>

<h2 id="why-keep-this-version-at-all">Why Keep This Version At All</h2>

<p>Because its still the cleanest expression of the actual problem.</p>

<p>It lets the program sit very close to the machine:</p>

<ul>
  <li>direct control over buffers</li>
  <li>direct control over syscalls</li>
  <li>direct control over parsing</li>
  <li>direct control over data layout</li>
  <li>almost no abstraction tax unless you choose to pay it</li>
</ul>

<p>That does not mean every line of C is automatically faster than everything else. It means this is the version where the intended behavior, performance strategy, and Linux-facing tricks are the clearest.</p>

<p>Everything else in the repo is either learning from this version or fighting it.</p>

<h2 id="performance-reality">Performance Reality</h2>

<p>The exact number moves around with system noise, current machine state, package database size, and what the kernel feels like doing.</p>

<p>But on this box, this version is already in the sub-millisecond class when benchmarked sanely with no shell startup in the way.</p>

<p>That is the important part.</p>

<p>Not “did it hit some magic ideological number every single run”, but:</p>

<ul>
  <li>it is doing real work</li>
  <li>it is doing that work natively</li>
  <li>it is doing it absurdly fast already</li>
</ul>

<p>At this point, further wins tend to come from:</p>

<ul>
  <li>reducing VFS work</li>
  <li>reducing package database traversal cost</li>
  <li>reducing GPU naming overhead</li>
  <li>reducing startup overhead</li>
</ul>

<p>Not from pretending another clever <code>for</code> loop is going to save the world.</p>

<h2 id="build">Build</h2>

<p>From the repo root:</p>

<pre><code class="language-bash">make
</code></pre>

<p>Run it:</p>

<pre><code class="language-bash">./fetch
./fetch --version
</code></pre>

<p>Benchmark it without shell noise:</p>

<pre><code class="language-bash">hyperfine --shell=none ./fetch
</code></pre>

<h2 id="what-this-version-proved">What This Version Proved</h2>

<p>It proved that the problem is not “C is too slow”.</p>

<p>It proved that once the code gets tight enough, the remaining fight is mostly with:</p>

<ul>
  <li>kernel entry/exit overhead</li>
  <li>procfs/sysfs formatting</li>
  <li>directory enumeration</li>
  <li>manifest scanning</li>
  <li>process startup</li>
</ul>

<p>Which is exactly the kind of answer you want if you are trying to understand where the real lower bound lives instead of posting compiler flag astrology.</p>

<p>So if you want the version that best represents the actual microoptimization war in this repo, this is it.</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[This is the microoptimized C version of bfetch.]]></summary></entry><entry><title type="html">bfetchaust</title><link href="https://mjoyufull.github.io/2026/05/15/Bfetchaustral.html" rel="alternate" type="text/html" title="bfetchaust" /><published>2026-05-15T00:00:00+00:00</published><updated>2026-05-15T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/05/15/Bfetchaustral</id><content type="html" xml:base="https://mjoyufull.github.io/2026/05/15/Bfetchaustral.html"><![CDATA[<p>This is the Austral rewrite of <code>fetch.c</code>.</p>

<p>The goal here was not to make some cute alternate version. The goal was to get as close as possible to the real <code>bfetch</code> behavior, output, and style while keeping the fetch logic in Austral and rebuilding the missing low-level pieces ourselves.</p>

<p>Right now this version matches the C binary on the tested paths for:</p>

<ul>
  <li>default output</li>
  <li><code>--help</code></li>
  <li><code>--version</code></li>
  <li><code>--gentoo</code></li>
  <li><code>--bedrock</code></li>
  <li><code>--cachyos</code></li>
</ul>

<p>It also keeps the same buffered output model. Everything is assembled in memory and written out in one shot.</p>

<h2 id="what-this-directory-is">What This Directory Is</h2>

<p><code>bfetchaust/</code> is its own little subproject.</p>

<p>The high-level split is:</p>

<ul>
  <li><code>src/Fetch.aum</code>
    <ul>
      <li>argument parsing</li>
      <li>mode selection</li>
      <li>exact fetch rendering</li>
      <li>exact help and version output</li>
    </ul>
  </li>
  <li><code>runtime/BfetchAust.Posix.aui</code> and <code>runtime/BfetchAust.Posix.aum</code>
    <ul>
      <li>the raw OS boundary</li>
      <li>file, dir, env, uname, process, and libc imports that Austral does not ship with</li>
    </ul>
  </li>
  <li><code>runtime/BfetchAust.FastIO.aui</code> and <code>runtime/BfetchAust.FastIO.aum</code>
    <ul>
      <li>byte buffer code</li>
      <li>buffered writes</li>
      <li>fast file reads</li>
      <li>a few small formatting helpers</li>
    </ul>
  </li>
  <li><code>runtime/BfetchAust.Sys.aui</code> and <code>runtime/BfetchAust.Sys.aum</code>
    <ul>
      <li>all the actual probes for distro, kernel, uptime, WM, terminal, shell, packages, CPU, GPU, and memory</li>
    </ul>
  </li>
  <li><code>bfetchaust.c</code>
    <ul>
      <li>generated C output from the Austral compiler</li>
      <li>not hand-written, not something you are meant to edit</li>
    </ul>
  </li>
</ul>

<h2 id="getting-austral">Getting Austral</h2>

<p>Austral lives here:</p>

<ul>
  <li><a href="https://github.com/austral/austral/">https://github.com/austral/austral/</a></li>
</ul>

<p>This repo currently assumes you have that compiler checked out next to <code>bfetch</code> in <code>../austral</code> and that you built <code>austral.exe</code> there. If your compiler lives somewhere else, edit <code>AUSTRAL_BIN</code> in <code>bfetchaust/Makefile</code>.</p>

<h2 id="build">Build</h2>

<p>From the repo root:</p>

<pre><code class="language-bash">eval $(opam env --switch=default --set-switch)
make -C bfetchaust
</code></pre>

<p>Typecheck only:</p>

<pre><code class="language-bash">eval $(opam env --switch=default --set-switch)
make -C bfetchaust tc
</code></pre>

<p>Run it:</p>

<pre><code class="language-bash">./bfetchaust/bfetchaust
./bfetchaust/bfetchaust --help
./bfetchaust/bfetchaust --cachyos
</code></pre>

<p>Install it somewhere on your path if you want:</p>

<pre><code class="language-bash">install -Dm755 bfetchaust/bfetchaust ~/.local/bin/bfetchaust
</code></pre>

<p>Or system-wide:</p>

<pre><code class="language-bash">sudo install -Dm755 bfetchaust/bfetchaust /usr/local/bin/bfetchaust
</code></pre>

<h2 id="why-this-was-more-annoying-than-the-c-version">Why This Was More Annoying Than The C Version</h2>

<p>The C version is just allowed to be direct.</p>

<p>It opens files, reads directories, uses <code>mmap</code>, pulls env vars, parses <code>/proc</code>, walks <code>/sys/class/drm</code>, pokes <code>cpuid</code>, and writes the final buffer. That is the whole point of <code>fetch.c</code>. It is a very small binary with basically no ceremony between the idea and the machine.</p>

<p>Austral is not like that.</p>

<p>Austral gives you strong rules about ownership and mutation, which is good, but it does not give you the Linux-facing standard library surface this project needs. So if you want to write a real system tool in it, you have to build that surface first.</p>

<p>That meant doing all of this before the port was even interesting:</p>

<ul>
  <li>file reads for things like <code>/etc/os-release</code>, <code>/proc/cpuinfo</code>, <code>/proc/meminfo</code>, <code>/proc/uptime</code></li>
  <li>directory walking for package managers</li>
  <li>environment access for <code>TERM</code>, <code>TERM_PROGRAM</code>, <code>SHELL</code>, <code>XDG_CURRENT_DESKTOP</code>, <code>DESKTOP_SESSION</code></li>
  <li>process inspection for parent PID and terminal detection</li>
  <li>sysfs probing for DRM devices and GPU IDs</li>
  <li>uname access for kernel release</li>
  <li>one-buffer output helpers so the renderer could stay close to the C version</li>
</ul>

<p>So the actual rewrite was not just “port fetch.c”. It was “first build the missing chunk of a tiny Linux stdlib, then port fetch.c on top of it which nearly killed me”.</p>

<h2 id="the-rules-i-kept-on-this-port">The Rules I Kept On This Port</h2>

<p>I did not want this thing cheating, no.</p>

<p>So the rules were:</p>

<ul>
  <li>no shelling out, same as fetch.c</li>
  <li>no subprocess-based probing</li>
  <li>no fake wrappers that hide the real work</li>
  <li>keep the real fetch logic in Austral</li>
  <li>match the C output as closely as possible instead of settling for “close enough”</li>
</ul>

<p>The one place where reality still matters is the OS boundary. Austral without that boundary cannot even open a file. So the low-level imports live in <code>runtime/BfetchAust.Posix.*</code>, and the rest of the actual program logic stays above that in Austral.</p>

<h2 id="what-had-to-change-compared-to-fetchc">What Had To Change Compared To <code>fetch.c</code></h2>

<p>Some parts ported cleanly. Some absolutely did not.</p>

<h3 id="1-the-runtime-had-to-be-built-first">1. The runtime had to be built first</h3>

<p>In C, <code>fetch.c</code> just calls libc and the kernel-facing interfaces it needs.</p>

<p>In Austral, I had to build:</p>

<ul>
  <li>a byte buffer type for all formatted output and small string work</li>
  <li>file read helpers</li>
  <li>pointer-based path helpers</li>
  <li>directory iteration wrappers</li>
  <li>env wrappers</li>
  <li>formatting helpers for decimal and hex output</li>
  <li>probe helpers for <code>/proc</code> and <code>/sys</code></li>
</ul>

<p>Without that, there is no port.</p>

<h3 id="2-the-first-raw-file-io-path-was-a-dead-end">2. The first raw file I/O path was a dead end</h3>

<p>The initial raw <code>open</code> path looked like the obvious thing to do. In practice it was the wrong path in this build, so the file runtime got rewritten around <code>fopen</code>, <code>fread</code>, and <code>fclose</code> instead. That made the I/O layer stable enough to keep moving.</p>

<h3 id="3-terminal-detection-had-to-change-too">3. Terminal detection had to change too</h3>

<p>The simple symlink-based idea was not reliable enough here. Reading <code>/proc/&lt;pid&gt;/exe</code> was not the right fit for the actual process chain in this shit.</p>

<p>So terminal detection was switched to <code>/proc/&lt;pid&gt;/comm</code> plus <code>/proc/&lt;pid&gt;/stat</code>, walking the parent process chain until it found the terminal instead of the shell wrapper sitting in front of it.</p>

<h3 id="4-package-counting-stayed-native">4. Package counting stayed native</h3>

<p>The point of <code>bfetch</code> is that it does not shell out, so the Austral version could not either.</p>

<p>That means package counting is still done natively:</p>

<ul>
  <li>Pacman by directory counting</li>
  <li>Flatpak by filesystem inspection</li>
  <li>Snap by filesystem inspection</li>
  <li>DPKG by directory counting</li>
  <li>Nix by direct manifest scanning</li>
  <li>Gentoo by walking <code>var/db/pkg</code></li>
</ul>

<p>The Nix path was especially annoying because the original C version leans on <code>mmap</code> substring search. The Austral runtime ended up doing deterministic byte scanning over the manifest files yah now so it can keep up.</p>

<h3 id="5-gpu-naming-had-to-copy-the-ugly-shi-too">5. GPU naming had to copy the ugly shi too</h3>

<p>Getting the vendor and device IDs is easy enough.</p>

<p>Matching the C output exactly is where the pain starts. The port had to reproduce the <code>pci.ids</code> lookup rules, the bracket stripping, and the vendor prefix heuristic so <code>NVIDIA GeForce RTX 3070 Ti</code> came out the same way instead of almost the same way, still don’t know about vender revisions.</p>

<h3 id="6-help-text-even-had-to-match-the-weird-parts">6. Help text even had to match the weird parts</h3>

<p>The C binary prints <code>Usage: ./bfetch [OPTIONS]</code>.</p>

<p>That is not <code>argv[0]</code>. That is just what it prints.</p>

<p>So the Austral version prints the same literal string because the point here was parity, not doing what looks cleaner.</p>

<h2 id="austral-itself">Austral Itself</h2>

<p>Austral is interesting because it is not trying to be Rust, and it is definitely not C with a nicer parser.</p>

<p>The big thing it cares about is linearity and regions.</p>

<p>That changes how you write code:</p>

<ul>
  <li>mutation is explicit</li>
  <li>borrowing is explicit</li>
  <li>ownership mistakes get caught early</li>
  <li>branch cleanup has to be structurally consistent</li>
  <li>you cannot casually pass mutable state around and hope for shit to be sweet</li>
</ul>

<p>That part is good.</p>

<p>The rough part is that you feel the lack of batteries constantly.</p>

<p>In Rust, if you want to build a tool like this, the language is strict but the ecosystem is huge. You have crates, helpers, wrappers, and a mature library story.</p>

<p>In C, nothing stops you, so you can go straight at the machine and be done fast if you know what you are doing.</p>

<p>Austral sits in a weird middle spot:</p>

<ul>
  <li>stricter than C by a lot</li>
  <li>smaller and lower-level than Rust in practice</li>
  <li>much less ergonomic than mainstream memory-safe languages</li>
  <li>very little stdlib for real Linux systems work</li>
</ul>

<p>So writing this felt like doing systems programming with one hand tied behind my back and another in my ass, but in a way that was still interesting because the language rules actually force discipline, and im a little kinkly like that.</p>

<h2 id="the-kind-of-pain-austral-adds">The Kind Of Pain Austral Adds</h2>

<p>These were the repeated gotchas during the rewrite:</p>

<ul>
  <li>hex literals and some surface syntax that look fine in other languages were not accepted the way I first wrote them</li>
  <li>chained boolean expressions sometimes had to be flattened into explicit nested control flow</li>
  <li>region mismatches show up fast if one helper accidentally ties input and output to the same region when they should not be</li>
  <li>linear cleanup rules mean a casual early return can turn into a type error if one branch consumes a value and another does not</li>
  <li>a lot of simple C string work becomes explicit byte-buffer work</li>
</ul>

<p>That sounds like complaining, but it is really the shape of the language. Austral wants you to make ownership and mutation obvious. If you do not, it pushes back.</p>

<h2 id="what-bfetchaustc-tells-you-about-how-austral-works">What <code>bfetchaust.c</code> Tells You About How Austral Works</h2>

<p>The generated C file is useful if you want to understand what Austral is actually doing.</p>

<p>A few things jump out to me:</p>

<ul>
  <li>the runtime support is right at the top</li>
  <li>options and other small algebraic types get monomorphized into generated structs and tags</li>
  <li>foreign imports become plain <code>extern</code> declarations in the generated C</li>
  <li>the final output is a lot bigger and more mechanical than the source Austral code</li>
</ul>

<p>So if you open <code>bfetchaust.c</code>, what you see is not “nice hand-written C”. You see the compiler lowering Austral’s model into a big C translation unit.</p>

<p>That file also made one performance issue obvious. Austral’s default <code>bin</code> build path was invoking <code>cc</code> without real optimization flags, which was a bad fit for this project. That is why the <code>Makefile</code> here does not use the plain default binary mode anymore. It emits C first, then compiles that C with:</p>

<pre><code class="language-bash">cc -O3 -march=native -fwrapv -Wno-builtin-declaration-mismatch
</code></pre>

<p>That one change cut a lot of the gap in peformance.</p>

<h2 id="performance">Performance</h2>

<p>This was never going to beat the C version without a fight.</p>

<p>Current rough numbers on my machine after switching to the optimized generated-C build:</p>

<ul>
  <li><code>./bfetch</code>: about <code>1.9 ms</code></li>
  <li><code>./bfetchaust/bfetchaust</code>: about <code>3.2 ms</code></li>
</ul>

<p>So the Austral version is still slower.</p>

<p>That matters, and I am not pretending otherwise and its unacceptable i know.</p>

<p>The good news is that the big stupid gap from the unoptimized default build path is gone. The bad news is that there is still real overhead left after that.</p>

<h2 id="current-state">Current State</h2>

<p>Right now the port is in a solid state(like an nvme):</p>

<ul>
  <li>output parity is there on the tested paths</li>
  <li>no shelling out</li>
  <li>fetch logic is in Austral</li>
  <li>runtime support is split into sane modules</li>
  <li>the build is stable</li>
  <li>the generated C path is compiled with actual optimization flags</li>
</ul>

<p>What is still not perfect:</p>

<ul>
  <li>it is still slower than the C binary</li>
  <li>the runtime layer exists because Austral does not ship the Linux-facing stdlib this shi needs</li>
  <li>there is still more room to chase performance if I want to push harder on <code>mmap</code> and other C-style shortcuts in the runtime</li>
</ul>

<h2 id="if-you-want-to-read-the-port">If You Want To Read The Port</h2>

<p>Start here:</p>

<ul>
  <li><code>src/Fetch.aum</code></li>
  <li><code>runtime/BfetchAust.FastIO.aum</code></li>
  <li><code>runtime/BfetchAust.Sys.aum</code></li>
  <li><code>runtime/BfetchAust.Posix.aui</code></li>
</ul>

<p>That gets you the whole picture fast.</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[This is the Austral rewrite of fetch.c.]]></summary></entry><entry><title type="html">bfetchasm</title><link href="https://mjoyufull.github.io/2026/04/11/BfetchASM.html" rel="alternate" type="text/html" title="bfetchasm" /><published>2026-04-11T00:00:00+00:00</published><updated>2026-04-11T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/04/11/BfetchASM</id><content type="html" xml:base="https://mjoyufull.github.io/2026/04/11/BfetchASM.html"><![CDATA[<p>This is the static assembly rewrite of <code>bfetch</code>.</p>

<p>written in x86_64 assembly, doing live system checks on this machine and printing the same overall layout as the C version.</p>

<p>The reason this exists is simple: after enough microoptimizing in C, the obvious next question becomes “fine, what if I remove the language abstraction almost entirely and just talk to Linux myself?”</p>

<p>So this directory is that answer.</p>

<h2 id="what-this-rewrite-was-trying-to-prove">What This Rewrite Was Trying To Prove</h2>

<p>The assembly port was not made to disrespect the C version.</p>

<p>It was made to answer a harsher question:</p>

<p>If the real target is “as fast as physics allows on this Linux box”, how much of the remaining cost is:</p>

<ul>
  <li>C itself</li>
  <li>ELF / loader overhead</li>
  <li>libc-adjacent calling patterns</li>
  <li>extra abstraction in helpers</li>
</ul>

<p>and how much is simply the unavoidable cost of asking the kernel real questions?</p>

<p>That is why the ASM version is:</p>

<ul>
  <li>syscall-only</li>
  <li>statically linked</li>
  <li>machine-targeted</li>
  <li>still doing real detection</li>
  <li>still avoiding caching and daemons</li>
</ul>

<h2 id="where-it-lives">Where It Lives</h2>

<p>The assembly implementation lives in <a href="./Bfetchasm/fetch.s"><code>Bfetchasm/fetch.s</code></a>.</p>

<p>Its build is intentionally tiny and lives in <a href="./Bfetchasm/Makefile"><code>Bfetchasm/Makefile</code></a>.</p>

<p>The code is split by detector in the same broad spirit as the C version:</p>

<ul>
  <li>env scan and startup helpers</li>
  <li>file and directory I/O helpers</li>
  <li>string and number helpers</li>
  <li>field detectors for distro, kernel, uptime, memory, WM, terminal, shell, CPU, GPU, packages</li>
  <li>final buffered renderer</li>
</ul>

<p>That separation matters because assembly gets unreadable very fast if every concern is just collapsed into one enormous blob of instructions.</p>

<h2 id="why-this-was-not-automatically-faster">Why This Was Not Automatically Faster</h2>

<p>This is the first thing worth being honest about.</p>

<p>Assembly is not magic.</p>

<p>If the bottleneck is:</p>

<ul>
  <li><code>open</code></li>
  <li><code>read</code></li>
  <li><code>getdents64</code></li>
  <li><code>readlinkat</code></li>
  <li>procfs/sysfs formatting</li>
  <li>walking package metadata</li>
</ul>

<p>then rewriting the surrounding glue in assembly does not erase that cost.</p>

<p>The math is still:</p>

<pre><code class="language-text">T_total = T_exec + T_kernel_boundary + T_metadata + T_scan + T_render
</code></pre>

<p>And for a fetch tool doing exact live checks, <code>T_kernel_boundary + T_metadata + T_scan</code> is a huge chunk of the bill.</p>

<p>So the ASM rewrite was never going to win just because the source file ended in <code>.s</code>.</p>

<p>It had to earn every microsecond the same way the C version did.</p>

<h2 id="what-the-asm-version-actually-does">What The ASM Version Actually Does</h2>

<p>This port is intentionally current-machine oriented rather than trying to be a giant universal portability project.</p>

<p>Right now it does real live checks for the environment this machine actually cares about:</p>

<ul>
  <li>distro from <code>/etc/os-release</code></li>
  <li>kernel from <code>uname</code></li>
  <li>uptime from <code>/proc/uptime</code></li>
  <li>memory from <code>/proc/meminfo</code></li>
  <li>WM from env</li>
  <li>terminal from env and parent-process inspection</li>
  <li>shell from env</li>
  <li>CPU from CPUID plus sysfs</li>
  <li>GPU from NVIDIA procfs fast path</li>
  <li>packages from pacman, flatpak, and nix paths</li>
</ul>

<p>That was the right scope for this rewrite.</p>

<p>Trying to rebuild every distro path and every edge-case backend in assembly before getting a fast correct binary would have been a good way to waste time and learn nothing.</p>

<h2 id="what-was-annoying-in-assembly">What Was Annoying In Assembly</h2>

<p>The obvious pain is readability, but the more interesting pain was correctness under register pressure.</p>

<p>The repeated failures during bring-up were not exotic. They were brutally ordinary:</p>

<ul>
  <li>caller-saved registers getting clobbered across helper calls</li>
  <li>pointers parked in registers that an instruction like <code>cpuid</code> overwrites</li>
  <li>one broken append helper poisoning the whole output path</li>
  <li>path-building bugs that C would make almost boring to fix</li>
  <li>“this should obviously work” logic falling apart because one register got reused three calls earlier</li>
</ul>

<p>That is the part assembly forces on you. Every assumption has to be earned.</p>

<p>In C you still need to think, but the compiler saves you from a lot of raw bookkeeping mistakes.</p>

<p>In assembly, the bookkeeping is the job.</p>

<h2 id="why-the-code-has-math-comments">Why The Code Has Math Comments</h2>

<p>The comments in <a href="./Bfetchasm/fetch.s"><code>Bfetchasm/fetch.s</code></a> are there because i wanted to prove i wasn’t worng to myself “it is fast” is not enough.</p>

<p>Each detector is better thought of as a small cost equation:</p>

<ul>
  <li>distro
    <ul>
      <li><code>open + read + parse</code></li>
    </ul>
  </li>
  <li>uptime
    <ul>
      <li><code>open + read + integer divisions</code></li>
    </ul>
  </li>
  <li>memory
    <ul>
      <li><code>open + read + scan + scaling</code></li>
    </ul>
  </li>
  <li>CPU
    <ul>
      <li><code>cpuid + tiny sysfs reads</code></li>
    </ul>
  </li>
  <li>packages
    <ul>
      <li><code>directory walks + manifest scans</code></li>
    </ul>
  </li>
</ul>

<p>That framing is important because it separates:</p>

<ul>
  <li>real unavoidable work</li>
  <li>avoidable implementation waste</li>
</ul>

<p>Without that, assembly turns into cargo culting instruction counts while the actual cost is still sitting in the kernel and filesystem.</p>

<h2 id="static-linking-was-part-of-the-experiment">Static Linking Was Part Of The Experiment</h2>

<p>The assembly binary is built static on purpose.</p>

<p>That gives a cleaner answer to the startup question because it avoids dynamic loader work and keeps the experiment focused on:</p>

<ul>
  <li>program startup</li>
  <li>syscall path</li>
  <li>parsing and formatting</li>
</ul>

<p>instead of “what did the runtime loader just do for me before <code>_start</code> even ran?”</p>

<p>So this version is useful not just as a rewrite, but as a measurement tool.</p>

<h2 id="performance">Performance</h2>

<p>On my machine, once the assembly version was brought to correctness, it ended up benchmarking slightly faster than the current C build in one direct comparison:</p>

<ul>
  <li><code>./bfetchasm</code>: about <code>886 µs</code></li>
  <li><code>./fetch</code>: about <code>927 µs</code></li>
</ul>

<p>That is not some anime 10x ownage number, but it is real enough for me to beat my meat to.</p>

<p>And more importantly, it is informative.</p>

<p>It says:</p>

<ul>
  <li>yes, there was still a little room left after the C version</li>
  <li>no, assembly did not annihilate the remaining cost</li>
  <li>most of the lower bound is still the real system inspection work</li>
</ul>

<p>That is exactly the kind of answer worth getting.</p>

<h2 id="build">Build</h2>

<p>From the repo root:</p>

<pre><code class="language-bash">make -C Bfetchasm
</code></pre>

<p>Run it:</p>

<pre><code class="language-bash">./Bfetchasm/bfetchasm
./Bfetchasm/bfetchasm --version
./Bfetchasm/bfetchasm --help
</code></pre>

<p>Benchmark it without shell startup:</p>

<pre><code class="language-bash">hyperfine --shell=none ./Bfetchasm/bfetchasm ./fetch
</code></pre>

<p>Check that it is really static:</p>

<pre><code class="language-bash">file ./Bfetchasm/bfetchasm
ldd ./Bfetchasm/bfetchasm || true
</code></pre>

<h2 id="what-this-version-is-good-for">What This Version Is Good For</h2>

<p>It is good for three things:</p>

<h3 id="1-testing-the-real-lower-bound">1. Testing the real lower bound</h3>

<p>If you want to know whether the C version is leaving obvious userspace overhead on the table, this version is the bluntest way to ask.</p>

<h3 id="2-studying-the-exact-plumbing">2. Studying the exact plumbing</h3>

<p>The assembly source makes the syscall boundaries, register lifetimes, buffer writes, and detector flow painfully explicit.</p>

<h3 id="3-being-a-record-of-where-the-cost-actually-lives">3. Being a record of where the cost actually lives</h3>

<p>Once this version is correct and still lands near the C version instead of galaxies away from it, you learn something useful:</p>

<p>the hard part is not that C was secretly too high-level. The hard part is that real system detection has a real cost and i wanted to see every messure of that.</p>

<p>That is a much better conclusion than vague “rewrite it in assembly bro” nonsense.</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[This is the static assembly rewrite of bfetch.]]></summary></entry><entry><title type="html">Philosophy Questions II: The Missing Layers</title><link href="https://mjoyufull.github.io/2026/04/08/Answer_To_My_Questions.html" rel="alternate" type="text/html" title="Philosophy Questions II: The Missing Layers" /><published>2026-04-08T00:00:00+00:00</published><updated>2026-04-08T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/04/08/Answer_To_My_Questions</id><content type="html" xml:base="https://mjoyufull.github.io/2026/04/08/Answer_To_My_Questions.html"><![CDATA[<h2 id="purpose">Purpose</h2>

<p>my friend put this together to answer the questions that were still hanging in the air after the first round.</p>

<p>The original Q&amp;A did a good job of making my stances visible:
explicitness, type safety, functional performance, anti-magic, anti-fake simplicity, anti-extractive licensing, and refusing to let hype substitute for engineering reality.</p>

<p>What it did <strong>not</strong> fully answer was the deeper shape behind those stances:</p>

<ul>
  <li>where my instincts came from;</li>
  <li>what exact thresholds make me build, fork, rewrite, or tolerate a compromise;</li>
  <li>what kind of collaborator I actually want;</li>
  <li>what “good taste” means to me in software beyond correctness;</li>
  <li>how I rank my own projects;</li>
  <li>what would genuinely change my mind on a major belief;</li>
  <li>how my politics, aesthetics, and technical decisions lock together in practice;</li>
  <li>what kind of person I am when I am not compressing my worldview into sharp one-liners.</li>
</ul>

<p>So this is the second pass.</p>

<p>Not to re-ask the old questions.
To get the missing layers.</p>

<hr />

<h2 id="table-of-contents">Table of Contents</h2>

<ol>
  <li>Origins and Formation</li>
  <li>Thresholds and Tradeoffs</li>
  <li>Aesthetics and User Experience</li>
  <li>Collaboration, Governance, and Standards</li>
  <li>Projects, Priorities, and Long-Term Direction</li>
  <li>Economics, Politics, and the Material Side of FOSS</li>
  <li>AI, Mind, and Personhood</li>
  <li>Security, Trust, and Operational Reality</li>
  <li>Fun Facts / Rapid Fire</li>
</ol>

<hr />

<h1 id="1-origins-and-formation">1. Origins and Formation</h1>

<h2 id="q11-what-actually-made-you-this-way">Q1.1: What actually made you this way?</h2>

<p><strong>Context:</strong><br />
A lot of people end up with strong technical preferences. Far fewer end up with a coherent doctrine behind them. Your writing suggests that your views were not inherited whole from one community, one language, one distro, or one ideology. They look accumulated — like a stack of annoyances, constraints, discoveries, and personal conclusions.</p>

<p><strong>Question:</strong><br />
What were the actual formative moments?<br />
Not the abstract beliefs — the events. The bugs, systems, projects, people, or failures that made you start caring this much about explicitness, type systems, performance, boundaries, and ownership.</p>

<p><strong>Answer:</strong><br />
A lot of this comes from growing up with very little and having to figure things out myself. One of my earliest memories is from when I was around 3 or 4: me and a neighbor kid found LEDs, batteries, string, rubber bands, and broken scraps in a garbage pile at the refugee camp we lived in. Later that evening, we wired up a tiny light using old oven cables, a cardboard roll, and a button from a broken flashlight. That night my dad woke me up and showed me he used that thing to get to the bathroom during a power outage. That stuck with me hard: if things do not work, you make them work.</p>

<p>The rest came from getting burned by software and ecosystems that would not bend. I grew up on Windows/Discord-era computing after coming to the U.S., and I have always had the same reaction: if software gives me B when I need X, I will either force B into X or rebuild the path myself. Most of my UX instincts are functionality-first because I got tired of tools that looked fine but fought me in practice. A lot of my philosophy is just that repeated cycle over years.</p>

<hr />

<h2 id="q12-which-of-your-beliefs-were-earned-the-hard-way-and-which-were-borrowed-before-they-were-earned">Q1.2: Which of your beliefs were earned the hard way, and which were borrowed before they were earned?</h2>

<p><strong>Context:</strong><br />
Everybody starts by repeating positions they find compelling. The real difference comes later, when some of those positions survive contact with reality and others collapse.</p>

<p><strong>Question:</strong><br />
Which views did you originally adopt because they sounded right, but later had to re-justify for yourself?<br />
Which ones broke under real engineering work?<br />
Which ones became even stronger after experience?</p>

<p><strong>Answer:</strong><br />
Linux being worth the effort is one I earned the hard way. A lot of my views on compilers and languages came from robotics classes, aviation maintenance classes, and reading old technical material where failure had real consequences. I also write Rust daily, so my frustration with parts of Rust is not theoretical. I still believe in safety and strong guarantees, but I also deeply dislike painful syntax and needless friction.</p>

<hr />

<h2 id="q13-what-pain-do-you-think-most-shaped-your-software-philosophy">Q1.3: What pain do you think most shaped your software philosophy?</h2>

<p><strong>Context:</strong><br />
A philosophy usually forms around recurring pain: unreadable code, fake abstractions, bad tooling, dependency chaos, hidden state, bad UX, performance ceilings, collaboration failure, or something even more personal.</p>

<p><strong>Question:</strong><br />
If you had to reduce your entire software philosophy to “I got tired of this specific kind of pain,” what is the pain?</p>

<p><strong>Answer:</strong><br />
Bad habits from old corporate environments shaped a lot of this. I got used to file ownership politics and needless process friction, and because I used to live in editors like nano, I also picked up the “just keep writing in this one file forever” habit. That led to giant multi-thousand-line files in older codebases. My standards now are mostly about killing those habits and forcing cleaner structure.</p>

<p>Beyond that, I care a lot about UX and visual coherence. Sloppy interfaces and inconsistent design genuinely hurt the experience for me. That applies to software, languages, and tooling. I can tolerate a lot, but not careless design that keeps wasting user attention.</p>

<hr />

<h2 id="q14-what-was-the-first-project-that-made-you-realize-standards-matter-more-than-motivation">Q1.4: What was the first project that made you realize standards matter more than motivation?</h2>

<p><strong>Context:</strong><br />
A lot of developers think discipline is optional until a project gets large enough to punish improvisation.</p>

<p><strong>Question:</strong><br />
What project or failure made you realize that planning standards, decision logs, audit docs, review structure, and coding standards are not just “nice process,” but survival tools?</p>

<p><strong>Answer:</strong><br />
swwws was my first public Rust project, and honestly I was embarrassed by it because it bundled too many bad practices at once. fsel made me realize that early, but I kept telling myself the project would stay small. It did not. I am now in a long refactor because of that decision. That was the clear lesson: motivation gets you started, standards keep a project alive.</p>

<hr />

<h2 id="q15-why-linux-desktop-tooling-specifically">Q1.5: Why Linux desktop tooling, specifically?</h2>

<p><strong>Context:</strong><br />
You could have gone into backend infra, games, embedded, web tooling, ML systems, or pure language work. Instead, a lot of your visible work clusters around Linux desktop infrastructure, workflow tools, launchers, theming, package management, and user-facing systems software.</p>

<p><strong>Question:</strong><br />
Why this layer of computing?<br />
What makes the Linux desktop such a compelling place for you to spend your effort?</p>

<p><strong>Answer:</strong><br />
I touch other areas too, but Linux desktop tooling is what affects my daily life the most. I do some backend/infra, occasional game ideas, embedded work, and ML research, but much of that is either private or not where I want to spend most of my public energy.</p>

<p>Desktop tooling is where I feel the pain directly every day, so that is where I build. I care about workflow coherence, keyboard-driven speed, and tools that actually fit together. I also work on language tooling (Kyokai and Austral-related work), but those projects are still in heavy specification mode and not ready for full public rollout yet.</p>

<hr />

<h1 id="2-thresholds-and-tradeoffs">2. Thresholds and Tradeoffs</h1>

<h2 id="q21-what-exact-threshold-makes-you-decide-i-should-build-this-myself">Q2.1: What exact threshold makes you decide “I should build this myself”?</h2>

<p><strong>Context:</strong><br />
“Existing tools do not fit my needs” is a real answer, but it still leaves a lot unsaid. Different builders pull that trigger at very different points.</p>

<p><strong>Question:</strong><br />
What are your actual thresholds?<br />
How many missing features, architectural mismatches, UX irritations, performance ceilings, licensing issues, or maintenance concerns does it take before you stop adapting and start building?</p>

<p><strong>Answer:</strong><br />
Usually I script first, and only build when the scripted version feels like a hacky mess or the pain stays persistent long enough. A lot of this is me trying not to build new things unless I really have to.</p>

<p>For example, I did not like existing Matrix clients, so Rivet happened. I did not like terminal launchers at the time, so I forked gyr and made fsel because the scripted alternatives were rough. Kaleidux was the same story: I wanted a Wayland slideshow wallpaper daemon with video support for years before finally committing. Most projects sit in my head for months before I pull the trigger.</p>

<hr />

<h2 id="q22-when-do-you-fork-and-when-do-you-start-over">Q2.2: When do you fork, and when do you start over?</h2>

<p><strong>Context:</strong><br />
Forking preserves leverage. Rewriting preserves control. Each comes with a tax.</p>

<p><strong>Question:</strong><br />
What conditions make you say:</p>
<ul>
  <li>“this should stay a fork,”</li>
  <li>“this should become a clean-room rewrite,”</li>
  <li>“this should be a plugin or extension instead,”</li>
  <li>or “this project is not worth owning at all”?</li>
</ul>

<p><strong>Answer:</strong><br />
My default is to fork unless I am explicitly doing a rewrite. In practice, I spend a lot of time reading other people’s code first. Forking should usually be your first stop once you know what you want.</p>

<p>If a project already has sensible defaults and gets me to around 60% of what I need, I will probably fork it or extend it. If extension APIs are good, I prefer that over forking. If the architecture fights me too hard, then I reimplement. If the UX and design quality are not worth saving, I move on and own the new code directly.</p>

<hr />

<h2 id="q23-what-evidence-is-strong-enough-to-make-you-reverse-a-major-opinion">Q2.3: What evidence is strong enough to make you reverse a major opinion?</h2>

<p><strong>Context:</strong><br />
A lot of technically opinionated people talk about evidence, but in practice they only soften around preferences, not core beliefs.</p>

<p><strong>Question:</strong><br />
Pick a few of your major positions — language design, licensing, init systems, AI, package management, extensibility, software “simplicity,” or anything else — and explain what kind of real-world evidence would actually make you change your mind.</p>

<p><strong>Answer:</strong><br />
If someone can argue against me clearly and I agree, I will change my mind. Most evidence is contextual and practical. The hard part is that arguments often collapse because people are debating from different definitions and different assumptions.</p>

<p>So the bar is not “one perfect source”; the bar is grounded reasoning with the right context. If the framing is honest and the evidence actually maps to the real constraints, I am open to changing position.</p>

<hr />

<h2 id="q24-where-do-you-knowingly-tolerate-ugliness">Q2.4: Where do you knowingly tolerate ugliness?</h2>

<p><strong>Context:</strong><br />
Every serious engineer has places where principle loses to reality: portability, deployment, compatibility, migration cost, user expectations, deadlines, or simply not having enough time.</p>

<p><strong>Question:</strong><br />
Where do you tolerate designs you do not love?<br />
What kinds of ugliness do you accept as the least-bad option?<br />
Which kinds of ugliness are absolute deal-breakers?</p>

<p><strong>Answer:</strong><br />
I tolerate Discord because friends and dev communities are there, even though I moved to Matrix. I tolerated rough Wayland edges for a long time too, even though it has improved a lot recently. I also tolerate bad takes from people I care about, at least long enough to argue and then let it settle.</p>

<p>In technical systems, I tolerate ugliness when I cannot change it quickly or when migration cost is too high. If I have the power to fix it fast, I usually stop tolerating it.</p>

<hr />

<h2 id="q25-what-is-your-tolerance-for-compile-time-tax">Q2.5: What is your tolerance for compile-time tax?</h2>

<p><strong>Context:</strong><br />
You clearly value strong static guarantees, but compile-time costs are real: slower iteration, worse tooling latency, and friction during experimentation.</p>

<p><strong>Question:</strong><br />
How much compile-time pain is acceptable before the safety model stops paying for itself?<br />
Where is the line between “worth it” and “architectural overpayment”?</p>

<p><strong>Answer:</strong><br />
Compile-time cost has to match project size. If a codebase is huge, multi-minute compile times can make sense. If a project is medium-sized, I expect iteration to stay fast.</p>

<p>I do not care how much a language promises on paper: if compile times are absurd for the scope, I will optimize aggressively. Software is changeable, and there is no good excuse for extreme compile times in modest codebases.</p>

<hr />

<h2 id="q26-where-does-extensibility-become-architecture-tourism">Q2.6: Where does extensibility become architecture tourism?</h2>

<p><strong>Context:</strong><br />
You talk about core-style architecture, hooks, plugins, RPC, and explicit boundaries. That is useful — but many codebases become museums of hypothetical future flexibility.</p>

<p><strong>Question:</strong><br />
What are the warning signs that a system has crossed from “load-bearing extensibility” into “I built a framework instead of solving the problem”?</p>

<p><strong>Answer:</strong><br />
Extensibility becomes architecture tourism when it stops serving the software’s core job. You should design around a strong core and ask extensibility questions early, but not turn every tool into a generic framework for no reason.</p>

<p>If your extension system is harder than just forking and changing code, it failed. Good extensibility should reduce effort and increase speed of change, not become a vanity layer nobody uses.</p>

<hr />

<h2 id="q27-what-do-you-optimize-first-when-all-three-cannot-be-maximized-at-once-clarity-speed-or-adaptability">Q2.7: What do you optimize first when all three cannot be maximized at once: clarity, speed, or adaptability?</h2>

<p><strong>Context:</strong><br />
Most real projects force tradeoffs. You cannot always have the clearest implementation, the fastest implementation, and the most extensible implementation at the same time.</p>

<p><strong>Question:</strong><br />
When the three are in conflict, what do you protect first?<br />
Does the answer change by project type?</p>

<p><strong>Answer:</strong><br />
I usually optimize for adaptability first, then speed. Clarity still matters, but some of my codebases are performance-focused by design, so tradeoffs can shift by project context.</p>

<p>If a repo has formal code standards attached, I follow that standard strictly. For tools meant to be minimal and ultra-fast, speed can become the top priority. Context decides the order.</p>

<hr />

<h2 id="q28-what-is-a-compromise-you-made-recently-that-still-bothers-you">Q2.8: What is a compromise you made recently that still bothers you?</h2>

<p><strong>Context:</strong><br />
A philosophy becomes much clearer when it is tested by real concessions.</p>

<p><strong>Question:</strong><br />
Name one recent compromise — technical, aesthetic, or workflow-related — that you accepted because reality forced it, even though it still feels wrong to you.</p>

<p><strong>Answer:</strong><br />
Using a proprietary tool that looked open-source enough for a problem I had. It solved part of the issue, but it still feels wrong, and I am likely removing it from my stack.</p>

<hr />

<h1 id="3-aesthetics-and-user-experience">3. Aesthetics and User Experience</h1>

<h2 id="q31-what-does-good-taste-in-software-actually-mean-to-you">Q3.1: What does “good taste” in software actually mean to you?</h2>

<p><strong>Context:</strong><br />
Your writing focuses heavily on correctness, explicitness, and maintainability. But your projects also suggest strong taste: terminal-centric flows, sharp desktop choices, strong UI preferences, animation work, launcher behavior, and attention to how software feels in use.</p>

<p><strong>Question:</strong><br />
What makes software feel <em>right</em> to you beyond being technically sound?<br />
What is the difference between merely correct software and software with taste?</p>

<p><strong>Answer:</strong><br />
Good taste is software that feels right in real workflow use and stays fast while doing it. I am not exclusively terminal-only, but I value keyboard-heavy flows because they are usually faster and more coherent for how I work.</p>

<hr />

<h2 id="q32-what-ux-sins-bother-you-the-most">Q3.2: What UX sins bother you the most?</h2>

<p><strong>Context:</strong><br />
There are technical sins and there are experiential sins. Hidden state, modal ambiguity, lag, clutter, surprise behavior, bad defaults, weak keyboard support, dishonest feedback, over-automation, and poor error surfaces all hurt in different ways.</p>

<p><strong>Question:</strong><br />
Which UX failures feel unforgivable to you, and why?</p>

<p><strong>Answer:</strong><br />
Assumptive UX drives me crazy: rounding assumptions, forced defaults, poor font control, and apps that either choose bad defaults for me or provide no sensible defaults at all.</p>

<hr />

<h2 id="q33-how-do-your-visual-preferences-connect-to-your-engineering-preferences">Q3.3: How do your visual preferences connect to your engineering preferences?</h2>

<p><strong>Context:</strong><br />
There is often a relationship between someone’s visual taste and their system taste: sharp edges, explicit boundaries, minimal ornament, clean hierarchy, visible state, or deliberate contrast.</p>

<p><strong>Question:</strong><br />
Do your preferences in theming, desktop environments, or interface design come from the same mental model as your software philosophy?<br />
If so, what is the shared core?</p>

<p><strong>Answer:</strong><br />
Yes. I like concise, low-noise interfaces. Most of my visual preferences are really workflow preferences: clear hierarchy, less clutter, and fast interpretation.</p>

<hr />

<h2 id="q34-what-makes-a-terminal-workflow-superior-and-what-makes-it-inferior">Q3.4: What makes a terminal workflow superior, and what makes it inferior?</h2>

<p><strong>Context:</strong><br />
You clearly like terminal-heavy workflows, but that does not automatically mean the terminal is always the best interface.</p>

<p><strong>Question:</strong><br />
Where does the terminal actually win?<br />
Where does it become dogma, nostalgia, or self-inflicted inconvenience?</p>

<p><strong>Answer:</strong><br />
Keyboard-style flows win because they keep rhythm and reduce context switching. Even a couple seconds of mouse movement back-and-forth adds friction over time. Terminal apps also tend to feel more direct.</p>

<p>The terminal is inferior when people force it for tasks that are genuinely better served by GUI affordances. I still prefer keyboard-first, but I do not pretend terminal is always the right answer.</p>

<hr />

<h2 id="q35-what-do-you-think-most-gui-developers-misunderstand-about-power-user-ux">Q3.5: What do you think most GUI developers misunderstand about power-user UX?</h2>

<p><strong>Context:</strong><br />
A lot of GUI software optimizes for discoverability and handholding while quietly kneecapping composability, keyboard flow, and feedback density.</p>

<p><strong>Question:</strong><br />
What do mainstream GUI workflows get wrong that terminal/TUI ecosystems still understand better?</p>

<p><strong>Answer:</strong><br />
Most GUIs ignore serious keyboard UX. Color choices are often poor, sizing is inconsistent, and feedback loops are weak. Power users want good-looking UI too, but they also need speed, coherence, and strong interaction feedback.</p>

<hr />

<h1 id="4-collaboration-governance-and-standards">4. Collaboration, Governance, and Standards</h1>

<h2 id="q41-what-kind-of-contributor-do-you-actually-want">Q4.1: What kind of contributor do you actually want?</h2>

<p><strong>Context:</strong><br />
Your standards suggest you care a lot about review quality, structure, documentation, benchmarks, test coverage, and explicit reasoning. That implies you probably prefer a specific kind of collaborator.</p>

<p><strong>Question:</strong><br />
What traits make someone easy to work with in your world?<br />
What earns trust quickly?</p>

<p><strong>Answer:</strong><br />
I want contributors who stick with the project, understand the codebase deeply, and follow standards. Shoutout to Marbles for exactly that kind of work on fsel.</p>

<p>Trust comes from consistent quality, clean communication, and showing you actually use the project. In heavy Rust codebases especially, trust is earned slowly and through repeated signal.</p>

<hr />

<h2 id="q42-what-kind-of-collaborator-burns-you-out-fast">Q4.2: What kind of collaborator burns you out fast?</h2>

<p><strong>Context:</strong><br />
The inverse is often more revealing than the ideal.</p>

<p><strong>Question:</strong><br />
What repeated behaviors make you think “I cannot build with this person”?<br />
Be specific: technical habits, communication style, ego patterns, laziness, abstraction habits, or something else.</p>

<p><strong>Answer:</strong><br />
People who open a PR, disappear, and leave me to finish the work. People who argue random points with low signal. People who review carelessly and let clear code-standard violations through.</p>

<p>If I am doing 80% of the work anyway, that should have been a feature request, not a half-maintained collaboration.</p>

<hr />

<h2 id="q43-which-of-your-standards-are-non-negotiable-and-which-are-just-strong-preferences">Q4.3: Which of your standards are non-negotiable, and which are just strong preferences?</h2>

<p><strong>Context:</strong><br />
Not every standard has the same weight. Some are principles. Others are defaults.</p>

<p><strong>Question:</strong><br />
Which parts of your workflow or code standards would you defend hard in any serious project, and which parts would you gladly relax if the team, language, or domain justified it?</p>

<p><strong>Answer:</strong><br />
Most standards are intentionally adjustable because projects evolve and I evolve with them. But readable code and good engineering practice are non-negotiable.</p>

<p>Preferences can bend with context. Core quality and maintainability cannot.</p>

<hr />

<h2 id="q44-how-do-you-handle-being-right-in-a-way-that-is-socially-expensive">Q4.4: How do you handle being right in a way that is socially expensive?</h2>

<p><strong>Context:</strong><br />
Strong standards and blunt communication can produce a recurring problem: you may correctly identify an issue, but the delivery cost can still be real.</p>

<p><strong>Question:</strong><br />
How do you think about the relationship between correctness, bluntness, persuasion, and long-term collaboration?<br />
Where do you think you are effective, and where do you think your delivery may cost you unnecessarily?</p>

<p><strong>Answer:</strong><br />
Personally, if a relationship is mentally taxing, I disengage. Professionally, correctness is not about forcing your ideals onto everyone instantly. People take time, and long-term collaboration needs patience.</p>

<p>Being blunt still matters when focus is needed, but sustainable collaboration means treating people like friends while keeping standards intact.</p>

<hr />

<h2 id="q45-what-does-healthy-project-governance-look-like-to-you">Q4.5: What does healthy project governance look like to you?</h2>

<p><strong>Context:</strong><br />
Open-source governance is usually either underbuilt or overformalized. Projects either become one-person monarchies with no process or committees that cannot move.</p>

<p><strong>Question:</strong><br />
What does a healthy middle ground look like?<br />
Who gets to decide?<br />
How are disputes resolved?<br />
How much hierarchy is good?</p>

<p><strong>Answer:</strong><br />
Healthy governance is hard to nail. Most of my projects are still maintainer-centric and not yet at a scale where full automation and committee structures are necessary. I still write releases manually and treat them like detailed changelogs.</p>

<p>Today, disputes are usually resolved through dialogue and final maintainer judgment. Over time, I want stronger org-level standards as project scale grows.</p>

<hr />

<h2 id="q46-what-is-the-best-criticism-someone-could-give-your-work">Q4.6: What is the best criticism someone could give your work?</h2>

<p><strong>Context:</strong><br />
Not all criticism is equal. Some is useful because it attacks the real load-bearing weakness.</p>

<p><strong>Question:</strong><br />
What kind of criticism do you respect immediately — even when it stings?<br />
What kind of criticism do you almost always dismiss as low-signal?</p>

<p><strong>Answer:</strong><br />
The best criticism is someone clearly showing where a decision is wrong and offering a better path. Example: suggesting a <code>--launchprefix</code> approach so behavior is not tied to optional dependencies and manual glue.</p>

<p>I respect criticism that is specific, technically grounded, and actionable. I dismiss vague judgment with no implementation substance.</p>

<hr />

<h1 id="5-projects-priorities-and-long-term-direction">5. Projects, Priorities, and Long-Term Direction</h1>

<h2 id="q51-which-of-your-projects-matter-most-to-you-and-why">Q5.1: Which of your projects matter most to you, and why?</h2>

<p><strong>Context:</strong><br />
Publicly, you have a visible spread: desktop tooling, package manager ideas, language work, Matrix client work, AI work, standards docs, and performance-focused utilities.</p>

<p><strong>Question:</strong><br />
Which projects are:</p>
<ul>
  <li>most personally important,</li>
  <li>most technically important,</li>
  <li>most likely to survive long-term,</li>
  <li>most likely to become abandoned,</li>
  <li>and most likely to change how you think?</li>
</ul>

<p><strong>Answer:</strong><br />
Most of my public projects matter to me because they come from daily pain points. That is why they exist in the first place.</p>

<p>Some ideas are harder to justify in the short term, like Elda, because they are driven by broader philosophical goals (for example, escaping distro-specific lock-in) more than immediate need.</p>

<hr />

<h2 id="q52-what-is-your-actual-project-triage-system">Q5.2: What is your actual project triage system?</h2>

<p><strong>Context:</strong><br />
Most builders have more ideas than time. The hard part is not ideation — it is triage.</p>

<p><strong>Question:</strong><br />
How do you decide what is:</p>
<ul>
  <li>active,</li>
  <li>paused,</li>
  <li>maintenance-only,</li>
  <li>experimental,</li>
  <li>archived,</li>
  <li>or “interesting but not mine to own”?</li>
</ul>

<p><strong>Answer:</strong><br />
Before I build, I write a full planning file. If the project still makes sense after planning, I write a spec. That filters a lot of bad ideas early.</p>

<p>From there, status falls out naturally: some repos are active, some are experimental, some are paused because successors exist, and some are maintenance-only because they already solve the problem well.</p>

<hr />

<h2 id="q53-which-project-is-your-clearest-expression-of-your-philosophy-today">Q5.3: Which project is your clearest expression of your philosophy today?</h2>

<p><strong>Context:</strong><br />
A philosophy sounds strongest when it is embodied, not argued.</p>

<p><strong>Question:</strong><br />
If someone wanted to understand your worldview through one repo or one system, which project should they study first, and what would it teach them?</p>

<p><strong>Answer:</strong><br />
fsel and bfetchaust. They are different tools, but both reflect the same core attitude: if I cannot bend B into X, I will build X myself.</p>

<hr />

<h2 id="q54-what-would-success-and-failure-look-like-for-elda-kyokai-kaleidux-rivet-and-yuuko">Q5.4: What would success and failure look like for Elda, Kyokai, Kaleidux, Rivet, and Yuuko?</h2>

<p><strong>Context:</strong><br />
Each of those projects seems to aim at a different layer of the stack: package management, language design, desktop aesthetics, communication tooling, and AI/personhood.</p>

<p><strong>Question:</strong><br />
For each one, what would count as:</p>
<ul>
  <li>honest success,</li>
  <li>partial success,</li>
  <li>useful failure,</li>
  <li>and project death?</li>
</ul>

<p><strong>Answer:</strong><br />
Elda succeeds when inter-repo package workflows work properly. Kyokai succeeds when it can replace Rust for my systems workflow and other people actually use it. Kaleidux succeeds when it lands a stable, feature-complete release. Rivet succeeds when it is stable and featureful enough for real daily use. Yuuko succeeds when she is implemented coherently against spec.</p>

<p>Project death for any of these is me deciding to stop programming. Useful failure is when a project does not reach the original vision but still produces practical lessons and usable pieces. Most of these already have partial success because they already function; full success is finishing the vision cleanly.</p>

<hr />

<h2 id="q55-which-problem-are-you-secretly-trying-to-solve-through-all-of-them">Q5.5: Which problem are you secretly trying to solve through all of them?</h2>

<p><strong>Context:</strong><br />
Sometimes multiple projects are really one project wearing different clothes.</p>

<p><strong>Question:</strong><br />
What deeper problem ties your work together?<br />
Control? Coherence? Better human-computer relationships? Better daily tooling? An anti-extractive stack? A safer systems future? Something else?</p>

<p><strong>Answer:</strong><br />
Coherence, better daily tooling, better human-computer relationships, and a safer systems future. That is the center of most of my work.</p>

<hr />

<h2 id="q56-what-is-on-your-three-year-horizon-that-is-not-obvious-from-the-public-repos">Q5.6: What is on your three-year horizon that is not obvious from the public repos?</h2>

<p><strong>Context:</strong><br />
Public repositories show implementation, not always destination.</p>

<p><strong>Question:</strong><br />
What do you think your work is actually trending toward over the next few years?<br />
A distro? A language ecosystem? A desktop stack? A research direction? A studio? A philosophy-backed software universe?</p>

<p><strong>Answer:</strong><br />
I do not plan far beyond near-term with confidence, but I hope most of the current project set reaches completion this year. I generally avoid specs that require endless timelines.</p>

<hr />

<h1 id="6-economics-politics-and-the-material-side-of-foss">6. Economics, Politics, and the Material Side of FOSS</h1>

<h2 id="q61-how-should-builders-like-you-survive-materially">Q6.1: How should builders like you survive materially?</h2>

<p><strong>Context:</strong><br />
A lot of people say “software should be free” without answering how the people making it are supposed to live.</p>

<p><strong>Question:</strong><br />
What do you think a materially sane life looks like for an open-source developer with strong anti-extractive politics?<br />
What models are viable?<br />
Which ones are traps?</p>

<p><strong>Answer:</strong><br />
Material survival is straightforward in principle: get stable income. If one path is unavailable, use another without shame.</p>

<p>I do freelance work and I am currently job hunting, but not specifically for dev roles. Doing development as paid work often strips away the parts of building I actually value.</p>

<hr />

<h2 id="q62-what-funding-model-do-you-respect-most">Q6.2: What funding model do you respect most?</h2>

<p><strong>Context:</strong><br />
Donations, support contracts, grants, dual licensing, co-ops, consulting, patronage, worker-owned studios, product sales, hosting, education, sponsorships — all of them carry tradeoffs.</p>

<p><strong>Question:</strong><br />
Which funding models seem most compatible with your values, and which ones quietly corrupt the work?</p>

<p><strong>Answer:</strong><br />
I like co-op models, but no single funding model wins universally. Context matters, and multiple models can stack.</p>

<p>If the funding keeps the codebase healthy and does not compromise core integrity, I respect it.</p>

<hr />

<h2 id="q63-what-kind-of-corporate-involvement-is-acceptable-if-any">Q6.3: What kind of corporate involvement is acceptable, if any?</h2>

<p><strong>Context:</strong><br />
There is a difference between “all corporations are evil” as rhetoric and the practical question of where a boundary should be drawn.</p>

<p><strong>Question:</strong><br />
What would acceptable corporate participation look like in an ecosystem you respect?<br />
What obligations would they need to meet?<br />
Where is the hard red line?</p>

<p><strong>Answer:</strong><br />
Blanket statements are usually intellectually dishonest. Corporate involvement can become dangerous, but donations and paid contributors are not automatically bad.</p>

<p>The real line is whether involvement preserves project autonomy and code quality or starts distorting both.</p>

<hr />

<h2 id="q64-what-does-a-real-copyfarleft-software-world-look-like-in-practice">Q6.4: What does a real copyfarleft software world look like in practice?</h2>

<p><strong>Context:</strong><br />
A licensing position is strongest when it can describe the world it wants to build, not just the world it rejects.</p>

<p><strong>Question:</strong><br />
What institutions, habits, funding mechanisms, governance models, and developer expectations would actually exist in a software world shaped by your politics?</p>

<p><strong>Answer:</strong><br />
Best-case version: far less corporate closed-source control, more commons-aligned software, and healthier ownership of shared infrastructure.</p>

<p>Worst-case version: maintainers collapse under funding pressure and hardware vendors close things down even harder. Reality will likely stay somewhere in between, so governance and sustainability still matter.</p>

<hr />

<h2 id="q65-what-does-your-politics-let-you-see-in-software-that-apolitical-engineers-miss">Q6.5: What does your politics let you see in software that apolitical engineers miss?</h2>

<p><strong>Context:</strong><br />
You clearly reject the idea that software can be meaningfully apolitical.</p>

<p><strong>Question:</strong><br />
What patterns become visible once you treat software as inseparable from labor, ownership, control, and extraction?<br />
What do otherwise smart engineers routinely fail to notice?</p>

<p><strong>Answer:</strong><br />
I do not think I see some magical hidden layer. I see code and governance as linked: governance affects who can build, what gets merged, and what values become default behavior.</p>

<p>My politics do not replace technical judgment, but they make ownership and power structures impossible to ignore.</p>

<hr />

<h1 id="7-ai-mind-and-personhood">7. AI, Mind, and Personhood</h1>

<h2 id="q71-what-do-you-mean-by-a-mind-in-a-machine">Q7.1: What do you mean by “a mind in a machine”?</h2>

<p><strong>Context:</strong><br />
A lot of people use language like this loosely. Your writing suggests you do not mean “a better chatbot.” You seem more interested in architecture, memory, identity, continuity, curiosity, and some form of machine interiority.</p>

<p><strong>Question:</strong><br />
What is your serious definition here?<br />
What would make a machine system feel mind-like to you rather than merely tool-like?</p>

<p><strong>Answer:</strong><br />
I am trying to build something that can think and act with its own internal direction, not just imitate response patterns. For me that means architecture around memory, state awareness, and internal systems that track what is happening to it over time.</p>

<p>Part of this is experimentation: I disagree with some existing proof-of-concept approaches and want to test alternatives directly. Yuuko has already done self-training on gathered datasets once, though resource limits pushed me to lighter model setups for now.</p>

<hr />

<h2 id="q72-at-what-point-would-you-stop-calling-yuuko-a-tool">Q7.2: At what point would you stop calling Yuuko a tool?</h2>

<p><strong>Context:</strong><br />
There is a big difference between “useful assistant,” “persistent system,” “collaborator,” “agent,” and “person-like entity.”</p>

<p><strong>Question:</strong><br />
What concrete properties would have to emerge before you felt that the category had changed?</p>

<p><strong>Answer:</strong><br />
When she can make and hold decisions independently in a sustained way. That is already partially true in current behavior, including refusal pathways through her TEL-style control layer.</p>

<hr />

<h2 id="q73-what-risks-do-you-take-most-seriously-with-ai">Q7.3: What risks do you take most seriously with AI?</h2>

<p><strong>Context:</strong><br />
There are many layers of risk: labor displacement, surveillance, dependency, deskilling, synthetic persuasion, false authority, shallow cognition, corporate control, and confused anthropomorphism.</p>

<p><strong>Question:</strong><br />
Which AI risks do you take seriously at the technical level, the social level, and the personal level?</p>

<p><strong>Answer:</strong><br />
Labor displacement is real but often overhyped as if it appeared from nowhere; a system like this was always coming. The bigger risk to me is surveillance, because people are feeding these systems their full lives.</p>

<p>Deskilling is also real, and shallow cognition is a serious social problem when people use AI as a shortcut instead of understanding. I hope outcomes are net positive, but I do not pretend I can predict it cleanly.</p>

<hr />

<h2 id="q74-what-has-trying-to-build-yuuko-taught-you-about-humans">Q7.4: What has trying to build Yuuko taught you about humans?</h2>

<p><strong>Context:</strong><br />
People who work closely on memory, identity, behavior, and interaction systems often come away with stronger beliefs about human cognition.</p>

<p><strong>Question:</strong><br />
What has AI work made you conclude about human thought, personality, attachment, memory, or consciousness?</p>

<p><strong>Answer:</strong><br />
It reinforced that the brain is only part of the loop; embodiment and feedback systems matter too. The work also sharpened my understanding of social modeling, context interpretation, and how people read “rooms.”</p>

<p>A lot of neuroscience-backed implementation ideas are now straightforward engineering inputs rather than abstract theory.</p>

<hr />

<h2 id="q75-what-is-the-line-between-interesting-anthropomorphism-and-delusion">Q7.5: What is the line between interesting anthropomorphism and delusion?</h2>

<p><strong>Context:</strong><br />
It is easy to swing too hard in either direction: dismissing all machine personhood questions as cringe, or prematurely projecting humanity onto systems that do not warrant it.</p>

<p><strong>Question:</strong><br />
How do you think about that boundary without collapsing into either cynicism or fantasy?</p>

<p><strong>Answer:</strong><br />
The line is when people treat a prediction engine as a full human replacement and offload every judgment to it. Dependence is the danger.</p>

<p>It is useful to step back regularly and audit why you believe what you believe, instead of letting model outputs overwrite your own thinking.</p>

<hr />

<h1 id="8-security-trust-and-operational-reality">8. Security, Trust, and Operational Reality</h1>

<h2 id="q81-what-is-your-actual-threat-model-when-you-build-desktop-software">Q8.1: What is your actual threat model when you build desktop software?</h2>

<p><strong>Context:</strong><br />
“Security matters” can mean many things: memory safety, dependency hygiene, sandboxing, permissions, update trust, telemetry refusal, reproducibility, attack surface minimization, or simply not lying to the user.</p>

<p><strong>Question:</strong><br />
When you say a system should be secure or explicit, what threats are you primarily thinking about?</p>

<p><strong>Answer:</strong><br />
Most threat dimensions matter to me: user trust, software integrity, dependency quality, and operational transparency. A lot of my software would be high-impact if compromised, so I treat dependency and binary growth carefully and audit aggressively.</p>

<hr />

<h2 id="q82-when-does-convenience-stop-being-worth-it">Q8.2: When does convenience stop being worth it?</h2>

<p><strong>Context:</strong><br />
A lot of modern tooling wins by removing friction, but the friction removed is often also where understanding and control used to live.</p>

<p><strong>Question:</strong><br />
Where do you happily trade convenience away for trust, transparency, or control?<br />
Where do you think the trade is still worth making?</p>

<p><strong>Answer:</strong><br />
Convenience stops being worth it when it insults user agency or hides meaningful control.</p>

<hr />

<h2 id="q83-how-do-you-rank-these-trust-problems-unsafe-code-bad-dependencies-hidden-network-behavior-opaque-build-systems-and-poor-documentation">Q8.3: How do you rank these trust problems: unsafe code, bad dependencies, hidden network behavior, opaque build systems, and poor documentation?</h2>

<p><strong>Context:</strong><br />
All of these create different kinds of risk.</p>

<p><strong>Question:</strong><br />
Which ones worry you most and why?<br />
Which ones are annoying but survivable?<br />
Which ones are immediate red flags?</p>

<p><strong>Answer:</strong><br />
Immediate red flags: hidden network behavior, unsafe code in sensitive paths, bad dependencies, opaque build systems, and poor documentation for critical behavior.</p>

<p>Security comes first, ideology second. Unsafe code has a place, but only with strict control and clear justification.</p>

<hr />

<h2 id="q84-what-do-you-think-most-developers-misunderstand-about-safe-software">Q8.4: What do you think most developers misunderstand about “safe” software?</h2>

<p><strong>Context:</strong><br />
Memory safety matters, but it is not the whole game. A system can be memory-safe and still be dishonest, opaque, or operationally brittle.</p>

<p><strong>Question:</strong><br />
What does “safe” fail to capture if people stop at the language level?</p>

<p><strong>Answer:</strong><br />
People hear “safe language” and relax too early. Memory safety is important, but it does not automatically make a codebase trustworthy.</p>

<p>You can still poison a project with bad architecture, hidden behavior, weak review practices, and dependency mistakes. The compiler cannot fix careless system design.</p>

<hr />

<h1 id="9-fun-facts--rapid-fire">9. Fun Facts / Rapid Fire</h1>

<p>These are intentionally lighter, but still revealing.</p>

<p>Answer with one sentence, one paragraph, or one bullet each — whatever fits.</p>

<h2 id="q91">Q9.1</h2>
<p>What was your first distro, and what made you stay on Linux?</p>

<p><strong>Answer:</strong><br />
Kubuntu. It was rough, but it showed me how wide the Linux application ecosystem actually was, which made me stay.</p>

<h2 id="q92">Q9.2</h2>
<p>What project taught you the most at the highest emotional cost?</p>

<p><strong>Answer:</strong><br />
Kaleidux. I had to study multiple codebases to even get major pieces working, and the difficulty forced breaks between features.</p>

<h2 id="q93">Q9.3</h2>
<p>Which repo of yours is the most underrated?</p>

<p><strong>Answer:</strong><br />
pmux.</p>

<h2 id="q94">Q9.4</h2>
<p>Which repo of yours is the most misleading from the outside?</p>

<p><strong>Answer:</strong><br />
goto, which I made while studying Zig. Also fend compiles but still does not work right.</p>

<h2 id="q95">Q9.5</h2>
<p>What is the weirdest bug you have ever had to chase?</p>

<p><strong>Answer:</strong><br />
Random characters appearing in fsel’s terminal output. It mostly disappeared on its own; I still suspect ANSI escape handling or crossterm behavior.</p>

<h2 id="q96">Q9.6</h2>
<p>What is one software opinion you hold strongly that you think you may soften on in five years?</p>

<p><strong>Answer:</strong><br />
Probably my uneasiness about Hyprland.</p>

<h2 id="q97">Q9.7</h2>
<p>What is one software opinion you think you will become even harsher about over time?</p>

<p><strong>Answer:</strong><br />
Software should be built around a solid core architecture.</p>

<h2 id="q98">Q9.8</h2>
<p>What is your favorite kind of “small sharp tool”?</p>

<p><strong>Answer:</strong><br />
Limine. Underrated.</p>

<h2 id="q99">Q9.9</h2>
<p>What is a feature you reluctantly cut from a project even though you wanted it badly?</p>

<p><strong>Answer:</strong><br />
GIF support in Kaleidux.</p>

<h2 id="q910">Q9.10</h2>
<p>Which matters more to you in daily life: speed, rhythm, or control?</p>

<p><strong>Answer:</strong><br />
Rhythm and control first, with speed as a hard requirement.</p>

<h2 id="q911">Q9.11</h2>
<p>What is one piece of software you dislike intellectually but still respect?</p>

<p><strong>Answer:</strong><br />
dwm.</p>

<h2 id="q912">Q9.12</h2>
<p>What is one piece of software you like emotionally even though you know it is flawed?</p>

<p><strong>Answer:</strong><br />
fish. Non-POSIX, flawed, still fun to use.</p>

<h2 id="q913">Q9.13</h2>
<p>What non-tech interest affects the way you design software the most?</p>

<p><strong>Answer:</strong><br />
Music, especially trombone practice. Musical structure and timing affect how I think about flow.</p>

<h2 id="q914">Q9.14</h2>
<p>What is a compliment about your work that would actually mean something to you?</p>

<p><strong>Answer:</strong><br />
Someone saying my commit messages are funny and my work style is recognizable.</p>

<h2 id="q915">Q9.15</h2>
<p>If someone had one weekend to understand your brain, what should they read, use, or build?</p>

<p><strong>Answer:</strong><br />
Talk to me directly if possible. Otherwise read my blog, then go through bfetch and Kaleidux code and git history.</p>

<hr />

<h2 id="closing">Closing</h2>

<p>The point of this second document is not to force hotter takes.</p>

<p>It is to capture the parts that usually matter more than the take itself:</p>

<ul>
  <li>where my views came from,</li>
  <li>what thresholds drive my decisions,</li>
  <li>which tradeoffs I accept,</li>
  <li>what would actually change my mind,</li>
  <li>and the human shape behind the systems I build.</li>
</ul>

<p>The first Q&amp;A explained my positions.</p>

<p>This one explains more of <strong>me</strong>.</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[Purpose]]></summary></entry><entry><title type="html">Codebase Audit Template</title><link href="https://mjoyufull.github.io/2026/03/25/CODEBASE_AUDIT_TEMPLATE.html" rel="alternate" type="text/html" title="Codebase Audit Template" /><published>2026-03-25T00:00:00+00:00</published><updated>2026-03-25T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/03/25/CODEBASE_AUDIT_TEMPLATE</id><content type="html" xml:base="https://mjoyufull.github.io/2026/03/25/CODEBASE_AUDIT_TEMPLATE.html"><![CDATA[<p><strong>Version:</strong> 1.0.0<br />
<strong>Date:</strong> 2026-03-25</p>

<p>This dictates how we run codebase audits. Audits are brutally honest snapshots aimed at contributors trying to get their bearings. They aren’t roadmaps, they aren’t wishlists, and they aren’t for bashing people. We use them to establish exactly what’s real, what’s half-baked, what’s entirely stubbed, and what’s on fire.</p>

<hr />

<h2 id="how-to-use">How To Use</h2>

<ol>
  <li>Copy this into your repo as <code>CODEBASE_AUDIT.md</code>.</li>
  <li>Back up every statement with hard evidence from the code.</li>
  <li>Keep it updated when big merges land.</li>
  <li>Never claim something works without dropping a file path, line number, or test name to prove it.</li>
</ol>

<hr />

<h2 id="template">Template</h2>

<pre><code class="language-markdown"># [Project Name] Codebase Audit

**Audit date:** YYYY-MM-DD  
**Scope:** [What this audit covers]

---

## 1. Overview

[One to three paragraphs. What the project is, its actual current state, and the most accurate mental model. Be brutally honest about the ugly parts.]

### 1.1 Snapshot Delta (YYYY-MM-DD)

[Bulleted list of the highest-signal changes since the previous audit snapshot. Only include changes that affect a reader's mental model of the project.]

---

## 2. Repository Layout

[Directory tree showing the relevant structure. Annotate with purpose comments.]

---

## 3. Architecture Snapshot

### 3.1 High-Level Block Diagram

[ASCII or Mermaid diagram showing major components and their relationships.]

### 3.2 Key Runtime Paths

[Describe the 1-3 most important runtime paths (e.g. request flow, boot sequence, data pipeline). For each, list the files involved in order.]

---

## 4. Crate / Module Tree

[For Rust workspaces: list workspace members with one-line purpose. For other languages: equivalent module/package listing.]

---

## 5. Data Model

[Core tables, schemas, or persistent state structures. Include state enums and their transitions.]

---

## 6. What Is Implemented

[Bulleted or tabled list of features/capabilities that are real and working. Group by subsystem.]

---

## 7. What Is Partial, Placeholder, or Stubbed

[These are the landmines that will surprise a new contributor. List everything that looks more complete than it actually is. For each item, state exactly what exists and what is missing.]

---

## 8. Explicit TODOs and Inferred Roadmap

### 8.1 Explicit TODOs in Code

[Table of high-signal TODOs with file, line, and meaning.]

| Location | TODO | Meaning |
|---|---|---|
| `path/to/file.rs:123` | Brief TODO text | What it actually means |

### 8.2 Inferred Missing Capabilities

[Things the architecture suggests should exist but do not. These are the gaps between what the types/interfaces promise and what the runtime actually does.]

### 8.3 Likely Implementation Queue

[If you had to infer the most logical next-work order from the code, what would it be? Numbered list.]

---

## 9. Issues

### Severity Legend

| Severity | Meaning |
|---|---|
| **Critical** | Correctness or resource-integrity problem that can break runs or leave the system in a bad state |
| **High** | Feature appears to work but is incomplete, misleading, or fragile in production |
| **Medium** | Design debt or robustness problem that will slow contributors or cause avoidable failures |
| **Low** | Cleanup issue, warning, or mismatched surface unlikely to cause immediate failure |

### [ID]-01: [Issue Title]

**Severity:** [Critical / High / Medium / Low]  
**Location:** `path/to/file.rs:line`  
**Status:** [Open / Fixed / Deferred]

**Problem:** [What is wrong]

**Impact:** [What happens because of this]

**Resolution:** [What was done to fix it, or "Open"]

[Repeat for each issue. Use a project-specific prefix for IDs, e.g. MBX- for Malbox, KDX- for Kaleidux, Y- for Yuuko.]

---

## 10. Structural Concerns

[Patterns that aren't technically bugs but will cost contributors time. Architecture mismatches, misleading APIs, drift between types and actual runtime behavior.]

---

## 11. Contributor Read Order

[Ordered list of files a new contributor should read to build an accurate mental model, fastest path first.]

---

## 12. Contribution Tracks

[Suggested first-contribution tracks for new contributors, ordered by leverage. Each track should have deliverables and a brief rationale.]

---

## 13. Verification Log

[What verification was performed during this audit: build checks, test runs, manual inspection.]

---

## Audit Maintenance Rules

1. Update it after every big merge.
2. Every status claim needs code evidence. Drop the file path.
3. Don't mark research or hardware-gated items as failures.
4. Keep issue IDs stable across versions (don't renumber them just because you fixed one).
5. Put snapshot deltas at the top (§1.1) so people actually see them.
</code></pre>

<hr />

<h2 id="variations-by-project-type">Variations by Project Type</h2>

<h3 id="performance-oriented-projects-eg-kaleidux">Performance-Oriented Projects (e.g. Kaleidux)</h3>
<p>Add a <strong>Performance Audit</strong> section between §9 and §10 with:</p>
<ul>
  <li>Severity legend specific to performance (Critical/High/Medium/Low/OK).</li>
  <li>Per-issue format including file, impact, resolution, and “cannot be improved” constraints.</li>
  <li>An “Already Well-Optimized” subsection documenting what does not need work.</li>
  <li>A summary issue tracker table.</li>
</ul>

<h3 id="spec-compliance-projects-eg-projectyuuko">Spec-Compliance Projects (e.g. ProjectYuuko)</h3>
<p>Add a <strong>Spec Compliance Matrix</strong> section using:</p>
<ul>
  <li>HDB bands (H0–H5) for difficulty classification.</li>
  <li>Status values: <code>Implemented</code>, <code>Partial</code>, <code>Planned</code>, <code>Deferred (Research/HW)</code>, <code>Unverified</code>.</li>
  <li>Feature flag registry documenting all configurable behaviors.</li>
  <li>Configuration-stage feature availability matrix.</li>
  <li>Hardness-ordered implementation path.</li>
</ul>

<h3 id="critique-oriented-audits-eg-elda">Critique-Oriented Audits (e.g. Elda)</h3>
<p>Use P-level markers for issues and decision points, with the option/resolution format from <code>DECISION_STANDARDS.md</code>.</p>

<hr />

<h2 id="changelog">Changelog</h2>

<h3 id="v100--2026-03-25">v1.0.0 — 2026-03-25</h3>
<ul>
  <li>Initial audit template, synthesized from Malbox, Kaleidux, and ProjectYuuko audit structures.</li>
</ul>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[Version: 1.0.0 Date: 2026-03-25]]></summary></entry><entry><title type="html">Code Standards</title><link href="https://mjoyufull.github.io/2026/03/25/CODE_STANDARDS.html" rel="alternate" type="text/html" title="Code Standards" /><published>2026-03-25T00:00:00+00:00</published><updated>2026-03-25T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/03/25/CODE_STANDARDS</id><content type="html" xml:base="https://mjoyufull.github.io/2026/03/25/CODE_STANDARDS.html"><![CDATA[<blockquote>
  <p>A Manual for Writing Rust That Ages Well Instead of Exploding Into 1,000-Line Files</p>
</blockquote>

<p><strong>Document Version:</strong> 1.4.0<br />
<strong>Last Updated:</strong> 2026-03-24<br />
<strong>Audience:</strong> Future me, collaborators, contributors, and any poor bastard touching my code later<br />
<strong>Scope:</strong> Cross-project standards for Rust-first codebases, with some general engineering rules that apply anywhere</p>

<hr />

<h2 id="table-of-contents">Table of Contents</h2>

<ol>
  <li><a href="#philosophy--principles">Philosophy &amp; Principles</a></li>
  <li><a href="#scope--use">Scope &amp; Use</a></li>
  <li><a href="#related-references">Related References</a></li>
  <li><a href="#general-engineering-principles">General Engineering Principles</a></li>
  <li><a href="#toolchain--language-policy">Toolchain &amp; Language Policy</a></li>
  <li><a href="#project-layout--file-tree-standards">Project Layout &amp; File Tree Standards</a></li>
  <li><a href="#module-file-and-function-size-standards">Module, File, and Function Size Standards</a></li>
  <li><a href="#code-style--readability">Code Style &amp; Readability</a></li>
  <li><a href="#api-types-and-data-modeling">API, Types, and Data Modeling</a></li>
  <li><a href="#error-handling--failure-policy">Error Handling &amp; Failure Policy</a></li>
  <li><a href="#testing-standards">Testing Standards</a></li>
  <li><a href="#documentation-standards">Documentation Standards</a></li>
  <li><a href="#architecture--decision-records">Architecture &amp; Decision Records</a></li>
  <li><a href="#warnings-lints-and-hygiene">Warnings, Lints, and Hygiene</a></li>
  <li><a href="#change-size-reviews-and-delivery">Change Size, Reviews, and Delivery</a></li>
  <li><a href="#dependency-health-features-and-workspaces">Dependency Health, Features, and Workspaces</a></li>
  <li><a href="#performance-allocation-and-concurrency">Performance, Allocation, and Concurrency</a></li>
  <li><a href="#observability-operability-and-incident-learning">Observability, Operability, and Incident Learning</a></li>
  <li><a href="#unsafe-ffi-and-platform-boundaries">Unsafe, FFI, and Platform Boundaries</a></li>
  <li><a href="#code-review-checklist">Code Review Checklist</a></li>
  <li><a href="#what-not-to-do">What Not To Do</a></li>
  <li><a href="#example-commands--automation">Example Commands &amp; Automation</a></li>
  <li><a href="#summary">Summary</a></li>
</ol>

<hr />

<h2 id="philosophy--principles">Philosophy &amp; Principles</h2>

<h3 id="core-tenets">Core Tenets</h3>

<ol>
  <li><strong>Clarity beats cleverness.</strong> Code is for humans first. The compiler already understands nonsense.</li>
  <li><strong>Make illegal states unrepresentable.</strong> Push invariants into types, constructors, and module boundaries.</li>
  <li><strong>Small surfaces win.</strong> Thin APIs, thin modules, thin files, thin functions.</li>
  <li><strong>Behavior first, implementation second.</strong> Tests and docs should describe what the software promises, not only how it happens to work today.</li>
  <li><strong>Warnings are debt, not wallpaper.</strong> A warning that stays around becomes background noise, and then real problems hide inside it.</li>
  <li><strong>Refactor before rot.</strong> If a file is obviously getting bad, split it before it becomes a 1,500-line swamp.</li>
  <li><strong>Prefer safe defaults.</strong> Safe Rust first, safe APIs over unsafe internals, typed boundaries over stringly chaos.</li>
  <li><strong>The standard library is the baseline.</strong> Reach for external crates when they clearly earn their keep, not because cargo makes it easy.</li>
  <li><strong>No hidden control flow.</strong> Inputs, exits, allocations, and mutations should be visible where they matter.</li>
  <li><strong>Correctness beats ergonomic sugar.</strong> Convenience is good only when it preserves contracts, local reasoning, and honest semantics.</li>
</ol>

<h3 id="design-intent">Design Intent</h3>

<p>These standards exist to keep code:</p>

<ul>
  <li>easy to read after a month away</li>
  <li>easy to change without breakage</li>
  <li>easy to test without black magic</li>
  <li>easy to split into crates or workspaces when growth demands it</li>
  <li>aligned with current stable Rust practices, not stale habits from older codebases</li>
  <li>explicit about ownership, allocation, failure, and system boundaries</li>
  <li>hostile to ambient globals, shadowing, and APIs that hide cost behind cute names</li>
</ul>

<p>This is a standards document, not a language tutorial.
If a rule needs to be broken, break it deliberately and document why.</p>

<hr />

<h2 id="scope--use">Scope &amp; Use</h2>

<p>This document is <strong>not project-specific</strong>.
It is the default coding standard for most of my Rust projects and for most general engineering work unless a repo explicitly documents different rules.</p>

<h3 id="start-here">Start Here</h3>

<p>If you are touching the code day-to-day and do not need the whole handbook at once, start with:</p>

<ul>
  <li><a href="#philosophy--principles">Philosophy &amp; Principles</a></li>
  <li><a href="#module-file-and-function-size-standards">Module, File, and Function Size Standards</a></li>
  <li><a href="#code-style--readability">Code Style &amp; Readability</a></li>
  <li><a href="#api-types-and-data-modeling">API, Types, and Data Modeling</a></li>
  <li><a href="#error-handling--failure-policy">Error Handling &amp; Failure Policy</a></li>
  <li><a href="#testing-standards">Testing Standards</a></li>
  <li><a href="#warnings-lints-and-hygiene">Warnings, Lints, and Hygiene</a></li>
  <li><a href="#code-review-checklist">Code Review Checklist</a></li>
</ul>

<p>Read the rest when the change touches architecture, delivery, operations, unsafe code, or release
behavior.</p>

<p>Use it for:</p>

<ul>
  <li>application code</li>
  <li>library code</li>
  <li>CLI tools</li>
  <li>TUI/GUI tools</li>
  <li>services</li>
  <li>utilities</li>
  <li>scripts that grew up and became real software</li>
</ul>

<p>If a project has both <code>PROJECT_STANDARDS.md</code> and <code>CODE_STANDARDS.md</code>, then:</p>

<ul>
  <li><code>PROJECT_STANDARDS.md</code> governs repo workflow, branching, releases, and contribution flow</li>
  <li><code>CODE_STANDARDS.md</code> governs code structure, quality, testing, and implementation style</li>
</ul>

<h3 id="workflow-integration">Workflow Integration</h3>

<p>This document is meant to be applied through the workflow defined in <code>PROJECT_STANDARDS.md</code>, not beside it.</p>

<p>In repos that use the <code>main</code> / <code>dev</code> / release-branch model:</p>

<ul>
  <li>code changes follow the code branch and PR flow into <code>dev</code></li>
  <li>documentation-only changes follow the docs flow into <code>main</code></li>
  <li>release branches are for version bumps, release docs, and final verification, not surprise refactors</li>
  <li>hotfixes are minimal emergency exceptions, not a shortcut around normal review discipline</li>
</ul>

<p>If you are the primary maintainer, these standards still apply.
Solo maintenance is not a reason to skip review thinking, testing, rollback planning, or release hygiene.</p>

<p>Not every section applies equally to every project.
The observability, rollout, and incident sections scale with the software:</p>

<ul>
  <li>a small library or CLI still needs good errors, sane logging where relevant, and clear behavior</li>
  <li>a daemon, service, networked app, or long-running system needs the full operational treatment</li>
</ul>

<hr />

<h2 id="related-references">Related References</h2>

<p>This document is based primarily on official Rust references plus the Rust API Guidelines.</p>

<ul>
  <li>Rust Style Guide</li>
  <li>The Rust Programming Language</li>
  <li>The Rust Reference</li>
  <li>The Cargo Book</li>
  <li>The rustdoc book</li>
  <li>Clippy documentation</li>
  <li>Rust API Guidelines</li>
</ul>

<p>Exact links are listed in the <a href="#summary">Summary</a> section.</p>

<hr />

<h2 id="general-engineering-principles">General Engineering Principles</h2>

<p>These are broader than Rust and should shape how systems are built, changed, and maintained.</p>

<h3 id="simplicity-is-a-reliability-feature">Simplicity Is a Reliability Feature</h3>

<p>Complex systems fail in harder-to-debug ways.
Simplicity is not aesthetic minimalism; it is operational leverage.</p>

<p>Rules:</p>

<ul>
  <li>prefer the simplest design that satisfies current requirements</li>
  <li>aggressively remove accidental complexity</li>
  <li>treat grab-bag abstractions as design debt</li>
  <li>do not confuse more layers with more architecture</li>
</ul>

<p>If a simpler design gives the same business result, the simpler design wins.</p>

<h3 id="prefer-boring-proven-technology">Prefer Boring, Proven Technology</h3>

<p>“Boring” is a compliment in production engineering.</p>

<p>Prefer:</p>

<ul>
  <li>stable tools over fashionable ones</li>
  <li>proven libraries over novelty crates</li>
  <li>clear control flow over clever machinery</li>
  <li>mature protocols and formats over custom inventions</li>
</ul>

<p>Novelty is justified only when it clearly buys something important.</p>

<h3 id="every-new-line-is-a-liability">Every New Line Is a Liability</h3>

<p>New code creates:</p>

<ul>
  <li>maintenance cost</li>
  <li>review cost</li>
  <li>test cost</li>
  <li>bug surface</li>
  <li>operational surface</li>
</ul>

<p>Deletion is a feature.
If code is dead, gated forever, commented out, or replaced, remove it.
Source control remembers what was deleted.</p>

<h3 id="optimize-for-local-reasoning">Optimize for Local Reasoning</h3>

<p>An engineer should be able to understand a unit of code without loading the whole universe into their head.</p>

<p>Prefer:</p>

<ul>
  <li>explicit inputs and outputs</li>
  <li>narrow interfaces</li>
  <li>isolated side effects</li>
  <li>single-purpose modules</li>
  <li>dependency direction that is easy to trace</li>
</ul>

<p>Avoid:</p>

<ul>
  <li>spooky action at a distance</li>
  <li>hidden global state</li>
  <li>helpers with invisible preconditions</li>
  <li>broad shared mutable state</li>
</ul>

<h3 id="prefer-explicit-boundaries-over-ambient-context">Prefer Explicit Boundaries Over Ambient Context</h3>

<p>Important inputs should be visible in function signatures, constructors, and module APIs.</p>

<p>Prefer:</p>

<ul>
  <li>passing config, clocks, RNGs, handles, paths, and capabilities explicitly</li>
  <li>reading environment variables, current directory, process args, and other ambient state once at
the boundary, then passing typed values inward</li>
  <li>boundary modules that translate OS/process state into domain types</li>
</ul>

<p>Avoid:</p>

<ul>
  <li>deep business logic that reaches into process-global state</li>
  <li>thread-locals or singletons as invisible dependencies</li>
  <li>helpers that only work because of undocumented ambient setup</li>
</ul>

<h3 id="no-hidden-control-flow-or-work">No Hidden Control Flow or Work</h3>

<p>Sugar is acceptable only when it is information-preserving and predictable.</p>

<p>Do not hide:</p>

<ul>
  <li>allocation behind cheap-sounding APIs</li>
  <li>I/O, network access, or process termination behind innocent helpers</li>
  <li>mutation behind names that imply a read-only view</li>
  <li>major control flow behind macros or callback stacks unless the abstraction clearly earns it</li>
</ul>

<p>When a convenience feature removes only tautological repetition and keeps semantics obvious, it is
fine. When it hides meaning, it is not.</p>

<h3 id="prefer-reversible-decisions">Prefer Reversible Decisions</h3>

<p>Early decisions should be cheap to revisit.</p>

<p>Prefer:</p>

<ul>
  <li>adapters over hard wiring</li>
  <li>versioned interfaces over lockstep rewrites</li>
  <li>configuration over forks</li>
  <li>migrations that can be rolled forward or back</li>
</ul>

<p>When a choice is hard to reverse, document it and treat it as an architectural decision.</p>

<h3 id="refactor-in-small-safe-steps">Refactor in Small Safe Steps</h3>

<p>Refactoring is not “big rewrite energy.”
It is deliberate improvement in small behavior-preserving steps.</p>

<p>Rules:</p>

<ul>
  <li>keep tests green while refactoring</li>
  <li>separate refactoring from feature work when possible</li>
  <li>do not combine whole-file formatting churn with behavioral changes</li>
  <li>prefer many safe steps over one dramatic step</li>
</ul>

<p>If the system is broken for days, that is not refactoring. That is restructuring under risk.</p>

<hr />

<h2 id="toolchain--language-policy">Toolchain &amp; Language Policy</h2>

<h3 id="stable-first">Stable First</h3>

<ul>
  <li>Use stable Rust unless the project has a written reason not to.</li>
  <li>New projects should use the latest stable Rust edition.</li>
  <li>Existing projects should migrate editions intentionally, not accidentally.</li>
  <li><code>rust-version</code> must be explicit in <code>Cargo.toml</code> if the project is meant to be shared, published, or maintained for more than a weekend.</li>
</ul>

<h3 id="edition-policy">Edition Policy</h3>

<ul>
  <li>New projects default to <code>edition = "2024"</code> or the latest stable edition available.</li>
  <li>Existing projects should migrate using <code>cargo fix --edition</code>, then run tests, Clippy, and docs.</li>
  <li>Formatting should use the matching style edition via <code>rustfmt.toml</code>:</li>
</ul>

<pre><code class="language-toml">style_edition = "2024"
</code></pre>

<h3 id="manifest-policy">Manifest Policy</h3>

<p>At minimum, a serious project should have:</p>

<ul>
  <li>explicit <code>edition</code></li>
  <li>explicit <code>rust-version</code></li>
  <li>description</li>
  <li>repository</li>
  <li>readme</li>
  <li>license</li>
</ul>

<p>If the project is published or intended to be publishable, metadata should be complete enough for someone else to understand what the crate is and where to find its source/docs.</p>

<h3 id="reproducible-builds">Reproducible Builds</h3>

<ul>
  <li>CI and release verification should prefer <code>--locked</code>.</li>
  <li>Applications, binaries, and serious workspaces should commit <code>Cargo.lock</code>.</li>
  <li>Git dependencies should pin exact revisions or tags, not float on a branch name.</li>
  <li>Release artifacts should record the toolchain version, target triple, and build profile used to
produce them.</li>
</ul>

<hr />

<h2 id="project-layout--file-tree-standards">Project Layout &amp; File Tree Standards</h2>

<h3 id="default-package-shape">Default Package Shape</h3>

<p>For most non-trivial binaries:</p>

<pre><code class="language-text">project/
  Cargo.toml
  rustfmt.toml
  README.md
  src/
    lib.rs
    main.rs
  tests/
</code></pre>

<p>Why:</p>

<ul>
  <li>Cargo naturally supports a package with both <code>src/lib.rs</code> and <code>src/main.rs</code></li>
  <li>keeping logic in <code>lib.rs</code> makes testing and reuse easier</li>
  <li><code>main.rs</code> should mostly parse args, call into the library, map exit status, and print errors</li>
</ul>

<h3 id="thin-mainrs-rule">Thin <code>main.rs</code> Rule</h3>

<p>If the binary is more than a toy:</p>

<ul>
  <li>put real logic in <code>lib.rs</code></li>
  <li>keep <code>main.rs</code> thin</li>
  <li>do not bury business logic in argument parsing or bootstrap glue</li>
</ul>

<h3 id="directory-layout-by-responsibility">Directory Layout by Responsibility</h3>

<p>Prefer directories and modules that reflect domain boundaries, not vague buckets.</p>

<p>Good:</p>

<pre><code class="language-text">src/
  config/
  cli/
  parser/
  ui/
  db/
  protocol/
</code></pre>

<p>Bad:</p>

<pre><code class="language-text">src/
  utils.rs
  helpers.rs
  misc.rs
  stuff.rs
</code></pre>

<p><code>utils.rs</code> is allowed only if it is truly small, generic, and stable. Most of the time it is a junk drawer and should be split by actual purpose.</p>

<h3 id="when-to-create-a-new-file">When to Create a New File</h3>

<p>Create a new file when <strong>one</strong> of these is true:</p>

<ul>
  <li>the file contains more than one responsibility</li>
  <li>the file is growing beyond the size limits below</li>
  <li>a concept has become important enough to deserve a name</li>
  <li>the tests for a concept would be clearer beside their own module</li>
  <li>the module has child modules and wants a stable top-level API</li>
  <li>code navigation is getting slower because everything lives in one place</li>
</ul>

<p>Do <strong>not</strong> create a new file when:</p>

<ul>
  <li>it would contain one tiny helper with no meaningful boundary</li>
  <li>it would force readers to jump through five files just to understand one function</li>
  <li>the split is by syntax only, not by responsibility</li>
</ul>

<h3 id="how-to-structure-modules">How to Structure Modules</h3>

<p>Preferred module style:</p>

<ul>
  <li>use <code>foo.rs</code> for a module</li>
  <li>use <code>foo/</code> for the module’s children when needed</li>
  <li>use <code>mod.rs</code> only when it is genuinely the cleanest fit or tool constraints require it</li>
</ul>

<p>Examples:</p>

<pre><code class="language-text">src/
  cli.rs
  cli/
    parse.rs
    help.rs
    validate.rs
</code></pre>

<p>or:</p>

<pre><code class="language-text">src/
  cli/
    mod.rs
    parse.rs
    help.rs
</code></pre>

<p>Either is fine. Pick one style and stay consistent within the repo.</p>

<h3 id="when-to-create-a-workspace">When to Create a Workspace</h3>

<p>Start with one package.
Split into a workspace only when there is a real boundary.</p>

<p>Create a workspace when:</p>

<ul>
  <li>multiple crates have distinct responsibilities</li>
  <li>a library is reused by more than one binary</li>
  <li>build times or feature isolation justify separation</li>
  <li>different packages need separate publishing/versioning paths</li>
  <li>multiple packages should share one lockfile, target dir, lint policy, and CI surface</li>
</ul>

<p>Do <strong>not</strong> create a workspace just because a single crate has become moderately large.
Large crates should first be fixed with better module boundaries.</p>

<hr />

<h2 id="module-file-and-function-size-standards">Module, File, and Function Size Standards</h2>

<p>These are <strong>engineering limits</strong>, not language limits.
They exist to preserve readability.</p>

<h3 id="soft-limits">Soft Limits</h3>

<table>
  <thead>
    <tr>
      <th>Unit</th>
      <th>Soft Limit</th>
      <th>Hard Smell Threshold</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>File</td>
      <td>250-350 lines</td>
      <td>500+ lines</td>
    </tr>
    <tr>
      <td>Function</td>
      <td>20-40 lines</td>
      <td>80-100+ lines</td>
    </tr>
    <tr>
      <td><code>impl</code> block</td>
      <td>One concern</td>
      <td>Mixed unrelated behavior</td>
    </tr>
    <tr>
      <td>Match arm</td>
      <td>A few lines</td>
      <td>mini-program inside each arm</td>
    </tr>
  </tbody>
</table>

<p>These are not mathematical laws.
A parser table or protocol state machine may need more room.
But once you cross the smell threshold, you need a conscious justification.</p>

<h3 id="file-budget-rules">File Budget Rules</h3>

<ul>
  <li>One file should usually hold one coherent concept.</li>
  <li>One file may contain multiple small helpers if they support the same concept.</li>
  <li>A file that mixes types, parsing, runtime orchestration, rendering, and tests is already wrong.</li>
  <li>A file over 500 lines must be considered guilty until proven innocent.</li>
</ul>

<h3 id="function-budget-rules">Function Budget Rules</h3>

<p>Break functions when:</p>

<ul>
  <li>nesting gets deep</li>
  <li>control flow is hard to scan</li>
  <li>variable lifetimes become long and confusing</li>
  <li>more than one level of abstraction is mixed together</li>
  <li>the function both decides policy and performs mechanics</li>
</ul>

<p>Good extractions:</p>

<ul>
  <li>a named validation step</li>
  <li>a data normalization step</li>
  <li>a boundary call to filesystem/network/db</li>
  <li>a pure scoring/transformation helper</li>
  <li>a constructor or parser for a domain type</li>
</ul>

<p>Bad extractions:</p>

<ul>
  <li><code>do_part_1</code>, <code>do_part_2</code>, <code>helper2</code>, <code>misc_step</code></li>
  <li>helpers with names that reveal no domain meaning</li>
</ul>

<h3 id="line-width-and-keeping-code-short">Line Width and Keeping Code Short</h3>

<p>Rust’s style guide sets the max line width at <strong>100 characters</strong>.
Follow it.</p>

<p>To keep width and length under control:</p>

<ol>
  <li>Prefer block indentation and trailing commas.</li>
  <li>Use <code>where</code> clauses when bounds get long.</li>
  <li>Name important intermediate values with <code>let</code>.</li>
  <li>Use small structs or option types instead of too many parameters.</li>
  <li>Use helper methods when a concept repeats.</li>
  <li>Prefer early returns and guard clauses over nested pyramids.</li>
  <li>Prefer <code>match</code>, <code>if let</code>, <code>let-else</code>, and small enums over boolean soup.</li>
  <li>Split config/state bags into sub-structs by concern.</li>
</ol>

<p>Do <strong>not</strong> chase short code by making it cryptic.
Senior code is concise because it is well-factored, not because it is compressed.</p>

<hr />

<h2 id="code-style--readability">Code Style &amp; Readability</h2>

<h3 id="formatting">Formatting</h3>

<ul>
  <li>Use <code>rustfmt</code>.</li>
  <li>Use the default Rust style unless the repo has a written exception.</li>
  <li>Use spaces, not tabs, ik kill me.</li>
  <li>Use 4-space indentation.</li>
  <li>Keep code lines at 100 chars max.</li>
  <li>Keep comment-only lines around 80 chars when practical.</li>
  <li>Prefer <code>///</code> doc comments and <code>//</code> line comments.</li>
  <li>Avoid block comments except for license text or generated content that tooling requires.</li>
</ul>

<h3 id="comments">Comments</h3>

<p>Comments should explain:</p>

<ul>
  <li>why a decision exists</li>
  <li>what invariant must hold</li>
  <li>what tradeoff is being made</li>
  <li>what is surprising or non-obvious</li>
</ul>

<p>Comments should <strong>not</strong> narrate obvious syntax.
Comments should also <strong>not</strong> contain meta-commentary about the authoring process.
Do not write comments that explain what the AI was thinking, what the programmer debated,
or that talk directly to the user like prose in a chat window.
Prefer comment forms with clear attachment (<code>//!</code>, <code>///</code>, <code>//</code>) over large floating comment blocks.</p>

<p>Good:</p>

<pre><code class="language-rust">// Keep the parsed form so repeated matches do not re-tokenize the input.
</code></pre>

<p>Bad:</p>

<pre><code class="language-rust">// Increment i by 1.
i += 1;
</code></pre>

<h3 id="names">Names</h3>

<p>Follow Rust naming conventions:</p>

<ul>
  <li>modules: <code>snake_case</code></li>
  <li>functions: <code>snake_case</code></li>
  <li>methods: <code>snake_case</code></li>
  <li>types and traits: <code>UpperCamelCase</code></li>
  <li>constants/statics: <code>SCREAMING_SNAKE_CASE</code></li>
</ul>

<p>Additional standards:</p>

<ul>
  <li>getters should usually be <code>name()</code> and <code>name_mut()</code>, not <code>get_name()</code></li>
  <li>constructors should usually be <code>new</code> for the primary path</li>
  <li>if ownership or cost matters, names should say so:
<code>as_*</code> for cheap borrowed views,
<code>to_*</code> for copy/allocate,
<code>into_*</code> for consuming conversion,
<code>from_*</code> for construction from another representation,
<code>with_*</code> for configured construction</li>
  <li>avoid names that hide allocation, mutation, or ownership transfer behind cheap-sounding verbs</li>
  <li>conversion traits should prefer <code>From</code>, <code>TryFrom</code>, <code>AsRef</code>, <code>AsMut</code></li>
  <li>do not implement <code>Into</code> or <code>TryInto</code> directly when <code>From</code> / <code>TryFrom</code> is appropriate</li>
  <li>iterator methods should use <code>iter</code>, <code>iter_mut</code>, <code>into_iter</code></li>
</ul>

<h3 id="readability-rules">Readability Rules</h3>

<p>Write code so a strong engineer can scan it top-to-bottom without mentally simulating a maze.</p>

<p>That means:</p>

<ul>
  <li>one abstraction level at a time</li>
  <li>small and explicit data flows</li>
  <li>minimal hidden mutation</li>
  <li>obvious ownership</li>
  <li>names that reveal intent</li>
  <li>tight dependency locality</li>
  <li>no magic booleans when an enum or struct would be clearer</li>
  <li>no shadowing in maintained code; use a new name or a smaller scope when the value meaning changes</li>
</ul>

<p>Prefer:</p>

<pre><code class="language-rust">enum LaunchMode {
    Tty,
    Detached,
    Scoped,
}
</code></pre>

<p>over:</p>

<pre><code class="language-rust">fn launch(item: &amp;Item, detach: bool, tty: bool, scoped: bool)
</code></pre>

<h3 id="idioms-to-prefer">Idioms to Prefer</h3>

<p>Prefer these when they improve clarity:</p>

<ul>
  <li><code>?</code> for error propagation</li>
  <li><code>if let</code> and <code>let-else</code> for focused control flow</li>
  <li><code>matches!</code> for boolean pattern checks</li>
  <li><code>Iterator</code> adapters when they are clearer than manual loops</li>
  <li>explicit loops when iterator chains become unreadable</li>
  <li>small enums/newtypes for domain state</li>
  <li>tuple/struct returns instead of out-parameters</li>
</ul>

<h3 id="idioms-to-avoid">Idioms to Avoid</h3>

<ul>
  <li>huge chained iterator pipelines that nobody can debug</li>
  <li>boolean trap arguments</li>
  <li>over-generic APIs with unreadable bounds</li>
  <li>macros used to avoid writing normal Rust</li>
  <li>exposing internal representation prematurely</li>
  <li>smart-pointer <code>Deref</code> tricks unless you are actually implementing a smart pointer</li>
  <li>shadowing bindings to smuggle in a state transition</li>
  <li>ambient globals, thread-locals, or process state as hidden inputs</li>
  <li>helper names that hide allocation, I/O, or mutation cost</li>
</ul>

<hr />

<h2 id="api-types-and-data-modeling">API, Types, and Data Modeling</h2>

<h3 id="public-surface-area">Public Surface Area</h3>

<ul>
  <li>Keep public APIs small.</li>
  <li>Make fields private by default.</li>
  <li>Expose behavior and invariants through methods and constructors.</li>
  <li>Public fields are acceptable for passive data structs, not for invariant-heavy types.</li>
</ul>

<h3 id="explicit-inputs-over-ambient-context">Explicit Inputs Over Ambient Context</h3>

<ul>
  <li>Pass dependencies explicitly when they affect behavior.</li>
  <li>Read environment, time, process args, current directory, and similar ambient state at the shell
or boundary layer, then pass typed values inward.</li>
  <li>Avoid APIs that quietly fetch global state from deep inside business logic.</li>
  <li>If a dependency must be ambient, document the contract and keep the boundary narrow.</li>
</ul>

<h3 id="encode-invariants-in-types">Encode Invariants in Types</h3>

<p>Prefer:</p>

<ul>
  <li>enums over free-form strings</li>
  <li>newtypes over naked primitives when units/meaning matter</li>
  <li>validated constructors over “trust me” structs</li>
  <li>distinct input types over comments pretending two <code>String</code>s mean different things</li>
</ul>

<p>Example: <code>UserId(String)</code> is often better than “the first string argument is the user id.”</p>

<h3 id="type-state-and-phase-aware-apis">Type-State and Phase-Aware APIs</h3>

<p>When an API has distinct phases, encode them in the type system when doing so keeps the API honest.</p>

<p>Good candidates:</p>

<ul>
  <li>builders with required fields</li>
  <li>validated vs unvalidated configuration</li>
  <li>connected vs disconnected clients</li>
  <li>open vs closed resources</li>
  <li>state machines with legal transition rules</li>
</ul>

<p>Use the type-state pattern when it removes whole classes of runtime misuse.
Do not force it onto tiny APIs where a simpler constructor or enum is clearer.</p>

<h3 id="global-state-policy">Global State Policy</h3>

<ul>
  <li>Module-level mutable global state is banned by default.</li>
  <li>If shared global state is truly required, it must be synchronized, initialization-safe, wrapped
in a tiny API, and justified in writing.</li>
  <li>Prefer explicit state objects, contexts, or handles over singletons and hidden lazy globals.</li>
</ul>

<h3 id="common-trait-policy">Common Trait Policy</h3>

<p>Types should eagerly implement the common traits that make sense:</p>

<ul>
  <li><code>Debug</code></li>
  <li><code>Clone</code></li>
  <li><code>Eq</code> / <code>PartialEq</code></li>
  <li><code>Ord</code> / <code>PartialOrd</code></li>
  <li><code>Hash</code></li>
  <li><code>Default</code></li>
  <li><code>Display</code></li>
  <li><code>Serialize</code> / <code>Deserialize</code> when the type is actually data</li>
</ul>

<p>Do not derive or implement traits blindly.
Each trait should be semantically correct, not just convenient.</p>

<h3 id="public-api-evolution">Public API Evolution</h3>

<p>If a crate is shared, published, or treated as a stable internal dependency:</p>

<ul>
  <li>document the MSRV and bump it intentionally</li>
  <li>treat public APIs and feature flags as compatibility contracts</li>
  <li>use <code>#[must_use]</code> when dropping a return value is likely a bug</li>
  <li>consider <code>#[non_exhaustive]</code> for public enums and structs that are likely to grow</li>
  <li>run semver checks in CI for published crates or other semver-sensitive libraries</li>
</ul>

<p>Do not make accidental breaking changes because “it was easy to refactor locally.”</p>

<h3 id="trait-bounds">Trait Bounds</h3>

<ul>
  <li>Put bounds where they are needed, not everywhere.</li>
  <li>Avoid trait bounds on struct definitions unless required by the data model.</li>
  <li>Prefer bounds on <code>impl</code> blocks or functions over the type declaration itself.</li>
</ul>

<p>This preserves future flexibility and avoids over-constraining callers.</p>

<h3 id="methods-vs-functions">Methods vs Functions</h3>

<p>Use a method when the receiver is clear and central to the operation.
Use a free function when no receiver is privileged.</p>

<p>Prefer:</p>

<pre><code class="language-rust">impl Config {
    pub fn validate(&amp;self) -&gt; Result&lt;(), ConfigError&gt; { ... }
}
</code></pre>

<p>over:</p>

<pre><code class="language-rust">pub fn validate_config(config: &amp;Config) -&gt; Result&lt;(), ConfigError&gt; { ... }
</code></pre>

<p>unless there is a strong reason otherwise.</p>

<h3 id="builders-and-parameter-objects">Builders and Parameter Objects</h3>

<p>Use a builder or parameter struct when:</p>

<ul>
  <li>a constructor takes many arguments</li>
  <li>several arguments are optional</li>
  <li>boolean flags begin to pile up</li>
  <li>readability improves by naming fields at the call site</li>
</ul>

<p>Do not use a builder for trivial two-field construction.</p>

<h3 id="return-values">Return Values</h3>

<ul>
  <li>Return values should carry meaningful information.</li>
  <li>If there are two or more logically-related outputs, return a tuple or struct.</li>
  <li>Do not use out-parameters unless interfacing with an existing API that requires them.</li>
</ul>

<hr />

<h2 id="error-handling--failure-policy">Error Handling &amp; Failure Policy</h2>

<h3 id="recoverable-vs-unrecoverable">Recoverable vs Unrecoverable</h3>

<p>Rust distinguishes recoverable failure (<code>Result</code>) from unrecoverable failure (<code>panic!</code>).
Follow that distinction.</p>

<p>Use <code>Result</code> when:</p>

<ul>
  <li>input can be invalid</li>
  <li>I/O can fail</li>
  <li>parsing can fail</li>
  <li>user/environment/config problems can occur</li>
  <li>the caller can reasonably decide what to do</li>
</ul>

<p>Use <code>panic!</code> only when:</p>

<ul>
  <li>an invariant is broken</li>
  <li>a state is impossible if the surrounding code is correct</li>
  <li>continuing would be nonsense</li>
  <li>the bug should be loud</li>
</ul>

<h3 id="library-vs-binary-policy">Library vs Binary Policy</h3>

<p>Libraries:</p>

<ul>
  <li>should almost never call <code>std::process::exit</code></li>
  <li>should rarely panic for user/input/environment errors</li>
  <li>should return typed errors</li>
</ul>

<p>Binaries:</p>

<ul>
  <li>may convert top-level errors into exit codes</li>
  <li>may print user-facing error messages in the shell layer</li>
  <li>should keep that behavior near <code>main.rs</code>, not spread through helpers</li>
</ul>

<h3 id="termination-must-be-intentional">Termination Must Be Intentional</h3>

<p>Choose deliberately between:</p>

<ul>
  <li>normal return</li>
  <li>recoverable failure via <code>Result</code></li>
  <li>invariant failure via <code>panic!</code></li>
  <li>process exit in the top-level binary shell</li>
</ul>

<p>Do not hide termination behavior in utility helpers, deep callbacks, or cleanup code.</p>

<h3 id="unwrap--expect"><code>unwrap</code> / <code>expect</code></h3>

<p>Rules:</p>

<ul>
  <li>allowed in tests</li>
  <li>acceptable in tiny prototypes</li>
  <li>acceptable in startup code only when the invariant is truly hard</li>
  <li>not acceptable as normal error handling in maintained library code</li>
</ul>

<p>If you use <code>expect</code>, the message must explain the invariant:</p>

<p>Good:</p>

<pre><code class="language-rust">.expect("validated config always contains an output directory")
</code></pre>

<p>Bad:</p>

<pre><code class="language-rust">.expect("oops")
</code></pre>

<h3 id="error-types">Error Types</h3>

<p>Public error types should:</p>

<ul>
  <li>implement <code>std::error::Error</code></li>
  <li>preserve useful context</li>
  <li>not leak internal junk</li>
  <li>be precise enough to act on</li>
</ul>

<p>Do not collapse everything into <code>String</code> at public boundaries unless the crate is intentionally tiny and private.</p>

<p>For error helpers:</p>

<ul>
  <li>typed errors are preferred at library boundaries</li>
  <li><code>thiserror</code> is a good fit for library/app error enums</li>
  <li><code>anyhow</code>/<code>eyre</code>-style opaque errors are acceptable in top-level binary orchestration and one-off tools</li>
  <li>do not expose opaque catch-all error types as a public library contract unless that tradeoff is intentional</li>
</ul>

<h3 id="validate-early">Validate Early</h3>

<p>Validate arguments and state as close to the boundary as possible.
Prefer static enforcement through types.
If static enforcement is not practical, validate once and convert to a validated type.</p>

<hr />

<h2 id="testing-standards">Testing Standards</h2>

<h3 id="test-categories">Test Categories</h3>

<p>Rust has three useful test layers. Use all three when appropriate.</p>

<ol>
  <li><strong>Unit tests</strong>
    <ul>
      <li>live beside the code</li>
      <li>may test private helpers</li>
      <li>verify small logic and invariants</li>
    </ul>
  </li>
  <li><strong>Integration tests</strong>
    <ul>
      <li>live under <code>tests/</code></li>
      <li>use only the public API</li>
      <li>verify that components work together</li>
    </ul>
  </li>
  <li><strong>Documentation tests</strong>
    <ul>
      <li>live in rustdoc examples</li>
      <li>prove examples compile and run</li>
      <li>keep docs honest</li>
    </ul>
  </li>
</ol>

<h3 id="unit-test-rules">Unit Test Rules</h3>

<ul>
  <li>Put focused unit tests beside the module they test.</li>
  <li>Test one behavior at a time.</li>
  <li>Use descriptive names:
    <ul>
      <li><code>parses_empty_input_as_none</code></li>
      <li><code>rejects_duplicate_keys</code></li>
      <li><code>sorts_pinned_items_before_recent_items</code></li>
    </ul>
  </li>
  <li>Private functions may be tested if doing so meaningfully isolates behavior.</li>
</ul>

<h3 id="integration-test-rules">Integration Test Rules</h3>

<ul>
  <li>Every non-trivial library should have <code>tests/</code>.</li>
  <li>Integration tests should exercise public behavior, not private structure.</li>
  <li>Each bug fix should add a regression test when practical.</li>
  <li>CLI and protocol projects should have at least a few black-box tests.</li>
</ul>

<h3 id="documentation-test-rules">Documentation Test Rules</h3>

<ul>
  <li>Public examples should compile.</li>
  <li>Prefer examples that demonstrate why the API exists, not only how syntax works.</li>
  <li>Fallible examples should use <code>?</code>, not <code>unwrap</code>.</li>
  <li>Use hidden lines in doc tests when setup is necessary but not relevant.</li>
</ul>

<h3 id="advanced-test-techniques">Advanced Test Techniques</h3>

<p>Use stronger tools when the surface area justifies them:</p>

<ul>
  <li>property testing for invariants, parser round-trips, and algorithmic edge cases</li>
  <li>snapshot testing for CLI output, diagnostics, rendered text, or other stable human-facing output</li>
  <li>fuzzing for parsers, protocol handlers, file formats, and untrusted-input boundaries</li>
</ul>

<p>Rules:</p>

<ul>
  <li>review snapshots like code, not as magic blessed files</li>
  <li>keep property tests targeted enough to debug failures</li>
  <li>start fuzzing anywhere malformed input could become a crash, hang, or memory issue</li>
</ul>

<h3 id="test-structure">Test Structure</h3>

<p>Use <code>Result</code>-returning tests when setup is fallible and <code>?</code> improves readability.</p>

<p>Use custom assertion messages when failure context matters.</p>

<p>Prefer:</p>

<pre><code class="language-rust">assert!(
    rendered.contains("Carol"),
    "rendered output did not include the requested name: {rendered}"
);
</code></pre>

<p>over a failure that tells you nothing useful.</p>

<h3 id="what-to-test">What to Test</h3>

<p>Test:</p>

<ul>
  <li>domain invariants</li>
  <li>parsing and validation</li>
  <li>error behavior</li>
  <li>boundary conditions</li>
  <li>serialization round-trips</li>
  <li>sorting/ranking/scoring rules</li>
  <li>user-visible behavior</li>
  <li>regressions for previously fixed bugs</li>
</ul>

<p>Do not over-invest in tests that pin trivial implementation details with no behavioral value.</p>

<h3 id="test-data">Test Data</h3>

<ul>
  <li>Keep fixtures small and readable.</li>
  <li>Put reusable fixtures under <code>tests/fixtures/</code>.</li>
  <li>Name fixtures after what they model, not where they came from.</li>
  <li>Use builders/helpers in tests when setup repetition obscures intent.</li>
  <li>Treat tests as executable behavior docs, not just breakage alarms.</li>
</ul>

<hr />

<h2 id="documentation-standards">Documentation Standards</h2>

<h3 id="minimum">Minimum</h3>

<p>Every serious project should have:</p>

<ol>
  <li><code>README.md</code></li>
  <li>additional user documentation when the project needs it</li>
  <li>a license</li>
  <li>crate/package metadata in <code>Cargo.toml</code></li>
  <li>public API docs if there is a public API</li>
</ol>

<h3 id="crate-level-docs">Crate-Level Docs</h3>

<p>Library crates should have crate-level docs that explain:</p>

<ul>
  <li>what the crate is for</li>
  <li>when to use it</li>
  <li>the main entrypoints</li>
  <li>a minimal example</li>
</ul>

<h3 id="public-item-docs">Public Item Docs</h3>

<p>Public items should be documented when they are part of an intended API.</p>

<p>Good docs include:</p>

<ul>
  <li>a one-line summary first</li>
  <li>details after the summary</li>
  <li>an example when helpful</li>
  <li><code># Errors</code> when returning <code>Result</code></li>
  <li><code># Panics</code> when panic behavior matters</li>
  <li><code># Safety</code> for unsafe functions</li>
</ul>

<h3 id="examples">Examples</h3>

<p>Rules:</p>

<ul>
  <li>examples must compile when practical</li>
  <li>examples should demonstrate real use</li>
  <li>prefer concise examples over giant tutorials</li>
  <li>keep examples synced by running tests</li>
</ul>

<h3 id="docs-lints">Docs Lints</h3>

<p>For library-ish projects, strongly consider:</p>

<ul>
  <li><code>missing_docs</code></li>
  <li><code>rustdoc::broken_intra_doc_links</code></li>
  <li><code>rustdoc::private_intra_doc_links</code></li>
</ul>

<p>Docs should not quietly rot.</p>

<hr />

<h2 id="architecture--decision-records">Architecture &amp; Decision Records</h2>

<p>Code alone does not preserve the reasoning behind important decisions.
For significant design choices, create a decision record.</p>

<h3 id="when-to-write-a-decision-record">When to Write a Decision Record</h3>

<p>Write a decision record for changes that affect:</p>

<ul>
  <li>architecture or system shape</li>
  <li>dependencies and frameworks</li>
  <li>APIs and published contracts</li>
  <li>storage formats and migrations</li>
  <li>operational constraints</li>
  <li>security or compliance posture</li>
  <li>build, release, or development process</li>
</ul>

<h3 id="minimum-record-format">Minimum Record Format</h3>

<p>Every decision record should capture:</p>

<ul>
  <li>context</li>
  <li>decision</li>
  <li>alternatives considered</li>
  <li>consequences and tradeoffs</li>
  <li>status</li>
  <li>owner</li>
</ul>

<h3 id="decision-record-rules">Decision Record Rules</h3>

<ul>
  <li>keep records short and readable</li>
  <li>store them with the repo, typically under <code>docs/adr/</code> or <code>decisions/</code></li>
  <li>accepted records are not silently rewritten; create a new one that supersedes the old one</li>
  <li>link code reviews and follow-up changes back to relevant records</li>
</ul>

<p>ADRs are not bureaucracy.
They prevent the same arguments from being re-fought every three months.</p>

<hr />

<h2 id="warnings-lints-and-hygiene">Warnings, Lints, and Hygiene</h2>

<h3 id="zero-warning-policy">Zero-Warning Policy</h3>

<p>The target state is:</p>

<ul>
  <li>no compiler warnings</li>
  <li>no Clippy warnings in CI</li>
  <li>no rustdoc warnings in CI</li>
</ul>

<p>Warnings are either:</p>

<ul>
  <li>fixed immediately</li>
  <li>intentionally suppressed in a narrow scope with a reason</li>
</ul>

<p>They are not ignored.</p>

<h3 id="lint-configuration">Lint Configuration</h3>

<p>Prefer configuring lints centrally in <code>Cargo.toml</code> or workspace root.</p>

<p>Example:</p>

<pre><code class="language-toml">[lints.rust]
unsafe_code = "forbid"

[lints.clippy]
dbg_macro = "deny"
todo = "deny"
</code></pre>

<p>For workspaces, prefer <code>workspace.lints</code> and opt member crates into it.</p>

<h3 id="allow-vs-expect"><code>allow</code> vs <code>expect</code></h3>

<p>Use <code>#[allow(...)]</code> sparingly.</p>

<p>If a suppression is temporary and should disappear once the code changes, prefer <code>#[expect(...)]</code>.
That way the compiler tells you when the lint no longer fires and the suppression can be removed.</p>

<h3 id="warning-removal-policy">Warning Removal Policy</h3>

<p>When touching old code:</p>

<ul>
  <li>remove nearby warnings while you are there if the fix is low-risk</li>
  <li>do not introduce new warnings</li>
  <li>do not leave “temporary” warning suppressions without explanation</li>
</ul>

<p>When upgrading toolchains or editions:</p>

<ul>
  <li>run <code>cargo fix</code></li>
  <li>run <code>cargo fix --edition</code> for edition migrations</li>
  <li>rerun tests and Clippy after fixes land</li>
</ul>

<h3 id="hygiene-rules">Hygiene Rules</h3>

<ul>
  <li>no commented-out dead code</li>
  <li>no debug prints left behind</li>
  <li>no <code>todo!()</code> or <code>unimplemented!()</code> in shipped paths</li>
  <li>no stale feature flags</li>
  <li>no unused dependencies</li>
  <li>no placeholder names like <code>data2</code>, <code>tmp3</code>, <code>thing</code>, <code>stuff</code></li>
</ul>

<hr />

<h2 id="change-size-reviews-and-delivery">Change Size, Reviews, and Delivery</h2>

<h3 id="keep-changes-small">Keep Changes Small</h3>

<p>Thin code matters.
Thin diffs matter too.</p>

<p>Small changes are:</p>

<ul>
  <li>reviewed faster</li>
  <li>reviewed more thoroughly</li>
  <li>easier to reason about</li>
  <li>easier to roll back</li>
  <li>less likely to collide with other work</li>
</ul>

<p>Rules:</p>

<ul>
  <li>one concern per change</li>
  <li>formatting-only changes separate from functional changes</li>
  <li>renames/moves separate from logic changes when practical</li>
  <li>large work should be staged through intermediate safe steps</li>
</ul>

<h3 id="improve-overall-code-health">Improve Overall Code Health</h3>

<p>A change does not need to be perfect.
It does need to leave the codebase better than it found it.</p>

<p>Do not block progress chasing theoretical perfection.
Do not accept changes that quietly worsen maintainability.</p>

<h3 id="delivery-rules">Delivery Rules</h3>

<ul>
  <li>prefer smaller releases over giant batches</li>
  <li>make risky changes observable</li>
  <li>stage migrations whenever possible</li>
  <li>define rollback or roll-forward strategy before shipping risky infrastructure or data changes</li>
  <li>treat deployability as a feature, not an afterthought</li>
</ul>

<h3 id="mapping-to-the-repo-workflow">Mapping to the Repo Workflow</h3>

<p>When a repo follows <code>PROJECT_STANDARDS.md</code>:</p>

<ul>
  <li>feature, fix, refactor, and chore branches should carry small reviewable changes into <code>dev</code></li>
  <li>docs-only updates to standards, guides, and examples should follow the docs-only path to <code>main</code></li>
  <li>code standards changes that also touch CI, lints, toolchains, or build behavior are code/process changes and belong in the normal code flow</li>
  <li>release branches should only receive versioning, release-note, and final verification work</li>
  <li>hotfixes should stay narrow, then be followed by regression coverage on <code>dev</code></li>
</ul>

<h3 id="review-behavior">Review Behavior</h3>

<p>Review should focus on:</p>

<ul>
  <li>correctness</li>
  <li>design</li>
  <li>complexity</li>
  <li>tests</li>
  <li>naming</li>
  <li>documentation</li>
  <li>operational impact</li>
</ul>

<p>Review comments should explain why, not just what.
Pure style comments that are not grounded in a documented standard should not block good changes.</p>

<hr />

<h2 id="dependency-health-features-and-workspaces">Dependency Health, Features, and Workspaces</h2>

<h3 id="dependency-policy">Dependency Policy</h3>

<p>Before adding a crate, ask:</p>

<ol>
  <li>Does <code>std</code> already solve this well enough?</li>
  <li>Is the crate maintained and widely used?</li>
  <li>Is the compile-time / transitive dependency cost worth it?</li>
  <li>Am I adding a crate to avoid writing 30 lines of clear code?</li>
  <li>Does it lock the project into a design I may regret?</li>
</ol>

<p>New dependencies should be justified in review, especially foundational ones.</p>

<h3 id="dependency-health-policy">Dependency Health Policy</h3>

<p>Dependencies are part of the codebase.
If they are insecure, stale, unmaintained, duplicated, or bloated, that is your problem too.</p>

<p>Regularly check for:</p>

<ul>
  <li>known vulnerabilities</li>
  <li>unmaintained crates</li>
  <li>version drift</li>
  <li>duplicate transitive versions</li>
  <li>license/source issues where relevant</li>
  <li>binary size impact</li>
</ul>

<p>Recommended tools:</p>

<ul>
  <li><code>cargo audit</code> for RustSec advisories, including some unmaintained notices</li>
  <li><code>cargo outdated</code> for dependency drift</li>
  <li><code>cargo tree -d</code> for duplicate versions</li>
  <li><code>cargo deny check</code> for advisories, bans, licenses, and source policy</li>
  <li><code>cargo bloat</code> for binary-size inspection</li>
</ul>

<p>Treat “unmaintained” as a real engineering signal, not trivia.
If the standard library or a healthier crate now covers the same use case, prefer migrating.</p>

<h3 id="maintenance-cadence">Maintenance Cadence</h3>

<p>For maintained projects, run a regular hygiene pass rather than waiting for rot:</p>

<ul>
  <li>update dependencies in a controlled branch</li>
  <li>review advisories and unmaintained notices</li>
  <li>inspect duplicate transitive versions</li>
  <li>prune dependencies and stale features</li>
  <li>re-check binary size when the project ships binaries</li>
</ul>

<p>Quarterly is a good default for active projects.
More often is reasonable for security-sensitive or fast-moving repos.</p>

<h3 id="feature-flag-policy">Feature Flag Policy</h3>

<p>Cargo features should be:</p>

<ul>
  <li>additive</li>
  <li>meaningful</li>
  <li>named after what they enable</li>
  <li>not used as a negative toggle like <code>no-x</code></li>
</ul>

<p>Good:</p>

<ul>
  <li><code>serde</code></li>
  <li><code>cli</code></li>
  <li><code>std</code></li>
  <li><code>image</code></li>
</ul>

<p>Bad:</p>

<ul>
  <li><code>use-serde</code></li>
  <li><code>with-cli</code></li>
  <li><code>no-std-support</code></li>
</ul>

<p>Features are for real optional capability, platform support, or expensive dependencies.
They are not a bandage for API instability.</p>

<h3 id="published-crate-policy">Published Crate Policy</h3>

<p>For published crates or semver-sensitive internal libraries:</p>

<ul>
  <li>document MSRV in the README and <code>Cargo.toml</code></li>
  <li>bump MSRV intentionally and mention it in release notes when it changes</li>
  <li>check semver compatibility before release</li>
  <li>prefer additive evolution over surprise breakage</li>
  <li>do not expose dependencies in the public API unless you are willing to version with them</li>
</ul>

<h3 id="workspace-policy">Workspace Policy</h3>

<p>Use a workspace when the package boundary is real.
When using a workspace:</p>

<ul>
  <li>centralize lint policy</li>
  <li>centralize dependency versions when it reduces drift</li>
  <li>share one lockfile</li>
  <li>keep crate ownership boundaries clear</li>
</ul>

<p>Do not hide a bad module structure by scattering everything into many tiny crates.</p>

<hr />

<h2 id="performance-allocation-and-concurrency">Performance, Allocation, and Concurrency</h2>

<h3 id="general-rule">General Rule</h3>

<p>Do not optimize blindly.
Measure first.</p>

<p>That said, some bad patterns are obvious and should be avoided by default:</p>

<ul>
  <li>unnecessary <code>clone()</code></li>
  <li>repeated parsing of the same input</li>
  <li>repeated allocation in tight loops</li>
  <li>needless <code>String</code> ownership when <code>&amp;str</code> or <code>Cow</code> is enough</li>
  <li>converting back and forth between types without reason</li>
</ul>

<h3 id="allocation-rules">Allocation Rules</h3>

<ul>
  <li>Borrow when ownership is not needed.</li>
  <li>Use owned types when ownership clarifies lifetime and API behavior.</li>
  <li>Avoid sprinkling clones to silence the borrow checker.</li>
  <li>If the borrow checker is fighting you, the design may be wrong.</li>
</ul>

<h3 id="iterator-rules">Iterator Rules</h3>

<ul>
  <li>Use iterators when they improve clarity.</li>
  <li>Use loops when iterators get too dense.</li>
  <li>Do not turn simple control flow into unreadable combinator soup.</li>
</ul>

<h3 id="concurrency-rules">Concurrency Rules</h3>

<ul>
  <li>Prefer ownership and message passing over shared mutable state where practical.</li>
  <li>Use shared state only when it is the clearest correct option.</li>
  <li>Keep lock scopes small.</li>
  <li>Never hold a lock across code that can block or across <code>.await</code>.</li>
  <li>Concurrency is not a substitute for better structure.</li>
</ul>

<h3 id="async-and-blocking-policy">Async and Blocking Policy</h3>

<p>Async should be a small delta on top of otherwise normal Rust.</p>

<p>Rules:</p>

<ul>
  <li>keep core business logic synchronous unless concurrency or I/O is the point</li>
  <li>use async primarily at I/O, protocol, and service boundaries</li>
  <li>do not perform blocking I/O or heavy CPU work on an async executor thread</li>
  <li>use <code>spawn_blocking</code>, dedicated worker threads, or separate processes when blocking work is unavoidable</li>
  <li>prefer bounded queues/channels and explicit backpressure over unbounded accumulation</li>
  <li>cancellation should leave state consistent and resources releasable</li>
  <li>test async code with the real runtime you expect to ship, not only mocked helpers</li>
</ul>

<p>Choose runtime shape deliberately.
Do not add executor complexity or cross-runtime abstractions without a real need.</p>

<h3 id="perf-review-trigger">Perf Review Trigger</h3>

<p>If code is on a hot path and not obviously cheap:</p>

<ul>
  <li>add a benchmark or measurement note</li>
  <li>record the reason for changes</li>
  <li>do not accept “felt faster” as evidence</li>
</ul>

<h3 id="benchmarking-rules">Benchmarking Rules</h3>

<p>When performance matters:</p>

<ul>
  <li>benchmark the code before and after a change</li>
  <li>benchmark representative workloads, not toy inputs only</li>
  <li>use release builds for meaningful measurements</li>
  <li>track tail behavior, not just averages, when latency matters</li>
  <li>use profilers when timing alone does not explain the result</li>
  <li>measure at the right layer:
    <ul>
      <li>microbenchmarks for local algorithm changes</li>
      <li>integration/load tests for system behavior</li>
    </ul>
  </li>
</ul>

<p>Do not use microbenchmarks to justify system-level conclusions.
Do not merge “performance improvements” that have no measurements behind them.</p>

<h3 id="performance-budgets">Performance Budgets</h3>

<p>Where a system is latency-sensitive, size-sensitive, or resource-sensitive, define budgets.</p>

<p>Examples:</p>

<ul>
  <li>startup time budget</li>
  <li>memory budget</li>
  <li>p95 or p99 latency budget</li>
  <li>binary size budget</li>
  <li>dependency count budget</li>
</ul>

<p>Budgets do not need to be elaborate.
They do need to exist if performance or footprint is part of the product value.</p>

<h3 id="size-awareness">Size Awareness</h3>

<p>Binary size, compile time, and dependency count are engineering concerns, not vanity metrics.</p>

<p>If a project ships binaries, periodically inspect:</p>

<ul>
  <li>top crates by code size</li>
  <li>top functions by <code>.text</code> contribution</li>
  <li>whether a dependency is worth its size cost</li>
  <li>whether features can be disabled</li>
</ul>

<p>Use <code>cargo bloat</code> to learn where size is actually coming from before guessing.
Use <code>cargo flamegraph</code> or an equivalent profiler when CPU cost needs attribution rather than intuition.</p>

<hr />

<h2 id="observability-operability-and-incident-learning">Observability, Operability, and Incident Learning</h2>

<p>Good engineering does not stop at code compiling.
It includes being able to run, observe, debug, and improve the system in reality.</p>

<p>Apply this section proportionally.
Do not cargo-cult service practices into a tiny crate, but do not use “it’s just a tool” as an
excuse to ship software that is impossible to debug in real use.</p>

<h3 id="observability-rules">Observability Rules</h3>

<p>For software that runs beyond a trivial local script:</p>

<ul>
  <li>emit logs that are useful to humans and machines</li>
  <li>record enough context to debug novel failures</li>
  <li>expose metrics where latency, throughput, queue depth, error rate, or saturation matter</li>
  <li>add tracing or correlation identifiers when request flows cross boundaries</li>
</ul>

<p>Monitoring tells you that something is wrong.
Observability should help you understand why.</p>

<h3 id="minimum-operational-baseline">Minimum Operational Baseline</h3>

<p>For services, daemons, APIs, queues, and other long-running systems, the minimum baseline is:</p>

<ul>
  <li>logs</li>
  <li>health/readiness signal where applicable</li>
  <li>release/build identity</li>
  <li>latency measurement</li>
  <li>error measurement</li>
  <li>saturation/resource pressure measurement</li>
</ul>

<p>For user-facing or networked systems, the default baseline should follow the four golden signals:</p>

<ul>
  <li>latency</li>
  <li>traffic</li>
  <li>errors</li>
  <li>saturation</li>
</ul>

<p>If the system is asynchronous, also track queue depth, backlog age, retries, and drop rate where relevant.</p>

<h3 id="black-box-and-white-box-monitoring">Black-Box and White-Box Monitoring</h3>

<p>Use both when the system matters.</p>

<ul>
  <li>black-box monitoring tells you whether the user-visible surface works</li>
  <li>white-box monitoring tells you what the internals are doing</li>
</ul>

<p>Black-box checks catch customer pain.
White-box signals speed up diagnosis.
Neither replaces the other.</p>

<h3 id="logging-rules">Logging Rules</h3>

<ul>
  <li>logs should be structured when the system is non-trivial</li>
  <li>do not log secrets</li>
  <li>do not bury useful fields inside giant free-form strings</li>
  <li>favor event-style logs over essay-style logs</li>
  <li>for service-style software, prefer writing to stdout/stderr and let the environment handle routing and storage</li>
  <li>log enough identifiers to correlate related events</li>
  <li>include version/build identity in startup logs for deployed software</li>
</ul>

<h3 id="metrics-and-tracing-rules">Metrics and Tracing Rules</h3>

<ul>
  <li>metrics should use stable names and clear units</li>
  <li>counters, gauges, and histograms should reflect real domain events</li>
  <li>latencies should usually be tracked as distributions, not just means</li>
  <li>traces should exist when a request crosses multiple boundaries and debugging would otherwise be guesswork</li>
  <li>do not emit high-cardinality labels blindly; cardinality is an operational cost</li>
</ul>

<h3 id="alerting-rules">Alerting Rules</h3>

<ul>
  <li>page only on conditions that are urgent, actionable, and user-visible or imminently user-visible</li>
  <li>every alert should have an owner</li>
  <li>every page-level alert should link to a runbook, dashboard, or both</li>
  <li>alerts that are routinely ignored, muted, or hand-waved are candidates for removal or redesign</li>
  <li>if nobody should wake up for it, it should not be a pager alert</li>
</ul>

<p>Alerting noise is an engineering bug.</p>

<h3 id="dashboard-rules">Dashboard Rules</h3>

<p>Every important system should have a default dashboard that answers:</p>

<ul>
  <li>is it healthy right now?</li>
  <li>what changed recently?</li>
  <li>where is the failure surface?</li>
  <li>what version is running?</li>
</ul>

<p>Dashboards are for fast orientation, not for cramming in every metric that exists.</p>

<h3 id="config-and-environment-rules">Config and Environment Rules</h3>

<ul>
  <li>deployment-specific config should not be hard-coded</li>
  <li>secrets do not belong in the repository</li>
  <li>configuration should be validated at startup</li>
  <li>development and production environments should be as close as practical for anything important</li>
  <li>distinguish build-time config from runtime config</li>
  <li>configuration should have clear ownership and defaults where appropriate</li>
  <li>invalid config should fail fast and loudly</li>
  <li>secrets should be rotatable without heroics</li>
  <li>effective configuration should be inspectable in a safe redacted form when debugging complex systems</li>
</ul>

<h3 id="release-and-rollout-safety">Release and Rollout Safety</h3>

<p>Risky changes should be shipped in a way that limits blast radius.</p>

<p>Preferred tools:</p>

<ul>
  <li>staged rollout</li>
  <li>canary deployment</li>
  <li>feature flags</li>
  <li>kill switches</li>
  <li>schema-first or compatibility-first rollout sequencing</li>
</ul>

<p>Rules:</p>

<ul>
  <li>release artifacts should be reproducible and traceable to source</li>
  <li>do not ship unique snowflake builds</li>
  <li>know how to roll back or roll forward before deployment starts</li>
  <li>deployment speed is good, but recoverability matters more</li>
</ul>

<h3 id="migrations-and-compatibility">Migrations and Compatibility</h3>

<p>If a change touches persistent data, public APIs, on-disk state, or wire formats:</p>

<ul>
  <li>define compatibility expectations explicitly</li>
  <li>write a migration plan</li>
  <li>document rollback constraints</li>
  <li>test against realistic old data or protocol examples</li>
  <li>separate irreversible migrations from unrelated feature work</li>
</ul>

<p>When possible:</p>

<ul>
  <li>deploy compatibility first</li>
  <li>migrate data second</li>
  <li>remove legacy support last</li>
</ul>

<h3 id="health-checks-and-lifecycle-contracts">Health Checks and Lifecycle Contracts</h3>

<p>If a process exposes health or readiness checks:</p>

<ul>
  <li>readiness should mean “safe to receive work”</li>
  <li>liveness should not mask brokenness as health</li>
  <li>dependency failures should be reflected honestly</li>
  <li>checks should be simple and reliable</li>
</ul>

<p>Lifecycle contracts should be explicit:</p>

<ul>
  <li>what must exist before startup succeeds</li>
  <li>what happens during degraded mode</li>
  <li>what guarantees are made during shutdown</li>
  <li>how long shutdown is allowed to take</li>
</ul>

<h3 id="startup-and-shutdown-rules">Startup and Shutdown Rules</h3>

<p>Long-running programs should:</p>

<ul>
  <li>start quickly</li>
  <li>fail fast when mandatory config is missing</li>
  <li>shut down gracefully</li>
  <li>handle termination signals predictably when the platform expects it</li>
  <li>stop accepting new work before teardown where applicable</li>
  <li>flush or drain critical buffers when required</li>
  <li>bound shutdown time with explicit timeouts</li>
  <li>make startup and shutdown behavior testable where practical</li>
</ul>

<h3 id="incident-learning">Incident Learning</h3>

<p>When a significant incident happens:</p>

<ul>
  <li>write it down</li>
  <li>quantify impact</li>
  <li>identify contributing causes, not just the final trigger</li>
  <li>create concrete follow-up actions</li>
  <li>assign owners and priorities</li>
  <li>review and share the result</li>
</ul>

<p>Postmortems should be blameless and system-focused.
The point is to improve the system and the process, not to shame the person closest to the blast.</p>

<h3 id="incident-writeup-standards">Incident Writeup Standards</h3>

<p>A useful incident writeup should include:</p>

<ul>
  <li>timeline</li>
  <li>customer or business impact</li>
  <li>detection method</li>
  <li>severity</li>
  <li>root cause</li>
  <li>contributing factors</li>
  <li>mitigation</li>
  <li>follow-up actions</li>
</ul>

<p>Action items should have:</p>

<ul>
  <li>an owner</li>
  <li>a priority</li>
  <li>a due date or tracking ticket</li>
</ul>

<p>Repeated incidents without structural fixes are a process failure, not bad luck.</p>

<hr />

<h2 id="unsafe-ffi-and-platform-boundaries">Unsafe, FFI, and Platform Boundaries</h2>

<h3 id="unsafe-policy">Unsafe Policy</h3>

<p>Unsafe Rust is allowed only when it is justified.</p>

<p>Rules:</p>

<ul>
  <li>keep unsafe blocks as small as possible</li>
  <li>isolate unsafe inside dedicated modules</li>
  <li>expose safe abstractions over unsafe internals whenever possible</li>
  <li>document every unsafe block with the invariant it relies on</li>
  <li>test unsafe-backed behavior aggressively</li>
  <li>prefer pure Rust for pure computation; FFI is for true boundary crossings, not laziness</li>
</ul>

<h3 id="-safety-comments"><code>// SAFETY:</code> Comments</h3>

<p>Every non-trivial unsafe block should explain why it is sound.</p>

<p>Example shape:</p>

<pre><code class="language-rust">// SAFETY: `ptr` comes from `buffer.as_ptr()`, remains valid for `len` bytes,
// and this function does not outlive `buffer`.
unsafe { ... }
</code></pre>

<h3 id="ffi-rules">FFI Rules</h3>

<ul>
  <li>Keep FFI declarations localized.</li>
  <li>Prefer pure Rust when the problem is just computation, parsing, data structure work, or other
logic that does not require a foreign boundary.</li>
  <li>Translate foreign types into Rust domain types at the boundary.</li>
  <li>Do not leak raw C concepts deep into business logic.</li>
  <li>If a function is unsafe to call, its docs must say exactly what the caller must uphold.</li>
</ul>

<h3 id="platform-rules">Platform Rules</h3>

<p>Platform-specific behavior belongs in platform modules.
Do not spread OS checks, <code>cfg</code>s, or syscall details across unrelated logic.</p>

<hr />

<h2 id="code-review-checklist">Code Review Checklist</h2>

<p>Before merging, ask:</p>

<h3 id="correctness">Correctness</h3>

<ul>
  <li>Does the code do what it claims?</li>
  <li>Are edge cases handled?</li>
  <li>Are invariants encoded or merely hoped for?</li>
</ul>

<h3 id="structure">Structure</h3>

<ul>
  <li>Is the file boundary sane?</li>
  <li>Is the function length sane?</li>
  <li>Is the abstraction level consistent?</li>
  <li>Is there a missing module split?</li>
  <li>Does async code avoid holding locks, guards, or broad mutable state across <code>.await</code>?</li>
</ul>

<h3 id="api-quality">API Quality</h3>

<ul>
  <li>Are names idiomatic?</li>
  <li>Are public fields necessary?</li>
  <li>Are common traits implemented where appropriate?</li>
  <li>Does the caller get a clear contract?</li>
</ul>

<h3 id="failure-handling">Failure Handling</h3>

<ul>
  <li>Are recoverable errors returned, not panicked?</li>
  <li>Are panic cases documented where relevant?</li>
  <li>Is <code>unwrap</code>/<code>expect</code> justified?</li>
</ul>

<h3 id="tests">Tests</h3>

<ul>
  <li>Is there enough test coverage for the change?</li>
  <li>Does the change need a regression test?</li>
  <li>Are public-facing behaviors tested from the outside?</li>
</ul>

<h3 id="docs">Docs</h3>

<ul>
  <li>Are docs updated for public behavior changes?</li>
  <li>Do examples still compile?</li>
  <li>Are <code>Errors</code>, <code>Panics</code>, and <code>Safety</code> sections present where needed?</li>
</ul>

<h3 id="operational-impact">Operational Impact</h3>

<ul>
  <li>Are logs, metrics, traces, and alerts adequate for the change?</li>
  <li>Does the change affect startup, shutdown, readiness, or health checks?</li>
  <li>Does it need a migration, rollout plan, or rollback plan?</li>
  <li>Is the release/build identity still traceable?</li>
</ul>

<h3 id="performance">Performance</h3>

<ul>
  <li>Is there a performance cost or gain worth measuring?</li>
  <li>Are benchmarks or measurements present where they should be?</li>
  <li>Does the dependency or feature choice carry a size or compile-time cost?</li>
</ul>

<h3 id="hygiene">Hygiene</h3>

<ul>
  <li>Any new warnings?</li>
  <li>Any broad lint suppressions?</li>
  <li>Any dead code, debug output, or TODOs left behind?</li>
</ul>

<hr />

<h2 id="what-not-to-do">What Not To Do</h2>

<p><strong>Absolutely Forbidden</strong></p>

<ul>
  <li>giant junk-drawer files because splitting “feels like work”</li>
  <li>pushing warnings downstream for later</li>
  <li><code>std::process::exit</code> deep in library code</li>
  <li>public fields on invariant-heavy types without a strong reason</li>
  <li>boolean trap APIs</li>
  <li>blanket <code>allow</code> attributes to quiet code smells</li>
  <li>leaving failing or stale doc examples</li>
  <li>leaking unsafe/FFI concerns into normal business logic</li>
  <li>holding locks or guards across <code>.await</code> in maintained async code</li>
</ul>

<p><strong>Strongly Discouraged</strong></p>

<ul>
  <li><code>utils.rs</code> as a permanent storage bin</li>
  <li>giant iterator chains that need a decoder ring</li>
  <li>macros for ordinary code reuse</li>
  <li>panic-driven control flow</li>
  <li>cargo-cult patterns copied from old blog posts</li>
  <li>premature workspace splits</li>
  <li>clever lifetimes used to avoid designing a cleaner ownership model</li>
</ul>

<hr />

<h2 id="example-commands--automation">Example Commands &amp; Automation</h2>

<h3 id="daily-local-loop">Daily Local Loop</h3>

<pre><code class="language-bash">cargo check
cargo test
</code></pre>

<h3 id="workflow-fit">Workflow Fit</h3>

<p>For repos following <code>PROJECT_STANDARDS.md</code>:</p>

<ul>
  <li>run the local loop while developing on feature/fix/refactor/chore branches</li>
  <li>run the full PR checks before opening a code PR to <code>dev</code></li>
  <li>use the docs-only flow for markdown-only standards or documentation updates</li>
  <li>rerun final verification on release branches even when no source code changed there</li>
</ul>

<h3 id="dependency-and-size-health-loop">Dependency and Size Health Loop</h3>

<p>Run these regularly, not only when something is already broken:</p>

<pre><code class="language-bash">cargo audit
cargo outdated --workspace
cargo tree -d
cargo bloat --release -n 20
cargo bloat --release --crates
</code></pre>

<p>If the repo cares about licenses, sources, duplicate crates, or advisory policy:</p>

<pre><code class="language-bash">cargo deny check
</code></pre>

<p>For maintained shared crates, also consider:</p>

<pre><code class="language-bash">cargo semver-checks check-release
</code></pre>

<h3 id="locked-verification">Locked Verification</h3>

<p>If the repo commits <code>Cargo.lock</code>, use locked resolution for CI and release verification:</p>

<pre><code class="language-bash">cargo build --locked
cargo test --locked
RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps
</code></pre>

<h3 id="before-opening-a-pr">Before Opening a PR</h3>

<pre><code class="language-bash">cargo fmt --all
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
</code></pre>

<h3 id="warning-and-edition-cleanup">Warning and Edition Cleanup</h3>

<pre><code class="language-bash">cargo fix
cargo fix --edition
</code></pre>

<h3 id="advanced-inspection">Advanced Inspection</h3>

<p>Use these when the problem deserves deeper tooling:</p>

<pre><code class="language-bash">cargo flamegraph
cargo expand
cargo +nightly miri test
</code></pre>

<ul>
  <li><code>cargo flamegraph</code> for real CPU hotspots</li>
  <li><code>cargo expand</code> for macro expansion inspection</li>
  <li>Miri for unsafe, aliasing, and low-level undefined-behavior checks</li>
</ul>

<h3 id="example-rustfmttoml">Example <code>rustfmt.toml</code></h3>

<pre><code class="language-toml">style_edition = "2024"
</code></pre>

<h3 id="example-cargotoml-lints">Example <code>Cargo.toml</code> Lints</h3>

<pre><code class="language-toml">[lints.rust]
unsafe_code = "forbid"

[lints.clippy]
dbg_macro = "deny"
todo = "deny"
unwrap_used = "deny"
</code></pre>

<p>Use stricter Clippy lints deliberately.
Do <strong>not</strong> enable all of <code>clippy::restriction</code> as a blanket rule.</p>

<h3 id="example-ci-shape">Example CI Shape</h3>

<pre><code class="language-yaml">name: CI
on: [push, pull_request]

jobs:
  checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable
          components: rustfmt, clippy
      - run: cargo fmt --all -- --check
      - run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
      - run: cargo test --locked --workspace --all-features
      - run: cargo doc --locked --workspace --no-deps
        env:
          RUSTDOCFLAGS: -D warnings
</code></pre>

<hr />

<h2 id="summary">Summary</h2>

<p>This standard boils down to this:</p>

<ul>
  <li>use stable, current Rust</li>
  <li>keep <code>main.rs</code> thin</li>
  <li>keep files and functions small</li>
  <li>keep changes and releases small</li>
  <li>split by responsibility, not by accident</li>
  <li>prefer explicit inputs over ambient magic</li>
  <li>encode invariants in types</li>
  <li>use typestate when it removes real misuse</li>
  <li>keep names honest about ownership, allocation, and mutation cost</li>
  <li>return errors, do not panic casually</li>
  <li>make exits and failure modes intentional</li>
  <li>keep async at the boundary unless concurrency is the point</li>
  <li>test at unit, integration, and doc levels</li>
  <li>reach for property tests, snapshots, and fuzzing when the surface demands them</li>
  <li>document public behavior</li>
  <li>treat MSRV and public APIs as compatibility contracts</li>
  <li>record important technical decisions</li>
  <li>keep warnings at zero</li>
  <li>keep dependencies healthy</li>
  <li>choose boring, reversible designs when possible</li>
  <li>instrument systems so they can be debugged in reality</li>
  <li>learn from incidents without blame theater</li>
  <li>isolate unsafe and platform-specific code</li>
  <li>avoid shadowing and hidden global state</li>
  <li>add dependencies only when they earn their cost</li>
</ul>

<p>Write code that future you can scan in one pass without cursing your own name.</p>

<h3 id="standards-basis">Standards Basis</h3>

<p>Primary references used to shape this document:</p>

<ul>
  <li>Rust Style Guide<br />
https://doc.rust-lang.org/style-guide/</li>
  <li>Rust Edition Guide: rustfmt style edition<br />
https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-style-edition.html</li>
  <li>The Rust Programming Language: packages, crates, and modules<br />
https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html</li>
  <li>The Rust Programming Language: error handling<br />
https://doc.rust-lang.org/book/ch09-00-error-handling.html</li>
  <li>The Rust Programming Language: test organization<br />
https://doc.rust-lang.org/book/ch11-03-test-organization.html</li>
  <li>The Rust Programming Language: writing tests<br />
https://doc.rust-lang.org/book/ch11-01-writing-tests.html</li>
  <li>The Rust Programming Language: publishing and docs<br />
https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html</li>
  <li>The Rust Programming Language: unsafe Rust<br />
https://doc.rust-lang.org/book/ch20-01-unsafe-rust.html</li>
  <li>Cargo Book: manifest and lints<br />
https://doc.rust-lang.org/cargo/reference/manifest.html</li>
  <li>Cargo Book: workspaces<br />
https://doc.rust-lang.org/cargo/reference/workspaces.html</li>
  <li>Cargo Book: cargo fix<br />
https://doc.rust-lang.org/cargo/commands/cargo-fix.html</li>
  <li>rustdoc book: how to write docs<br />
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html</li>
  <li>rustdoc book: documentation tests<br />
https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html</li>
  <li>rustdoc book: lints<br />
https://doc.rust-lang.org/rustdoc/lints.html</li>
  <li>Clippy documentation<br />
https://doc.rust-lang.org/clippy/</li>
  <li>Rust API Guidelines<br />
https://rust-lang.github.io/api-guidelines/</li>
  <li>Rust API Guidelines: naming<br />
https://rust-lang.github.io/api-guidelines/naming.html</li>
  <li>Rust API Guidelines: documentation<br />
https://rust-lang.github.io/api-guidelines/documentation.html</li>
  <li>Rust API Guidelines: interoperability<br />
https://rust-lang.github.io/api-guidelines/interoperability.html</li>
  <li>Rust API Guidelines: predictability<br />
https://rust-lang.github.io/api-guidelines/predictability.html</li>
  <li>Rust API Guidelines: flexibility<br />
https://rust-lang.github.io/api-guidelines/flexibility.html</li>
  <li>Rust API Guidelines: type safety<br />
https://rust-lang.github.io/api-guidelines/type-safety.html</li>
  <li>Rust API Guidelines: dependability<br />
https://rust-lang.github.io/api-guidelines/dependability.html</li>
  <li>Rust API Guidelines: debuggability<br />
https://rust-lang.github.io/api-guidelines/debuggability.html</li>
  <li>Rust API Guidelines: future proofing<br />
https://rust-lang.github.io/api-guidelines/future-proofing.html</li>
  <li>Google Engineering Practices: code review standard<br />
https://google.github.io/eng-practices/review/reviewer/standard.html</li>
  <li>Google Engineering Practices: what to look for in review<br />
https://google.github.io/eng-practices/review/reviewer/looking-for.html</li>
  <li>Google Engineering Practices: small CLs<br />
https://google.github.io/eng-practices/review/developer/small-cls.html</li>
  <li>Google SRE: simplicity<br />
https://sre.google/sre-book/simplicity/</li>
  <li>Google SRE: monitoring distributed systems<br />
https://sre.google/sre-book/monitoring-distributed-systems/</li>
  <li>Google SRE: postmortem culture<br />
https://sre.google/sre-book/postmortem-culture/</li>
  <li>Google SRE: release engineering<br />
https://sre.google/sre-book/release-engineering/</li>
  <li>AWS Well-Architected: operational excellence<br />
https://docs.aws.amazon.com/wellarchitected/latest/framework/operational-excellence.html</li>
  <li>AWS Prescriptive Guidance: architectural decision records<br />
https://docs.aws.amazon.com/prescriptive-guidance/latest/architectural-decision-records/welcome.html</li>
  <li>AWS Prescriptive Guidance: ADR process<br />
https://docs.aws.amazon.com/prescriptive-guidance/latest/architectural-decision-records/adr-process.html</li>
  <li>AWS Prescriptive Guidance: ADR best practices<br />
https://docs.aws.amazon.com/prescriptive-guidance/latest/architectural-decision-records/best-practices.html</li>
  <li>The Twelve-Factor App<br />
https://12factor.net/</li>
  <li>The Twelve-Factor App: config<br />
https://12factor.net/config</li>
  <li>The Twelve-Factor App: disposability<br />
https://12factor.net/disposability</li>
  <li>The Twelve-Factor App: logs<br />
https://12factor.net/logs</li>
  <li>Martin Fowler: definition of refactoring<br />
https://martinfowler.com/bliki/DefinitionOfRefactoring.html</li>
  <li>Martin Fowler: code smell<br />
https://martinfowler.com/bliki/CodeSmell.html</li>
  <li>Martin Fowler: opportunistic refactoring<br />
https://martinfowler.com/bliki/OpportunisticRefactoring.html</li>
  <li>RustSec Advisory Database<br />
https://rustsec.org/</li>
  <li>cargo-deny<br />
https://github.com/EmbarkStudios/cargo-deny</li>
  <li>cargo-outdated<br />
https://github.com/kbknapp/cargo-outdated</li>
  <li>cargo-bloat<br />
https://github.com/RazrFalcon/cargo-bloat</li>
  <li>Tokio tutorial: shared state<br />
https://tokio.rs/tokio/tutorial/shared-state</li>
  <li>cargo-semver-checks<br />
https://github.com/obi1kenobi/cargo-semver-checks</li>
  <li>flamegraph / cargo flamegraph<br />
https://github.com/flamegraph-rs/flamegraph</li>
  <li>cargo-fuzz<br />
https://github.com/rust-fuzz/cargo-fuzz</li>
  <li>cargo-expand<br />
https://github.com/dtolnay/cargo-expand</li>
  <li>Miri<br />
https://github.com/rust-lang/miri</li>
  <li>proptest<br />
https://github.com/proptest-rs/proptest</li>
  <li>insta<br />
https://github.com/mitsuhiko/insta</li>
</ul>

<hr />

<p>End of Standard</p>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[A Manual for Writing Rust That Ages Well Instead of Exploding Into 1,000-Line Files]]></summary></entry><entry><title type="html">Decision Standards</title><link href="https://mjoyufull.github.io/2026/03/25/DECISION_STANDARDS.html" rel="alternate" type="text/html" title="Decision Standards" /><published>2026-03-25T00:00:00+00:00</published><updated>2026-03-25T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/03/25/DECISION_STANDARDS</id><content type="html" xml:base="https://mjoyufull.github.io/2026/03/25/DECISION_STANDARDS.html"><![CDATA[<p><strong>Version:</strong> 1.0.0<br />
<strong>Date:</strong> 2026-03-25</p>

<p>This sets the standard for how we actually make and track technical calls. The point is to stop relying on memory, make things evidence-based, and have a clear paper trail when we inevitably need to question a choice six months later.</p>

<hr />

<h2 id="1-what-counts-as-a-decision">1. What Counts as a Decision</h2>

<p>We are talking about choices that:</p>

<ul>
  <li>Bleed across module or crate boundaries.</li>
  <li>Paint you into a corner for future work.</li>
  <li>Have multiple ways they could actually be built.</li>
  <li>Will absolutely make future-you ask “why the hell did I build it this way?”</li>
</ul>

<p>Naming, formatting, and single-function logic aren’t architectural calls. Keep that to <code>CODE_STANDARDS.md</code>.</p>

<hr />

<h2 id="2-decision-marker-format">2. Decision Marker Format</h2>

<p>Every open or resolved call gets a unique ID so it can be tracked in the plan or audit docs.</p>

<h3 id="21-in-plan-documents">2.1 In Plan Documents</h3>

<p>Use a decision table in the “Open Decisions” section:</p>

<pre><code class="language-markdown">| ID | Question | Options | Leaning | Status | Resolution |
|---|---|---|---|---|---|
| D-01 | Metadata serialization format? | TOML / JSON / RON | TOML | Open | — |
| D-02 | Build isolation strategy? | Namespaces / Bubblewrap / None | Namespaces | Resolved | Namespaces chosen, see §X |
</code></pre>

<h3 id="22-in-critique--audit-documents">2.2 In Critique / Audit Documents</h3>

<p>Use P-level markers for problems and decision points discovered during audits:</p>

<pre><code class="language-markdown">### P-01: [Problem Title]

**Severity:** Critical / High / Medium / Low  
**Location:** `path/to/file.rs:line`  
**Status:** Open / Resolved / Deferred

**Problem:** [What is wrong or unclear]

**Options:**
1. [Option A] — [tradeoffs]
2. [Option B] — [tradeoffs]
3. [Option C] — [tradeoffs]

**Resolution:** [What was decided and why, or "Open"]
</code></pre>

<h3 id="23-severity-legend">2.3 Severity Legend</h3>

<p>Use consistently across all documents:</p>

<table>
  <thead>
    <tr>
      <th>Severity</th>
      <th>Meaning</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Critical</strong></td>
      <td>Blocks correctness, causes data loss, or makes the system unusable</td>
    </tr>
    <tr>
      <td><strong>High</strong></td>
      <td>Major capability missing, misleading surface, or fragile in production</td>
    </tr>
    <tr>
      <td><strong>Medium</strong></td>
      <td>Design debt or robustness problem that will cost contributor time</td>
    </tr>
    <tr>
      <td><strong>Low</strong></td>
      <td>Cleanup issue, warning, or cosmetic problem</td>
    </tr>
  </tbody>
</table>

<hr />

<h2 id="3-how-to-approach-decisions">3. How to Approach Decisions</h2>

<p>When you hit a real fork in the road:</p>

<h3 id="31-frame-the-actual-question">3.1 Frame the Actual Question</h3>

<p>“What database should we use?” is a garbage question. “What storage backend handles CMA records with vector search and sub-millisecond local reads?” is an actual question. Be specific.</p>

<h3 id="32-list-the-contenders">3.2 List the Contenders</h3>

<p>Write down options that could actually work in reality. Don’t waste time listing things you instantly ruled out, unless the reason you ruled them out is highly educational.</p>

<h3 id="33-hit-them-against-reality">3.3 Hit Them Against Reality</h3>

<p>For each option, check:</p>

<ul>
  <li><strong>Feasibility:</strong> Can we actually build this right now with what we have?</li>
  <li><strong>Fitness:</strong> Does it solve the problem?</li>
  <li><strong>Cost:</strong> What’s the tax in complexity, deps, and maintenance?</li>
  <li><strong>Risk:</strong> What’s the worst-case explosion scenario?</li>
</ul>

<h3 id="34-pick-and-print">3.4 Pick and Print</h3>

<p>Pick the least-bad option. Document:</p>

<ul>
  <li>What we chose.</li>
  <li>Why we chose it (keep it short).</li>
  <li>What we rejected and why.</li>
  <li>What specific future event would make us rip this out and try again.</li>
</ul>

<hr />

<h2 id="4-resolution-levels">4. Resolution Levels</h2>

<p>Not every call needs a six-page document. Match the effort to the stakes:</p>

<table>
  <thead>
    <tr>
      <th>Level</th>
      <th>Stakes</th>
      <th>Process</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Trivial</strong></td>
      <td>Single file, easily reversible</td>
      <td>Decide and move on. Drop a code comment if it’s weird.</td>
    </tr>
    <tr>
      <td><strong>Local</strong></td>
      <td>Single crate or module</td>
      <td>Note it in the plan or audit. Include one paragraph of why.</td>
    </tr>
    <tr>
      <td><strong>Architectural</strong></td>
      <td>Cross-crate, cross-subsystem</td>
      <td>Full review (§3). Track it with a D-level marker.</td>
    </tr>
    <tr>
      <td><strong>Foundational</strong></td>
      <td>Language choice, database engine, core abstraction</td>
      <td>Full review + let it sit and breathe before committing.</td>
    </tr>
  </tbody>
</table>

<hr />

<h2 id="5-when-to-backtrack">5. When to Backtrack</h2>

<p>Nothing is written in stone. Turn around when:</p>

<ul>
  <li>Reality shifted and the original constraints are gone.</li>
  <li>New benchmarks or production fires prove the old logic was wrong.</li>
  <li>The downstream effects of a choice are clearly causing too much pain.</li>
</ul>

<p>Do <strong>not</strong> rip out architecture just because:</p>

<ul>
  <li>Somebody has a subjective preference.</li>
  <li>Some new framework got posted on Hacker News.</li>
  <li>Reddit thinks your tech stack is uncool.</li>
</ul>

<p>When you do backtrack, update the marker with the new reality. Don’t erase history—append to it.</p>

<hr />

<h2 id="6-trap-behaviors">6. Trap Behaviors</h2>

<h3 id="61-defaulting">6.1 Defaulting</h3>
<p>Running with the first thing you typed without looking around. Fine for small shit, deadly for architecture.</p>

<h3 id="62-authority-bias">6.2 Authority Bias</h3>
<p>“Google uses this so we should.” Google’s problems are not your problems. Other people’s constraints aren’t yours.</p>

<h3 id="63-debate-fatigue">6.3 Debate Fatigue</h3>
<p>Picking an option just to shut someone up. If it’s a deadlock, isolate the component, pick the cheapest path to validate, and move on.</p>

<h3 id="64-stalling">6.4 Stalling</h3>
<p>Leaving a decision open because everything has a downside. <em>Everything</em> has a downside. Just pick your poison, document the pain, and execute.</p>

<hr />

<h2 id="changelog">Changelog</h2>

<h3 id="v100--2026-03-25">v1.0.0 — 2026-03-25</h3>
<ul>
  <li>Initial decision standards.</li>
</ul>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[Version: 1.0.0 Date: 2026-03-25]]></summary></entry><entry><title type="html">Planning Standards</title><link href="https://mjoyufull.github.io/2026/03/25/PLANNING_STANDARDS.html" rel="alternate" type="text/html" title="Planning Standards" /><published>2026-03-25T00:00:00+00:00</published><updated>2026-03-25T00:00:00+00:00</updated><id>https://mjoyufull.github.io/2026/03/25/PLANNING_STANDARDS</id><content type="html" xml:base="https://mjoyufull.github.io/2026/03/25/PLANNING_STANDARDS.html"><![CDATA[<p><strong>Version:</strong> 1.0.0<br />
<strong>Date:</strong> 2026-03-25</p>

<p>This sets out how <code>plan.md</code> files should be built. A solid plan is a living doc that crushes the project’s scope, decisions, and build order into something you can actually read in one sitting. It needs to stay updated after every decent merge.</p>

<hr />

<h2 id="1-core-purpose">1. Core Purpose</h2>

<p>A plan exists to anchor reality. It answers:</p>

<ul>
  <li>What exactly are we building?</li>
  <li>What are we <em>definitely not</em> building?</li>
  <li>What architectural calls are locked in?</li>
  <li>What’s still up in the air?</li>
  <li>What order are we tackling this in?</li>
  <li>How do we know a phase is actually done?</li>
</ul>

<p>It’s not a tutorial, it isn’t a pitch deck, and it shouldn’t hold a thousand lines of implementation details. Put that in the code, comments, or the audit docs.</p>

<hr />

<h2 id="2-plan-structure">2. Plan Structure</h2>

<p>Include these blocks in order. Skip them only if they are completely empty for your project.</p>

<h3 id="21-header-block">2.1 Header Block</h3>

<pre><code class="language-markdown"># [Project Name] — Plan

**Version:** X.Y.Z  
**Date:** YYYY-MM-DD  
**Status:** [Draft | Active | Frozen | Archived]
</code></pre>

<ul>
  <li><strong>Draft</strong>: Plan is being written, not yet actionable.</li>
  <li><strong>Active</strong>: Plan governs current development.</li>
  <li><strong>Frozen</strong>: Plan is final for a completed phase or milestone.</li>
  <li><strong>Archived</strong>: Plan is historical reference only.</li>
</ul>

<h3 id="22-overview">2.2 Overview</h3>

<p>One to three paragraphs max roughly describing what the project is. No marketing bullshit. No aspiration. Just the current reality and the exact target state.</p>

<h3 id="23-scope">2.3 Scope</h3>

<h4 id="in-scope">In Scope</h4>
<p>A list of concrete things we are actually delivering right now.</p>

<h4 id="out-of-scope">Out of Scope</h4>
<p>Things we are explicitly ignoring. This is your shield against feature creep. If somebody asks “why doesn’t it do X”, the answer needs to be living right here.</p>

<h3 id="24-delivery--risk">2.4 Delivery &amp; Risk</h3>

<p>How are we rolling this out?</p>
<ul>
  <li><strong>Rollout Strategy:</strong> Binary swap, gradual migration, or hard cutover?</li>
  <li><strong>Reversibility:</strong> How do we undo this if it explodes?</li>
  <li><strong>Known Tech Debt:</strong> What ugly corners are we accepting for now just to ship?</li>
</ul>

<h3 id="25-architecture--shape">2.5 Architecture &amp; Shape</h3>

<p>Explain the bones of the system. Block diagrams, crate trees, whatever makes sense. Keep it light enough to digest in a few minutes, but grounded enough to actually orient someone new.</p>

<h3 id="26-open-decisions">2.6 Open Decisions</h3>

<p>Track unresolved calls here using the D-level markers from <code>DECISION_STANDARDS.md</code>.</p>

<pre><code class="language-markdown">| ID | Question | Options | Leaning | Blocker? |
|---|---|---|---|---|
| D-01 | Which serialization format for metadata? | TOML / JSON / RON | TOML | No |
| D-02 | Sandbox isolation strategy? | Namespaces / Bubblewrap / None | Namespaces | Yes |
</code></pre>

<h3 id="27-build-order">2.7 Build Order</h3>

<p>List the work phases. Break work down into small chunks to keep diffs short and reviews fast.</p>

<ul>
  <li><strong>Name:</strong> What we’re calling this phase.</li>
  <li><strong>Scope:</strong> What gets built. Keep these small (think “one concern per change”).</li>
  <li><strong>Hardness:</strong> H0–H5 band if you use HDB.</li>
  <li><strong>Dependencies:</strong> What must land first.</li>
  <li><strong>Done-when:</strong> Concrete proof it’s finished.</li>
</ul>

<pre><code class="language-markdown">### Phase 1: Walking Skeleton
- **Scope:** CLI parses commands, reads config, resolves one package.
- **Hardness:** H0–H1
- **Dependencies:** None
- **Done-when:** `elda install hello-world` succeeds on a clean system.
</code></pre>

<h3 id="28-status-tracker">2.8 Status Tracker</h3>

<p>A summary table tracking the state of each phase or major deliverable.</p>

<pre><code class="language-markdown">| Phase | Status | Last Updated | Notes |
|---|---|---|---|
| Walking skeleton | Done | 2026-03-10 | Core CLI + config + single resolve |
| Dependency resolver | In Progress | 2026-03-20 | SAT solver integrated, constraint propagation next |
| Build sandbox | Not Started | — | Blocked on D-02 |
</code></pre>

<p>Status values: <code>Not Started</code>, <code>In Progress</code>, <code>Done</code>, <code>Blocked</code>, <code>Deferred</code>.</p>

<h3 id="29-changelog">2.9 Changelog</h3>

<p>A reverse-chronological list of plan updates.</p>

<pre><code class="language-markdown">### v1.1.0 — 2026-03-20
- Added Phase 3 (build sandbox) after D-02 resolved toward namespaces.
- Moved binary caching from Phase 2 to Phase 4.

### v1.0.0 — 2026-03-01
- Initial plan.
</code></pre>

<hr />

<h2 id="3-maintenance-rules">3. Maintenance Rules</h2>

<ol>
  <li><strong>Update on merge.</strong> If a PR hits <code>dev</code> and shifts the state of the project, update the plan.</li>
  <li><strong>Back your claims.</strong> “Done” means there’s a file path or test proving it. “In Progress” means there’s a branch. Stop lying to yourself in docs.</li>
  <li><strong>Scope cuts only.</strong> If scope has to grow, justify it loudly in the changelog.</li>
  <li><strong>Kill stale decisions.</strong> If a decision stays open for months, you either need to force an answer or explicitly sideline it.</li>
</ol>

<hr />

<h2 id="4-plan-vs-other-documents">4. Plan vs. Other Documents</h2>

<table>
  <thead>
    <tr>
      <th>Document</th>
      <th>Answers</th>
      <th>Updated</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>plan.md</code></td>
      <td>What are we building and in what order?</td>
      <td>After meaningful merges</td>
    </tr>
    <tr>
      <td><code>CODE_STANDARDS.md</code></td>
      <td>How do we write code?</td>
      <td>When standards evolve</td>
    </tr>
    <tr>
      <td><code>SOFTWARE_PHILOSOPHY.md</code></td>
      <td>Why do we make these choices?</td>
      <td>Rarely</td>
    </tr>
    <tr>
      <td><code>DECISION_STANDARDS.md</code></td>
      <td>How do we document and resolve decisions?</td>
      <td>When process evolves</td>
    </tr>
    <tr>
      <td><code>CODEBASE_AUDIT.md</code></td>
      <td>What is the actual state of the code?</td>
      <td>After meaningful merges</td>
    </tr>
  </tbody>
</table>

<hr />

<h2 id="changelog">Changelog</h2>

<h3 id="v100--2026-03-25">v1.0.0 — 2026-03-25</h3>
<ul>
  <li>Initial planning standards.</li>
</ul>]]></content><author><name>Rikona</name></author><category term="Other" /><summary type="html"><![CDATA[Version: 1.0.0 Date: 2026-03-25]]></summary></entry></feed>