Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
461 commits
Select commit Hold shift + click to select a range
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
740fafe
Remove dedicated synonym application variant
purefunctor Mar 12, 2026
66b106e
Extract shared code for application checking
purefunctor Mar 13, 2026
8ee1413
Add failing test case for strict operator check
purefunctor Mar 7, 2026
4dd4e50
Remove operator type shape verification completely
purefunctor Mar 14, 2026
802b6c2
Add failing test case for missing Type::Function normalisation
purefunctor Mar 14, 2026
c389c71
Fix missing Type::Function normalisation rule in unification
purefunctor Mar 14, 2026
14effbc
Fix omitted substitution when specialising class members
purefunctor Mar 14, 2026
82dad70
Use kind arguments in constraint checking
purefunctor Mar 14, 2026
7bb6617
Add failing test case for kind arguments in deriving
purefunctor Mar 14, 2026
d04a7d2
Consume kind arguments for substitution in deriving
purefunctor Mar 14, 2026
ab26661
Fix missing derived instances in checking2 snapshots
purefunctor Mar 14, 2026
48c594c
Add tests for unsuppressed MissingPatterns errors
purefunctor Mar 14, 2026
31080ff
Suppress MissingPatterns errors when Partial is given
purefunctor Mar 14, 2026
00556e0
Add failing test for invalid identity check in resolving
purefunctor Mar 14, 2026
352df8a
Fix invalid identity check for exports in resolving
purefunctor Mar 14, 2026
373906f
Enable synonym expansion for discovery
purefunctor Mar 14, 2026
e60e00a
Fix default variable visibility and rendering
purefunctor Mar 14, 2026
13e9b8b
Add test cases for visible type applications
purefunctor Mar 14, 2026
4a0edfe
Implement visible type applications
purefunctor Mar 14, 2026
361309d
Rename intern_function_list and intern_function_iter
purefunctor Mar 17, 2026
17ef3a7
Fix clippy lints
purefunctor Mar 17, 2026
0634d81
Add failing test for quoted labels in records
purefunctor Mar 17, 2026
091e769
Extract content for string labels
purefunctor Mar 17, 2026
4741aac
Add failing test case for record field instantiation
purefunctor Mar 17, 2026
781505f
Instantiate constructors and variables in record fields
purefunctor Mar 17, 2026
5a8ae35
Add test case for missing argument kind applications
purefunctor Mar 17, 2026
73629cf
Fix missing kind applications in data constructor arguments
purefunctor Mar 17, 2026
89eee6d
Add failing test case for missing instance kind substitution
purefunctor Mar 18, 2026
6d52fdf
Fix missing kind substitutions in instance matching
purefunctor Mar 18, 2026
12c139e
Implement kind argument matching for instance declarations
purefunctor Mar 18, 2026
65a178f
Use kind elaboration to construct delegate constraints
purefunctor Mar 18, 2026
4768955
Add failing test case for type synonyms in row tails
purefunctor Mar 18, 2026
9a4b2ef
Use recursive normalisation in extraction functions
purefunctor Mar 18, 2026
5cb4aa2
Instantiate unmatched binders before stuck handling
purefunctor Mar 18, 2026
c8f15ec
Implement improvement for compiler-solvable givens
purefunctor Mar 19, 2026
96056e3
Add failing test case for Row.Nub via Row.Union
purefunctor Mar 20, 2026
dc94a0d
Improve Prim.Row.Union solving for open-left subtraction cases
purefunctor Mar 20, 2026
565f2d4
Extract Prim.Row.Union solving rules into named functions
purefunctor Mar 20, 2026
2cd1584
Construct tail-only rows when extracting non-row types
purefunctor Mar 20, 2026
27ac9ba
Add failing test for forall as row field
purefunctor Mar 21, 2026
ca87305
Replace infer with check in TypeKind::Forall and TypeKind::Row
purefunctor Mar 20, 2026
fe53a7d
Add failing test case for duplicated kind applications
purefunctor Mar 21, 2026
dadb697
Fix duplicated kind application for recursive constructors
purefunctor Mar 21, 2026
6cc13ee
Add failing test case for synonym in given instances
purefunctor Mar 22, 2026
17df19e
Apply expansion to row tails in normalise::expand
purefunctor Mar 22, 2026
a4e315b
Add failing test case for sectioned expressions
purefunctor Mar 22, 2026
d6f18dc
Add checking rule for operator chains
purefunctor Mar 22, 2026
48247cd
Fix fallback rule for section inference
purefunctor Mar 22, 2026
629bcea
Implement Functor and Apply for (->)
purefunctor Mar 22, 2026
b2ebbee
Add failing test case for polymorphic record fields
purefunctor Mar 22, 2026
974e9b1
Fix inference for polymorphic record fields
purefunctor Mar 22, 2026
8829991
Add diagnostics support for checked2
purefunctor Mar 22, 2026
9ef0e1c
Add failing test case for operator checking ordering
purefunctor Mar 23, 2026
297a2d1
Check result type after branch types in operator checking
purefunctor Mar 23, 2026
e763a16
Add failing test case for recursion through operator
purefunctor Mar 23, 2026
2fe4b67
Make checking for operators pass-through
purefunctor Mar 23, 2026
5ab68c5
Align record field inference and checking rules with upstream
purefunctor Mar 23, 2026
e89daf3
Add failing test case for synonym prenex depth mismatch
purefunctor Mar 24, 2026
2241520
Implement skolemisation for value equation checking
purefunctor Mar 24, 2026
ec12f30
Add failing test case for application-based function subtyping
purefunctor Mar 25, 2026
0fe860c
Preserve function subtyping in application-based functions
purefunctor Mar 25, 2026
ff62a0a
Use module span for rendering crumbless errors
purefunctor Mar 26, 2026
2f197d4
Add error crumbs for constraint solving errors
purefunctor Mar 26, 2026
95f29e4
Add failing test case for false positive instance match
purefunctor Mar 26, 2026
9535b66
Make matching rules stronger for application-based functions
purefunctor Mar 26, 2026
221f7e0
Add failing test case for false given matching
purefunctor Mar 28, 2026
a11c3e3
Align given instance matching with declared instances
purefunctor Mar 27, 2026
a75d2aa
Add failing test case for niche let bindings bug
purefunctor Mar 28, 2026
17b7b95
Use subtyping instead of overwriting let node type
purefunctor Mar 28, 2026
fce3359
Remove all references to original type checker
purefunctor Mar 30, 2026
44e6b19
Rename checking2 directories to checking
purefunctor Mar 30, 2026
ee0020b
Update references from checking2 to checking
purefunctor Mar 30, 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 checking 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 `checking`.

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

## Creating a Test

### 1. Create fixture directory

```bash
just t checking --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 (checking) 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 checking NNN MMM
```

### 4. Accept or reject snapshots

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

## Multi-File Tests

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

```
tests-integration/fixtures/checking/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