Model Nix store as Attributed C-Set for dependency verification, GC analysis, and Flox world management with Gay.jl coloring.
/plugin marketplace add plurigrid/asi/plugin install plurigrid-asi-skills@plurigrid/asiThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Trit: -1 (MINUS) - Constraint verification of Nix store semantics
Model Nix store as Attributed C-Set for dependency verification and world management.
@present SchNixStore(FreeSchema) begin
(Path, Hash, Name, Type, World)::Ob
path_hash::Hom(Path, Hash)
path_name::Hom(Path, Name)
path_type::Hom(Path, Type)
depends_on::Hom(Path, Path)
belongs_to::Hom(Path, World)
hash_value::Attr(Hash, String) # 32-char base32
name_value::Attr(Name, String)
type_value::Attr(Type, Symbol) # :drv, :out, :source, :patch
world_name::Attr(World, String)
size_bytes::Attr(Path, Int)
is_dead::Attr(Path, Bool)
end
function live_roots(store::NixStoreACSet)
filter(p -> !store[:is_dead][p], parts(store, :Path))
end
function dead_paths(store::NixStoreACSet)
filter(p -> store[:is_dead][p], parts(store, :Path))
end
Flox environments as categorical worlds:
World := {name, dev_env, run_env, manifest}
Live worlds (2024-12-24):
music-topos - Audio/visual synthesisstellogen - Stellar generatorsbevy_fullscreen_app - Rust game enginecubical-agda - HoTT proof assistantDependencies form a sheaf over the store graph:
function dependency_sheaf(store::NixStoreACSet)
# Check transitive closure consistency
for p in parts(store, :Path)
deps = store[:depends_on][p]
for d in deps
@assert haspart(store, :Path, d)
end
end
end
function hash_to_color(hash::String)
seed = parse(UInt64, hash[1:16], base=32)
gay_color(seed ⊻ GAY_SEED)
end
| Metric | Value |
|---|---|
| Dead paths | 299 |
| Reclaimable | 3.9 GB |
| Live roots | 17 |
| Worlds pruned | 5 |
nix-acset-worlding (-1) ⊗ flox-envs (0) ⊗ world-hopping (+1) = 0 ✓
nix-acset-worlding (-1) ⊗ structured-decomp (0) ⊗ gay-mcp (+1) = 0 ✓
# Snapshot current store
nix-store --gc --print-roots > roots.txt
nix-store --gc --print-dead > dead.txt
# Build ACSet from snapshot
julia -e 'using NixACSet; build_from_snapshot("dead.txt")'
# Verify dependency sheaf
julia -e 'using NixACSet; verify_sheaf(load_store())'
P ──────→ A
│ │
↓ ↓
B ──────→ C
When two derivations depend on conflicting versions: