Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
389 commits
Select commit Hold shift + click to select a range
898ace3
Move normalise_expand_type to dedicated module
purefunctor Feb 8, 2026
c387b4a
Fix synonyms in delegate constraints for 'derive newtype'
purefunctor Feb 8, 2026
bb25a70
Fix higher rank fields in record subtyping
purefunctor Feb 9, 2026
a33d61b
Add unification rule for Type::Forall
purefunctor Feb 10, 2026
4319bff
Migrate from level-based variables to unique-based
purefunctor Feb 10, 2026
250944d
Implement deferred generalisation for value groups
purefunctor Feb 11, 2026
e45f7d0
Add failing test case for operator generalisation
purefunctor Feb 11, 2026
dbd55a5
Implement deferred generalisation for operators
purefunctor Feb 11, 2026
d20f315
Fix missing generalisation for Deferred
purefunctor Feb 11, 2026
22953f3
Add test case for immediate generalisation on foreign
purefunctor Feb 11, 2026
f4047d3
Small observability fixes
purefunctor Feb 11, 2026
46f7f93
Implement deferred kind generalisation
purefunctor Feb 12, 2026
a2f8e1d
Fix formatting
purefunctor Feb 12, 2026
33940e3
Implement initial syntax-driven checking
purefunctor Feb 12, 2026
b208f21
Add missing unification rules for Forall
purefunctor Feb 12, 2026
c24b486
Move normalise_expand_type to toolkit
purefunctor Feb 12, 2026
0ecf006
Rename constraint collection functions
purefunctor Feb 12, 2026
92a5ee0
Move manual span calls into instrument
purefunctor Feb 12, 2026
b571df2
Reorganise compiler-compatibility crates
purefunctor Feb 12, 2026
c341ab3
Update API surface for check_package
purefunctor Feb 12, 2026
e713742
Improve compiler-compatibility cli output
purefunctor Feb 12, 2026
5f803f8
Keep simple let bindings polymorphic
purefunctor Feb 12, 2026
a3c13fb
Clean up output for compiler-compatibility
purefunctor Feb 12, 2026
07f5cf7
Add compatibility to justfile
purefunctor Feb 12, 2026
e1244e1
Fix missing trim for qualifier in qualified do/ado
purefunctor Feb 13, 2026
809c510
Expand type synonyms on Coercible solving
purefunctor Feb 13, 2026
625f8f5
Normalise tail-only rows into the tail
purefunctor Feb 13, 2026
8be1a1b
Implement structural equality checks for Coercible
purefunctor Feb 13, 2026
ed3b2d0
Implement conditional instantiation for pattern matching
purefunctor Feb 13, 2026
64b132d
Canonicalise record labels in exhaustiveness checking
purefunctor Feb 14, 2026
3258547
Implement full package set checking and reports
purefunctor Feb 14, 2026
634c079
Add support for open rows in Prim.Row constraints
purefunctor Feb 14, 2026
ccf96f7
Combine signature and definition checking
purefunctor Feb 14, 2026
1e367f4
Format files
purefunctor Feb 14, 2026
cfb0f48
Fix issue with overlap in exported modules
purefunctor Feb 14, 2026
f8cfc6b
Expand type synonyms in Prim.Row classes
purefunctor Feb 14, 2026
c966100
Format files
purefunctor Feb 17, 2026
f418652
Add core type structures
purefunctor Feb 17, 2026
37eca57
Add checking2 crate with ExternalQueries, CheckedModule, and check_prim
purefunctor Feb 17, 2026
7a2ce63
Add context module with CheckContext and caches for known types
purefunctor Feb 17, 2026
d97dfce
Implement CheckState and scaffolding for check_foreign_signature
purefunctor Feb 17, 2026
fa41a49
Implement safety utilities for use in checking rules
purefunctor Feb 17, 2026
8759771
Implement UnificationState for unification variable bookkeeping
purefunctor Feb 17, 2026
a0fc545
Implement core::normalise for unification variable pruning
purefunctor Feb 17, 2026
96944c9
Implement ErrorCrumb, ErrorKind, CheckError
purefunctor Feb 18, 2026
65ada2f
Implement initial utilities for constructing types
purefunctor Feb 18, 2026
e6bfa4a
Add depth field to Type::Rigid
purefunctor Feb 18, 2026
9e8a75c
Add fold and walk abstractions for core
purefunctor Feb 18, 2026
112d944
Implement core::substitute and SubstituteName
purefunctor Feb 18, 2026
e2e8b4f
Add depth tracking and with_depth to CheckState
purefunctor Feb 18, 2026
f85899d
Add fresh_unification and fresh_rigid helpers to CheckState
purefunctor Feb 18, 2026
4fe0bcd
Implement core::unification and initial rules
purefunctor Feb 17, 2026
1c54bbd
Implement unification variable solving and promotion
purefunctor Feb 18, 2026
2fdb0d2
Add text field to ForallBinder
purefunctor Feb 18, 2026
23b6f8a
Implement pretty-printer for core
purefunctor Feb 18, 2026
e1d87ab
Use pretty printer in error messages
purefunctor Feb 18, 2026
5b1ccf8
Implement collection for implication constraints
purefunctor Feb 18, 2026
e4502cb
Implement subtyping and unification for rows
purefunctor Feb 18, 2026
9bede66
Add utility for pretty-print-intern
purefunctor Feb 19, 2026
bbf92e4
Implement syntax-driven kind checking rules
purefunctor Feb 18, 2026
5d71fc2
Implement detection for type synonym applications
purefunctor Feb 19, 2026
28a9269
Move check_kind/infer_kind internals to _core functions
purefunctor Feb 19, 2026
6f5b2a5
Allow Constraint kinds in Constraint and Forall
purefunctor Feb 19, 2026
468bf9c
Add documentation to ElaborationMode
purefunctor Feb 19, 2026
fcea5e6
Refactor subtyping to use a strategy pattern
purefunctor Feb 19, 2026
74611fb
Update documentation for SubstituteName
purefunctor Feb 19, 2026
1cdea7b
Add documentation for function subtyping
purefunctor Feb 19, 2026
bcd3566
Add documentation for forall subtyping
purefunctor Feb 19, 2026
ecacc2e
Add documentation for record subtyping
purefunctor Feb 19, 2026
066c445
Add documentation for unification rules
purefunctor Feb 19, 2026
b630b33
Add stub for check_data_signature
purefunctor Feb 19, 2026
53d98cc
Implement ReplaceThen for folding
purefunctor Feb 20, 2026
3c19d30
Implement generalisation
purefunctor Feb 19, 2026
2343c13
Implement zonking traversal
purefunctor Feb 20, 2026
e7558a8
Implement stateless pretty printer
purefunctor Feb 20, 2026
165ebea
Align synonym application with type application
purefunctor Feb 20, 2026
937d496
Add as_slice and is_recursive for Scc
purefunctor Feb 20, 2026
856a404
Implement binding group seeding for SCCs
purefunctor Feb 20, 2026
f479eee
Implement core::toolkit and function_components
purefunctor Feb 20, 2026
dc6a916
Implement initial check_data_equation
purefunctor Feb 20, 2026
e55c874
Partition invalid items and populate with unknowns
purefunctor Feb 21, 2026
3c4e61a
Move Zonk::on to zonk
purefunctor Feb 21, 2026
ec0c141
Add documentation for check_type_items
purefunctor Feb 21, 2026
c85f3a5
Improve type signature and variable checking
purefunctor Feb 21, 2026
523cc10
Rename to check_data_constructors
purefunctor Feb 22, 2026
b65f3bd
Make generalise solve unification variables to rigid variables
purefunctor Feb 23, 2026
b5cbcdf
Accept IntoIter for intern_function_chain
purefunctor Feb 23, 2026
d0aed3d
Collect ForallBinder in check_type_variable_bindings
purefunctor Feb 23, 2026
635dc10
Return ForallBinder in data check and infer modes
purefunctor Feb 23, 2026
27a39bb
Add toolkit functions for inspection
purefunctor Feb 23, 2026
108ff9c
Add terms field for CheckState
purefunctor Feb 23, 2026
6f84881
Implement generalisation for constructors
purefunctor Feb 23, 2026
e94d195
Format files and apply clippy
purefunctor Feb 23, 2026
7df9a5d
Add CoreInterners struct for checking2
purefunctor Feb 23, 2026
76d4650
Add initial support for checking2 in QueryEngine
purefunctor Feb 23, 2026
1e00b73
Add support for checking2 in integration tests
purefunctor Feb 23, 2026
5130012
Add initial integration tests for foreign data
purefunctor Feb 23, 2026
1965674
Use flags for compiler-scripts snapshot manipulation
purefunctor Feb 23, 2026
a2a4c86
Move .claude to .agents and add symlinks to skills
purefunctor Feb 23, 2026
84263ee
Add initial tests for data declarations
purefunctor Feb 23, 2026
4d6be0d
Add initial tests for newtype declarations
purefunctor Feb 23, 2026
3d965b1
Add checking rule for synonym signatures
purefunctor Feb 23, 2026
e9326fd
Use unique for generating variable names
purefunctor Feb 24, 2026
80cdc23
Implement builder-style API for printer
purefunctor Feb 24, 2026
95b526b
Implement checking and inference for synonyms
purefunctor Feb 23, 2026
8c1f828
Apply clippy fixes
purefunctor Feb 24, 2026
d6f0eae
Add CheckedClass type and extend CheckedModule with classes map
purefunctor Feb 24, 2026
863e5bb
Implement ClassGroup checking in source.rs
purefunctor Feb 24, 2026
db758b2
Add Classes section to checking2 test reports
purefunctor Feb 24, 2026
e3a0ed2
Add integration tests for class checking
purefunctor Feb 24, 2026
297e691
Implement operator declaration checking
purefunctor Feb 24, 2026
5d35ce3
Add integration tests for operator declarations
purefunctor Feb 24, 2026
4aeba3b
Move lookup functions to toolkit
purefunctor Feb 24, 2026
11321e9
Name::as_text for missing text
purefunctor Feb 24, 2026
47a817e
Implement operator chain checking for types
purefunctor Feb 24, 2026
1c8a60f
Implement integration tests for operator chains
purefunctor Feb 24, 2026
2c9c7e6
Implement initial elaborate_kind
purefunctor Feb 24, 2026
dd8fa1a
Improve formatting code for integration tests
purefunctor Feb 24, 2026
27fab9a
Use SmolStrId for ForallBinder::text
purefunctor Feb 24, 2026
6efbb19
Implement basic role inference
purefunctor Feb 24, 2026
44a79e1
Add integration tests for role inference
purefunctor Feb 24, 2026
226b9fd
Implement initial term signature checking
purefunctor Feb 25, 2026
32ad36f
Add integration tests for foreign and value terms
purefunctor Feb 25, 2026
34cafe1
Implement checking for term operators
purefunctor Feb 25, 2026
ee99551
Add integration tests for term operators
purefunctor Feb 25, 2026
3968786
Move item rules to separate modules
purefunctor Feb 25, 2026
25ecbbe
Implement CheckedNodes structure and accessors
purefunctor Feb 25, 2026
7bf9033
Move instantiate_unifications to toolkit
purefunctor Feb 25, 2026
e80ed36
Move decompose_function_kind to toolkit
purefunctor Feb 25, 2026
cc26ea4
Implement checking rules for binders
purefunctor Feb 25, 2026
881496d
Initial scaffolding for term checking
purefunctor Feb 25, 2026
720d292
Port over initial rules for term checking
purefunctor Feb 25, 2026
7b3744e
Format files and apply clippy fixes
purefunctor Feb 25, 2026
13e28a8
Port exhaustiveness checking to checking2
purefunctor Feb 25, 2026
56d1e80
Add integration tests for exhaustiveness checking
purefunctor Feb 25, 2026
f405ae9
Split intern_function_chain and intern_function_chain_iter
purefunctor Feb 25, 2026
de15f1f
Implement defer for partial synonym applications
purefunctor Feb 25, 2026
9440938
Organise CheckState fields
purefunctor Feb 26, 2026
50f823a
Fix generalisation bug for Scc::Mutual
purefunctor Feb 26, 2026
f065a14
Introduce quantification for class canonical types
purefunctor Feb 26, 2026
8454b29
Implement initial instance declaration checking
purefunctor Feb 26, 2026
f705853
Add integration test for instance declaration checking
purefunctor Feb 26, 2026
ee76e85
Track canonical names in CheckedModule
purefunctor Feb 27, 2026
51da0b0
Implement functional dependencies and closure computation
purefunctor Feb 28, 2026
5f691a1
Use NameToType reference in SubstituteName
purefunctor Feb 28, 2026
e4c5724
Port initial constraint solver from checking
purefunctor Feb 28, 2026
ee799d5
Organise constraint solving into submodules
purefunctor Feb 28, 2026
ff3d07f
Add integration tests for instance solving
purefunctor Feb 28, 2026
a295200
Fix missing collect_givens in signature checking
purefunctor Feb 28, 2026
7381476
Add scaffolding for compiler-solved instances
purefunctor Feb 28, 2026
4cad9b6
Move can_unify from instances to unification
purefunctor Feb 28, 2026
b54b7ab
Implement initial compiler-solved helpers
purefunctor Feb 28, 2026
d456f52
Implement Prim.Int, Prim.Symbol, Prim.RowList
purefunctor Feb 28, 2026
d8774af
Rename functional_dependency to fd
purefunctor Feb 28, 2026
2bf4150
Implement Prim.Row instances
purefunctor Mar 1, 2026
c64c49b
Add integration tests for Prim.Row
purefunctor Mar 1, 2026
84c4d16
Implement Reflectable and Prim.TypeError
purefunctor Mar 1, 2026
16b2aa2
Add tests for Reflectable and Prim.TypeError
purefunctor Mar 1, 2026
bae63e4
Add tests for givens and minimisation
purefunctor Mar 1, 2026
fd4c1fb
Implemet Prim.Coerce instances
purefunctor Mar 1, 2026
10e0f87
Add tests for Prim.Coerce
purefunctor Mar 1, 2026
f527d5b
Elaborate coercible into symmetric
purefunctor Mar 1, 2026
06db668
Implement instance member checking
purefunctor Mar 1, 2026
d8d08b4
Add instance member checking tests
purefunctor Mar 1, 2026
98db3f9
Use imports where possible
purefunctor Mar 2, 2026
5d20778
Implement scaffolding for derive instance port
purefunctor Mar 2, 2026
6f99983
Add initial smoke test for Eq deriving
purefunctor Mar 2, 2026
1321b15
Add smoke tests for deriving Eq
purefunctor Mar 3, 2026
d9c302a
Implement deriving for Eq
purefunctor Mar 3, 2026
d4d6cec
Add smoke tests for deriving Ord
purefunctor Mar 3, 2026
0ae21f3
Implement deriving for Ord
purefunctor Mar 3, 2026
8a11630
Add smoke tests for Eq1
purefunctor Mar 3, 2026
c1d9925
Implement deriving for Eq1
purefunctor Mar 3, 2026
67947b1
Add smoke tests for Ord1
purefunctor Mar 3, 2026
2c965bd
Implement deriving for Ord1
purefunctor Mar 3, 2026
4a77c60
Add smoke tests for Functor
purefunctor Mar 3, 2026
a496946
Implement deriving for Functor
purefunctor Mar 3, 2026
54be30b
Add smoke tests for Bifunctor
purefunctor Mar 3, 2026
bd060e6
Implement deriving for Bifunctor
purefunctor Mar 3, 2026
fab01fd
Add smoke tests for Contravariant
purefunctor Mar 3, 2026
46e8a68
Implement deriving for Contravariant
purefunctor Mar 3, 2026
9d2c931
Add smoke tests for Profunctor
purefunctor Mar 3, 2026
a63cd11
Implement deriving for Profunctor
purefunctor Mar 3, 2026
058b692
Add smoke tests for Foldable
purefunctor Mar 3, 2026
0b23c4b
Implement deriving for Foldable
purefunctor Mar 3, 2026
eca6b07
Add smoke tests for Bifoldable
purefunctor Mar 3, 2026
fa23002
Implement deriving for Bifoldable
purefunctor Mar 3, 2026
80d8988
Add smoke tests for Traversable
purefunctor Mar 3, 2026
105e0c5
Implement deriving for Traversable
purefunctor Mar 3, 2026
00554ce
Add smoke tests for Bitraversable
purefunctor Mar 3, 2026
a5847af
Implement deriving for Bitraversable
purefunctor Mar 3, 2026
7a0ec6f
Add smoke tests for derive newtype
purefunctor Mar 3, 2026
276ce4a
Implement 'derive newtype'
purefunctor Mar 3, 2026
9cb92f1
Implement deriving for Newtype
purefunctor Mar 3, 2026
83d3be9
Add smoke tests for Generic
purefunctor Mar 3, 2026
a22d026
Implement deriving for Generic
purefunctor Mar 3, 2026
e02ac61
Add tests for derivable type classes
purefunctor Mar 3, 2026
52029d7
Add tests for checking implication scoping
purefunctor Mar 3, 2026
6ef60c9
Add tests for open rows on compiler-solved classes
purefunctor Mar 3, 2026
0aa7b6d
Format files
purefunctor Mar 3, 2026
17dc5f0
Remove OperatorApplication and OperatorConstructor from core
purefunctor Mar 4, 2026
ff4ab62
Refactor synonyms to have kind applications
purefunctor Mar 4, 2026
9bbcf8b
Implement binding-count aware signature inspection
purefunctor Mar 4, 2026
4e23871
Make variable naming consistent in matching functions
purefunctor Mar 5, 2026
2d5ead1
Add test for different forms of const
purefunctor Mar 5, 2026
ec4a528
Improve handling for synonyms in signatures
purefunctor Mar 5, 2026
25c7815
Implement proper expansion with inspect_signature_core
purefunctor Mar 5, 2026
a866978
Add ParsedSynonym struct
purefunctor Mar 5, 2026
101eca8
Implement prenex-aware decompose_signature
purefunctor Mar 5, 2026
e5c2e1c
Migrate inspect_ function calls to use decompose_signature
purefunctor Mar 5, 2026
a9748ac
Implement prenex awareness for class members
purefunctor Mar 5, 2026
d0733b0
Remove super from derive functions
purefunctor Mar 5, 2026
0b09efa
Expand synonyms before type comparison
purefunctor Mar 6, 2026
2795b1b
Fix kind arguments in synonym expansion
purefunctor Mar 6, 2026
c9954ff
Update type-checker-tests to mention checking2
purefunctor Mar 6, 2026
7bdf707
Remove stale .gitkeep
purefunctor Mar 6, 2026
ec4cc15
Add test coverage for generic deriving
purefunctor Mar 6, 2026
5fad840
Add test coverage for do/ado blocks
purefunctor Mar 6, 2026
08ed53b
Add test coverage for exhaustiveness
purefunctor Mar 6, 2026
8d50602
Fix missing let binding exhaustiveness
purefunctor Mar 6, 2026
487c81e
Simplify overloaded equation rules
purefunctor Mar 6, 2026
c4665fe
Add test coverage for application and type application
purefunctor Mar 6, 2026
6109231
Add test coverage for record expressions and binders
purefunctor Mar 6, 2026
d7fb0fa
Add test coverage for givens and row instances
purefunctor Mar 6, 2026
55ac189
Add test coverage for synonyms and binder instantiation
purefunctor Mar 6, 2026
2316837
Add test coverage for structural coercions
purefunctor Mar 6, 2026
1b925b4
Add test coverage for coercion failures and constructor visibility
purefunctor Mar 6, 2026
eb8b3e1
Add test coverage for deep and higher-kinded coercions
purefunctor Mar 6, 2026
a66f65d
Use normalise_expand in Prim.Coerce checks
purefunctor Mar 6, 2026
c768145
Extract all applications in newtype extraction
purefunctor Mar 6, 2026
9c1a1f5
Use normalise_expand and remove redundant normalisation
purefunctor Mar 7, 2026
a8cfbae
Add NonLocalNewtype and coverage for error cases
purefunctor Mar 7, 2026
9cd0f95
Use normalise_expand in more places
purefunctor Mar 7, 2026
335cada
Rename normalise_expand to expand
purefunctor Mar 7, 2026
14178b0
Fix lookup function delegation
purefunctor Mar 7, 2026
5dc01b0
Add documentation to normalise and expand
purefunctor Mar 7, 2026
98b56b1
Use normalise::expand in more checking rules
purefunctor Mar 7, 2026
3e18281
Use analysis patterns for function application
purefunctor Mar 7, 2026
d1a1b8f
Fix synonym applications in operator checking
purefunctor Mar 8, 2026
9034def
Extract utility for application checking
purefunctor Mar 8, 2026
798c9d2
Implement try_peel_trailing_rigids
purefunctor Mar 10, 2026
20d1bd3
Consider more forms in is_binary_operator_type
purefunctor Mar 10, 2026
f9f5cfc
Add failing test case for missing freshening
purefunctor Mar 10, 2026
f0894ef
Apply freshening when checking instance members
purefunctor Mar 10, 2026
3deb4d4
Defer expansion when checking synonym arguments
purefunctor Mar 10, 2026
a5ccf8b
Add test case for partial synonym error in operators
purefunctor Mar 11, 2026
9de1a7a
Defer expansion when checking operator arguments
purefunctor Mar 10, 2026
bb4cab4
Add tests for higher-order synonyms as arguments
purefunctor Mar 12, 2026
1a2ce37
Fix expansion for discovered synonym applications
purefunctor Mar 12, 2026
3d6ca7b
Implement name-based type checker (#96)
purefunctor Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
136 changes: 136 additions & 0 deletions .agents/skills/type-checker-tests/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
name: type-checker-tests
description: Add integration tests for type checker inference and checking2 functions
allowed-tools: Bash(mkdir:*)
---

# Type Checker Integration Tests

Use the command reference at `reference/compiler-scripts.md` for test runner syntax, snapshot workflows, filters, and trace debugging. The category is `checking2`.

**Language:** Fixtures use PureScript syntax, not Haskell.

## Creating a Test

### 1. Create fixture directory

```bash
just t checking2 --create "descriptive name"
```

The CLI picks the next fixture number and creates the folder.

Tests are auto-discovered by `build.rs`.

### 2. Write Main.purs

**Standard pattern** - pair typed (checking2) and untyped (inference) variants:

```purescript
module Main where

-- Checking mode: explicit signature constrains type checker
test :: Array Int -> Int
test [x] = x

-- Inference mode: type checker infers unconstrained
test' [x] = x
```

**Guidelines:**
- Test ONE specific behavior per fixture
- Name tests: `test`, `test'`, `test2`, `test2'`, etc.
- Include edge cases relevant to the behavior

### 3. Run and review

```bash
just t checking2 NNN MMM
```

### 4. Accept or reject snapshots

```bash
just t checking2 NNN --diff # Inspect a fixture diff
just t checking2 NNN --accept # Accept a specific fixture
just t checking2 NNN --reject # Reject a specific fixture
just t checking2 --accept --confirm # Accept all pending snapshots
```

## Multi-File Tests

For imports, re-exports, or cross-module behavior:

```
tests-integration/fixtures/checking2/NNN_import_test/
├── Main.purs # Test file (snapshot generated)
├── Lib.purs # Supporting module
└── Main.snap # Generated snapshot
```

**Lib.purs:**
```purescript
module Lib where

life :: Int
life = 42

data Maybe a = Just a | Nothing
```

**Main.purs:**
```purescript
module Main where

import Lib (life, Maybe(..))

test :: Maybe Int
test = Just life
```

- Module name must match filename
- Only `Main.purs` generates a snapshot

## Snapshot Structure

```
Terms
functionName :: InferredOrCheckedType
...

Types
TypeName :: Kind
...

Errors
ErrorKind { details } at [location]
```

## Acceptance Criteria

Before accepting, verify:

1. **Types are correct**
- `test :: Array Int -> Int` - signature preserved
- `test' :: forall t. Array t -> t` - polymorphism inferred

2. **No unexpected `???`**
- `test :: ???` - STOP: inference failure
- `CannotUnify { ??? -> ???, Int }` - OK in error tests

3. **Errors appear where expected**
- Confirm error kind matches (`NoInstanceFound`, `CannotUnify`)
- Verify location points to correct declaration

4. **Polymorphism is appropriate**
- Type variables scoped correctly
- Constraints propagate as expected

## Common Issues

| Symptom | Likely Cause |
|---------|--------------|
| `test :: ???` | Syntax error or undefined names |
| Unexpected monomorphism | Missing polymorphic context |
| Wrong error location | Check binder/expression placement |
| Missing types in snapshot | Module header or imports incorrect |
67 changes: 67 additions & 0 deletions .agents/skills/type-checker-tests/reference/compiler-scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Compiler Scripts Command Reference

CLI tools in `compiler-scripts/` for running integration tests.

## Test Runner Commands

### Run tests

```bash
just t <category> [filters...] # Run tests (summary output)
just t <category> --diff [filters...] # Run with full inline diffs
just t <category> --count 10 [filters...] # Show more snapshots (default: 3)
just t <category> --debug [filters...] # Enable tracing
just t <category> --verbose [filters...] # Show test progress
just t <category> --create "name" # Scaffold a new fixture
just t <category> --delete "name" # Dry-run fixture deletion (use --confirm)
```

### Categories

| Category | Alias | Description |
|----------|-------|-------------|
| checking | c | Type checker tests |
| lowering | l | Lowering tests |
| resolving | r | Resolver tests |
| lsp | - | LSP tests |

### Snapshot commands

```bash
just t <category> [filters...] --accept # Accept matching snapshots
just t <category> [filters...] --reject # Reject matching snapshots
just t <category> --accept --confirm # Accept all pending snapshots
```

For safety, unfiltered `--accept` requires `--confirm`.

### Exclusion filters

Hide snapshots ephemerally during a session:

```bash
just t <category> --exclude "pattern" # Single exclusion
just t <category> --exclude "foo" --exclude "bar" # Multiple exclusions
EXCLUDE_SNAPSHOTS="foo,bar" just t <category> # Via environment variable
```

### Filters

Space-delimited, passed through to nextest. Mix numbers and patterns:

```bash
just t c 101 102 # Run tests 101 and 102
just t c pattern # Filter by name pattern
just t c 101 102 pattern # Numbers + pattern together
```

## Debugging Traces

When `--debug` is used, traces are written to `target/compiler-tracing/{test_id}_{module}.jsonl`.

```bash
wc -l target/compiler-tracing/*.jsonl # Check sizes
shuf -n 20 target/compiler-tracing/NNN_*.jsonl | jq . # Sample
jq 'select(.level == "DEBUG")' file.jsonl # Filter by level
jq 'select(.target | contains("unification"))' file.jsonl
```
1 change: 1 addition & 0 deletions .claude/skills
Loading
Loading