Skip to content

Commit 1a3035d

Browse files
antonsyndclaude
andcommitted
docs: update CLAUDE.md with current partial file counts and validators
TypeChecker and RoslynEmitter were split into additional partial files (.Expressions.Access, .Expressions.Literals, .Expressions.Operators) that weren't reflected in the docs. Also adds 4 missing validators to the ValidationPipeline list and the dogfood-run skill. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4ba3a22 commit 1a3035d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CLAUDE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The semantic phase runs multiple ordered passes. Understanding this is critical
6262

6363
**Pass 2 — Type Resolution** (`TypeResolver.cs`): Resolves type annotations on declarations to concrete types. Type inference provided by `TypeInferenceService` and `GenericTypeInferenceService`.
6464

65-
**Pass 3 — Type Checking** (`TypeChecker.cs`, split into 5 partial files: `.cs`, `.Definitions.cs`, `.Expressions.cs`, `.Statements.cs`, `.Utilities.cs`): Traverses AST, infers types, records them in `SemanticInfo`. Then runs `ValidationPipeline`. Type narrowing (e.g., `if x is not None:` narrows `T?``T`) is tracked via `_narrowingContext` (`TypeNarrowingContext`).
65+
**Pass 3 — Type Checking** (`TypeChecker.cs`, split into 8 partial files: `.cs`, `.Definitions.cs`, `.Expressions.cs`, `.Expressions.Access.cs`, `.Expressions.Literals.cs`, `.Expressions.Operators.cs`, `.Statements.cs`, `.Utilities.cs`): Traverses AST, infers types, records them in `SemanticInfo`. Then runs `ValidationPipeline`. Type narrowing (e.g., `if x is not None:` narrows `T?``T`) is tracked via `_narrowingContext` (`TypeNarrowingContext`).
6666

6767
**Key registries**: `OperatorRegistry`, `ProtocolRegistry`, `BuiltinRegistry`, `ModuleRegistry`, `PrimitiveCatalog` (source of truth for primitive types and CLR mappings).
6868

@@ -124,11 +124,15 @@ Pluggable validators implement `ISemanticValidator` with an `Order` property (lo
124124
- **Order 55**: `NamingConventionValidator` — Naming convention checks
125125
- **Order 60**: `DecoratorValidator` — Decorator validation
126126
- **Order 150**: `SignatureValidator` — Dunder method signatures
127+
- **Order 160**: `EqualityContractValidator` — Equality contract checks
128+
- **Order 170**: `InterfaceConflictValidator` — Interface conflict detection
127129
- **Order 250**: `DefaultParameterValidator` — Default parameter validation
128130
- **Order 400**: `ControlFlowValidator` — CFG-based unreachable code, missing returns
131+
- **Order 410**: `PropertyValidator` — Property validation
129132
- **Order 420**: `UnusedVariableValidator` — Unused variable warnings
130133
- **Order 430**: `UnusedImportValidator` — Unused import warnings
131134
- **Order 450**: `AccessValidator` — Private/protected member access
135+
- **Order 460**: `DunderInvocationValidator` — Direct dunder call warnings
132136
- **Order 500**: `ProtocolValidator`, `OperatorValidator` — Protocol/operator validation
133137

134138
**Responsibility split**: TypeChecker handles type mismatches and in-progress inference. ValidationPipeline handles self-contained AST analyses that don't need active inference state.
@@ -149,7 +153,7 @@ All diagnostics use `SPY` prefix (`Diagnostics/DiagnosticCodes.cs`):
149153

150154
## Code Generation
151155

152-
The `RoslynEmitter` is split into 8 partial classes (~6,225 lines total): `RoslynEmitter.cs` (entry, name resolution), `.Expressions.cs`, `.Statements.cs`, `.TypeDeclarations.cs`, `.ClassMembers.cs`, `.CompilationUnit.cs`, `.ModuleClass.cs`, `.Operators.cs`.
156+
The `RoslynEmitter` is split into 11 partial classes (~10,300 lines total): `RoslynEmitter.cs` (entry, name resolution), `.Expressions.cs`, `.Expressions.Access.cs`, `.Expressions.Literals.cs`, `.Expressions.Operators.cs`, `.Statements.cs`, `.TypeDeclarations.cs`, `.ClassMembers.cs`, `.CompilationUnit.cs`, `.ModuleClass.cs`, `.Operators.cs`.
153157

154158
**Name resolution strategy**:
155159
- Module-level symbols → `Symbol.CodeGenInfo` (precomputed during semantic analysis)
@@ -268,6 +272,7 @@ Available in `.claude/skills/`:
268272
| `/project:verify-python <expr>` | Run Python 3 to verify behavior before implementing |
269273
| `/project:add-test-fixture <desc>` | Create a file-based integration test |
270274
| `/project:dogfood-analyze [dir]` | Analyze dogfood results and classify failures by root cause |
275+
| `/project:dogfood-run` | Run dogfooding iterations to test the Sharpy compiler |
271276
| `/project:compiler-audit [focus]` | Run a comprehensive compiler health audit |
272277
| `/project:verify-plan <plan.md>` | Verify a plan for accuracy and architectural soundness |
273278
| `/project:implement-plan <plan.md>` | Implement a plan with a coordinated agent team |

0 commit comments

Comments
 (0)