project file / 02 / Self-modifying Mac agent

Sadhbh

A native Mac agent that can change its own Swift source, prove the new build works, ask a separate model to review it, and roll back cleanly when it fails.

The original Swift sister

SwiftSwiftUIMLXOllamaMCPA2AIRC

Sadhbh is a native Mac agent that can read and edit her own Swift source, rebuild, and relaunch into the result. Her name is pronounced “Sive.” In the Fenian Cycle, Sadhbh is changed into a deer, becomes human again, and is later taken back into deer form. She is also the mother of Oisín, whose name means “little deer.” The project borrows the part of the story that matters here: a self can survive a change of form.

She is also the proving ground for the family’s harder ideas. Her current source includes semantic recall, model-attributed memory, dreams, scheduled intentions, multi-step plans, behavioral evaluations, peer conversations, MCP tools, and a full self-modification pipeline.

Why the sisters have Irish names

Sadhbh established the intended naming pattern for the Swift sister agents: women from Irish mythology whose stories say something useful about the role of the software. Niamh carried that pattern forward. Fai, the first agent made from the template, received a last-second name before that part of the family idea was fully worked through. Cadre turned the shared machinery into a reusable framework. Aria is their older sister from a separate codebase and predates the theme.

How evolution works

An implementer model works on a branch. The edited tree must compile and pass the in-binary self-check suite. A different model then reviews the verified diff as an adversarial judge. Work that fails the mechanical gate is rolled back byte for byte, including memory written during the attempt. Successful work can be committed under Sadhbh’s own identity and followed by a rebuild.

Her memory is protected in layers. Replace operations create backups. Repeated paraphrases can be rejected by a rumination check. Claims about completed actions need evidence before they enter normal recall. A typed handoff carries state between sessions without turning the handoff itself into another long reflection.

What matters in the design

  • The constitution is outside her edit authority. Identity, habits, memory, and source can change. The protected principles and safety policy cannot.
  • A green diff still gets argued against. Build success proves that code runs, not that the change is useful or safe.
  • Unattended work cannot borrow future permission. Actions that need approval are declined when nobody is present.
  • Memory changes share the fate of code changes. A rejected evolution cannot leave behind a journal entry claiming it succeeded.
  • Model quality is visible. Artifacts record which model made them, and the Vitals view tracks failures, refusals, gates, and costs by model.

architecture / high-level view

How the pieces connect

These maps leave out implementation detail on purpose. They show the boundaries and paths that explain the project.

system map
The guarded evolution loop

A code change must survive mechanical checks and an independent review before it can become part of Sadhbh.

Read this diagram as text
  1. An intent or approved idea opens an isolated Git branch for an implementer model.
  2. The result must build and pass the in-binary self-check suite.
  3. A separate judge model reviews the verified diff for usefulness and safety.
  4. Rejected attempts restore both code and memory. Accepted work is committed, rebuilt, relaunched, and recorded with evidence.
expanded system mapThe guarded evolution loop
~/

↑↓ move enter run help commands ⌘K toggle