ies/music-topos/.agents/skills/möbius-path-filtering/SKILL.md
Non-orientable topological filtering that eliminates self-revisiting paths
npx skillsauth add plurigrid/asi möbius-path-filteringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A Möbius filter is a non-orientable topological constraint that eliminates paths where traversal would require "doubling back" or revisiting a configuration from a different orientation.
In navigator terms: some paths appear valid locally but are invalid globally because they would require the navigator to traverse the same logical position in two different ways simultaneously—geometrically impossible on a Möbius surface.
This constraint is checked before path compilation, preventing invalid Navigators from ever being cached.
Consider a nested structure:
data = Dict(
"a" => [1, 2, 3],
"b" => Dict(
"c" => [4, 5, 6],
"a" => [7, 8, 9] # Same key name, different context!
)
)
A naive path like [ALL_KEYS, ALL_VALUES, ALL] might:
But what if we then try to transform all "a" keys? The path becomes ambiguous:
On a Möbius surface, this ambiguity is geometrically impossible—you can't have two distinct orientations of the same location.
Möbius filtering rejects paths that would create "twists" in the navigation space. It asks:
"Does this path require the navigator to visit the same logical location from two different orientations?"
If yes → path is invalid and compilation is rejected.
For each path step, track:
A valid path maintains consistent orientation throughout:
For each proposed path:
visited_states = Set()
for step in path:
new_state = (position, orientation)
if new_state in visited_states:
return INVALID # Möbius twist detected!
visited_states.add(new_state)
update(position, orientation) # Based on step type
return VALID
| Step Type | Orientation Change |
|-----------|-------------------|
| ALL | +0 (preserves) |
| keypath(k) | +0 (direct navigation) |
| pred(f) | +0 (filtering, no reorientation) |
| INDEX(i) | +0 (direct indexing) |
| REVERSE | +1 (flips orientation) |
| Nested navigation | Compound (sum orientations) |
Critical: Sequences that accumulate orientation flips (like a Möbius strip has) are rejected.
is_valid_path(path_expr) :: Bool
Returns true if path doesn't create Möbius twists.
is_valid_path([ALL, keypath("x")]) # => true
is_valid_path([REVERSE, ALL, REVERSE]) # => true (2 flips = orientable)
is_valid_path([ALL, REVERSE, ALL, REVERSE]) # => false (creates twist)
validate_path(path_expr) :: Result
Returns validation result with detailed feedback.
result = validate_path([ALL, pred(f), keypath("a"), ALL])
# => ValidResult(:ok, "Path is topologically valid")
result = validate_path([REVERSE, ALL, keypath("self"), ALL])
# => InvalidResult(:möbius_twist, "Orientation flip at step 3 creates non-orientable surface")
eliminate_invalid_paths(paths::Vector) :: Vector
Filters a list of candidate paths, keeping only valid ones.
candidates = [
[ALL, keypath("x")],
[ALL, REVERSE, ALL],
[keypath("a"), keypath("b"), REVERSE, ALL, REVERSE]
]
valid = eliminate_invalid_paths(candidates)
# => [[ALL, keypath("x")], [ALL, REVERSE, ALL]]
When coerce_nav(path_expr) is called:
function coerce_nav(path_expr)
# Step 1: Möbius filtering
is_valid_path(path_expr) || throw(MöbiusTwistError(...))
# Step 2: Type inference
verify_types(path_expr) || throw(TypeMismatchError(...))
# Step 3: Constraint checking
check_constraints(path_expr) || throw(UnsatisfiableConstraintError(...))
# Step 4: Compilation
Navigator(path_expr)
end
| Operation | Complexity | Notes |
|-----------|-----------|-------|
| is_valid_path() | O(|path|) | Single pass, constant per-step |
| Early rejection | O(k) | Stops at first violation (k ≤ |path|) |
| Eliminates invalid paths | Compile-time | Prevents expensive runtime errors |
No runtime overhead - filtering happens before caching, ensuring only valid Navigators are cached.
A consequence of Möbius filtering: valid paths never revisit states.
Why? Because revisiting with different orientation = Möbius twist = invalid path.
This guarantees:
Without Möbius filtering:
# These would all pass type checking and compile successfully
nav1 = @late_nav([ALL, keypath("x"), pred(f), ALL, keypath("x")]) # ❌ Möbius twist!
nav2 = @late_nav([REVERSE, REVERSE, REVERSE]) # ❌ Odd number of flips!
nav3 = @late_nav([keypath("a"), keypath("b"), pred(g), keypath("a")]) # ❌ Revisit with flip!
With Möbius filtering: All three are rejected during validation, before any Navigator is created.
# Circular reference
data = Dict("x" => Dict())
data["x"]["ref"] = data
# Path that would traverse: root → x → ref → x → ...
# Möbius filtering rejects this at step 3 (re-entry to "x" from different orientation)
# Transform a value that references itself
data = [1, 2, 3]
data[1] = data # Circular!
# Any path that goes [INDEX(1), ALL, INDEX(1)] is invalid
development
BDD-Driven Mathematical Content Verification Skill Combines Behavior-Driven Development with mathematical formula extraction, verification, and transformation using: - Cucumber/Gherkin for specification - RSpec for implementation verification - mathpix-gem for LaTeX/mathematical content extraction - Pattern matching on syntax trees for formula validation Enables iterative discovery and verification of mathematical properties through executable specifications.
tools
Meta-skill that generates domain-specific AI skills from tool documentation
development
Code Query with AI-enhanced deterministic analysis via SplitMix ternary classification
development
Directed Yoneda lemma as directed path induction. Riehl-Shulman's key insight for synthetic ∞-categories.