Asi finder-color-walk
Deterministic triadic fanout over file-sets with macOS Finder label coloring, GF(3) conservation, and Strong Parallelism Invariance (SPI).
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/finder-color-walk" ~/.claude/skills/plurigrid-asi-finder-color-walk-08c36b && rm -rf "$T"
manifest:
skills/finder-color-walk/SKILL.mdsource content
finder-color-walk
Deterministic triadic fanout over a file-set, with macOS Finder label coloring, supporting GF(3) conservation and Strong Parallelism Invariance (SPI).
Contract
Inputs
- Root path(s) to enumerate files (user-supplied).
- Optional filters (extensions, max depth, ignore globs).
- Policy:
(default):raw
only; SPI holds; GF(3) not guaranteed.color_at(file)
: colors are assigned in position-aligned triplets across the 3 routed fibers; GF(3) holds.gf3_balanced
Outputs
- A (file → color) assignment and a (file → fiber) routing.
- Optional application of macOS Finder label colors.
Guarantees
SPI (Strong Parallelism Invariance)
For a fixed file-set, policy, and seed:
- routing is deterministic and order-independent
- color assignment is deterministic and order-independent
Formally: any permutation of the same input file-set yields the same final mapping.
GF(3) conservation (policy = gf3_balanced
)
gf3_balancedLet the three fibers be sorted lists
F0,F1,F2 of equal length N.
For each index i define trits t0(i), t1(i), t2(i) ∈ {0,1,2} as assigned to F0[i],F1[i],F2[i].
Then for all i:
t0(i) + t1(i) + t2(i) ≡ 0 (mod 3)
Implementation: choose
t0,t1 deterministically; set t2 := (-t0-t1) mod 3.
Files
— Catlab ACSet schema:schema.jl
.FileColorWalk
— GF(3)-balanced routing into 3 fibers.triadic_router.bb
— single-stream walk (policyfinder_color_walk.bb
).raw
— 3-stream walk +parallel_walk.bb
coloring.gf3_balanced
— verifies SPI + GF(3) (where requested).spi_test.py
— 4-corpus synthesis notes.INTERLEAVED.md
Quick start
Route files into 3 fibers
bb triadic_router.bb --root . --out fibers.json
Apply GF(3)-balanced colors (dry-run by default)
bb parallel_walk.bb --fibers fibers.json --policy gf3_balanced --dry-run
Verify invariants
python spi_test.py --fibers fibers.json --policy gf3_balanced
macOS Finder label mapping
Trits → label colors (customize inside scripts):
- 0: None
- 1: Green
- 2: Blue
Related Skills (Backlinks)
| Skill | Trit | Integration |
|---|---|---|
| google-workspace | 0 | Drive file coloring via |
| gay-mcp | +1 | SplitMix64 algorithm, trit-to-hue mapping |
| triad-interleave | +1 | Schedule file walks in balanced triplets |
| bisimulation-game | -1 | Verify file state equivalence |
| spi-parallel-verify | -1 | Strong Parallelism Invariance verification |
Comparison with Related Skills
vs gay-mcp
- gay-mcp: Pure color generation, OkLCH space, hex output
- finder-color-walk: File-focused, routing + coloring, Finder integration
- Shared: SplitMix64 RNG, GF(3) trits, SPI guarantee
vs triad-interleave
- triad-interleave: Stream scheduling, temporal ordering
- finder-color-walk: Spatial routing into fibers
- Shared: 3-way balanced triplets, GF(3) conservation
vs bisimulation-game
- bisimulation-game: State equivalence verification
- finder-color-walk: Deterministic state generation
- Integration: Use bisim to verify color assignments match across systems
Integration Bridge
# drive_color_walk.py bridges: # google-workspace MCP (file listing) # → finder-color-walk (GF(3) routing) # → gay-mcp (color generation) # → Finder/Drive labels from google_workspace import list_drive_items from finder_color_walk import route_to_fibers, gf3_color from gay import SplitMixTernary files = list_drive_items(folder_id="root") fibers = route_to_fibers(files, seed=0x42D) colored = gf3_color(fibers, seed=0x42D) # Apply to both Drive (via MCP) and Finder (via xattr)