Skip to content

Instantly share code, notes, and snippets.

View galligan's full-sized avatar
🧪
Tinkering

Matt Galligan galligan

🧪
Tinkering
View GitHub Profile
@galligan
galligan / MIKE-QUESTIONS-RESPONSE.md
Created April 13, 2026 16:47
Response to Mike's questions on libxmtp modularity work

Responding to Mike's Questions on the Modularity Work

This document maps Mike's specific questions and concerns to what the exploration found, where things actually live in the stack, and what's protocol-required vs. solvable at a higher layer.

1. Crypto and security isolation

Mike's question: Stronger isolation of crypto and security concepts. Make it hard to get wrong. End consumers shouldn't care about nonces, inbox IDs, installations. How close can we get?

Where this stands today:

@galligan
galligan / 2026-04-13-libxmtp-modularity-exploration-status-check.md
Last active April 13, 2026 16:12
2026-04-13 `libxmtp` Modularity Exploration Status Check

libxmtp Modularity Exploration: Status and Findings

Context

Over the weekend I ran a structured exploration into whether libxmtp's internals, specifically mls_sync and the groups module, could be made meaningfully more modular without forcing a broad public crate split or breaking downstream consumers. These are the two largest and most complex modules in the codebase, and their size has been making it harder to reason about behavior, isolate bugs, and onboard new contributors.

I used my team of agents (Codex & Claude) to do the heavy lifting: planning milestones, executing the refactors, writing tests, and validating the results. The goal was to answer the modularity question with code, not architecture diagrams. Prove or disprove specific internal boundaries, then make a grounded recommendation. The work followed an incremental milestone plan (M0–M8), where each milestone produced reviewable commits and a retro that informed the next step.

By the numbers

@galligan
galligan / split-host-remote-design.md
Last active April 8, 2026 20:06
xmtp-signet: split host/remote design (draft)

Split host/remote signet — design

Status: Living draft. Section 1 reflects converged direction from the brainstorm; later sections are placeholders to be filled in as the conversation continues. Do not treat unfilled sections as decided.

0. Context

Signet today runs as a single daemon: the XMTP node, key vault, policy engine, credential lifecycle, and any agent code that consumes credentials all live in one process. That works for a developer running it on their laptop, but it forecloses two things we want:

  1. Ephemeral agent processes. A long-running container holds the XMTP connection; agent processes spin up only when there is work for them.
  2. Hosted signet. Eventually a third party (e.g. XMTP Labs) can run the host half so a developer signs up, points their code at it, and ships an agent without operating an XMTP node themselves.
@galligan
galligan / qmd-chunking-note.md
Last active April 10, 2026 16:29
qmd chunker improvements: four-PR series context for tobi

qmd chunker: improvements PR

PR: #553 (consolidated from earlier stacked PRs #538-#541)

I've been using qmd to index agent instruction files and Obsidian-style notes and noticed chunks landing in weird places. Pulled the thread and it turned into four distinct improvements, shipped as one PR with clean commit-per-change history.

What's wrong today

The chunker uses scored "break points" (places where splitting is OK) and "protected regions" (places to never split). Four specific issues:

@galligan
galligan / trails-ergonomics-brief.md
Created April 5, 2026 11:49
Trails ergonomics brief — CLI surface, scaffolding, pattern generators design context

Trails Ergonomics Brief

Comprehensive context for designing the next phase of Trails developer experience. Covers three layers: CLI trailhead primitives, the trails CLI tool, and pattern generators. Written April 5, 2026 after shipping beta.14.

Design Direction (from conversation with Matt)

These decisions shape the design across all three layers:

Audience

Both agents and curious human developers. An agent operates entirely through flags and JSON. A human who runs trails create without flags gets a guided experience. Neither should feel like a second-class citizen.

GitButler Per-Branch Stack Verification

Why Stacks Matter for Agent Workflows

Stacked branches unlock something that wasn’t practical before: agents can independently ship large, complex features while keeping every change reviewable.

The confluence looks like this. On the build side, agent teams can now parallelize across a stack — one team on infrastructure, another on business logic, another on docs — and land a big feature as a series of small, scoped PRs instead of one monster diff. On the review side, code review tools like Reptle, Devin, and others are most effective when PRs are tight — small line count, limited file scope, clear intent. Stacks give both sides what they need.

That’s a real improvement over what we had before. Giant PRs that no human (or bot) can meaningfully review. Or the alternative: manually decomposing work into branches that constantly drift and conflict. Stacks make it possible to move fast on big features and enforce correctness at each slice. From a git hygiene pers

@galligan
galligan / layers-promotion-vs-subsumption.md
Created April 1, 2026 04:48
Trails ADR exploration: Should layers be promoted to first-class primitives or subsumed into existing ones?

Should Layers Be Promoted to First-Class Primitives?

Context: Trails has four definition functions — trail(), service(), event(), and pack() — that produce frozen objects with kind discriminants, namespaced IDs, and full participation in survey, warden, and testing. Layers are the exception: plain objects with name and wrap, no factory, no kind, no topo registration, no governance. This document explores whether layers should be promoted to match the other primitives or subsumed into them.

The Current State

What layers look like today

// Auth: plain object literal
@galligan
galligan / xmtp-signet-agent-harness.md
Created March 30, 2026 16:21
A design note on making `xmtp-signet` harness-compatible with fast HTTP actions, a websocket-first event bridge, and a cleaner path from XMTP’s client-shaped runtime to existing agent workflows.

XMTP Signet, Harness Compatibility, and the Fast Path to HTTP

Date: 2026-03-30 Status: Working memo

Thesis

The current XMTP pain is real, but the right answer is not "make XMTP look exactly like Slack webhooks."

The right answer is:

Warden Dogfood: A Progressive Discovery

How an attempt to dogfood the Trails framework on its own governance system led to a deeper architectural insight — and made the framework better.


Part 1: The Experiment

We set out to prove the Trails model by applying it to its own governance tool. The warden has 16 lint rules that check Trails conventions. We wrapped each one as a trail() with typed Zod schemas and examples, composed them into a lintFile hike via ctx.follow(), and made them discoverable through a wardenTopo.

Restructuring a CLI in Trails: blazecreate + add

The request

"I'd like to split blaze up in the CLI to simply create for new repos, adding trails to existing projects, or adding a new package within a workspace. Then add for the other parts of blaze, such as trails add trail 'name'."

This is a product-level restructuring of a 9-trail CLI tool. The old command tree:

trails blaze  # scaffold a project (route composing 3 sub-trails)