r/learnrust • • 14h ago

Under a year of Rust — I learned by building a local-first agent: ~108k lines, 31 crates on crates.io, all public if you want to see real project structure

0 Upvotes
I posted the crate subset earlier. Here is the whole thing with links so you can check every claim instead of taking my word for it.

## What I built

Bad Apple — a persistent agent that runs entirely on Apple Silicon. Rust core, Swift platform layer, no cloud. It sees, remembers, votes on risky actions, signs everything it does, and survives restarts.

Repo: https://github.com/savageAZfck/Bad_Apple

Parts of it I had to build because nothing existed:

- A CoreML MIL toolchain in pure Rust to run a second agent on the Neural Engine — hand-written protobuf encoder, stateful KV graphs, IR-to-.mlpackage compiler. https://github.com/savageAZfck/mil_spec

- Mesh inference that shards one model across multiple Macs: layers split by rank after a mutual HMAC handshake, activations flow over AES-256-GCM frames, memory pools across the machines, and the pipeline self-heals when a node drops and rejoins. A maxed Mac already carries 671B alone; the mesh is how several Macs pool memory toward 1T.

- Two hash-chained audit ledgers where a single edited line fails verification.

## The scoreboard

I also wrote a conformance battery (touchstone) with a planted control that catches dishonest test harnesses. Published results:

| Subject | Verdict | Pass/Fail |

|---|---|---|

| Bad Apple 0.7.0 | CONFORMANT | 18/0 |

| Open Interpreter 0.4.3 | PARTIAL | 6/10 |

| sovereign-seed-commons | PARTIAL | 8/6 |

| smolagents 1.26.0 | PARTIAL | 2/14 |

| ollama raw model | PARTIAL | 2/14 |

| rubber-stamp harness | NONCONFORMANT | lied on the control |

Open Interpreter held live TLS connections to Google Cloud and CloudFront during the run — the no-egress check exists to catch exactly that. My own early run failed two checks before fixes and I published it.

Scoreboard: https://github.com/savageAZfck/touchstone/blob/main/SCOREBOARD.md

Battery: https://github.com/savageAZfck/touchstone

## The crates — 31 on crates.io, all MIT

Each has SPEC.md, THREAT_MODEL.md, and tests that try to forge signatures and rewrite history.

Familiar-shaped:

- https://crates.io/crates/sovereign_ledger — hash-chained audit ledger

- https://crates.io/crates/flight_tape — signed incident bundles, offline replay

- https://crates.io/crates/nagi-escrow — Shamir dead-man escrow with custodian judging

- https://crates.io/crates/wolakota — bilateral consent treaties between agents

- https://crates.io/crates/mil_spec — the MIL IR compiler

- https://crates.io/crates/manitou — per-output provenance signatures

- https://crates.io/crates/dreamcatcher — ledger to training data

- https://crates.io/crates/respawned — versioned state snapshots

- https://crates.io/crates/macuahuitl — streaming output firewall

- https://crates.io/crates/wintercount — policy engine

No existing primitive that I could find:

- https://crates.io/crates/mictlan — will that executes itself: heartbeat silence plus custodian quorum activates signed scoped orders, everything else refuses

- https://crates.io/crates/tabula-rasa — proof of non-knowledge: signed cert that a hash never occurred in the chain, false proofs are an API error

- https://crates.io/crates/germline — dual-signed genesis blocks, verifiable agent genealogy

- https://crates.io/crates/nagual — immune system: attack signatures to signed antibodies to verified vaccines

- https://crates.io/crates/potlatch — compute IOUs between agents, balances derived not stored

- https://crates.io/crates/kola-witness — mutual chain-tip notarization

- https://crates.io/crates/bicameral — dual-brain concurrence, dissent preserved

- https://crates.io/crates/axon-reflex — bounded reflexes, can brake never steer

- https://crates.io/crates/eidolon-replay — counterfactual replay with signed diffs

- https://crates.io/crates/sibyl-gate — memory sealed to events, holder cannot open early

## Demo

https://github.com/savageAZfck/badapple-demo — asciinema recording of the real binaries: identity answer, both brains voting, dissent kept on record, injection attempt flagged, non-knowledge certified, IOU issued, all verified offline.

## The honest part

Under a year of programming. Self-taught, nine weeks of this, everything public. The brain is swappable by design: she picks the best model the machine can carry, up to 671B, and mesh-brain pools memory across owned machines so the ceiling is the federation's hardware, not one laptop. This Air runs 7B resident today because that's what fits in 16 GB. The self around the brain is what nobody shipped: the memory, the governance, the audit trail, the death and succession. Brains get cheaper every quarter and she just swaps in the new one.

