<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eshan Roy (eshanized)</title>
    <description>The latest articles on DEV Community by Eshan Roy (eshanized) (@eshanized).</description>
    <link>https://dev.to/eshanized</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1353443%2F73ae79ba-7ffd-47f8-8d9b-9e96eed29261.jpg</url>
      <title>DEV Community: Eshan Roy (eshanized)</title>
      <link>https://dev.to/eshanized</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eshanized"/>
    <language>en</language>
    <item>
      <title>I Got Tired of AI Guessing Its Way Through Linux Engineering. So I Started Building SysWright.</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Tue, 24 Nov 2026 16:33:42 +0000</pubDate>
      <link>https://dev.to/eshanized/i-got-tired-of-ai-guessing-its-way-through-linux-engineering-so-i-started-building-syswright-3ppe</link>
      <guid>https://dev.to/eshanized/i-got-tired-of-ai-guessing-its-way-through-linux-engineering-so-i-started-building-syswright-3ppe</guid>
      <description>&lt;p&gt;I've been spending quite a lot of time working with Linux systems, building applications, maintaining infrastructure, and developing tools around the Linux ecosystem.&lt;/p&gt;

&lt;p&gt;And if you've worked with Linux long enough, you probably know that things aren't always as straightforward as they look.&lt;/p&gt;

&lt;p&gt;A kernel API changes. A systemd directive behaves differently across versions. A package builds perfectly on one distribution but fails somewhere else. A driver behaves unexpectedly, and suddenly you're digging through kernel documentation, mailing lists, source code, and old discussions trying to understand what actually happened.&lt;/p&gt;

&lt;p&gt;That's normal systems engineering.&lt;/p&gt;

&lt;p&gt;What isn't normal is an AI coding agent confidently giving you an outdated solution, inventing configuration options, or claiming something is fixed without actually verifying it.&lt;/p&gt;

&lt;p&gt;I've encountered this problem enough times that I started questioning how I was using AI for systems engineering in the first place.&lt;/p&gt;

&lt;p&gt;Maybe the problem wasn't the prompt.&lt;/p&gt;

&lt;p&gt;Maybe the problem was the engineering process behind it.&lt;/p&gt;

&lt;p&gt;That's where SysWright started.&lt;/p&gt;

&lt;p&gt;The problem isn't that AI can't write code&lt;/p&gt;

&lt;p&gt;I'm not against AI-assisted development. Quite the opposite. I use AI tools extensively in my engineering workflow.&lt;/p&gt;

&lt;p&gt;But there's a difference between generating code and engineering a system.&lt;/p&gt;

&lt;p&gt;When you're building a typical application, an incorrect implementation might produce a visible error. You fix it, run the tests, and move forward.&lt;/p&gt;

&lt;p&gt;Linux systems engineering is considerably less forgiving.&lt;/p&gt;

&lt;p&gt;Consider a few situations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're writing a kernel module against a specific kernel version.&lt;/li&gt;
&lt;li&gt;You're troubleshooting a systemd service with security restrictions.&lt;/li&gt;
&lt;li&gt;You're developing a device driver and investigating DMA or interrupt handling.&lt;/li&gt;
&lt;li&gt;You're creating a PKGBUILD or maintaining packages across multiple distributions.&lt;/li&gt;
&lt;li&gt;You're modifying bootloader configurations or storage layouts.&lt;/li&gt;
&lt;li&gt;You're investigating a performance regression.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In these situations, context matters enormously.&lt;/p&gt;

&lt;p&gt;The kernel version matters. The distribution matters. The userspace implementation matters. The upstream documentation matters.&lt;/p&gt;

&lt;p&gt;An answer that worked five years ago isn't necessarily correct today.&lt;/p&gt;

&lt;p&gt;And confidence isn't evidence.&lt;/p&gt;

&lt;p&gt;I wanted something that would encourage AI agents to approach these problems more like an experienced systems engineer rather than an autocomplete engine.&lt;/p&gt;

&lt;p&gt;What exactly is SysWright?&lt;/p&gt;

