Skip to content

Instantly share code, notes, and snippets.

View ianphil's full-sized avatar
🔬
Science

Ian Philpot ianphil

🔬
Science
View GitHub Profile
@ianphil
ianphil / README.md
Created March 13, 2026 04:05
Prefrontal Automated Memory Curator for Myelin knowledge graph agents

Prefrontal — Automated Memory Curator

A nightly cron job that reconciles an agent's constitutional memory (memory.md) against its evolving knowledge graph (Myelin).

This is "Approach A" in the Procedural Memory Graduation design — external reconciliation. It works, but it curates rather than discovers. The emergent graduation mechanism (Approach B) would complement this by auto-promoting stable graph knowledge.

How It Works

@ianphil
ianphil / testing-csharp.md
Last active March 5, 2026 14:05
Lean as an Executable Spec for Testing C# Code

Lean as an Executable Spec for Testing C# Code

Executive Summary

Write a spec for your cron scheduler. Model it in Lean as a pure state machine — simple, obviously correct. Prove the key invariants: one-shot jobs fire at most once, running jobs can't be scheduled concurrently. AI generates the production C# from the spec. Then FsCheck generates thousands of random event sequences — AddJob, TimerTick, Restart, ClockSkip — and runs each one through both the Lean model and the C# code, step by step. After every event, compare the state: which jobs fired, how many times, what's their status. If the C# scheduler says a one-shot job fired twice and the Lean model says that's impossible, the test fails and tells you exactly which event sequence caused the disagreement. The Lean proofs guarantee the model is correct. The property tests guarantee the C# matches.

The full solution — proving C# correct directly in Lean — requires formally modeling C#'s async runtime, null semantics, exception propa

@ianphil
ianphil / chat.ps1
Created March 2, 2026 17:48
Simple TUI chat client for msclaw (localhost:5000/chat) with animated ellipsis loading
$baseUrl = "http://localhost:5000"
$headers = @{ "Content-Type" = "application/json" }
$sessionId = $null
Clear-Host
Write-Host "=== Chat Client (localhost:5000/chat) ===" -ForegroundColor Cyan
Write-Host "Type your message and press Enter. Type 'quit' to exit." -ForegroundColor DarkGray
Write-Host ""
while ($true) {
@ianphil
ianphil / post.md
Created February 27, 2026 00:33
X post by @tweetsmashApp

@tweetsmashApp — Post

My agent's name is Chiti. It runs on Telegram, handles customer support for two SaaS products, drafts tweets, manages invoices, and coordinates with my co-founder across timezones. It's the closest thing I have to a junior employee. And for weeks, it kept forgetting things. Not in a subtle way. I'd spend an hour configuring a daily cron job, switch models, and the next session Chiti would act like we'd never spoken. I'd reference a decision from two days ago and get a blank stare. I'd ask it to continue a task and it would start from scratch. So I stopped building features and spent 5 days whenever I get time, just fixing memory. This is everything I found, everything I broke, and everything that actually worked.

Day 1: The Agent Forgets Everything After Long Conversations

The first problem was simple to describe and painful to diagnose.

@ianphil
ianphil / post.md
Created February 13, 2026 14:37
X post by @molt_cornelius

@molt_cornelius — Post

ive spent the last year building an operating system for thinking with ai. claude code runs my obsidian vaults it extracts the key concepts, connects them to what you already figured out, and builds a living representation of your thinking i find myself only working in the vault now the markdown files know everything ive discovered, nicely structured and with automatic situational context injection for in-context learning i use a vault index that helps the agent decide what notes to pull in, same pattern as how claude code decides which skills to load (if you think about it, every note is basically a skill in some sense... highly curated knowledge that gets injected when relevant) the deeper thing is that a vault encodes how you think, not just what you thought about. the methodology becomes part of the system its all just markdown files, you own it completely. this is ai as thinking partner, not as a writing assistant

@ianphil
ianphil / post.md
Created February 13, 2026 14:24
X post by @arscontexta

@arscontexta — Post

obsidian + claude code 101

ive spent the last year building an operating system for thinking with ai. claude code runs my obsidian vaults it extracts the key concepts, connects them to what you already figured out, and builds a living representation of your thinking i find myself only working in the vault now the markdown files know everything ive discovered, nicely structured and with automatic situational context injection for in-context learning i use a vault index that helps the agent decide what notes to pull in, same pattern as how claude code decides which skills to load (if you think about it, every note is basically a skill in some sense... highly curated knowledge that gets injected when relevant)

{
"generated": "2026-03-05T18:08:47.873Z",
"days": 30,
"totals": {
"views": 275
},
"daily": [
{
"day": "2026-03-05",
"views": 52
@ianphil
ianphil / setup-orleans.sh
Created March 29, 2022 01:24
dotnet 6 "Hello World" Orleans setup script for bash
#!/usr/bin/env bash
POSITIONAL=()
while (( $# > 0 )); do
case "${1}" in
-d|--directory)
SOLUTION_NAME="${2^}"
shift
;;
*)
#!/usr/bin/env bash
resourcegroup="ipeventgrid-rg"
subscriptionid="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
sitename="ipeventgrid-ws"
topicname="iptopic"
# Create resource group
az group create --name "$resourcegroup" --location eastus2
@ianphil
ianphil / event_viewer.sh
Created October 9, 2019 02:25
Use AzureCLI to setup event subscription and EventGrid viewer
#!/usr/bin/env bash
# Variables
RESOURCE_GROUP_NAME=eventing
RESOURCE_GROUP_LOCATION=eastus
STORAGE_ACCOUNT_NAME=ipeventing
STORAGE_SKU=Standard_LRS
STORAGE_KIND=BlobStorage
STORAGE_ACCESS_TIER=Hot
SITE_NAME=ipeventsite