Skip to content
Agentmart
Submit a tool

type-inference-validation

Static type inference and validation for navigation paths

Skill by plurigrid

IndexedMIT★ 70
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/plurigrid-type-inference-validation

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Static type inference and validation for navigation paths

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/type-inference-validation

What's inside

Skill name
type-inference-validation
Description
Static type inference and validation for navigation paths
License
MIT
Instructions
255 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Type Inference Validation

## Core Concept

Static type validation that **rejects invalid path compositions before caching**. Every Navigator path must prove type compatibility with its input structure—this skill enforces that proof.

Works alongside Möbius filtering as a second line of defense: Möbius eliminates topological impossibilities, Type Inference eliminates structural impossibilities.

## Why Type Validation?

Consider this dangerous scenario:
```julia
data_numbers = [1, 2, 3, 4, 5]
data_dict = Dict("x" => 10, "y" => 20)

# This path makes sense for numbers
nav1 = @late_nav([ALL, pred(iseven)])  # Type ✓: Vector → Numbers → Numbers

# But what if someone mistakenly uses it on the dict?
nav_select(nav1, data_dict, x -> [x])
# => IndexError! (dicts don't support ALL enumeration this way)
```

**Type Inference Validation prevents this at compile time**, not runtime.

## Architecture

### Type System

Each Navigator carries a **type signature**:
```
Navigator{InputType, OutputType, PathSteps}
```

Examples:
```julia
nav_vector = Navigator{Vector, Vector, [ALL, pred(f)]}
nav_dict = Navigator{Dict, Vector, [keypath(k), ALL]}
nav_sexp = Navigator{SExpression, Symbol, [sexp_nth(2), SEXP_HEAD]}
```

### Type Refinement Pipeline

```
Input Type
    ↓
@late_nav(path_expr) triggers validation
    ↓
Type each step in path:
  [ALL] : Vector{T} → T
  [keypath(k)] : Dict{K,V} → V
  [pred(f)] : T → T (preserves type)
  [INDEX(i)] : Vector{T} → T
  [SEXP_HEAD] : SExpr → Symbol
    ↓
Unify step outputs with next step inputs
    ↓
Final output type computed
    ↓
Cache with type signature
    ↓
Accept or Reject
```

### Type Incompatibility Detection

| Step | Input Type | Output Type | Valid? |
|------|-----------|------------|--------|
| `[ALL]` | Vector{T} | T | ✓ |
| `[ALL]` | Dict{K,V} | ⚠️ (ambiguous) | ✗ |
| `[keypath(k)]` | Dict{K,V} | V | ✓ |
| `[keypath(k)]` | Vector{T} | ✗ | ✗ |
| `[pred(f)]` | T | T | ✓ |
| `[INDEX(i)]` | Vector{T} | T | ✓ |
| `[INDEX(i)]` | Dict | ✗ | ✗ |

## API

### Type Inference

**`infer_type(path_expr, input_type) :: Result{OutputType, Error}`**
Computes the output type of a path given an input type.

```julia
infer_type([ALL, pred(iseven)], Vector{Int})
# => Result(Int)  # outputs Int values

infer_type([keypath("x"), ALL], Dict{String, Vector{Int}})
# => Result(Int)  # navigates to x, then enumerates integers

infer_type([keypath("x")], Vector{Int})
# => Result(TypeError("Cannot apply keypath to Vector"))
```

**`validate_path(navigator::Navigator, input_type) :: Bool`**
Checks if a Navigator is compatible with a given input type.

```julia
nav = @late_nav([ALL, pred(f)])
validate_path(nav, Vector{Int})      # => true
validate_path(nav, Dict{String, Int})  # => false ✗

# Causes @late_nav to reject the Navigator before caching
```

### Type Signatures

**`navigator_signature(nav::Navigator) :: TypeSignature`**
Returns the full type signature of a cached Navigator.

```julia
nav = @late_nav([ALL, pred(iseven)])
sig = navigator_signature(nav)

# => TypeSignature(
#     input: Vector{T},
#     output: T,
#     constraints: [iseven(T)],
#     steps: [[ALL], [pred(iseven)]],

From plurigrid/asi, MIT.

More from plurigrid/asi

Signals

Stars
70
Forks
13
Open issues
3
Last commit (this folder)
Dec 27, 2025 (10 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from plurigrid

Cite this page

type-inference-validation skill. Agent Mart. https://agentmart.dev/skills/plurigrid-type-inference-validation (last updated 2026-10-24)