&lt;p&gt;"SysWright" (&lt;a href="https://github.com/eshanized/SysWright" rel="noopener noreferrer"&gt;https://github.com/eshanized/SysWright&lt;/a&gt;) is a research-first Linux systems engineering intelligence system and a collection of specialist skills designed for AI coding agents.&lt;/p&gt;

&lt;p&gt;The central idea is relatively simple:&lt;/p&gt;

&lt;p&gt;Research before implementation. Evidence before assumptions. Verification before completion.&lt;/p&gt;

&lt;p&gt;Instead of relying on one enormous instruction file, I wanted a structured system where different engineering domains have their own responsibilities.&lt;/p&gt;

&lt;p&gt;For example, SysWright includes specialist skills for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux kernel engineering&lt;/li&gt;
&lt;li&gt;Driver engineering&lt;/li&gt;
&lt;li&gt;systemd engineering&lt;/li&gt;
&lt;li&gt;Boot and initramfs engineering&lt;/li&gt;
&lt;li&gt;Linux networking and storage&lt;/li&gt;
&lt;li&gt;Linux security&lt;/li&gt;
&lt;li&gt;Linux performance and observability&lt;/li&gt;
&lt;li&gt;Linux debugging and fuzzing&lt;/li&gt;
&lt;li&gt;GTK and Qt/QML development&lt;/li&gt;
&lt;li&gt;Native Linux application engineering&lt;/li&gt;
&lt;li&gt;Arch, Debian, Ubuntu, Fedora and openSUSE packaging&lt;/li&gt;
&lt;li&gt;Reproducible builds and distribution engineering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also a central "linux-engineer" skill that acts as the entry point and coordinates the appropriate specialists.&lt;/p&gt;

&lt;p&gt;The intention isn't to make every agent an expert at everything.&lt;/p&gt;

&lt;p&gt;It's to give the agent a more disciplined way to approach different engineering problems.&lt;/p&gt;

&lt;p&gt;I wanted research to be part of the workflow, not an optional step&lt;/p&gt;

&lt;p&gt;This is probably the most important design decision in SysWright.&lt;/p&gt;

&lt;p&gt;When an agent encounters an unfamiliar kernel API, packaging convention, or system configuration, it shouldn't immediately start generating an implementation.&lt;/p&gt;

&lt;p&gt;It should first establish what it is working with.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understanding the actual problem and its constraints.&lt;/li&gt;
&lt;li&gt;Identifying the target environment and relevant versions.&lt;/li&gt;
&lt;li&gt;Consulting authoritative upstream documentation.&lt;/li&gt;
&lt;li&gt;Inspecting existing source code and relevant project history.&lt;/li&gt;
&lt;li&gt;Recording the evidence behind important conclusions.&lt;/li&gt;
&lt;li&gt;Developing an implementation based on that evidence.&lt;/li&gt;
&lt;li&gt;Running appropriate verification.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For Linux systems work, sources such as "docs.kernel.org", "man7.org", freedesktop.org documentation, distribution packaging guidelines, and upstream source repositories are considerably more useful than blindly trusting an old tutorial.&lt;/p&gt;

&lt;p&gt;I also wanted important technical claims to have traceable supporting evidence.&lt;/p&gt;

&lt;p&gt;If an agent tells me that an API changed, I want to know where that information came from and which version it applies to.&lt;/p&gt;

&lt;p&gt;Not just another confidently written paragraph.&lt;/p&gt;

&lt;p&gt;Safety matters more when an AI can interact with the actual system&lt;/p&gt;

&lt;p&gt;There is another problem I didn't want to ignore.&lt;/p&gt;

&lt;p&gt;Giving an AI agent access to a terminal is one thing. Giving it permission to modify a real Linux installation is something else entirely.&lt;/p&gt;

&lt;p&gt;A command involving a workspace build is not equivalent to a command that modifies partitions, changes bootloader configuration, or loads a kernel module.&lt;/p&gt;

&lt;p&gt;SysWright therefore uses a four-tier operational safety model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tier 0 – Diagnostics: Read-only system inspection.&lt;/li&gt;
&lt;li&gt;Tier 1 – Workspace development: Editing and building within an explicitly declared workspace.&lt;/li&gt;
&lt;li&gt;Tier 2 – Isolated environments: Automated work inside clean chroots or appropriately isolated virtual machines.&lt;/li&gt;
&lt;li&gt;Tier 3 – Privileged host mutations: Operations requiring explicit human approval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I particularly care about the last category.&lt;/p&gt;

&lt;p&gt;I don't want an autonomous agent deciding that formatting a disk, changing a bootloader, or modifying the host package database is an acceptable next step.&lt;/p&gt;

&lt;p&gt;Some operations should remain under human control.&lt;/p&gt;

&lt;p&gt;Automation should improve engineering, not remove accountability.&lt;/p&gt;

&lt;p&gt;Not another framework tied to one AI provider&lt;/p&gt;

&lt;p&gt;I also didn't want SysWright to become dependent on a single coding assistant.&lt;/p&gt;

&lt;p&gt;Different developers use different tools. Some prefer Claude Code, others use OpenAI Codex, and some use other environments that support agent skills.&lt;/p&gt;

&lt;p&gt;So I designed SysWright around a canonical skill architecture with platform-specific adapters.&lt;/p&gt;

&lt;p&gt;The core engineering knowledge remains in one place, while the distribution layer handles the requirements of individual agent environments.&lt;/p&gt;

&lt;p&gt;The repository currently includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Canonical Agent Skills&lt;/li&gt;
&lt;li&gt;Claude Code plugin integration&lt;/li&gt;
&lt;li&gt;Codex packaging support&lt;/li&gt;
&lt;li&gt;General distributable skill archives&lt;/li&gt;
&lt;li&gt;Shared engineering references&lt;/li&gt;
&lt;li&gt;Validation and testing scripts&lt;/li&gt;
&lt;li&gt;Engineering evaluation suites&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This architecture also makes it easier to expand compatibility without duplicating the actual engineering knowledge.&lt;/p&gt;

&lt;p&gt;Engineering quality needs to be testable&lt;/p&gt;

&lt;p&gt;I don't think a collection of Markdown instructions should be considered reliable simply because it looks comprehensive.&lt;/p&gt;

&lt;p&gt;That's why SysWright also has validation tooling and evaluation scenarios.&lt;/p&gt;

&lt;p&gt;The repository includes checks for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agent Skill specification compliance&lt;/li&gt;
&lt;li&gt;Reference and documentation integrity&lt;/li&gt;
&lt;li&gt;Unit and integration tests&lt;/li&gt;
&lt;li&gt;Skill-routing behavior&lt;/li&gt;
&lt;li&gt;Research quality&lt;/li&gt;
&lt;li&gt;Kernel and systems engineering scenarios&lt;/li&gt;
&lt;li&gt;Packaging workflows&lt;/li&gt;
&lt;li&gt;Native application engineering&lt;/li&gt;
&lt;li&gt;Cross-distribution engineering&lt;/li&gt;
&lt;li&gt;Advanced debugging, security, and performance workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tooling is implemented using the Python standard library, avoiding unnecessary external dependencies for the validation process.&lt;/p&gt;

&lt;p&gt;I want the project to be inspectable and reproducible rather than relying on complicated infrastructure just to validate its own instructions.&lt;/p&gt;

&lt;p&gt;What I want SysWright to become&lt;/p&gt;

&lt;p&gt;I don't consider the existence of 29 specialist skills a measure of success by itself.&lt;/p&gt;

&lt;p&gt;Having a large catalog is easy compared with ensuring that those skills actually improve engineering outcomes.&lt;/p&gt;

&lt;p&gt;There is still a lot to evaluate.&lt;/p&gt;

&lt;p&gt;I want to keep improving the quality of the research process, the accuracy of technical references, the routing between specialists, and the reliability of the evaluation scenarios.&lt;/p&gt;

&lt;p&gt;More importantly, I want to test it against real engineering problems rather than optimizing it around artificial demonstrations.&lt;/p&gt;

&lt;p&gt;I also want the project to remain useful outside my own development environment.&lt;/p&gt;

&lt;p&gt;Linux engineering isn't exclusive to one distribution or one group of developers. Whether you're working with Arch, Debian, Fedora, Ubuntu, or openSUSE, the underlying engineering discipline should remain consistent.&lt;/p&gt;

&lt;p&gt;That's the direction I'm working toward.&lt;/p&gt;

&lt;p&gt;Try it, inspect it, and challenge it&lt;/p&gt;

&lt;p&gt;SysWright is open source, and I'd genuinely like to get feedback from people who work on Linux systems, maintain distributions, develop kernel components, build native applications, or experiment with AI coding agents.&lt;/p&gt;

&lt;p&gt;You can explore the repository here:&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/eshanized/SysWright" rel="noopener noreferrer"&gt;https://github.com/eshanized/SysWright&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find something useful, try it in your own workflow.&lt;/p&gt;

&lt;p&gt;If something is inaccurate, tell me. If a specialist skill is missing, I'd like to hear about it. And if you have a better approach to making AI-assisted systems engineering more reliable, I'm interested in that conversation.&lt;/p&gt;

&lt;p&gt;I'm building SysWright because I want AI agents to become better engineering partners.&lt;/p&gt;

&lt;p&gt;Not simply better at producing code, but better at understanding systems, respecting constraints, investigating problems, and verifying their work.&lt;/p&gt;

&lt;p&gt;Because ultimately, I don't want an AI agent that just tells me something should work.&lt;/p&gt;

&lt;p&gt;I want one that can show me why it should work, what evidence supports that conclusion, and how it verified the result.&lt;/p&gt;

&lt;p&gt;— Eshan Roy&lt;/p&gt;

</description>
      <category>ai</category>
      <category>linux</category>
      <category>opensource</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Introducing Snigdha OS Decentralize: A Privacy-First Arch Linux Operating System</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Sat, 14 Nov 2026 08:23:57 +0000</pubDate>
      <link>https://dev.to/snigdhaos/introducing-snigdha-os-decentralize-a-privacy-first-arch-linux-operating-system-45a4</link>
      <guid>https://dev.to/snigdhaos/introducing-snigdha-os-decentralize-a-privacy-first-arch-linux-operating-system-45a4</guid>
      <description>&lt;p&gt;What if your operating system was designed to forget by default?&lt;/p&gt;

&lt;p&gt;Most conventional operating systems are designed around persistence. They remember your files, application history, caches, configurations, network activity, and previous sessions. This is convenient for everyday computing, but there are situations where leaving less information behind is a fundamental requirement.&lt;/p&gt;

&lt;p&gt;Privacy should not depend entirely on individual application settings. It should be considered at the operating system level.&lt;/p&gt;

&lt;p&gt;Today, we're excited to introduce Snigdha OS Decentralize, a new initiative from the Snigdha OS project focused on building a privacy-first, security-oriented Linux operating system.&lt;/p&gt;

&lt;p&gt;Our goal is ambitious: develop an Arch Linux-based live operating system that combines amnesic computing, fail-closed network privacy, encrypted persistence, application isolation, and verifiable software supply chains into one integrated environment.&lt;/p&gt;

&lt;p&gt;And we've just published our first public release candidate.&lt;/p&gt;

&lt;p&gt;Welcome to Snigdha OS Decentralize.&lt;/p&gt;

&lt;p&gt;What is Snigdha OS Decentralize?&lt;/p&gt;

&lt;p&gt;Snigdha OS Decentralize is an independent Arch Linux-based live operating system designed around privacy, anonymity, and security-conscious computing.&lt;/p&gt;

&lt;p&gt;It isn't simply another Arch Linux distribution with a different desktop theme and a collection of preinstalled applications.&lt;/p&gt;

&lt;p&gt;We are building an integrated security architecture where the operating system itself participates in enforcing privacy boundaries.&lt;/p&gt;

&lt;p&gt;The project brings together several major subsystems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Snigdha Amnesia: Volatile, RAM-backed operating system sessions.&lt;/li&gt;
&lt;li&gt;Snigdha NetGuard: System-wide Tor traffic enforcement and fail-closed networking.&lt;/li&gt;
&lt;li&gt;Snigdha Persistence: Optional encrypted storage using LUKS2 and Argon2id.&lt;/li&gt;
&lt;li&gt;Snigdha Isolation: Application confinement using Bubblewrap, AppArmor, seccomp, and D-Bus filtering.&lt;/li&gt;
&lt;li&gt;Snigdha Security Center: A centralized interface for system security management.&lt;/li&gt;
&lt;li&gt;Snigdha Penetration Center: A curated environment for authorized security testing.&lt;/li&gt;
&lt;li&gt;Verified Boot and Supply Chain: Cryptographic boot integrity and verifiable release artifacts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These components are designed to work together rather than operate as unrelated applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Amnesia: An operating system designed to forget&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Snigdha Amnesia is one of the most important components of this project.&lt;/p&gt;

&lt;p&gt;The fundamental idea is simple: the default live session should not leave normal operating system changes behind after shutdown.&lt;/p&gt;

&lt;p&gt;Instead of allowing the writable root filesystem to modify the underlying storage directly, Snigdha OS uses a read-only system image with a volatile OverlayFS upper layer backed by RAM.&lt;/p&gt;

&lt;p&gt;The architecture looks conceptually like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             SNIGDHA AMNESIA

        Read-only system image
                 |
                 v
             OverlayFS
                 |
         +-------+-------+
         |               |
         v               v
   Read-only layer   Writable layer
      (EROFS)         (RAM / tmpfs)
                         |
                         v
                   Live session
                         |
                         v
                   System shutdown
                         |
                         v
              Volatile session discarded
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This means ordinary session changes, application caches, temporary files, and user configuration changes are intended to disappear when the system shuts down.&lt;/p&gt;

&lt;p&gt;The architecture also includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAM-backed volatile filesystem layers.&lt;/li&gt;
&lt;li&gt;Disabled swap and hibernation.&lt;/li&gt;
&lt;li&gt;Protection against unintended internal disk mounting.&lt;/li&gt;
&lt;li&gt;Early-boot checks for critical filesystem invariants.&lt;/li&gt;
&lt;li&gt;Shutdown-time memory sanitization measures.&lt;/li&gt;
&lt;li&gt;A watchdog mechanism for removable-media events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amnesia is not just a cleanup script. It is integrated into the boot process, initramfs, filesystem layout, system services, and shutdown lifecycle.&lt;/p&gt;

&lt;p&gt;The objective is to make session volatility a system-level property.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;NetGuard: Network privacy enforced at the kernel level&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Installing Tor Browser is not equivalent to protecting the entire operating system's network traffic.&lt;/p&gt;

&lt;p&gt;A terminal application, background daemon, package manager, or another application could still attempt to connect directly to the internet.&lt;/p&gt;

&lt;p&gt;This is the problem Snigdha NetGuard is designed to address.&lt;/p&gt;

&lt;p&gt;NetGuard uses Linux nftables rules to enforce a Tor-oriented networking policy across the operating system.&lt;/p&gt;

&lt;p&gt;Its core principle:&lt;/p&gt;

&lt;p&gt;Applications should either use the approved Tor network path or have their traffic blocked.&lt;/p&gt;

&lt;p&gt;The architecture includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transparent TCP redirection through Tor.&lt;/li&gt;
&lt;li&gt;Dedicated DNS handling.&lt;/li&gt;
&lt;li&gt;nftables-based network enforcement.&lt;/li&gt;
&lt;li&gt;Fail-closed behavior when Tor becomes unavailable.&lt;/li&gt;
&lt;li&gt;IPv6 and UDP leakage controls.&lt;/li&gt;
&lt;li&gt;Tor circuit isolation for different classes of applications.&lt;/li&gt;
&lt;li&gt;Secure time synchronization over Tor-routed connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are also integrating support for Tor bridges and pluggable transports.&lt;/p&gt;

&lt;p&gt;Depending on the installed transport clients, the system can support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard Tor bridges.&lt;/li&gt;
&lt;li&gt;obfs4.&lt;/li&gt;
&lt;li&gt;Snowflake.&lt;/li&gt;
&lt;li&gt;WebTunnel.&lt;/li&gt;
&lt;li&gt;Additional runtime-detected transports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users can explicitly control the Tor connection lifecycle through the desktop interface and command-line tooling.&lt;/p&gt;

&lt;p&gt;An important design decision is that network connectivity should not silently fall back to ordinary direct internet access when Tor fails.&lt;/p&gt;

&lt;p&gt;When the network security boundary is unavailable, the intended behavior is to block traffic rather than silently weaken the privacy configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Encrypted persistence: Keep what matters, forget everything else&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A completely volatile operating system is useful, but users sometimes need to retain selected information across sessions.&lt;/p&gt;

&lt;p&gt;That's why we developed Snigdha Persistence.&lt;/p&gt;

&lt;p&gt;Instead of making the entire operating system persistent, we provide an optional encrypted storage mechanism based on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LUKS2.&lt;/li&gt;
&lt;li&gt;AES-XTS encryption.&lt;/li&gt;
&lt;li&gt;Argon2id key derivation.&lt;/li&gt;
&lt;li&gt;Selective persistence mounts.&lt;/li&gt;
&lt;li&gt;Encrypted header backups.&lt;/li&gt;
&lt;li&gt;Recovery and lifecycle management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users can selectively preserve data such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Personal documents.&lt;/li&gt;
&lt;li&gt;SSH identities.&lt;/li&gt;
&lt;li&gt;GnuPG keyrings.&lt;/li&gt;
&lt;li&gt;Application configurations.&lt;/li&gt;
&lt;li&gt;Authorized security-testing configurations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rest of the operating system can remain volatile.&lt;/p&gt;

&lt;p&gt;We consider this distinction important. Persistence should be an explicit decision, not an unavoidable default.&lt;/p&gt;

&lt;p&gt;There is also an important security consideration: persistence protects stored data while locked, but it does not protect unlocked files from a compromised active session. Persisting long-term identities can also make sessions more linkable.&lt;/p&gt;

&lt;p&gt;Our documentation addresses these operational boundaries rather than presenting encryption as a universal security solution.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Application isolation and sandboxing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Application isolation is another major part of our security architecture.&lt;/p&gt;

&lt;p&gt;Traditional Linux permissions alone are not always sufficient when dealing with untrusted applications.&lt;/p&gt;

&lt;p&gt;Snigdha Isolation combines several Linux security mechanisms:&lt;/p&gt;

&lt;p&gt;Technology| Responsibility&lt;br&gt;
Bubblewrap| Namespaces and application sandboxing&lt;br&gt;
AppArmor| Mandatory access control&lt;br&gt;
seccomp-BPF| System-call filtering&lt;br&gt;
xdg-dbus-proxy| D-Bus interface filtering&lt;br&gt;
systemd hardening| Service-level restrictions&lt;/p&gt;

&lt;p&gt;Applications can receive restricted filesystem views, isolated process namespaces, limited system interfaces, and controlled network access.&lt;/p&gt;

&lt;p&gt;The objective is to reduce the damage an application can cause if it becomes compromised.&lt;/p&gt;

&lt;p&gt;We also want to be transparent about the current desktop architecture.&lt;/p&gt;

&lt;p&gt;The present i3wm edition uses X11. X11 has an inherent shared-display trust model, meaning sandboxed graphical applications that access the host display can potentially observe or interact with other windows.&lt;/p&gt;

&lt;p&gt;Filesystem and process sandboxing do not eliminate this limitation. We document it explicitly rather than claiming complete graphical application isolation.&lt;/p&gt;

&lt;p&gt;Security engineering requires acknowledging what a system cannot currently protect against.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verified boot and software supply-chain integrity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A security-focused operating system should not only consider what happens after boot.&lt;/p&gt;

&lt;p&gt;It should also consider whether the system being booted can be trusted.&lt;/p&gt;

&lt;p&gt;Snigdha OS integrates multiple layers of boot and release integrity:&lt;/p&gt;

&lt;p&gt;Unified Kernel Images (UKI)&lt;/p&gt;

&lt;p&gt;The kernel, initramfs, and boot configuration are packaged into a unified boot artifact designed for cryptographic verification.&lt;/p&gt;

&lt;p&gt;UEFI Secure Boot&lt;/p&gt;

&lt;p&gt;Signed boot artifacts establish a cryptographic trust relationship during the boot process.&lt;/p&gt;

&lt;p&gt;dm-verity&lt;/p&gt;

&lt;p&gt;A Merkle-tree-based integrity mechanism protects the read-only root filesystem against unauthorized modifications.&lt;/p&gt;

&lt;p&gt;Software Bill of Materials (SBOM)&lt;/p&gt;

&lt;p&gt;Release artifacts include an SPDX 2.3 software bill of materials describing packaged software components.&lt;/p&gt;

&lt;p&gt;Build provenance&lt;/p&gt;

&lt;p&gt;We include SLSA v1.0 / in-toto provenance artifacts to improve build traceability.&lt;/p&gt;

&lt;p&gt;OpenPGP signatures&lt;/p&gt;

&lt;p&gt;Release artifacts and associated verification metadata are accompanied by cryptographic signatures.&lt;/p&gt;

&lt;p&gt;Our objective is to make release integrity independently verifiable instead of asking users to blindly trust a download link.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A desktop designed around productivity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Security doesn't mean sacrificing usability.&lt;/p&gt;

&lt;p&gt;Snigdha OS currently uses a lightweight, keyboard-driven i3wm desktop environment with the Everblush visual palette.&lt;/p&gt;

&lt;p&gt;The desktop includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;i3 window management.&lt;/li&gt;
&lt;li&gt;Picom compositor.&lt;/li&gt;
&lt;li&gt;Polybar.&lt;/li&gt;
&lt;li&gt;Rofi application launcher.&lt;/li&gt;
&lt;li&gt;Kitty and Alacritty terminals.&lt;/li&gt;
&lt;li&gt;Dunst notifications.&lt;/li&gt;
&lt;li&gt;Thunar file manager.&lt;/li&gt;
&lt;li&gt;Native GTK4 security-management interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have also integrated dedicated shortcuts for important system components, making it possible to manage security-related operations without navigating through multiple unrelated applications.&lt;/p&gt;

&lt;p&gt;Two particularly important applications are:&lt;/p&gt;

&lt;p&gt;Snigdha Security Center&lt;/p&gt;

&lt;p&gt;A centralized interface for monitoring and managing important system security components.&lt;/p&gt;

&lt;p&gt;Snigdha Penetration Center&lt;/p&gt;

&lt;p&gt;A curated environment for security auditing and authorized penetration-testing workflows.&lt;/p&gt;

&lt;p&gt;The Penetration Center includes a categorized security-tool ecosystem with documentation and ethical usage considerations.&lt;/p&gt;

&lt;p&gt;We want security management to feel like a coherent part of the operating system rather than a collection of disconnected scripts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Built on Arch Linux, with an independent architecture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why Arch Linux?&lt;/p&gt;

&lt;p&gt;We wanted a distribution foundation that gives us control over packages, system configuration, kernel integration, and the overall build process.&lt;/p&gt;

&lt;p&gt;ArchISO provides the foundation for building the live image, while our own engineering work handles the privacy and security subsystems.&lt;/p&gt;

&lt;p&gt;The project uses a combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bash for system integration and build orchestration.&lt;/li&gt;
&lt;li&gt;Python for selected system services and tooling.&lt;/li&gt;
&lt;li&gt;Rust for native system applications and security-related components.&lt;/li&gt;
&lt;li&gt;GTK4 for desktop interfaces.&lt;/li&gt;
&lt;li&gt;systemd for service lifecycle management.&lt;/li&gt;
&lt;li&gt;nftables for network enforcement.&lt;/li&gt;
&lt;li&gt;Linux namespaces and security mechanisms for confinement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are not simply maintaining a collection of desktop customizations.&lt;/p&gt;

&lt;p&gt;We are developing an independent operating system architecture and the applications required to manage it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first public Release Candidate is available&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We have published Snigdha OS Decentralized 2026.11.13-rc1.&lt;/p&gt;

&lt;p&gt;Release information&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Release: "2026.11.13-rc1"&lt;/li&gt;
&lt;li&gt;Tag: "v2026.11.13-rc1"&lt;/li&gt;
&lt;li&gt;Architecture: "x86_64"&lt;/li&gt;
&lt;li&gt;Release channel: Candidate&lt;/li&gt;
&lt;li&gt;ISO size: Approximately 1.4 GiB&lt;/li&gt;
&lt;li&gt;License: GPL-3.0-or-later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Download and explore:&lt;/p&gt;

&lt;p&gt;"Download Snigdha OS Decentralize — Release Candidate 1" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso/-/releases/v2026.11.13-rc1" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso/-/releases/v2026.11.13-rc1&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;"Explore the ISO repository" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Verify before booting&lt;/p&gt;

&lt;p&gt;Please do not skip release verification.&lt;/p&gt;

&lt;p&gt;Download the ISO, checksum manifests, signing key, and detached signatures from the official release.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;h2&gt;
  
  
  Import the release signing key
&lt;/h2&gt;

&lt;p&gt;gpg --import release-signing-key.asc&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify the checksum manifest signature
&lt;/h1&gt;

&lt;p&gt;gpg --verify SHA256SUMS.sig SHA256SUMS&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify the ISO checksum
&lt;/h1&gt;

&lt;p&gt;sha256sum -c SHA256SUMS --ignore-missing&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify the ISO's detached signature
&lt;/h1&gt;

&lt;p&gt;gpg --verify \&lt;br&gt;
  snigdhaos-decentralize-2026.11.13-x86_64.iso.sig \&lt;br&gt;
  snigdhaos-decentralize-2026.11.13-x86_64.iso&lt;/p&gt;

&lt;p&gt;Before trusting the signing key, independently confirm its published fingerprint:&lt;/p&gt;

&lt;p&gt;2BDB 00AE 6CAB EF0E 4052&lt;br&gt;
0A8F 553F D42B 02A8 211A&lt;/p&gt;

&lt;p&gt;For complete instructions, consult the "official release verification guide" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso/-/blob/v2026.11.13-rc1/docs/getting-started/RELEASE-VERIFICATION.md" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso/-/blob/v2026.11.13-rc1/docs/getting-started/RELEASE-VERIFICATION.md&lt;/a&gt;).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Transparency: What this release is, and what it isn't&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We want to be very clear about the current development status.&lt;/p&gt;

&lt;p&gt;Snigdha OS Decentralized is currently a Release Candidate, not a stable production release.&lt;/p&gt;

&lt;p&gt;Our internal engineering and verification milestones have been completed to the project's current release-candidate requirements. However, the project's release governance explicitly blocks stable promotion until an independent, accredited third-party security audit has been completed.&lt;/p&gt;

&lt;p&gt;There are also documented security limitations, including the shared X11 display boundary and risks associated with unlocked persistent storage.&lt;/p&gt;

&lt;p&gt;We encourage developers, Linux enthusiasts, privacy researchers, and security professionals to evaluate the project, inspect its source code, and provide feedback.&lt;/p&gt;

&lt;p&gt;However, this release candidate should not be treated as an independently audited anonymity solution or relied upon for high-risk operational security.&lt;/p&gt;

&lt;p&gt;We believe being transparent about security limitations is more valuable than making impressive but unverified marketing claims.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We want the open-source community involved&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Snigdha OS Decentralize is an open-source engineering effort.&lt;/p&gt;

&lt;p&gt;We don't want this project to develop in isolation.&lt;/p&gt;

&lt;p&gt;There are several areas where community contributions can make a meaningful difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux kernel and initramfs engineering.&lt;/li&gt;
&lt;li&gt;Tor integration and network security.&lt;/li&gt;
&lt;li&gt;Rust system applications.&lt;/li&gt;
&lt;li&gt;Linux application sandboxing.&lt;/li&gt;
&lt;li&gt;LUKS2 and encrypted storage management.&lt;/li&gt;
&lt;li&gt;Secure boot and boot-chain verification.&lt;/li&gt;
&lt;li&gt;Hardware compatibility testing.&lt;/li&gt;
&lt;li&gt;Documentation and reproducible builds.&lt;/li&gt;
&lt;li&gt;Security reviews and responsible vulnerability disclosure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can start by exploring our repositories and reading the project documentation.&lt;/p&gt;

&lt;p&gt;Project resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Snigdha OS Decentralize — GitLab Group" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"ISO and system architecture" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"Documentation repository" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/docs" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/docs&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"Official website" (&lt;a href="https://decentralize.snigdhaos.org" rel="noopener noreferrer"&gt;https://decentralize.snigdhaos.org&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"Documentation portal" (&lt;a href="https://decentralize.snigdhaos.org/docs" rel="noopener noreferrer"&gt;https://decentralize.snigdhaos.org/docs&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To build the operating system from source on an Arch Linux host:&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso.git" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;cd iso&lt;/p&gt;

&lt;h1&gt;
  
  
  Validate the build environment
&lt;/h1&gt;

&lt;p&gt;make check-host&lt;/p&gt;

&lt;h1&gt;
  
  
  Execute the automated test suites
&lt;/h1&gt;

&lt;p&gt;make test&lt;/p&gt;

&lt;h1&gt;
  
  
  Build the live ISO
&lt;/h1&gt;

&lt;p&gt;make build&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify release outputs
&lt;/h1&gt;

&lt;p&gt;make release-verify&lt;/p&gt;

&lt;p&gt;Please read the contribution guidelines before submitting changes:&lt;/p&gt;

&lt;p&gt;"Contributing to Snigdha OS Decentralize" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize/iso/-/blob/v2026.11.13-rc1/CONTRIBUTING.md" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize/iso/-/blob/v2026.11.13-rc1/CONTRIBUTING.md&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;What's next?&lt;/p&gt;

&lt;p&gt;The Release Candidate is an important milestone, but it is not the end of the project.&lt;/p&gt;

&lt;p&gt;Our continued development priorities include refining the security architecture, expanding hardware compatibility, improving the desktop experience, strengthening application isolation, improving release infrastructure, and preparing for independent external security evaluation.&lt;/p&gt;

&lt;p&gt;We also want to keep growing the surrounding Snigdha OS ecosystem, including its documentation, system utilities, and developer tooling.&lt;/p&gt;

&lt;p&gt;Our long-term objective is to build an operating system where privacy and security are architectural considerations rather than optional application-level features.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;Privacy-focused operating systems are not built by adding a browser, a VPN, and a few security tools to an existing desktop.&lt;/p&gt;

&lt;p&gt;They require careful decisions throughout the entire system: from boot and memory management to network routing, application execution, storage, and software distribution.&lt;/p&gt;

&lt;p&gt;That is the direction we are taking with Snigdha OS Decentralize.&lt;/p&gt;

&lt;p&gt;We are building it openly, documenting the architecture, publishing verifiable release artifacts, and inviting the community to participate.&lt;/p&gt;

&lt;p&gt;The first public release candidate is available. The next chapter is about making the architecture stronger through testing, review, and collaboration.&lt;/p&gt;

&lt;p&gt;Explore the project, test it in a controlled environment, inspect the code, and tell us what you think.&lt;/p&gt;

&lt;p&gt;Let's build a more privacy-conscious Linux ecosystem together.&lt;/p&gt;

&lt;p&gt;— Eshan Roy&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RiO&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;"GitLab" (&lt;a href="https://gitlab.com/SnigdhaOS/decentralize" rel="noopener noreferrer"&gt;https://gitlab.com/SnigdhaOS/decentralize&lt;/a&gt;) · "Website" (&lt;a href="https://decentralize.snigdhaos.org" rel="noopener noreferrer"&gt;https://decentralize.snigdhaos.org&lt;/a&gt;) · "Documentation" (&lt;a href="https://decentralize.snigdhaos.org/docs" rel="noopener noreferrer"&gt;https://decentralize.snigdhaos.org/docs&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>privacy</category>
      <category>archlinux</category>
    </item>
    <item>
      <title>I’m Building an Autonomous AI Software Engineer in Rust. Here's What Happens Beyond Code Generation.</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Sun, 08 Nov 2026 06:59:34 +0000</pubDate>
      <link>https://dev.to/eshanized/im-building-an-autonomous-ai-software-engineer-in-rust-heres-what-happens-beyond-code-generation-4bj9</link>
      <guid>https://dev.to/eshanized/im-building-an-autonomous-ai-software-engineer-in-rust-heres-what-happens-beyond-code-generation-4bj9</guid>
      <description>&lt;p&gt;An AI coding agent shouldn't just generate code. It should understand the task, plan the implementation, execute safely, verify its work, and recover when things go wrong.&lt;/p&gt;

&lt;p&gt;We've all seen the evolution of AI coding tools.&lt;/p&gt;

&lt;p&gt;First, autocomplete.&lt;/p&gt;

&lt;p&gt;Then, conversational coding assistants.&lt;/p&gt;

&lt;p&gt;Now, autonomous agents that can read repositories, modify files, execute commands, and orchestrate entire development workflows.&lt;/p&gt;

&lt;p&gt;But there's a problem I keep coming back to:&lt;/p&gt;

&lt;p&gt;What happens when an AI agent makes a mistake with access to your actual development environment?&lt;/p&gt;

&lt;p&gt;What happens when two agents modify the same files? What happens when a process crashes halfway through a task? What happens when a model-generated command attempts to access something it shouldn't?&lt;/p&gt;

&lt;p&gt;I wanted to approach these problems from a systems engineering perspective.&lt;/p&gt;

&lt;p&gt;That's why I'm building "M31A" (&lt;a href="https://github.com/eshanized/M31A" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It's an autonomous software-engineering runtime written in Rust, designed around controlled execution, policy enforcement, workflow orchestration, and verifiable outcomes.&lt;/p&gt;

&lt;p&gt;This article explores some of the engineering decisions behind it.&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;The problem with simply wrapping an LLM&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A typical coding-agent architecture looks something like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send context to an LLM.&lt;/li&gt;
&lt;li&gt;Receive a tool call.&lt;/li&gt;
&lt;li&gt;Execute the tool.&lt;/li&gt;
&lt;li&gt;Return the result.&lt;/li&gt;
&lt;li&gt;Repeat until the model decides it's finished.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This works for simple tasks.&lt;/p&gt;

&lt;p&gt;But it becomes considerably more complicated when you introduce:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parallel agents.&lt;/li&gt;
&lt;li&gt;Long-running engineering tasks.&lt;/li&gt;
&lt;li&gt;Concurrent file modifications.&lt;/li&gt;
&lt;li&gt;Persistent execution state.&lt;/li&gt;
&lt;li&gt;Human approval requirements.&lt;/li&gt;
&lt;li&gt;Crash recovery.&lt;/li&gt;
&lt;li&gt;Security boundaries.&lt;/li&gt;
&lt;li&gt;Reliable verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An LLM's decision to finish isn't proof that the task is complete.&lt;/p&gt;

&lt;p&gt;M31A approaches this differently.&lt;/p&gt;

&lt;p&gt;The model is responsible for reasoning and proposing actions. The runtime is responsible for enforcing execution rules and maintaining system integrity.&lt;/p&gt;

&lt;p&gt;The distinction is important.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A workflow engine instead of an infinite agent loop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;M31A uses structured workflow orchestration rather than relying exclusively on an unstructured tool-calling loop.&lt;/p&gt;

&lt;p&gt;The architecture is built around typed tasks and a Directed Acyclic Graph (DAG).&lt;/p&gt;

&lt;p&gt;A workflow can contain different task categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analysis&lt;/li&gt;
&lt;li&gt;Implementation&lt;/li&gt;
&lt;li&gt;Speculative execution&lt;/li&gt;
&lt;li&gt;Integration&lt;/li&gt;
&lt;li&gt;Verification&lt;/li&gt;
&lt;li&gt;Delivery&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Independent tasks can execute in parallel, while dependencies determine execution order.&lt;/p&gt;

&lt;p&gt;Take a look at the implementation:&lt;/p&gt;

&lt;p&gt;Source: "AUTONOMOUS_WORKFLOW_ARCHITECTURE.md" (&lt;a href="https://github.com/eshanized/M31A/blob/master/docs/architecture/AUTONOMOUS_WORKFLOW_ARCHITECTURE.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/docs/architecture/AUTONOMOUS_WORKFLOW_ARCHITECTURE.md&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The architecture includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DAG validation using Kahn's algorithm.&lt;/li&gt;
&lt;li&gt;Topological execution waves.&lt;/li&gt;
&lt;li&gt;Write-path conflict detection.&lt;/li&gt;
&lt;li&gt;Bounded worker concurrency.&lt;/li&gt;
&lt;li&gt;Durable task state.&lt;/li&gt;
&lt;li&gt;Worker leases and recovery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One particularly interesting implementation is:&lt;/p&gt;

&lt;p&gt;"workflow_store.rs" (&lt;a href="https://github.com/eshanized/M31A/blob/master/crates/m31a-storage/src/workflow_store.rs" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/crates/m31a-storage/src/workflow_store.rs&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The "WorkflowStore::claim_ready_task" operation handles task claiming with dependency validation and worker lease semantics.&lt;/p&gt;

&lt;p&gt;Why does that matter?&lt;/p&gt;

&lt;p&gt;Imagine two workers attempting to execute the same task.&lt;/p&gt;

&lt;p&gt;Or imagine a worker crashing and another worker taking over.&lt;/p&gt;

&lt;p&gt;A simple in-memory task queue isn't sufficient for these scenarios.&lt;/p&gt;

&lt;p&gt;M31A uses durable state and worker fencing to prevent stale workers from overwriting newer execution results.&lt;/p&gt;

&lt;p&gt;This is the kind of infrastructure that becomes important when an agent needs to work beyond a single short interaction.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Security is part of the runtime, not an optional feature&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is probably the area I've spent the most architectural attention on.&lt;/p&gt;

&lt;p&gt;Giving an AI agent shell access is powerful.&lt;/p&gt;

&lt;p&gt;It's also dangerous.&lt;/p&gt;

&lt;p&gt;A permission prompt alone isn't a complete security architecture.&lt;/p&gt;

&lt;p&gt;M31A implements an execution-policy subsystem with an 11-stage policy gate and a decision model covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"ALLOW"&lt;/li&gt;
&lt;li&gt;"DENY"&lt;/li&gt;
&lt;li&gt;"ASK"&lt;/li&gt;
&lt;li&gt;"ESCALATE"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Policy resolution also incorporates precedence rules and fail-closed approval semantics.&lt;/p&gt;

&lt;p&gt;Relevant implementation and documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Execution Policy" (&lt;a href="https://github.com/eshanized/M31A/tree/master/crates/m31a-execpolicy" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/tree/master/crates/m31a-execpolicy&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"Sandbox Security Architecture" (&lt;a href="https://github.com/eshanized/M31A/blob/master/docs/SANDBOX_SECURITY.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/docs/SANDBOX_SECURITY.md&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"CHANGELOG.md" (&lt;a href="https://github.com/eshanized/M31A/blob/master/CHANGELOG.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/CHANGELOG.md&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OS-level sandboxing&lt;/p&gt;

&lt;p&gt;M31A also has a dedicated sandbox subsystem.&lt;/p&gt;

&lt;p&gt;On Linux, it supports Bubblewrap isolation and Landlock-based filesystem restrictions.&lt;/p&gt;

&lt;p&gt;The sandbox runner is implemented here:&lt;/p&gt;

&lt;p&gt;"crates/m31a-sandbox/src/runner.rs" (&lt;a href="https://github.com/eshanized/M31A/blob/master/crates/m31a-sandbox/src/runner.rs" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/crates/m31a-sandbox/src/runner.rs&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;One interesting design decision is the use of a typed command representation:&lt;/p&gt;

&lt;p&gt;pub enum SandboxCommand {&lt;br&gt;
    Shell(String),&lt;br&gt;
    Exec {&lt;br&gt;
        program: String,&lt;br&gt;
        args: Vec,&lt;br&gt;
    },&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Why not simply accept a command string everywhere?&lt;/p&gt;

&lt;p&gt;Because a shell command and a direct executable invocation have different semantics.&lt;/p&gt;

&lt;p&gt;Keeping them distinct helps avoid argument-splitting and quoting problems.&lt;/p&gt;

&lt;p&gt;The sandbox also uses platform-specific isolation backends and enforces failure behavior when required confinement is unavailable.&lt;/p&gt;

&lt;p&gt;Additional implementation:&lt;/p&gt;

&lt;p&gt;"landlock.rs" (&lt;a href="https://github.com/eshanized/M31A/blob/master/crates/m31a-sandbox/src/landlock.rs" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/crates/m31a-sandbox/src/landlock.rs&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;My philosophy here is straightforward:&lt;/p&gt;

&lt;p&gt;If the runtime cannot establish the security boundary required by a policy, it shouldn't silently pretend that execution is safe.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Crash recovery and durable execution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's another problem that doesn't receive enough attention in AI coding tools.&lt;/p&gt;

&lt;p&gt;What happens when an agent crashes halfway through a workflow?&lt;/p&gt;

&lt;p&gt;Suppose an agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creates a task plan.&lt;/li&gt;
&lt;li&gt;Modifies three files.&lt;/li&gt;
&lt;li&gt;Runs tests.&lt;/li&gt;
&lt;li&gt;Crashes before recording the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Should the entire workflow start again?&lt;/p&gt;

&lt;p&gt;Should another worker repeat completed operations?&lt;/p&gt;

&lt;p&gt;Could a stale worker overwrite newer results?&lt;/p&gt;

&lt;p&gt;These are distributed-systems problems, even when everything runs on a developer's local machine.&lt;/p&gt;

&lt;p&gt;M31A addresses these through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQLite-backed workflow persistence.&lt;/li&gt;
&lt;li&gt;Worker leases.&lt;/li&gt;
&lt;li&gt;Lease renewal.&lt;/li&gt;
&lt;li&gt;Stale task reconciliation.&lt;/li&gt;
&lt;li&gt;Optimistic concurrency checks.&lt;/li&gt;
&lt;li&gt;Durable workflow events.&lt;/li&gt;
&lt;li&gt;Content-addressed artifacts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The implementation is available in:&lt;/p&gt;

&lt;p&gt;"workflow_store.rs" (&lt;a href="https://github.com/eshanized/M31A/blob/master/crates/m31a-storage/src/workflow_store.rs" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/crates/m31a-storage/src/workflow_store.rs&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The architectural explanation is documented in:&lt;/p&gt;

&lt;p&gt;"AUTONOMOUS_WORKFLOW_ARCHITECTURE.md" (&lt;a href="https://github.com/eshanized/M31A/blob/master/docs/architecture/AUTONOMOUS_WORKFLOW_ARCHITECTURE.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/docs/architecture/AUTONOMOUS_WORKFLOW_ARCHITECTURE.md&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The objective is to make long-running agent execution recoverable and auditable instead of treating every interruption as a completely new session.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It isn't tied to a single interface&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I don't want the runtime to become inseparable from its terminal interface.&lt;/p&gt;

&lt;p&gt;M31A exposes an App Server based on JSON-RPC 2.0.&lt;/p&gt;

&lt;p&gt;This creates a separation between the execution engine and its clients.&lt;/p&gt;

&lt;p&gt;The protocol supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thread and session management.&lt;/li&gt;
&lt;li&gt;Turn execution.&lt;/li&gt;
&lt;li&gt;Streaming notifications.&lt;/li&gt;
&lt;li&gt;Tool lifecycle events.&lt;/li&gt;
&lt;li&gt;Human approval callbacks.&lt;/li&gt;
&lt;li&gt;Checkpoint operations.&lt;/li&gt;
&lt;li&gt;Agent coordination.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Architecture and protocol:&lt;/p&gt;

&lt;p&gt;"docs/APP_SERVER_RPC.md" (&lt;a href="https://github.com/eshanized/M31A/blob/master/docs/APP_SERVER_RPC.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/docs/APP_SERVER_RPC.md&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The longer-term architectural direction is to make the same underlying runtime accessible through different clients, rather than implementing separate agent engines for every interface.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why Rust?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rust wasn't selected simply because it's fashionable.&lt;/p&gt;

&lt;p&gt;M31A has several requirements that make systems-level engineering particularly relevant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explicit ownership and resource management.&lt;/li&gt;
&lt;li&gt;Strong type boundaries.&lt;/li&gt;
&lt;li&gt;Concurrent execution.&lt;/li&gt;
&lt;li&gt;Process isolation.&lt;/li&gt;
&lt;li&gt;Predictable failure handling.&lt;/li&gt;
&lt;li&gt;Reliable persistence.&lt;/li&gt;
&lt;li&gt;Maintainable subsystem boundaries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository is organized as a multi-crate Cargo workspace.&lt;/p&gt;

&lt;p&gt;Instead of concentrating every responsibility in one enormous application module, subsystems have explicit boundaries.&lt;/p&gt;

&lt;p&gt;You can explore the workspace here:&lt;/p&gt;

&lt;p&gt;"Explore the M31A crates" (&lt;a href="https://github.com/eshanized/M31A/tree/master/crates" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/tree/master/crates&lt;/a&gt;)&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;What I'm trying to build&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I don't think the next generation of coding agents should be judged exclusively by how impressive their generated code looks.&lt;/p&gt;

&lt;p&gt;We should also ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can the agent explain what it changed?&lt;/li&gt;
&lt;li&gt;Can we constrain what it is allowed to execute?&lt;/li&gt;
&lt;li&gt;Can we recover after an unexpected crash?&lt;/li&gt;
&lt;li&gt;Can multiple agents collaborate without corrupting shared state?&lt;/li&gt;
&lt;li&gt;Can we verify that the requested work was actually completed?&lt;/li&gt;
&lt;li&gt;Can developers inspect the decisions and execution history?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the questions driving M31A.&lt;/p&gt;

&lt;p&gt;It's an ongoing engineering project, and I don't want to pretend that every architectural challenge has been solved.&lt;/p&gt;

&lt;p&gt;I'd rather build, test, expose the implementation, and invite people to challenge the design.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Explore the project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/eshanized/M31A" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're interested in the implementation, I'd particularly recommend exploring:&lt;/p&gt;

&lt;p&gt;Area| Source&lt;br&gt;
Workflow orchestration| "crates/m31a-agent-engine/"&lt;br&gt;
Execution policies| "crates/m31a-execpolicy/"&lt;br&gt;
Sandbox runtime| "crates/m31a-sandbox/"&lt;br&gt;
Workflow persistence| "crates/m31a-storage/"&lt;br&gt;
App Server| "crates/m31a-app-server/"&lt;br&gt;
Architecture documentation| "docs/architecture/"&lt;/p&gt;

&lt;p&gt;Contributions, architectural criticism, bug reports, and security feedback are welcome.&lt;/p&gt;




&lt;p&gt;Let's discuss something.&lt;/p&gt;

&lt;p&gt;I have three questions for developers building autonomous coding systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Execution security: Would you trust an AI coding agent with unrestricted shell access, or should every action pass through a runtime-enforced policy system?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Architecture: Do you think DAG-based workflow orchestration is a better foundation for long-running autonomous engineering tasks than a conventional agent loop?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verification: Should an AI coding agent be allowed to declare a task complete, or should completion always require independently verifiable evidence?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'd genuinely like to hear different engineering perspectives, especially from people building coding agents, developer infrastructure, and systems software.&lt;/p&gt;

&lt;p&gt;M31A is open source. Let's build better autonomous engineering systems together.&lt;/p&gt;

&lt;p&gt;— Eshan Roy&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/eshanized/M31A" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rust</category>
      <category>opensource</category>
      <category>agents</category>
    </item>
    <item>
      <title>Building an AI Agent That Learns from Its Mistakes: The Ledger System</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 22 Jun 2026 12:14:45 +0000</pubDate>
      <link>https://dev.to/eshanized/building-an-ai-agent-that-learns-from-its-mistakes-the-ledger-system-4op9</link>
      <guid>https://dev.to/eshanized/building-an-ai-agent-that-learns-from-its-mistakes-the-ledger-system-4op9</guid>
      <description>&lt;p&gt;Every time you start a new ChatGPT or Copilot session, it starts from zero. No memory of what worked yesterday, no idea which models performed best on your codebase, no record of which tasks failed and why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;M31A's cross-session learning ledger changes that.&lt;/strong&gt; Every session writes a structured record to a markdown file. Over time, the agent queries this ledger to learn from past sessions — which frameworks are common, what types of tasks fail, and how long things typically take.&lt;/p&gt;

&lt;p&gt;In this post, I'll show you how the ledger works, why markdown is the perfect storage format, and how this simple feedback loop creates compounding value.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: AI Agents with Amnesia
&lt;/h2&gt;

&lt;p&gt;Here's the typical experience with AI coding tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You spend 10 minutes explaining your project structure&lt;/li&gt;
&lt;li&gt;The agent generates code that doesn't match your patterns&lt;/li&gt;
&lt;li&gt;You correct it, it works&lt;/li&gt;
&lt;li&gt;Next session? Same dance from scratch&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agent never learns that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You prefer functional React components over class components&lt;/li&gt;
&lt;li&gt;Your Go services use &lt;code&gt;chi&lt;/code&gt; for routing, not &lt;code&gt;gorilla/mux&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Tasks involving database migrations always need extra verification&lt;/li&gt;
&lt;li&gt;Claude handles your codebase better than GPT-4 for refactoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Every session is a fresh start.&lt;/strong&gt; The knowledge you build up exists only in your head.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: A Structured Learning Record
&lt;/h2&gt;

&lt;p&gt;M31A solves this with a &lt;strong&gt;cross-session learning ledger&lt;/strong&gt; (&lt;code&gt;pkg/ledger/&lt;/code&gt;). After every session, the agent writes a structured record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Session    | Model              | Tasks | Failed | Cost  | Duration | Framework | Goal                    |
|------------|--------------------|-------|--------|-------|----------|-----------|-------------------------|
| a1b2c3d4   | claude-3.5-sonnet  | 5     | 1      | $0.12 | 8min     | react     | refactor auth middleware |
| e5f6g7h8   | gpt-4-turbo        | 3     | 0      | $0.08 | 4min     | go        | add rate limiting       |
| i9j0k1l2   | claude-3.5-sonnet  | 7     | 2      | $0.21 | 12min    | python    | implement celery tasks  |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't just logging — it's a &lt;strong&gt;feedback loop&lt;/strong&gt;. The agent can query this data to make better decisions in future sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Tracked
&lt;/h2&gt;

&lt;p&gt;The ledger captures seven key dimensions per session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/ledger.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;LedgerEntry&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;SessionID&lt;/span&gt;   &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Timestamp&lt;/span&gt;   &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Time&lt;/span&gt;
    &lt;span class="n"&gt;Model&lt;/span&gt;       &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Provider&lt;/span&gt;    &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;TaskCount&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;FailedTasks&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;CostEstimate&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;Duration&lt;/span&gt;    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;
    &lt;span class="n"&gt;ProjectType&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Framework&lt;/span&gt;   &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;GoalKeywords&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;FailureReasons&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Goal Keywords (with Stop-Word Filtering)
&lt;/h3&gt;

&lt;p&gt;The agent extracts keywords from your goal description, filtering out common stop words:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/keywords.go&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stopWords&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;"the"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"a"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"an"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"is"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"to"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"for"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"of"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"with"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c"&gt;// ... 100+ stop words&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;ExtractKeywords&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;goal&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fields&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ToLower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;goal&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;keywords&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;".,;:!?"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;stopWords&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;keywords&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keywords&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;keywords&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means "Refactor the authentication middleware to use JWT" becomes &lt;code&gt;["refactor", "authentication", "middleware", "jwt"]&lt;/code&gt; — the semantic core of your intent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Failure Tracking
&lt;/h3&gt;

&lt;p&gt;When tasks fail, the ledger records why:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;FailureSyntaxError&lt;/span&gt;    &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"syntax_error"&lt;/span&gt;
    &lt;span class="n"&gt;FailureTestFailure&lt;/span&gt;    &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"test_failure"&lt;/span&gt;
    &lt;span class="n"&gt;FailureTimeout&lt;/span&gt;        &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"timeout"&lt;/span&gt;
    &lt;span class="n"&gt;FailureDependency&lt;/span&gt;     &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"dependency_error"&lt;/span&gt;
    &lt;span class="n"&gt;FailureLLMRefusal&lt;/span&gt;     &lt;span class="n"&gt;FailureReason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"llm_refusal"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Over time, you can see patterns: "40% of my Python failures are test failures" or "Claude refuses to modify security-critical code."&lt;/p&gt;

&lt;h2&gt;
  
  
  Querying the Ledger
&lt;/h2&gt;

&lt;p&gt;The real power comes from querying historical data. M31A exposes ledger statistics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/ledger.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;LedgerStats&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;TotalSessions&lt;/span&gt;      &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;AvgTaskCount&lt;/span&gt;       &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;AvgCost&lt;/span&gt;            &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;AvgDurationMinutes&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;TotalFailedTasks&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;TopFailures&lt;/span&gt;        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;TopFrameworks&lt;/span&gt;       &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;ByProjectType&lt;/span&gt;      &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;ModelPerformance&lt;/span&gt;   &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;ModelStats&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;ModelStats&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Sessions&lt;/span&gt;    &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;AvgCost&lt;/span&gt;     &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;AvgDuration&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;FailureRate&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can run &lt;code&gt;/ledger stats&lt;/code&gt; in the TUI to see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📊 Ledger Statistics (12 sessions)

Models Used:
  claude-3.5-sonnet  8 sessions  $0.14 avg  2.3% failure rate
  gpt-4-turbo        4 sessions  $0.09 avg  5.1% failure rate

Top Frameworks:
  react      5 sessions
  go         4 sessions
  python     3 sessions

Average per Session:
  Tasks: 4.2  |  Cost: $0.11  |  Duration: 6.8min
  Failed Tasks: 0.3 (7.1% failure rate)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The insight&lt;/strong&gt;: Claude is more expensive but has half the failure rate on this codebase. For critical tasks, use Claude. For quick refactors, GPT-4 is fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Learning Loop in Action
&lt;/h2&gt;

&lt;p&gt;Here's a real scenario showing how the ledger creates value over time:&lt;/p&gt;

&lt;h3&gt;
  
  
  Session 1: First Contact
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goal: "Add rate limiting to the API gateway"
Model: gpt-4-turbo
Tasks: 3
Failed: 1 (test_failure)
Cost: $0.08
Duration: 5min
Framework: go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ledger records that GPT-4 failed a test on a Go project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Session 2: The Agent Adapts
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goal: "Implement request validation middleware"
Model: claude-3.5-sonnet  ← Agent chose Claude based on Session 1 failure
Tasks: 4
Failed: 0
Cost: $0.15
Duration: 7min
Framework: go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent learned: "GPT-4 had test failures on Go projects. Try Claude instead."&lt;/p&gt;

&lt;h3&gt;
  
  
  Session 3: Pattern Recognition
&lt;/h3&gt;

&lt;p&gt;After 10 sessions, the ledger shows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Go Projects:
  gpt-4-turbo:   3 sessions, 2 failures (test failures)
  claude-3.5:     7 sessions, 0 failures

Recommendation: Use Claude for Go projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;This isn't hard-coded logic.&lt;/strong&gt; It's emergent behavior from structured data collection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Markdown?
&lt;/h2&gt;

&lt;p&gt;I chose markdown tables over a database for several reasons:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Human Readability
&lt;/h3&gt;

&lt;p&gt;You can open &lt;code&gt;ledger.md&lt;/code&gt; in any editor and understand the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Session | Model | Tasks | Failed | Cost | Duration |
|---------|-------|-------|--------|------|----------|
| a1b2c3  | claude | 5    | 1      | $0.12| 8min     |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No SQL knowledge required. No special tools. Just text.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Git-Friendly
&lt;/h3&gt;

&lt;p&gt;The ledger lives in &lt;code&gt;.m31a/ledger.md&lt;/code&gt; and gets committed with your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; .m31a/ledger.md
a1b2c3d Session: refactor auth middleware &lt;span class="o"&gt;(&lt;/span&gt;claude-3.5, 5 tasks, &lt;span class="nv"&gt;$0&lt;/span&gt;.12&lt;span class="o"&gt;)&lt;/span&gt;
e5f6g7h Session: add rate limiting &lt;span class="o"&gt;(&lt;/span&gt;gpt-4, 3 tasks, &lt;span class="nv"&gt;$0&lt;/span&gt;.08&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see how your AI usage evolves over the project's lifetime.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Diffable
&lt;/h3&gt;

&lt;p&gt;When something changes, you see exactly what:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-| a1b2c3 | claude-3.5-sonnet | 5 | 1 | $0.12 | 8min | react |
&lt;/span&gt;&lt;span class="gi"&gt;+| a1b2c3 | claude-3.5-sonnet | 5 | 0 | $0.12 | 7min | react |
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The failure count dropped. The agent is learning.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Zero Dependencies
&lt;/h3&gt;

&lt;p&gt;No SQLite, no PostgreSQL, no ORMs. Just &lt;code&gt;bufio.Scanner&lt;/code&gt; and string splitting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/parser.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;ParseLedgerLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;LedgerEntry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fields&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"|"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrInvalidFormat&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;LedgerEntry&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;SessionID&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TrimSpace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
        &lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;      &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TrimSpace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
        &lt;span class="n"&gt;TaskCount&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
        &lt;span class="n"&gt;FailedTasks&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
        &lt;span class="c"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced: Model Performance Tracking
&lt;/h2&gt;

&lt;p&gt;The ledger tracks per-model statistics to answer: "Which model should I use for this task?"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/stats.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Ledger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ModelStats&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;ModelStats&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;ModelStats&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;entries&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sessions&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalCost&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CostEstimate&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalDuration&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FailedTasks&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalFailures&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Calculate averages&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AvgCost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalCost&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sessions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AvgDuration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalDuration&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sessions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FailureRate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TotalFailures&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sessions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent uses this data during the &lt;strong&gt;model selection phase&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User goal: "Refactor the payment processing module"

Agent analysis:
  - Task involves financial code (high complexity)
  - Past sessions show Claude has 0% failure rate on payment code
  - GPT-4 failed 2/3 times on similar tasks

Recommendation: claude-3.5-sonnet (higher cost, lower risk)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Implementation: The Write Path
&lt;/h2&gt;

&lt;p&gt;Writing ledger entries is simple but robust:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/writer.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Ledger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;WriteEntry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="n"&gt;LedgerEntry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unlock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c"&gt;// Open file in append mode&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OpenFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_APPEND&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_CREATE&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_WRONLY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0644&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"opening ledger: %w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c"&gt;// Format as markdown table row&lt;/span&gt;
    &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"| %s | %s | %d | %d | $%.2f | %s | %s | %s |&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SessionID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TaskCount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FailedTasks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CostEstimate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Second&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Framework&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GoalSummary&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WriteString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"writing entry: %w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key design decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Append-only&lt;/strong&gt;: Never modify past entries. History is immutable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic writes&lt;/strong&gt;: Open with &lt;code&gt;O_APPEND|O_CREATE&lt;/code&gt; to avoid race conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No locking at file level&lt;/strong&gt;: Use a mutex in memory for concurrent access.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Privacy Considerations
&lt;/h2&gt;

&lt;p&gt;The ledger stores &lt;strong&gt;metadata&lt;/strong&gt;, not code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Model name, task count, cost, duration&lt;/li&gt;
&lt;li&gt;✅ Framework type (react, go, python)&lt;/li&gt;
&lt;li&gt;✅ Goal keywords (filtered, not full text)&lt;/li&gt;
&lt;li&gt;✅ Failure categories (not stack traces)&lt;/li&gt;
&lt;li&gt;❌ Actual code changes&lt;/li&gt;
&lt;li&gt;❌ Full goal descriptions&lt;/li&gt;
&lt;li&gt;❌ API keys or tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your code never touches the ledger. Only operational metadata is recorded.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Compounding Effect
&lt;/h2&gt;

&lt;p&gt;After 50 sessions, the ledger becomes a &lt;strong&gt;knowledge base&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📊 Your M31A Usage Patterns

Most Productive Model:
  claude-3.5-sonnet for Go projects (0% failure, $0.14 avg)
  gpt-4-turbo for Python scripts (3% failure, $0.08 avg)

Task Complexity Distribution:
  trivial: 23% (avg 2min, $0.03)
  simple:  41% (avg 5min, $0.08)
  moderate: 28% (avg 10min, $0.18)
  complex:  8% (avg 25min, $0.42)

Common Failure Patterns:
  - Database migrations: 12% failure rate (always verify)
  - React hooks: 8% failure rate (test thoroughly)
  - Security middleware: 0% failure rate (Claude excels)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;This data is yours.&lt;/strong&gt; It lives in your repo, gets committed with your code, and helps the agent serve you better over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;The ledger is automatic. Every M31A session writes to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start a session&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;m31a

&lt;span class="c"&gt;# After the session completes, check your ledger&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .m31a/ledger.md

&lt;span class="c"&gt;# Or use the built-in stats command&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;m31a /ledger stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ledger file is created on first session and appended to on every subsequent session.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;The ledger is just the beginning. Planned enhancements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Goal similarity matching&lt;/strong&gt;: Find past sessions with similar goals to inform current decisions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost optimization alerts&lt;/strong&gt;: Warn when a session is exceeding historical averages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model recommendation engine&lt;/strong&gt;: Suggest models based on task type and historical performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export to analytics&lt;/strong&gt;: Pipe ledger data to external dashboards&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Building the ledger taught me three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simple data beats complex systems.&lt;/strong&gt; A markdown table is easier to debug, version, and share than a SQLite database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Metadata is underrated.&lt;/strong&gt; You don't need to store code changes to learn from them. Task counts, failure rates, and durations tell you most of what you need.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learning compounds.&lt;/strong&gt; The first 10 sessions are noise. After 50, patterns emerge. After 100, the agent is predictably better at serving your specific codebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The cross-session learning ledger is M31A's secret weapon. It turns every session into training data, creating a feedback loop that makes the agent sharper over time. No cloud sync, no analytics servers, no privacy concerns — just a markdown file that gets smarter as you use it.&lt;/p&gt;

&lt;p&gt;If you're building AI tools, consider adding structured logging from day one. The insights compound faster than you think.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it out:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install M31A&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/eshanized/M31A/master/install.sh | bash

&lt;span class="c"&gt;# Run a few sessions&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;m31a

&lt;span class="c"&gt;# Check your ledger after a few sessions&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;m31a /ledger stats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eshanized/M31A" rel="noopener noreferrer"&gt;github.com/eshanized/M31A&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://github.com/eshanized/M31A/tree/master/docs" rel="noopener noreferrer"&gt;docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Previous post: &lt;a href="https://dev.to/eshanized/building-m31a"&gt;Building M31A: A Terminal-Native AI Coding Agent&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;What patterns would you track in your AI coding sessions? I'd love to hear what metadata would be most valuable to you. Open an issue or reach out on Twitter.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>go</category>
      <category>agents</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Building M31A: A Terminal-Native AI Coding Agent That Ships, Not Just Suggests</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 15 Jun 2026 23:14:24 +0000</pubDate>
      <link>https://dev.to/eshanized/building-m31a-a-terminal-native-ai-coding-agent-that-ships-not-just-suggests-2p0m</link>
      <guid>https://dev.to/eshanized/building-m31a-a-terminal-native-ai-coding-agent-that-ships-not-just-suggests-2p0m</guid>
      <description>&lt;p&gt;Most AI coding assistants are glorified autocomplete on steroids. They suggest code, maybe write a function or two, but leave you holding the bag when it comes to testing, verification, and actually shipping the changes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;M31A (M31 Autonomous)&lt;/strong&gt; takes a different approach. It's a terminal-based AI coding agent written in Go that owns a &lt;strong&gt;six-phase workflow end-to-end&lt;/strong&gt;: Initialize → Discuss → Plan → Execute → Verify → Ship. Every run ends with a verified git commit and a learning ledger entry. One static binary, zero telemetry, any POSIX shell.&lt;/p&gt;

&lt;p&gt;In this post, I'll walk you through the architecture, design decisions, and technical highlights of this open-source project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: AI Assistants That Don't Finish the Job
&lt;/h2&gt;

&lt;p&gt;Here's the typical workflow with most AI coding tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask the AI to write some code&lt;/li&gt;
&lt;li&gt;Copy-paste the suggestion into your editor&lt;/li&gt;
&lt;li&gt;Run tests manually&lt;/li&gt;
&lt;li&gt;Debug the inevitable issues&lt;/li&gt;
&lt;li&gt;Repeat until it works&lt;/li&gt;
&lt;li&gt;Commit the changes yourself&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The AI "helped" with step 1, but you're still doing 80% of the work. And if something breaks three commits later? Good luck figuring out what the AI actually changed.&lt;/p&gt;

&lt;p&gt;M31A flips this model. Instead of being a suggestion engine, it's an &lt;strong&gt;autonomous agent&lt;/strong&gt; that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asks clarifying questions before planning&lt;/li&gt;
&lt;li&gt;Generates a structured implementation plan&lt;/li&gt;
&lt;li&gt;Executes tasks with proper dependency resolution&lt;/li&gt;
&lt;li&gt;Runs verification (tests, syntax checks)&lt;/li&gt;
&lt;li&gt;Commits verified changes to git&lt;/li&gt;
&lt;li&gt;Records what it learned for future sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture at a Glance
&lt;/h2&gt;

&lt;p&gt;M31A is built with a clean six-layer architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────┐
│  TUI Layer (Bubble Tea)                                     │
│  29 screens, keyboard/mouse handling, streaming display     │
└─────────────────────────────────────────────────────────────┘
                           ↓
┌─────────────────────────────────────────────────────────────┐
│  Workflow Engine                                             │
│  Six-phase orchestration, LLM streaming, plan parsing       │
└─────────────────────────────────────────────────────────────┘
                           ↓
         ┌─────────────────┼─────────────────┐
         ↓                 ↓                 ↓
┌──────────────┐  ┌──────────────┐  ┌────────────────────┐
│  Providers   │  │  Tools       │  │  Domain Packages   │
│  OpenRouter  │  │  Bash        │  │  session, ledger   │
│  Zen         │  │  FileRead    │  │  rollback, bisect  │
│  Fallback    │  │  FileWrite   │  │  taskrunner        │
│              │  │  Glob, Grep  │  │  keychain          │
└──────────────┘  └──────────────┘  └────────────────────┘
         ↓                 ↓                 ↓
┌─────────────────────────────────────────────────────────────┐
│  Infrastructure Layer                                        │
│  git, config, tokens, codeintel, fileutil, logging          │
└─────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key insight? &lt;strong&gt;Separation of concerns at every level.&lt;/strong&gt; The TUI doesn't know about LLM APIs. The workflow engine doesn't know about terminal rendering. The tools don't know about workflow phases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Six-Phase Workflow Engine
&lt;/h2&gt;

&lt;p&gt;The heart of M31A is the workflow engine, implemented in &lt;code&gt;internal/workflow/engine.go&lt;/code&gt;. Let's break down each phase:&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 1: Initialize
&lt;/h3&gt;

&lt;p&gt;The agent detects your project type (Go, Python, Node, etc.), initializes git if needed, and creates a &lt;code&gt;.m31a/&lt;/code&gt; planning directory with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;PROJECT.md&lt;/code&gt; — project metadata&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;STATE.md&lt;/code&gt; — current workflow state&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TASKS.md&lt;/code&gt; — task list (populated later)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From internal/workflow/initialize.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;runInitialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Detect project type, framework, language&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;detectProject&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c"&gt;// Initialize git repo if needed&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsRepository&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Create planning directory&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MkdirAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;planningDir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0755&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Write PROJECT.md, STATE.md&lt;/span&gt;
    &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;writeProjectState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Phase 2: Discuss
&lt;/h3&gt;

&lt;p&gt;Before jumping into code, the agent asks clarifying questions via LLM streaming. This prevents the classic "I built exactly what you asked for, but not what you wanted" problem.&lt;/p&gt;

&lt;p&gt;The discuss phase uses embedded prompt templates (loaded via &lt;code&gt;//go:embed prompts/*.md&lt;/code&gt;) to guide the LLM toward asking useful questions about scope, constraints, and edge cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 3: Plan
&lt;/h3&gt;

&lt;p&gt;The agent generates a structured implementation plan in markdown format. A custom parser (&lt;code&gt;internal/workflow/plan_parser.go&lt;/code&gt;) extracts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Task titles and descriptions&lt;/li&gt;
&lt;li&gt;Dependencies between tasks&lt;/li&gt;
&lt;li&gt;Files that will be modified&lt;/li&gt;
&lt;li&gt;Review notes and questions
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From internal/workflow/plan_parser.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Plan&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Title&lt;/span&gt;      &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Tasks&lt;/span&gt;      &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="n"&gt;Task&lt;/span&gt;
    &lt;span class="n"&gt;Questions&lt;/span&gt;  &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Notes&lt;/span&gt;      &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ID&lt;/span&gt;           &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;Action&lt;/span&gt;       &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Description&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Files&lt;/span&gt;        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Dependencies&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The plan parser supports refinement with retry logic (max 3 retries, max 5 refinements) and classifies prompt complexity: &lt;code&gt;trivial → simple → moderate → complex&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 4: Execute
&lt;/h3&gt;

&lt;p&gt;This is where the rubber meets the road. The task runner (&lt;code&gt;pkg/taskrunner/runner.go&lt;/code&gt;) uses &lt;strong&gt;Kahn's algorithm&lt;/strong&gt; for topological sorting to determine execution order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/taskrunner/runner.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Runner&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Schedule&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;([][]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Build adjacency list and in-degree count&lt;/span&gt;
    &lt;span class="n"&gt;inDegree&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;dependents&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;][]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Dependencies&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;inDegree&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
            &lt;span class="n"&gt;dependents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dependents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Find all tasks with no dependencies&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;inDegree&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Process tasks in topological order&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;groups&lt;/span&gt; &lt;span class="p"&gt;[][]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;groups&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;dependents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;inDegree&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;inDegree&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dep&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tasks within a group can run with bounded parallelism (default: 4 concurrent tasks via semaphore). The executor includes a &lt;strong&gt;self-heal loop&lt;/strong&gt; that retries recoverable failures up to 2 times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 5: Verify
&lt;/h3&gt;

&lt;p&gt;The agent runs verification checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File existence validation&lt;/li&gt;
&lt;li&gt;Syntax checking (language-specific)&lt;/li&gt;
&lt;li&gt;Test execution&lt;/li&gt;
&lt;li&gt;Smart file truncation for LLM context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If verification fails, the agent can rollback the commit chain using git-bisect integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 6: Ship
&lt;/h3&gt;

&lt;p&gt;The final phase:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creates a git commit with all verified changes&lt;/li&gt;
&lt;li&gt;Writes a ledger entry (cross-session learning record)&lt;/li&gt;
&lt;li&gt;Archives the session&lt;/li&gt;
&lt;li&gt;Generates a demonstration summary&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Provider System: Multi-LLM with Automatic Fallback
&lt;/h2&gt;

&lt;p&gt;M31A supports two LLM providers out of the box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenRouter&lt;/strong&gt; — primary gateway with access to Claude, GPT-4, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zen&lt;/strong&gt; — secondary provider (OpenCode Zen)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The provider layer (&lt;code&gt;internal/provider/&lt;/code&gt;) includes some clever engineering:&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic Fallback
&lt;/h3&gt;

&lt;p&gt;When a provider degrades (429 rate limit, 503 service unavailable), M31A automatically switches to a healthy provider. The fallback logic uses &lt;strong&gt;parallel health checks&lt;/strong&gt; to minimize latency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From internal/provider/fallback.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;FindFallbackProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;registry&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Registry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;FallbackEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Collect candidate providers&lt;/span&gt;
    &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListAll&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c"&gt;// Parallel health checks (10s timeout)&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cancel&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WithTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Background&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Second&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;cancel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;chan&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HealthCheck&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Return first healthy provider in priority order&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"live"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"slow"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TrySetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;FallbackEvent&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Model Arbitrage
&lt;/h3&gt;

&lt;p&gt;M31A includes a &lt;strong&gt;model arbitrage system&lt;/strong&gt; (&lt;code&gt;pkg/arbitrage/&lt;/code&gt;) that automatically switches to the cheapest model that meets the task's capability threshold:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/arbitrage/arbitrage.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Scorer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ComplexityLevel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;classifyText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Boost complexity when task touches many files&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boostLevel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Boost when task has many dependencies&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Dependencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boostLevel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EstimateTokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The scorer uses keyword analysis to classify tasks as &lt;code&gt;simple&lt;/code&gt;, &lt;code&gt;moderate&lt;/code&gt;, or &lt;code&gt;complex&lt;/code&gt;, then recommends the cheapest model that can handle that complexity level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool System: Deliberately Small, Aggressively Sandboxed
&lt;/h2&gt;

&lt;p&gt;M31A ships with 5 core tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bash&lt;/strong&gt; — shell command execution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FileRead&lt;/strong&gt; — read files with size limits (50MB max)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FileWrite&lt;/strong&gt; — atomic file writes (temp + rename)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glob&lt;/strong&gt; — file pattern matching (doublestar, 1000 result limit)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grep&lt;/strong&gt; — content search (ripgrep when available, pure-Go fallback)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The tool surface area is intentionally small. Each tool is aggressively sandboxed with:&lt;/p&gt;

&lt;h3&gt;
  
  
  Permission Gating
&lt;/h3&gt;

&lt;p&gt;Every tool call is gated by a permission modal with configurable timeout (default 300s):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From internal/tools/permissions.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;PermissionMode&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;ModeAsk&lt;/span&gt;         &lt;span class="n"&gt;PermissionMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"ask"&lt;/span&gt;
    &lt;span class="n"&gt;ModeAllowAll&lt;/span&gt;    &lt;span class="n"&gt;PermissionMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"allow_all"&lt;/span&gt;
    &lt;span class="n"&gt;ModeDenyAll&lt;/span&gt;     &lt;span class="n"&gt;PermissionMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"deny_all"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Dispatcher&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;RequestPermission&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="n"&gt;Tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="n"&gt;ToolInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ModeAllowAll&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Send permission request to TUI&lt;/span&gt;
    &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;chan&lt;/span&gt; &lt;span class="n"&gt;PermissionResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;emitter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PermissionRequestMsg&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="c"&gt;// Wait for user response with timeout&lt;/span&gt;
    &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Approved&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ErrPermissionDenied&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;After&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ErrPermissionTimeout&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security Guards
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Path traversal guards&lt;/strong&gt;: symlink resolution + workDir prefix check&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output capping&lt;/strong&gt;: MaxToolOutputChars (10,000) / BashOutputLimit (50,000)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSRF protection&lt;/strong&gt;: DNS pinning, TOCTOU prevention, redirect checking (WebFetch)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process lifecycle&lt;/strong&gt;: SIGINT/SIGKILL grace period, pipe cleanup&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Risk Levels
&lt;/h3&gt;

&lt;p&gt;Each tool declares its risk level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;RiskSafe&lt;/span&gt;        &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"safe"&lt;/span&gt;
    &lt;span class="n"&gt;RiskMedium&lt;/span&gt;      &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"medium"&lt;/span&gt;
    &lt;span class="n"&gt;RiskDangerous&lt;/span&gt;   &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"dangerous"&lt;/span&gt;
    &lt;span class="n"&gt;RiskDestructive&lt;/span&gt; &lt;span class="n"&gt;RiskLevel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"destructive"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bash is &lt;code&gt;dangerous&lt;/code&gt;, FileWrite is &lt;code&gt;medium&lt;/code&gt;, FileRead is &lt;code&gt;safe&lt;/code&gt;. The permission system uses these levels to determine whether to prompt the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cross-Session Learning Ledger
&lt;/h2&gt;

&lt;p&gt;One of M31A's most interesting features is the &lt;strong&gt;cross-session learning ledger&lt;/strong&gt; (&lt;code&gt;pkg/ledger/&lt;/code&gt;). Every session writes a structured record to a markdown file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Session | Model | Tasks | Failed | Cost | Duration | Framework |
|---------|-------|-------|--------|------|----------|-----------|
| a1b2c3d4 | claude-3.5-sonnet | 5 | 1 | $0.12 | 8min | react |
| e5f6g7h8 | gpt-4-turbo | 3 | 0 | $0.08 | 4min | go |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ledger tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session ID and timestamp&lt;/li&gt;
&lt;li&gt;Model and provider used&lt;/li&gt;
&lt;li&gt;Task count and failures&lt;/li&gt;
&lt;li&gt;Cost estimate&lt;/li&gt;
&lt;li&gt;Duration&lt;/li&gt;
&lt;li&gt;Project type and framework&lt;/li&gt;
&lt;li&gt;Goal keywords (with stop-word filtering)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over time, the agent can query the ledger to learn from past sessions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/ledger/ledger.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;LedgerStats&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;TotalSessions&lt;/span&gt;      &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;AvgTaskCount&lt;/span&gt;       &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;AvgCost&lt;/span&gt;            &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;AvgDurationMinutes&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;
    &lt;span class="n"&gt;TotalFailedTasks&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;TopFailures&lt;/span&gt;        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;TopFrameworks&lt;/span&gt;       &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;ByProjectType&lt;/span&gt;      &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a feedback loop where the agent gets sharper over time, learning which frameworks are common, what types of tasks fail, and how long things typically take.&lt;/p&gt;

&lt;h2&gt;
  
  
  AutoDream: Context Window Consolidation
&lt;/h2&gt;

&lt;p&gt;Long conversations blow the context window. M31A solves this with &lt;strong&gt;AutoDream&lt;/strong&gt; (&lt;code&gt;pkg/autodream/&lt;/code&gt;), an automatic context consolidation system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/autodream/autodream.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Consolidator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Consolidate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConsolidationResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Protect system prompts and recent messages&lt;/span&gt;
    &lt;span class="n"&gt;protected&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;protectedIndices&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;candidateIndices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;protected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Summarize oldest 50% of non-protected messages&lt;/span&gt;
    &lt;span class="n"&gt;midpoint&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
    &lt;span class="n"&gt;toCompress&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;midpoint&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c"&gt;// Build summary prompt&lt;/span&gt;
    &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toCompress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Replace old messages with summary&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replaceWithSummary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toCompress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ConsolidationResult&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;MessagesRemoved&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toCompress&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;TokensSaved&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;     &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;estimateTokensSaved&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toCompress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AutoDream triggers at 60% context usage by default. It uses role-sampled summarization (system prompts are never compressed) and preserves recent messages for continuity.&lt;/p&gt;

&lt;h2&gt;
  
  
  TUI: 29 Screens Built with Bubble Tea
&lt;/h2&gt;

&lt;p&gt;The terminal UI is built with &lt;a href="https://github.com/charmbracelet/bubbletea" rel="noopener noreferrer"&gt;Bubble Tea&lt;/a&gt;, following the Elm architecture. Screen routing uses an enum-based dispatcher:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From internal/tui/app_state.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Screen&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;ScreenREPL&lt;/span&gt; &lt;span class="n"&gt;Screen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;iota&lt;/span&gt;
    &lt;span class="n"&gt;ScreenGoalInput&lt;/span&gt;
    &lt;span class="n"&gt;ScreenPhaseModelPicker&lt;/span&gt;
    &lt;span class="n"&gt;ScreenPlan&lt;/span&gt;
    &lt;span class="n"&gt;ScreenDiscuss&lt;/span&gt;
    &lt;span class="n"&gt;ScreenExecute&lt;/span&gt;
    &lt;span class="n"&gt;ScreenVerify&lt;/span&gt;
    &lt;span class="n"&gt;ScreenShip&lt;/span&gt;
    &lt;span class="n"&gt;ScreenModelSelector&lt;/span&gt;
    &lt;span class="n"&gt;ScreenSettings&lt;/span&gt;
    &lt;span class="c"&gt;// ... 19 more screens&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;AppState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="n"&gt;tea&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tea&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tea&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Cmd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;SwitchScreenMsg&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Screen&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Route to active screen's Update function&lt;/span&gt;
    &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;ScreenREPL&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;repl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;repl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;ScreenPlan&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The TUI includes some nice touches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fuzzy model selector&lt;/strong&gt; with per-token cost comparison&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission modals&lt;/strong&gt; with keyboard shortcuts (y/a/n/e for allow/allow always/deny/exit)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming display&lt;/strong&gt; for real-time LLM output&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dark/light themes&lt;/strong&gt; with auto mode&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context warning banner&lt;/strong&gt; at 80% window usage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commit Rollback Chain
&lt;/h2&gt;

&lt;p&gt;When verification fails, M31A can rollback the commit chain using git-bisect integration (&lt;code&gt;pkg/bisect/&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/rollback/rollback.go&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Rollback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;HardReset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Create backup branch before destructive operation&lt;/span&gt;
    &lt;span class="n"&gt;backupName&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"m31a/rollback-backup-%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unix&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CreateBranch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;backupName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Auto-stash uncommitted changes&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HasUncommittedChanges&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Stash&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StashPop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// Hard reset to target commit&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResetHard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rollback system maintains a commit chain with soft/hard/safe reset options. Safe reset creates backup branches before any destructive operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  OS-Native Secure Key Storage
&lt;/h2&gt;

&lt;p&gt;API keys are stored using OS-native keychain backends (&lt;code&gt;pkg/keychain/&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linux&lt;/strong&gt;: D-Bus Secret Service + &lt;code&gt;pass&lt;/code&gt; CLI fallback&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS&lt;/strong&gt;: &lt;code&gt;/usr/bin/security&lt;/code&gt; CLI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows&lt;/strong&gt;: Windows Credential Manager
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// From pkg/keychain/keychain.go&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Keychain&lt;/span&gt; &lt;span class="k"&gt;interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;
    &lt;span class="n"&gt;Delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The keychain abstraction uses build tags to select the platform-specific implementation at compile time. Service names follow the pattern &lt;code&gt;m31a/openrouter&lt;/code&gt;, &lt;code&gt;m31a/zen&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key resolution order&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Environment variable: &lt;code&gt;M31A_OPENROUTER_API_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Standard fallback: &lt;code&gt;OPENROUTER_API_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;OS keychain: &lt;code&gt;m31a/openrouter&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Config file: &lt;code&gt;provider.openrouter.api_key&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keys are never written to disk in plaintext when keychain is available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Static Binary, Zero Telemetry
&lt;/h2&gt;

&lt;p&gt;M31A is compiled with &lt;code&gt;CGO_ENABLED=0&lt;/code&gt;, producing a fully static binary with no C dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# From Makefile
&lt;/span&gt;&lt;span class="nl"&gt;build&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 go build &lt;span class="nt"&gt;-ldflags&lt;/span&gt; &lt;span class="s2"&gt;"-s -w &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
        -X main.Version=&lt;/span&gt;&lt;span class="p"&gt;$(&lt;/span&gt;&lt;span class="s2"&gt;VERSION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
        -X main.Commit=&lt;/span&gt;&lt;span class="p"&gt;$(&lt;/span&gt;&lt;span class="s2"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
        -X main.Date=&lt;/span&gt;&lt;span class="p"&gt;$(&lt;/span&gt;&lt;span class="s2"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;-o&lt;/span&gt; m31a ./cmd/m31a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The binary is typically 15-20MB (stripped with &lt;code&gt;-s -w&lt;/code&gt; ldflags). Cross-compilation targets include linux/darwin/windows × amd64/arm64.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zero telemetry&lt;/strong&gt;: no analytics, no crash reporting, no usage pings. Your code never leaves your machine except when sent to the LLM provider for inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Session Persistence and Recovery
&lt;/h2&gt;

&lt;p&gt;Sessions persist to &lt;code&gt;&amp;lt;workDir&amp;gt;/.m31a/session.json&lt;/code&gt;, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Workflow state (goal, phase, questions)&lt;/li&gt;
&lt;li&gt;Message history (separate &lt;code&gt;messages.json&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Checkpoints (max 2 for undo/rollback)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you hit &lt;code&gt;Ctrl+C&lt;/code&gt;, lose network, or your laptop dies, you can resume mid-workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;m31a &lt;span class="nt"&gt;--resume&lt;/span&gt;
&lt;span class="c"&gt;# Shows session browser with recent sessions&lt;/span&gt;
&lt;span class="c"&gt;# Restores workflow state and continues from last checkpoint&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing Strategy
&lt;/h2&gt;

&lt;p&gt;M31A uses Go's standard &lt;code&gt;testing&lt;/code&gt; package with no external mocking frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit tests&lt;/strong&gt;: individual functions/methods&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration tests&lt;/strong&gt;: real git repos, temp dirs, HTTP test servers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security tests&lt;/strong&gt;: SSRF protection, timeout enforcement, path traversal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table-driven tests&lt;/strong&gt;: anonymous structs with &lt;code&gt;t.Parallel()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Coverage targets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overall: 75% (currently ~74.7%)&lt;/li&gt;
&lt;li&gt;Critical packages: 90% — &lt;code&gt;pkg/taskrunner&lt;/code&gt; (89.9%), &lt;code&gt;pkg/bisect&lt;/code&gt; (91.3%), &lt;code&gt;pkg/rollback&lt;/code&gt; (89.1%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The test suite includes some interesting patterns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// Security test for SSRF protection&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;TestWebFetch_BlocksPrivateIPs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;tests&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt;      &lt;span class="kt"&gt;string&lt;/span&gt;
        &lt;span class="n"&gt;wantErr&lt;/span&gt;  &lt;span class="kt"&gt;error&lt;/span&gt;
    &lt;span class="p"&gt;}{&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"http://127.0.0.1/admin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrPrivateIPBlocked&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"http://192.168.1.1/config"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrPrivateIPBlocked&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"http://10.0.0.1/secret"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrPrivateIPBlocked&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"http://169.254.169.254/metadata"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrPrivateIPBlocked&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="c"&gt;// AWS metadata&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tt&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;tests&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Parallel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;WebFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wantErr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"got %v, want %v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wantErr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Installation is a one-liner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS (Homebrew)&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;eshanized/tap/m31a

&lt;span class="c"&gt;# Linux / macOS (curl)&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/eshanized/M31A/main/install.sh | bash

&lt;span class="c"&gt;# From source (any OS)&lt;/span&gt;
git clone https://github.com/eshanized/M31A.git
&lt;span class="nb"&gt;cd &lt;/span&gt;M31A
&lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 go build &lt;span class="nt"&gt;-o&lt;/span&gt; m31a ./cmd/m31a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On first launch, M31A prompts for your OpenRouter or Zen API key and stores it in the OS keychain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;m31a
&lt;span class="c"&gt;# TUI launches&lt;/span&gt;
&lt;span class="c"&gt;# Type your goal: "refactor the auth middleware to use JWT with RS256"&lt;/span&gt;
&lt;span class="c"&gt;# Agent runs through six phases&lt;/span&gt;
&lt;span class="c"&gt;# Ends with verified git commit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Slash commands&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/help          list all commands
/workflow      kick off the six-phase flow
/model         open the model selector (fuzzy search)
/provider      switch provider
/ledger stats  show your cross-session ledger
/rollback      show the commit chain; --hard to reset
/compress      trigger AutoDream manually
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;M31A is at v1.0.0 with the core feature set complete. The roadmap includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ghost mode&lt;/strong&gt; — headless runs producing structured diffs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Picture-in-picture&lt;/strong&gt; — second agent in side pane for cross-review&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subagents&lt;/strong&gt; — delegate sub-tasks to specialized agents (code, test, doc)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deferred tools&lt;/strong&gt; — queue tool calls requiring human approval for batch review&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Building M31A taught me a few things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Workflow ownership matters more than code generation&lt;/strong&gt;. The six-phase workflow is more valuable than any single code suggestion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Small tool surface area is a feature&lt;/strong&gt;. Five well-sandboxed tools are easier to secure than twenty half-baked ones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learning compounds&lt;/strong&gt;. The cross-session ledger creates a feedback loop that makes the agent better over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Terminal UIs can be delightful&lt;/strong&gt;. Bubble Tea proves that terminal apps don't have to be ugly or hard to use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Static binaries are liberating&lt;/strong&gt;. No runtime dependencies, no Docker required, just download and run.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;M31A is an experiment in what AI coding assistants could be if they owned the entire workflow instead of just the fun part. It's not perfect — the TUI test coverage needs work (38.6%), and there are some known bugs around git status detection — but the architecture is sound and the core workflow is production-ready.&lt;/p&gt;

&lt;p&gt;If you're interested in the intersection of AI, developer tools, and terminal UIs, I'd love your feedback. Star the repo, open an issue, or better yet, try it on your codebase and let me know what breaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eshanized/M31A" rel="noopener noreferrer"&gt;github.com/eshanized/M31A&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://github.com/eshanized/M31A/tree/master/docs" rel="noopener noreferrer"&gt;docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Issues: &lt;a href="https://github.com/eshanized/M31A/issues" rel="noopener noreferrer"&gt;github.com/eshanized/M31A/issues&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - Research: &lt;a href="https://github.com/eshanized/M31A/blob/master/RESEARCH.md" rel="noopener noreferrer"&gt;https://github.com/eshanized/M31A/blob/master/RESEARCH.md&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Thanks to the Bubble Tea, Lip Gloss, and Glamour teams for making terminal UIs enjoyable to build. And thanks to everyone who has tried M31A and reported bugs — your feedback makes it better.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>terminal</category>
      <category>cli</category>
      <category>devtools</category>
    </item>
    <item>
      <title>I Built an Automated SLM Fine-Tuning Engine with Python and Unsloth 🚀</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 19 Jan 2026 21:15:36 +0000</pubDate>
      <link>https://dev.to/eshanized/i-built-an-automated-slm-fine-tuning-engine-with-python-and-unsloth-257j</link>
      <guid>https://dev.to/eshanized/i-built-an-automated-slm-fine-tuning-engine-with-python-and-unsloth-257j</guid>
      <description>&lt;p&gt;Fine-tuning Small Language Models (SLMs) like Llama 3.2 or Phi-4 is easier than ever thanks to tools like Unsloth. But the &lt;em&gt;setup&lt;/em&gt; is still a pain. You have to find the right Colab notebook, format your data into JSONL, debug generic errors, and figure out which model actually fits your use case.&lt;/p&gt;

&lt;p&gt;I wanted to fix that friction. So I built &lt;a href="https://github.com/eshanized/slmgen" rel="noopener noreferrer"&gt;&lt;strong&gt;SLMGen&lt;/strong&gt;&lt;/a&gt;, an open-source tool that automates the entire process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your Data → Best Model → Matched. One notebook. Zero setup.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how I built it and how it works under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Architecture
&lt;/h2&gt;

&lt;p&gt;SLMGen is a full-stack application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Python 3.11 with FastAPI (because Python is the language of AI).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js 16 (for a snappy, modern UI).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication:&lt;/strong&gt; Supabase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engine:&lt;/strong&gt; A custom Recommendation Engine &amp;amp; Notebook Generator.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core magic happens in &lt;code&gt;libslmgen&lt;/code&gt;, the Python backend. Let's dive into the cool parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 1. The Recommendation Engine
&lt;/h2&gt;

&lt;p&gt;Most people don't know which model to pick. "Should I use Phi-4 or Llama 3.2? Is Mistral 7B too big for my edge device?"&lt;/p&gt;

&lt;p&gt;I built a &lt;strong&gt;100-point scoring system&lt;/strong&gt; to mathematically answer that question. It analyzes your dataset and intent to pick the perfect model.&lt;/p&gt;

&lt;p&gt;Here is the scoring logic from &lt;code&gt;core/recommender.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_recommendations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;characteristics&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="c1"&gt;# 50 points: Does the model fit the task? (e.g. Code vs Creative Writing)
&lt;/span&gt;    &lt;span class="n"&gt;task_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_task_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 30 points: Does it fit the hardware? (e.g. Edge vs Cloud)
&lt;/span&gt;    &lt;span class="n"&gt;deploy_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_deployment_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 20 points: Does the data match the model strengths? (e.g. Multilingual -&amp;gt; Qwen)
&lt;/span&gt;    &lt;span class="n"&gt;data_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_data_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;characteristics&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task_score&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;deploy_score&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;data_score&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It doesn't just guess. It looks at your &lt;strong&gt;data&lt;/strong&gt; features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multilingual?&lt;/strong&gt; → Bonus for Qwen 2.5 (it's great at non-English).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSON Output?&lt;/strong&gt; → Bonus for Phi-4 or Qwen (strong structured output).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge Deployment?&lt;/strong&gt; → Big penalty for 7B models, big bonus for Gemma 2B or SmolLM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔍 2. Dataset Intelligence
&lt;/h2&gt;

&lt;p&gt;Before you train, you should know what you're training on. SLMGen scans your JSONL file for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality Issues:&lt;/strong&gt; Duplicates, empty responses, short inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personality:&lt;/strong&gt; Is your data "Formal &amp;amp; Expert" or "Casual &amp;amp; Helpful"?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hallucination Risk:&lt;/strong&gt; It scans for vague language ("might," "probably") vs. grounded language ("according to," numbers/dates).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is done via heuristic analysis in &lt;code&gt;core/personality.py&lt;/code&gt; and &lt;code&gt;core/risk.py&lt;/code&gt;. It's not an LLM judging an LLM—it's fast, deterministic signal processing on text.&lt;/p&gt;

&lt;h2&gt;
  
  
  🪄 3. Self-Contained Notebooks
&lt;/h2&gt;

&lt;p&gt;This is my favorite feature. Usually, to run a Colab notebook, you have to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download a notebook.&lt;/li&gt;
&lt;li&gt;Upload your JSONL file to Colab.&lt;/li&gt;
&lt;li&gt;Fix the file path in the code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SLMGen removes steps 2 and 3. It &lt;strong&gt;embeds your dataset directly into the notebook&lt;/strong&gt; as a base64 string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# From core/notebook.py
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_notebook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset_jsonl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...):&lt;/span&gt;
    &lt;span class="c1"&gt;# Encode dataset
&lt;/span&gt;    &lt;span class="n"&gt;dataset_b64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset_jsonl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Generate Python code cell
&lt;/span&gt;    &lt;span class="n"&gt;code_cell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    import base64
    import json

    DATASET_B64 = &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;dataset_b64&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;

    # Decode on the fly
    dataset_str = base64.b64decode(DATASET_B64).decode()
    raw_data = [json.loads(line) for line in dataset_str.splitlines()]
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you open the notebook, you just click "Run All". No file uploads. No path errors. It just works.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡ 4. Unsloth Integration
&lt;/h2&gt;

&lt;p&gt;For the actual training, I rely on &lt;a href="https://github.com/unslothai/unsloth" rel="noopener noreferrer"&gt;Unsloth&lt;/a&gt;. It makes fine-tuning 2x faster and uses 70% less memory.&lt;/p&gt;

&lt;p&gt;SLMGen automatically configures the correct LoRA target modules for every supported model structure (Llama, Phi, Gemma, etc.), so you never face a "layer not found" error.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Supported Models
&lt;/h2&gt;

&lt;p&gt;Right now, SLMGen supports 11 top-tier SLMs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Phi-4 Mini&lt;/strong&gt; (Reasoning powerhouse)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Llama 3.2&lt;/strong&gt; (1B/3B)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 2&lt;/strong&gt; (2B)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mistral 7B&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen 2.5&lt;/strong&gt; (Best for coding/multilingual)&lt;/li&gt;
&lt;li&gt;And more...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💻 Try it out
&lt;/h2&gt;

&lt;p&gt;The project is fully open source. You can run it locally or deploy it yourself.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/eshanized/slmgen" rel="noopener noreferrer"&gt;https://github.com/eshanized/slmgen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://slmgen.vercel.app" rel="noopener noreferrer"&gt;https://slmgen.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear your feedback! If this helps you fine-tune your first model, drop a star on the repo! ⭐&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>nlp</category>
    </item>
    <item>
      <title>MultiGit: One repository. Infinite destinations</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Wed, 05 Nov 2025 23:20:32 +0000</pubDate>
      <link>https://dev.to/eshanized/multigit-one-repository-infinite-destinations-2adj</link>
      <guid>https://dev.to/eshanized/multigit-one-repository-infinite-destinations-2adj</guid>
      <description>&lt;p&gt;MultiGit is a production-ready, cross-platform Git multi-remote synchronization tool built in Rust. It lets you push, pull, and sync your repository across multiple Git hosting platforms—GitHub, GitLab, Bitbucket, Codeberg, and Gitea/Forgejo—with one command.&lt;/p&gt;

&lt;p&gt;Available as both &lt;code&gt;multigit&lt;/code&gt; and &lt;code&gt;mg&lt;/code&gt; commands for your convenience.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/TIVerse/multigit" rel="noopener noreferrer"&gt;https://github.com/TIVerse/multigit&lt;/a&gt;&lt;br&gt;
Crate: &lt;a href="https://crates.io/crates/multigit" rel="noopener noreferrer"&gt;https://crates.io/crates/multigit&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://docs.rs/multigit" rel="noopener noreferrer"&gt;https://docs.rs/multigit&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why MultiGit?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You want redundancy and resilience across platforms.&lt;/li&gt;
&lt;li&gt;You contribute to both public (GitHub) and internal (GitLab) repos.&lt;/li&gt;
&lt;li&gt;You need reliable backups and continuous mirroring.&lt;/li&gt;
&lt;li&gt;You want a single workflow to manage many platforms without brittle scripts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Multi-Remote Sync: push/pull/sync to/from multiple remotes simultaneously&lt;/li&gt;
&lt;li&gt;Secure by Default: OS keyring integration with encrypted fallback&lt;/li&gt;
&lt;li&gt;Fast and Concurrent: Tokio-based async operations with proper concurrency limits&lt;/li&gt;
&lt;li&gt;Smart Conflict Handling: detection, reporting, and guided resolution strategies&lt;/li&gt;
&lt;li&gt;Daemon Mode: background sync with scheduling, logs, and health checks&lt;/li&gt;
&lt;li&gt;Rich CLI UX: progress indicators, pretty output, and JSON mode for automation&lt;/li&gt;
&lt;li&gt;Cross-Platform: Linux, macOS, and Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Backed by a comprehensive test suite (unit + integration + workflow) and CI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;Install from crates.io:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;multigit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/TIVerse/multigit.git
&lt;span class="nb"&gt;cd &lt;/span&gt;multigit
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;
./target/release/multigit &lt;span class="nt"&gt;--version&lt;/span&gt;
./target/release/mg &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize in a repository and add remotes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;your-repo
mg init

mg remote add github your-username
mg remote add gitlab your-username

&lt;span class="c"&gt;# Commit with the interactive Conventional Commit helper&lt;/span&gt;
mg cc

&lt;span class="c"&gt;# Sync to all remotes&lt;/span&gt;
mg &lt;span class="nb"&gt;sync&lt;/span&gt;

&lt;span class="c"&gt;# Check status across remotes&lt;/span&gt;
mg status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip: Use &lt;code&gt;mg&lt;/code&gt; for quick typing or &lt;code&gt;multigit&lt;/code&gt; in scripts—they are identical binaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Multi-remote operations: &lt;code&gt;push&lt;/code&gt;, &lt;code&gt;pull&lt;/code&gt;, &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;sync&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remote lifecycle: &lt;code&gt;remote add/remove/list/test/update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Conflicts: &lt;code&gt;conflict list&lt;/code&gt; and interactive &lt;code&gt;conflict resolve&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Automation: &lt;code&gt;daemon start/stop/status/logs&lt;/code&gt; with interval-based scheduling&lt;/li&gt;
&lt;li&gt;Health and diagnostics: &lt;code&gt;doctor&lt;/code&gt; to auto-detect common issues&lt;/li&gt;
&lt;li&gt;Developer UX: &lt;code&gt;cc&lt;/code&gt; (Conventional Commit helper), &lt;code&gt;log&lt;/code&gt;, &lt;code&gt;switch&lt;/code&gt;, &lt;code&gt;stash&lt;/code&gt;, &lt;code&gt;undo&lt;/code&gt;, &lt;code&gt;amend&lt;/code&gt;, &lt;code&gt;changelog&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Compatibility: pass-through to native git for everything else&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage Cheatsheet
&lt;/h2&gt;

&lt;p&gt;Initialize and add platforms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit init
multigit remote add github your-username
multigit remote add gitlab your-username
multigit remote add bitbucket your-username
multigit remote add mygitea your-username &lt;span class="nt"&gt;--url&lt;/span&gt; https://gitea.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sync safely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Interactive sync with conflict detection&lt;/span&gt;
multigit &lt;span class="nb"&gt;sync&lt;/span&gt;

&lt;span class="c"&gt;# Dry run to preview&lt;/span&gt;
multigit &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nt"&gt;--dry-run&lt;/span&gt;

&lt;span class="c"&gt;# To force push history (use with caution), use push or mirror:&lt;/span&gt;
multigit push &lt;span class="nt"&gt;--force&lt;/span&gt;
multigit mirror &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conflicts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit conflict list
multigit conflict resolve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Daemon mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit daemon start &lt;span class="nt"&gt;--interval&lt;/span&gt; 5
multigit daemon status
multigit daemon logs &lt;span class="nt"&gt;--lines&lt;/span&gt; 100
multigit daemon stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conventional commits (interactive):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mg cc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSON output for automation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit &lt;span class="nt"&gt;--json&lt;/span&gt; status
multigit &lt;span class="nt"&gt;--json&lt;/span&gt; remote list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;MultiGit uses a hierarchical configuration system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CLI Flags (highest priority)&lt;/li&gt;
&lt;li&gt;Repository config: &lt;code&gt;.multigit/config.toml&lt;/code&gt; (project)&lt;/li&gt;
&lt;li&gt;User config: &lt;code&gt;~/.config/multigit/config.toml&lt;/code&gt; (global)&lt;/li&gt;
&lt;li&gt;Built-in defaults (lowest)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example &lt;code&gt;~/.config/multigit/config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[settings]&lt;/span&gt;
&lt;span class="py"&gt;default_branch&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"main"&lt;/span&gt;
&lt;span class="py"&gt;parallel_push&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;max_parallel&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="py"&gt;colored_output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[sync]&lt;/span&gt;
&lt;span class="py"&gt;auto_sync&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="py"&gt;strategy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fast-forward"&lt;/span&gt;
&lt;span class="py"&gt;detect_conflicts&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[security]&lt;/span&gt;
&lt;span class="py"&gt;auth_backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"keyring"&lt;/span&gt;  &lt;span class="c"&gt;# or "encrypted-file"&lt;/span&gt;
&lt;span class="py"&gt;audit_log&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[remotes.github]&lt;/span&gt;
&lt;span class="py"&gt;username&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your-username"&lt;/span&gt;
&lt;span class="py"&gt;enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"github"&lt;/span&gt;

&lt;span class="nn"&gt;[remotes.gitlab]&lt;/span&gt;
&lt;span class="py"&gt;username&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your-username"&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://gitlab.com"&lt;/span&gt;
&lt;span class="py"&gt;enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gitlab"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your repository-local config (created by &lt;code&gt;mg init&lt;/code&gt;) lives at &lt;code&gt;.multigit/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OS Keyring Integration: macOS Keychain, Windows Credential Manager, Linux Secret Service&lt;/li&gt;
&lt;li&gt;Encrypted Fallback: age-encrypted local storage when keyring is unavailable&lt;/li&gt;
&lt;li&gt;No Plain-Text Secrets: tokens are never stored in plain text&lt;/li&gt;
&lt;li&gt;Audit Logging: optional, configurable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Credentials are stored when you add a remote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit remote add github your-username
&lt;span class="c"&gt;# You’ll be prompted for a token, stored securely&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Architecture (High-Level)
&lt;/h2&gt;

&lt;p&gt;MultiGit follows a modular architecture with a clear separation of concerns. Source files referenced are in the &lt;code&gt;src/&lt;/code&gt; tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph TB
  UI[CLI Commands] --&amp;gt; CORE[Core Engine]
  CORE --&amp;gt; PROVIDERS[Provider Layer]
  CORE --&amp;gt; GIT[Git Operations (git2)]
  CORE --&amp;gt; SECURITY[Security]
  CORE --&amp;gt; DAEMON[Daemon &amp;amp; Scheduler]

  subgraph Core
    CONFIG[core/config.rs]
    AUTH[core/auth.rs]
    SYNC[core/sync_manager.rs]
    CONFLICT[core/conflict_resolver.rs]
    HEALTH[core/health_checker.rs]
  end

  subgraph Providers
    FACTORY[providers/factory.rs]
    GH[providers/github.rs]
    GL[providers/gitlab.rs]
    BB[providers/bitbucket.rs]
    CB[providers/codeberg.rs]
    GE[providers/gitea.rs]
  end

  subgraph Daemon
    SERVICE[daemon/service.rs]
    SCHED[daemon/scheduler.rs]
  end

  UI --&amp;gt; CONFIG
  CONFIG --&amp;gt; SYNC
  AUTH --&amp;gt; PROVIDERS
  SYNC --&amp;gt; GIT
  SYNC --&amp;gt; PROVIDERS
  SYNC --&amp;gt; CONFLICT
  SERVICE --&amp;gt; SYNC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notable modules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src/main.rs&lt;/code&gt;: CLI command tree (push/pull/fetch/sync/status/remote/daemon/conflict/etc.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/core/&lt;/code&gt;: configuration, authentication, sync orchestration, conflict resolution&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/providers/&lt;/code&gt;: provider trait + concrete implementations (GitHub, GitLab, Bitbucket, Codeberg, Gitea), created via &lt;code&gt;providers::factory&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/daemon/&lt;/code&gt;: daemon service and scheduler&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/git/&lt;/code&gt;: thin wrapper around &lt;code&gt;git2&lt;/code&gt; for reliable Git operations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/ui/&lt;/code&gt;: formatting, progress indicators, output helpers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/utils/&lt;/code&gt;: error handling, logging (&lt;code&gt;tracing&lt;/code&gt;), helpers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Sync Works
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;sync&lt;/code&gt; command orchestrates a safe flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load config and current branch&lt;/li&gt;
&lt;li&gt;Ensure working directory is clean&lt;/li&gt;
&lt;li&gt;Fetch from all enabled remotes&lt;/li&gt;
&lt;li&gt;Detect conflicts/divergence&lt;/li&gt;
&lt;li&gt;Push to all remotes in parallel with sane concurrency limits&lt;/li&gt;
&lt;li&gt;Report per-remote results and update state
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/cli/commands/sync.rs (excerpt)&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;SyncManager&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="nf"&gt;.with_max_parallel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.settings.max_parallel&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="nf"&gt;.enabled_remotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.keys&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.cloned&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.collect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;fetch_results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="nf"&gt;.fetch_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;push_results&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="nf"&gt;.push_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;branch_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Interactive Setup &amp;amp; Conventional Commits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;multigit setup&lt;/code&gt; launches a friendly wizard: select providers, guided token prompts, connection testing, and config persistence. See &lt;code&gt;src/cli/commands/setup.rs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mg cc&lt;/code&gt; opens an interactive Conventional Commit helper with:

&lt;ul&gt;
&lt;li&gt;File staging (All or Selectively)&lt;/li&gt;
&lt;li&gt;Type, scope (auto-suggestions), and description validation&lt;/li&gt;
&lt;li&gt;Optional body, breaking change flag, and footer (issues/refs)&lt;/li&gt;
&lt;li&gt;Preview and edit-before-commit&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Daemon Mode
&lt;/h2&gt;

&lt;p&gt;Run background syncs on a schedule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit daemon start &lt;span class="nt"&gt;--interval&lt;/span&gt; 5
multigit daemon status
multigit daemon logs &lt;span class="nt"&gt;--lines&lt;/span&gt; 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood (&lt;code&gt;src/daemon/&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interval-based scheduler&lt;/li&gt;
&lt;li&gt;Proper termination and PID handling&lt;/li&gt;
&lt;li&gt;Invokes real syncs and logs results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a minimal reproducible pattern, see &lt;code&gt;examples/scheduler_example.rs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;examples/basic_usage.rs&lt;/code&gt;: configure remotes with the &lt;code&gt;Config&lt;/code&gt; API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;examples/scheduler_example.rs&lt;/code&gt;: periodic tasks with the scheduler&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;examples/ui_formatting.rs&lt;/code&gt;: pretty terminal output helpers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; basic_usage
cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; scheduler_example
cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; ui_formatting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing &amp;amp; CI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tests: &lt;code&gt;tests/unit/&lt;/code&gt; and &lt;code&gt;tests/integration/&lt;/code&gt; cover core logic, providers, UI formatting, sync manager, and workflows&lt;/li&gt;
&lt;li&gt;CI: GitHub Actions build, test, and verify on each change&lt;/li&gt;
&lt;li&gt;Developer utilities: &lt;code&gt;verify.sh&lt;/code&gt;, coverage reports, and a structured changelog&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance &amp;amp; Reliability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Concurrency: tokio + semaphore-based parallelism for bounded concurrency&lt;/li&gt;
&lt;li&gt;Timeouts: network operations include sensible timeouts and progress callbacks&lt;/li&gt;
&lt;li&gt;Accurate metrics: fetch/push feedback and improved commit counting&lt;/li&gt;
&lt;li&gt;Robust error model: typed errors (&lt;code&gt;anyhow&lt;/code&gt;, &lt;code&gt;thiserror&lt;/code&gt;) and structured logging (&lt;code&gt;tracing&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Roadmap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Terminal UI (TUI) dashboard with &lt;code&gt;ratatui&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Workspace management for multiple repos&lt;/li&gt;
&lt;li&gt;Git LFS and Submodules&lt;/li&gt;
&lt;li&gt;Webhook server for push notifications&lt;/li&gt;
&lt;li&gt;GUI app (Tauri)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Contributions are welcome—check &lt;code&gt;CONTRIBUTING.md&lt;/code&gt; and open a PR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started Today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install: &lt;code&gt;cargo install multigit&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Initialize: &lt;code&gt;mg init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add providers: &lt;code&gt;mg remote add &amp;lt;provider&amp;gt; &amp;lt;username&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sync: &lt;code&gt;mg sync&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find MultiGit useful, star the repo and share feedback or ideas. Happy syncing!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>git</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Unlock clearer Rust dependency insight with dep-insight</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Tue, 04 Nov 2025 22:35:38 +0000</pubDate>
      <link>https://dev.to/eshanized/unlock-clearer-rust-dependency-insight-with-dep-insight-16kl</link>
      <guid>https://dev.to/eshanized/unlock-clearer-rust-dependency-insight-with-dep-insight-16kl</guid>
      <description>&lt;p&gt;If you’ve ever felt buried under a sprawling &lt;code&gt;Cargo.lock&lt;/code&gt;, wondered &lt;em&gt;“Which crate dragged in all these transitive deps?”&lt;/em&gt; or &lt;em&gt;“Why do I have two versions of &lt;code&gt;foo-crate&lt;/code&gt; in my workspace?”&lt;/em&gt;, then meet &lt;strong&gt;dep-insight&lt;/strong&gt;: a CLI + library tool designed to give you clear, actionable visibility into your Rust project’s dependency graph.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;In many non-trivial Rust codebases I work or consult on, I keep seeing the same patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate crate versions sneaking in (hello, &lt;code&gt;serde 1.0.130&lt;/code&gt; and &lt;code&gt;serde 1.0.131&lt;/code&gt; side by side)&lt;/li&gt;
&lt;li&gt;One transitive ancestor crate pulling in dozens of downstream modules, silently ballooning compile times and binary size&lt;/li&gt;
&lt;li&gt;License rustle: “Wait, is this dependency licensed permissively? Or do I need to worry?”&lt;/li&gt;
&lt;li&gt;Security: “Do we have known vulnerabilities via &lt;code&gt;rustsec&lt;/code&gt; in our dependencies?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short: I needed clarity. I needed &lt;strong&gt;dep-insight&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What it does — and how
&lt;/h2&gt;

&lt;p&gt;At its core, dep-insight does three important jobs:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Analyze
&lt;/h3&gt;

&lt;p&gt;You run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;dep-insight
&lt;span class="nb"&gt;cd &lt;/span&gt;your-rust-workspace/
cargo dep-insight analyze
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It walks your &lt;code&gt;Cargo.toml&lt;/code&gt; + lockfile, builds the dependency graph, finds duplicates (same crate, multiple versions), flags crates with &lt;em&gt;large&lt;/em&gt; transitive footprints, and gathers metadata (licenses, optional RustSec vulnerabilities) when configured.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Visualize
&lt;/h3&gt;

&lt;p&gt;Need to show the team a picture rather than a wall of text?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo dep-insight visualize &lt;span class="nt"&gt;--out&lt;/span&gt; deps.html &lt;span class="nt"&gt;--no-open&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generates a self-contained HTML file with an interactive D3.js graph of your crate-dependencies. You can hover, zoom, see “aha” moments like “this one crate is pulling in 45 others”.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Integrate &amp;amp; Automate
&lt;/h3&gt;

&lt;p&gt;It outputs JSON too — perfect for CI checks. Want your pull requests to fail if duplicate versions appear? Build automation on top of the JSON output. Want a nightly audit report? Plug it in.&lt;br&gt;
You can also enable the &lt;code&gt;audit&lt;/code&gt; feature to incorporate &lt;code&gt;rustsec&lt;/code&gt; vulnerability scanning and license checks.&lt;/p&gt;


&lt;h2&gt;
  
  
  When &amp;amp; how to use it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pre-release audits&lt;/strong&gt;: Before tagging a release, run &lt;code&gt;analyze&lt;/code&gt; + &lt;code&gt;visualize&lt;/code&gt;, inspect large dependency clusters, ask: “Do we really need &lt;em&gt;that&lt;/em&gt; crate dragging in a hundred deps?”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/PR gate&lt;/strong&gt;: Hook into the JSON output; fail if duplicates &amp;gt; 0 or forbid non-permissive licenses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team onboarding / documentation&lt;/strong&gt;: Use the HTML visualization as a baseline snapshot of your project’s dependencies—so new devs get a big-picture view fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency cleanup sprints&lt;/strong&gt;: Pick an analysis report, pick the “top heavy” crate(s), ask “Can we remove / replace this with a lighter alternative?” and track progress over time.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What it gets right
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It’s written in Rust and built for Rust projects — no awkward cross-language adaptation.&lt;/li&gt;
&lt;li&gt;Works offline (by default) unless you enable online features — good for locked-down CI environments.&lt;/li&gt;
&lt;li&gt;A dual interface: CLI for devs, JSON for machines, HTML for humans and teams.&lt;/li&gt;
&lt;li&gt;Strong “refactoring value”: duplicates + footprint flags directly correlate to maintenance and build-time savings.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What’s still worth improving
&lt;/h2&gt;

&lt;p&gt;Nothing’s perfect, and I see a few areas where dep-insight can push further:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;GitHub Action&lt;/strong&gt; integration would be killer — e.g., automatically generate the HTML, upload as an artifact, comment on PRs with a summary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incremental caching&lt;/strong&gt; of crates.io metadata would speed large workspace analyses.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;SARIF&lt;/strong&gt; or compatible standard format for vulnerability/license results (so security dashboards can ingest them) would enhance enterprise adoption.&lt;/li&gt;
&lt;li&gt;More &lt;strong&gt;examples&lt;/strong&gt; or boilerplate code showing how to embed the library in custom tooling or dashboards could lower the barrier for consumers.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;If your Rust project is more than “a handful of crates”, you’ll likely uncover hidden debt: duplicate versions, unintended heavy subgraphs, license surprises. Half the battle is &lt;strong&gt;visibility&lt;/strong&gt; — &lt;em&gt;knowing what you depend on&lt;/em&gt;. dep-insight gives you that visibility, and makes it usable (and shareable) across your team.&lt;/p&gt;

&lt;p&gt;Give it a spin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;dep-insight
cargo dep-insight analyze &lt;span class="nt"&gt;--json&lt;/span&gt; report.json
cargo dep-insight visualize &lt;span class="nt"&gt;--out&lt;/span&gt; deps.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the output, share the HTML, ask your team “Do we &lt;em&gt;really&lt;/em&gt; need that crate?” and start trimming the unseen baggage.&lt;/p&gt;

&lt;p&gt;If you try it and hit weird results, or have ideas for integrations (like GitHub Actions, dashboard plugins, etc), I’d love to hear about them!&lt;/p&gt;

&lt;p&gt;Happy refactoring 🙂&lt;br&gt;
— Eshan (CEO @ Tonmoy Infrastructure)&lt;/p&gt;

</description>
      <category>rust</category>
      <category>dependencyinversion</category>
      <category>crates</category>
    </item>
    <item>
      <title>9 Must-Know Python-Pandas Operations for Working with Data</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 11 Aug 2025 02:42:15 +0000</pubDate>
      <link>https://dev.to/eshanized/9-must-know-python-pandas-operations-for-working-with-data-1h5o</link>
      <guid>https://dev.to/eshanized/9-must-know-python-pandas-operations-for-working-with-data-1h5o</guid>
      <description>&lt;p&gt;Hey folks 👋&lt;br&gt;
It’s been a while since my last post here — but I’m back! 🚀&lt;/p&gt;

&lt;p&gt;Today I’m sharing a one-stop Pandas cheat sheet + explanations that I’ve been using in my own projects. Whether you’re importing, cleaning, analyzing, or exporting data, this guide will save you time and clicks.&lt;/p&gt;



&lt;p&gt;📥 1. Data Import — Get data into Pandas&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.csv&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load CSV
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_excel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.xlsx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sheet_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sheet1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load Excel
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_sql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Run SQL query
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load JSON
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.parquet&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load Parquet
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Bring data from almost anywhere into your DataFrame.&lt;/p&gt;




&lt;p&gt;🔍 2. Data Selection — Access what you need&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;column&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                &lt;span class="c1"&gt;# Single column
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;row&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;        &lt;span class="c1"&gt;# By label
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;           &lt;span class="c1"&gt;# By position
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col &amp;gt; 5&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# SQL-like filter
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;isin&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])]&lt;/span&gt;  &lt;span class="c1"&gt;# Multiple matches
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Quickly filter and grab specific rows or columns.&lt;/p&gt;




&lt;p&gt;🔄 3. Data Manipulation — Shape your data&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;  &lt;span class="c1"&gt;# Group stats
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;left&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Join data
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pivot_table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;val&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;idx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# Pivot table
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort_values&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ascending&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# Sort
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;melt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id_vars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;value_vars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;    &lt;span class="c1"&gt;# Unpivot
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                         &lt;span class="c1"&gt;# Apply func
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Transform your dataset to match your analysis goals.&lt;/p&gt;




&lt;p&gt;📊 4. Statistics — Quick insights&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                          &lt;span class="c1"&gt;# Summary stats
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;median&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;std&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# Key metrics
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;value_counts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Value %s
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;corr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pearson&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Correlation
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cov&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                               &lt;span class="c1"&gt;# Covariance
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quantile&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;         &lt;span class="c1"&gt;# Quartiles
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Get instant understanding of your data distribution.&lt;/p&gt;




&lt;p&gt;🧹 5. Data Cleaning — Make it usable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dropna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;any&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# Remove NaNs
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ffill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                  &lt;span class="c1"&gt;# Fill forward
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drop_duplicates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;         &lt;span class="c1"&gt;# Deduplicate
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;old&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;new&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;           &lt;span class="c1"&gt;# Replace values
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# Convert type
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;interpolate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;linear&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="c1"&gt;# Fill by trend
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Reliable data means reliable analysis.&lt;/p&gt;




&lt;p&gt;⏳ 6. Time Series — Work with dates&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;M&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                     &lt;span class="c1"&gt;# Monthly avg
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rolling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                 &lt;span class="c1"&gt;# Rolling avg
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                          &lt;span class="c1"&gt;# Shift data
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;date_range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2024&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;freq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;M&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Date range
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asfreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;D&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ffill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# Daily freq
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%Y-%m-%d&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Format date
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Time-based data often needs resampling or shifting.&lt;/p&gt;




&lt;p&gt;✂ 7. String Operations — Text wrangling&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pattern&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Match
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;(\d+)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Extract nums
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;          &lt;span class="c1"&gt;# Split text
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                       &lt;span class="c1"&gt;# Lowercase
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                       &lt;span class="c1"&gt;# Trim spaces
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;\s+&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Normalize spaces
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Clean messy text fields directly in Pandas.&lt;/p&gt;




&lt;p&gt;🚀 8. Advanced Features — Power moves&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                              &lt;span class="c1"&gt;# Chain funcs
&lt;/span&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;df1 + df2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                       &lt;span class="c1"&gt;# Fast eval
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;memory_usage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                 &lt;span class="c1"&gt;# Memory check
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select_dtypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;number&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;       &lt;span class="c1"&gt;# Filter types
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nlargest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                      &lt;span class="c1"&gt;# Top values
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;explode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                          &lt;span class="c1"&gt;# Expand lists
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Write cleaner, faster, and more efficient code.&lt;/p&gt;




&lt;p&gt;💾 9. Data Export — Save your work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.csv&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# CSV
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_excel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.xlsx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sheet_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sheet1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# Excel
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.parquet&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                    &lt;span class="c1"&gt;# Parquet
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orient&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;records&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# JSON
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Share results in the right format instantly.&lt;/p&gt;




&lt;p&gt;💡 Pro Tips&lt;/p&gt;

&lt;p&gt;📝 Use &lt;code&gt;.copy()&lt;/code&gt; to avoid accidental changes.&lt;/p&gt;

&lt;p&gt;🔗 Chain methods for cleaner code.&lt;/p&gt;

&lt;p&gt;🗂 Use &lt;code&gt;dtype='category'&lt;/code&gt; to save memory.&lt;/p&gt;

&lt;p&gt;❌ Avoid &lt;code&gt;inplace=True&lt;/code&gt; — reassign instead.&lt;/p&gt;




&lt;p&gt;💬 Question for you: Which Pandas trick here do you use the most? Or do you have a favorite that’s not listed? Let’s share and make this an even better cheat sheet. 🚀&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>cheatsheet</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mastering Python Virtual Environments: A Complete Guide</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 10 Mar 2025 15:27:13 +0000</pubDate>
      <link>https://dev.to/eshanized/mastering-python-virtual-environments-a-complete-guide-578d</link>
      <guid>https://dev.to/eshanized/mastering-python-virtual-environments-a-complete-guide-578d</guid>
      <description>&lt;p&gt;Python is a powerful and versatile language, but managing dependencies across multiple projects can become a challenge. This is where &lt;strong&gt;Python virtual environments&lt;/strong&gt; come in handy. In this guide, we’ll explore virtual environments in depth, including their benefits, setup, inner workings, and best practices.  &lt;/p&gt;

&lt;h2&gt;
  
  
  📌 What is a Python Virtual Environment?
&lt;/h2&gt;

&lt;p&gt;A virtual environment is an isolated Python environment where dependencies are installed separately from the system-wide Python installation.  &lt;/p&gt;

&lt;p&gt;It allows you to:  &lt;/p&gt;

&lt;p&gt;✅ Maintain project-specific dependencies.&lt;br&gt;&lt;br&gt;
✅ Avoid conflicts between different projects.&lt;br&gt;&lt;br&gt;
✅ Experiment with different package versions safely.&lt;br&gt;&lt;br&gt;
✅ Ensure reproducibility across different environments.  &lt;/p&gt;
&lt;h2&gt;
  
  
  ❓ Why Do We Need Virtual Environments?
&lt;/h2&gt;

&lt;p&gt;Without a virtual environment, all Python packages are installed globally, meaning:  &lt;/p&gt;

&lt;p&gt;🚨 &lt;strong&gt;Dependency Conflicts&lt;/strong&gt; – If two projects require different versions of the same package, one will break.&lt;br&gt;&lt;br&gt;
🚨 &lt;strong&gt;System Pollution&lt;/strong&gt; – Installing packages globally can clutter the system and cause unexpected issues.&lt;br&gt;&lt;br&gt;
🚨 &lt;strong&gt;Reproducibility Issues&lt;/strong&gt; – A project might work on one machine but fail on another due to different package versions.  &lt;/p&gt;

&lt;p&gt;Using virtual environments ensures each project has &lt;strong&gt;its own dependencies&lt;/strong&gt;, preventing conflicts and improving maintainability.&lt;/p&gt;
&lt;h2&gt;
  
  
  ⚙️ How Does a Virtual Environment Work?
&lt;/h2&gt;

&lt;p&gt;When you create a virtual environment, it essentially &lt;strong&gt;replicates&lt;/strong&gt; the structure of a Python installation but in an isolated manner. Here's how:  &lt;/p&gt;
&lt;h3&gt;
  
  
  1️⃣ &lt;strong&gt;Directory Structure&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Creating a virtual environment generates a folder (e.g., &lt;code&gt;myenv/&lt;/code&gt;) with the following structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myenv/
│── bin/ (or Scripts/ on Windows) → Contains the Python binary &amp;amp; activation scripts  
│── lib/ → Contains installed Python packages  
│── include/ → Contains C headers for compiled dependencies  
│── pyvenv.cfg → Configuration file linking the environment to the correct Python version  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ &lt;strong&gt;Activation Mechanism&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you activate a virtual environment:&lt;br&gt;&lt;br&gt;
✔️ The system &lt;strong&gt;modifies the &lt;code&gt;PATH&lt;/code&gt;&lt;/strong&gt; to use the Python binary inside &lt;code&gt;myenv/bin&lt;/code&gt; (or &lt;code&gt;Scripts/&lt;/code&gt; on Windows).&lt;br&gt;&lt;br&gt;
✔️ &lt;code&gt;pip&lt;/code&gt; and all installed packages are scoped within &lt;code&gt;myenv/&lt;/code&gt; instead of affecting global Python.  &lt;/p&gt;
&lt;h3&gt;
  
  
  3️⃣ &lt;strong&gt;Installing Packages&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It installs &lt;strong&gt;only inside the &lt;code&gt;lib/&lt;/code&gt; folder of the virtual environment&lt;/strong&gt; and doesn't affect system-wide Python.&lt;/p&gt;

&lt;h3&gt;
  
  
  4️⃣ &lt;strong&gt;Deactivation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you deactivate the environment, your shell restores the original &lt;code&gt;PATH&lt;/code&gt;, reverting back to system Python.  &lt;/p&gt;

&lt;p&gt;This isolation ensures each project has its own dependencies and doesn't interfere with others.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 How to Set Up a Python Virtual Environment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Check Your Python Version
&lt;/h3&gt;

&lt;p&gt;Before creating a virtual environment, ensure Python is installed on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ Create a Virtual Environment
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;venv&lt;/code&gt; (Recommended for Python 3.3+)
&lt;/h4&gt;

&lt;p&gt;The built-in &lt;strong&gt;venv&lt;/strong&gt; module is the recommended way to create virtual environments in Python 3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a directory named &lt;code&gt;myenv&lt;/code&gt; containing the isolated Python environment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;virtualenv&lt;/code&gt; (For older versions)
&lt;/h4&gt;

&lt;p&gt;If you're using an older Python version (&amp;lt;3.3) or want additional features, install &lt;strong&gt;virtualenv&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;virtualenv
virtualenv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3️⃣ Activate the Virtual Environment
&lt;/h3&gt;

&lt;h4&gt;
  
  
  On macOS/Linux
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source &lt;/span&gt;myenv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  On Windows (Command Prompt)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myenv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\a&lt;/span&gt;ctivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  On Windows (PowerShell)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myenv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\A&lt;/span&gt;ctivate.ps1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once activated, your terminal will show the virtual environment name, indicating that it's active:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;myenv&lt;span class="o"&gt;)&lt;/span&gt; user@machine:~&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4️⃣ Install Dependencies
&lt;/h3&gt;

&lt;p&gt;Now that your virtual environment is active, install dependencies using &lt;code&gt;pip&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;requests flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check installed packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5️⃣ Deactivate the Virtual Environment
&lt;/h3&gt;

&lt;p&gt;When you're done working in the virtual environment, deactivate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔄 Managing Dependencies with &lt;code&gt;requirements.txt&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To make your project reproducible, store dependencies in a &lt;code&gt;requirements.txt&lt;/code&gt; file.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Save Installed Packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install from &lt;code&gt;requirements.txt&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🗑️ Deleting a Virtual Environment
&lt;/h2&gt;

&lt;p&gt;To remove a virtual environment, simply delete the directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; myenv  &lt;span class="c"&gt;# macOS/Linux&lt;/span&gt;
rd /s /q myenv  &lt;span class="c"&gt;# Windows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🛠️ Advanced Virtual Environment Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Using &lt;code&gt;pyenv&lt;/code&gt; for Managing Python Versions
&lt;/h3&gt;

&lt;p&gt;If you work with multiple Python versions, &lt;strong&gt;pyenv&lt;/strong&gt; helps you switch between them. Install &lt;strong&gt;pyenv&lt;/strong&gt; and create virtual environments with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pyenv &lt;span class="nb"&gt;install &lt;/span&gt;3.11.2
pyenv virtualenv 3.11.2 myenv
pyenv activate myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ Using &lt;code&gt;pipenv&lt;/code&gt; for Simplified Dependency Management
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;pipenv&lt;/strong&gt; combines &lt;code&gt;pip&lt;/code&gt; and &lt;code&gt;venv&lt;/code&gt; into a single tool. Install and use it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;pipenv
pipenv &lt;span class="nb"&gt;install &lt;/span&gt;requests
pipenv shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 Best Practices for Virtual Environments
&lt;/h2&gt;

&lt;p&gt;✅ Always create a virtual environment for each project.&lt;br&gt;&lt;br&gt;
✅ Use &lt;code&gt;requirements.txt&lt;/code&gt; for reproducibility.&lt;br&gt;&lt;br&gt;
✅ Keep virtual environments outside your project directory (e.g., &lt;code&gt;~/venvs/&lt;/code&gt;).&lt;br&gt;&lt;br&gt;
✅ Add &lt;code&gt;myenv/&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt; to avoid committing unnecessary files.  &lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;Python virtual environments are a must-have for efficient project management. By isolating dependencies, they help prevent conflicts and ensure smooth development. Whether you're working on a personal project or collaborating with a team, using virtual environments is a best practice you shouldn't ignore!  &lt;/p&gt;

&lt;p&gt;🔹 Do you use virtual environments in your projects? Share your experience in the comments! 🚀 &lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why I Developed Snigdha OS?</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Wed, 08 Jan 2025 13:31:30 +0000</pubDate>
      <link>https://dev.to/eshanized/why-i-developed-snigdha-os-3b2o</link>
      <guid>https://dev.to/eshanized/why-i-developed-snigdha-os-3b2o</guid>
      <description>&lt;p&gt;Developing &lt;strong&gt;Snigdha OS&lt;/strong&gt; has been a journey that combines personal loss, technical passion, and a desire to leave a meaningful legacy. Here’s the story behind why I decided to create this operating system.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. A Tribute to Mubasshira Snigdha
&lt;/h3&gt;

&lt;p&gt;Life has a way of presenting us with moments that change everything. For me, one such moment was the loss of &lt;strong&gt;Mubasshira Snigdha&lt;/strong&gt;, my late girlfriend. Her untimely passing left a void in my life, but it also ignited a desire to honor her memory in a way that would truly reflect her influence on me.&lt;/p&gt;

&lt;p&gt;I named this operating system &lt;strong&gt;Snigdha OS&lt;/strong&gt; as a tribute to her. It is more than just a software project; it’s a testament to the love and inspiration she brought into my life. Every line of code, every feature, and every decision behind Snigdha OS is a way of preserving her legacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Passion for Open Source and Innovation
&lt;/h3&gt;

&lt;p&gt;As an open-source enthusiast, I’ve always believed in the power of technology to empower people. I wanted Snigdha OS to be more than just another Linux distribution; I envisioned it as a system that combines performance, flexibility, and simplicity to cater to a wide range of users, from developers to cybersecurity professionals to everyday users.&lt;/p&gt;

&lt;p&gt;I saw an opportunity to create something unique—an operating system that aligns with modern needs while staying true to the ethos of open source. Snigdha OS embodies my commitment to building a platform that is lightweight, customizable, and accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Addressing Gaps in Existing Linux Distributions
&lt;/h3&gt;

&lt;p&gt;While working with various Linux distributions over the years, I noticed certain gaps—whether it was performance issues, lack of customization, or limited usability for specific workflows. With Snigdha OS, I wanted to bridge these gaps by creating a distribution that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance-Optimized&lt;/strong&gt;: Leveraging the Linux Zen and LTS kernels for improved responsiveness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Highly Customizable&lt;/strong&gt;: Offering a modular approach that allows users to tailor the OS to their needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer-Friendly&lt;/strong&gt;: Pre-configured with tools and frameworks that make it ideal for software development and penetration testing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By focusing on these aspects, I aimed to create a system that not only meets user expectations but exceeds them.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Pushing My Technical Boundaries
&lt;/h3&gt;

&lt;p&gt;Developing an operating system is no small feat, and I saw it as a challenge to push my technical boundaries. It was an opportunity to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Demonstrate my expertise in Linux systems, shell scripting, and software development.&lt;/li&gt;
&lt;li&gt;Learn and grow as a developer while solving complex problems.&lt;/li&gt;
&lt;li&gt;Build something that reflects my skills and passion for technology.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snigdha OS became my playground for experimentation and innovation, allowing me to explore new ideas and bring them to life.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Building a Legacy
&lt;/h3&gt;

&lt;p&gt;Beyond the technical and emotional aspects, I wanted Snigdha OS to stand as a lasting legacy. It’s not just an operating system; it’s a story. A story of love, loss, and the determination to create something meaningful out of life’s most challenging moments.&lt;/p&gt;

&lt;p&gt;I hope Snigdha OS inspires others to pursue their passions and create projects that matter. It’s a reminder that even in the face of adversity, we can build something beautiful and impactful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Last Words
&lt;/h3&gt;

&lt;p&gt;Snigdha OS is more than just an Arch-based Linux distribution. It’s a reflection of my journey, a tribute to someone I deeply loved, and a contribution to the open-source community. Creating it has been a labor of love, a technical challenge, and a deeply personal mission.&lt;/p&gt;

&lt;p&gt;If you’re looking for a performance-driven, customizable, and user-centric operating system, I invite you to try Snigdha OS. It’s not just software; it’s a story, and I’d be honored for you to be part of it.&lt;/p&gt;

</description>
      <category>eshanized</category>
      <category>snigdhaos</category>
    </item>
    <item>
      <title>Install and use VirtualBox on Arch Linux &amp; Snigdha OS</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Tue, 07 Jan 2025 20:47:46 +0000</pubDate>
      <link>https://dev.to/snigdhaos/install-and-use-virtualbox-on-arch-linux-snigdha-os-5cb3</link>
      <guid>https://dev.to/snigdhaos/install-and-use-virtualbox-on-arch-linux-snigdha-os-5cb3</guid>
      <description>&lt;p&gt;To install and use VirtualBox on Arch Linux, you can follow these steps. VirtualBox is available in the Arch User Repository (AUR), and you can install it using &lt;code&gt;pacman&lt;/code&gt; or an AUR helper like &lt;code&gt;yay&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install VirtualBox
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;pacman&lt;/code&gt; (Official Arch repository):
&lt;/h4&gt;

&lt;p&gt;If you're using the VirtualBox version from the official Arch repository, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update your system&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-Syu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install VirtualBox&lt;/strong&gt;:
Install VirtualBox and the required dependencies:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install VirtualBox and related tools. However, you will also need to install the kernel headers for your specific kernel version.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install Kernel Headers:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you are using the default &lt;code&gt;linux&lt;/code&gt; kernel:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; linux-headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are using another kernel, like &lt;code&gt;linux-lts&lt;/code&gt;, install the corresponding headers:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; linux-lts-headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load the VirtualBox kernel module&lt;/strong&gt;:
After installing VirtualBox, load the necessary kernel modules by running:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;modprobe vboxdrv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you encounter errors, try to ensure that the correct kernel headers are installed and that your system is using the correct kernel.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start VirtualBox&lt;/strong&gt;:
Now, you can start VirtualBox from the terminal by typing:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Using the AUR (if you prefer the AUR version):
&lt;/h4&gt;

&lt;p&gt;The AUR version is often up-to-date with the latest VirtualBox releases. You can install it using an AUR helper such as &lt;code&gt;yay&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install yay (if you haven't already)&lt;/strong&gt;:
If you don’t have &lt;code&gt;yay&lt;/code&gt; installed, you can install it using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; yay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install VirtualBox from AUR&lt;/strong&gt;:
Run the following command to install VirtualBox from the AUR:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   yay &lt;span class="nt"&gt;-S&lt;/span&gt; virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will also handle dependencies and kernel headers.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add Your User to the vboxusers Group
&lt;/h3&gt;

&lt;p&gt;To allow your user to use VirtualBox without needing to run it as root, add your user to the &lt;code&gt;vboxusers&lt;/code&gt; group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;gpasswd &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nv"&gt;$USER&lt;/span&gt; vboxusers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to log out and log back in for the changes to take effect.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Create a Virtual Machine (VM)
&lt;/h3&gt;

&lt;p&gt;Once VirtualBox is installed and the necessary modules are loaded, you can start creating and managing virtual machines using the VirtualBox GUI or the command line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start VirtualBox GUI&lt;/strong&gt;: &lt;br&gt;
You can launch VirtualBox from the applications menu or by running &lt;code&gt;virtualbox&lt;/code&gt; in the terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a VM&lt;/strong&gt;:&lt;br&gt;
In the VirtualBox GUI, click on "New" to create a new virtual machine. You will need to specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name and type of OS.&lt;/li&gt;
&lt;li&gt;Memory size.&lt;/li&gt;
&lt;li&gt;Virtual hard disk (you can create a new one or use an existing one).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install an OS on your VM&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Once the VM is created, you can start it and install an operating system on the virtual hard disk.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. (Optional) Install Extension Pack
&lt;/h3&gt;

&lt;p&gt;To unlock additional features such as USB 2.0/3.0 support, better video support, and remote desktop capabilities, you may want to install the VirtualBox Extension Pack.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Download the Extension Pack&lt;/strong&gt; from the VirtualBox website: &lt;a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener noreferrer"&gt;VirtualBox Extension Pack&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the Extension Pack&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After downloading, you can add it to VirtualBox from the GUI by going to &lt;strong&gt;File &amp;gt; Preferences &amp;gt; Extensions&lt;/strong&gt; and clicking the &lt;strong&gt;Add&lt;/strong&gt; button to browse and select the downloaded extension pack file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Troubleshooting:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kernel module issues&lt;/strong&gt;: If you run into issues with loading the &lt;code&gt;vboxdrv&lt;/code&gt; module, ensure that you have the correct kernel headers installed and that your kernel matches the one you're using.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check VirtualBox version compatibility&lt;/strong&gt;: Ensure that you're running the appropriate version of VirtualBox for your kernel and system setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once everything is set up, you can start using VirtualBox to create and manage virtual machines on your Arch Linux system!&lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>snigdhaos</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