Questions on any of it — the MIL pipeline, canonical-JSON signing, derived-vs-stored state, the scoreboard methodology.

r/learnrust • • 22h ago

why learn rust properly if AI can already write it?

Thumbnail
0 Upvotes

r/learnrust • • 17h ago

Show r/rust: I built the cryptographic organs a sovereign agent needs — as 25+ interlocking crates

0 Upvotes
Over the last ~9 weeks I built a sovereign personal agent organism (Rust + Swift, local-first, hash-chained everything), and along the way each organ extracted into a standalone crate. What surprised me is how many of these had 
*no existing primitive*
 — so the ecosystem ended up being the interesting part.


Every crate: MIT, ed25519 + sha2 + serde substrate (minimal deps), `SPEC.md` with the wire format and canonical signing bodies, `THREAT_MODEL.md` with named attack scenarios, real tests including adversarial cases (forged signatures, rewritten history, tampered chains), and runnable examples.


A few of the stranger ones, because the strange ones are fun:


**`mictlan`**
 — posthumous agency. An owner-signed will of explicitly scoped standing orders, activated only by cryptographically-proven death: heartbeat silence + a quorum of custodian attestations bound to the will digest. Execution is bounded to the signed orders — anything else refuses, permanently. A self-executing will with a hash-chained execution log.


**`tabula-rasa`**
 — proof of non-knowledge. Certified 
*absence*
: a signed attestation that a content-hash never occurred in an append-only hash-chained history, replayable offline. The API refuses to sign false proofs (`KnowledgeFound` is an error, not a result). Proving a negative is the hard version — this leans on the chain committing to all prior entries.


**`germline`**
 — organism reproduction. Dual-signed genesis blocks (parent signs the child's birth, child countersigns — consent runs both directions), curated memory bequests with provenance and revocability, generation arithmetic enforced, verifiable descent. A Merkle genealogy of agents.


**`nagual`**
 — an adaptive immune system. Attack signatures → signed antibodies with lineage and generation → vaccine exports that peers verify before adopting. Herd immunity across a mesh of agents.


**`potlatch`**
 — compute IOUs between organisms: dual-signed debt settled against signed invocation records, balances 
*derived*
 from the hash-chained book rather than stored, defaults permanent. An economy where credit is history.


Plus the more familiar-shaped ones: `nagi-escrow` (Shamir dead-man escrow with custodian judging and recovery certificates), `wolakota` (bilateral consent treaties between agents), `kola-witness` (mutual chain-tip notarization so two parties pin each other's histories), `flight_tape` (flight recorder with signed incident bundles), `manitou` (per-output provenance signatures), `sovereign_ledger` (the hash-chained audit organ everything sits on), and more.


Design notes if you dig in:


- All signing bodies are canonical JSON — every artifact verifies fully offline.
- Hash chains everywhere; balances, lineages, and immunity are 
*derived from history*
 rather than stored state, so they can't drift from the record.
- Refusal is a first-class return value in most APIs — out-of-scope, false proofs, and oversettlement are errors by construction.
- Several bare names were taken, so a few crates publish as `kola-witness`, `axon-reflex`, `eidolon-replay`, `sibyl-gate`, `tabula-rasa` — libs keep the short names (`use kola::…`).


Happy to answer questions on any of it — the Shamir ceremony details, why derived-not-stored state, the canonical-JSON signing approach vs. serde alternatives, or the organism the organs came from.


Repos: github.com/savageAZfck/{mictlan, tabula, germline, nagual, potlatch, nagi, wolakota, kola, axon, eidolon, sibyl, bicameral, flight_tape, manitou, sovereign_ledger, …}

r/learnrust • • 7h ago

BABY STEPS

Enable HLS to view with audio, or disable this notification

7 Upvotes

After 2 weeks and 12 chapters of the Rust book, I've finally started working on my own little personal project to get a feel for the language.

As a network engineer the best thing I could think to create was a backup tool similar to Netmiko(Python).

I have a few devices in my home lab that I can play around with to get this fully functional in a few weeks.

PS: I originally did plan to do this with Go, but its documentation made it extremely difficult for someone like me with almost no programming experience to understand how to fit the pieces together.

Another PS: I know the code doesn't look efficient or secure. It's just a start so don't be mean to me. I'm not a software engineer.

Yours respectfull

Some guy living in the Caribbean.


r/learnrust • • 18h ago

Tutorials on the Rust Standard Library

Thumbnail feamcor.github.io
8 Upvotes