Skip to content

Commit 95f51f9

Browse files
committed
Merge remote-tracking branch 'origin/fix/nested-class-ref-sanitization' into fix/nested-class-ref-sanitization
2 parents 0eb8bdf + 7a81797 commit 95f51f9

5 files changed

Lines changed: 81 additions & 77 deletions

File tree

CLAUDE.md

Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,28 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
## What this is
44

5-
## Development Commands
5+
ReflectorNet is a .NET reflection toolkit for AI-driven scenarios: fuzzy method discovery, type-preserving serialization, and dynamic invocation. It ships as the NuGet package `com.IvanMurzak.ReflectorNet` and is the most foundational library in the workspace dependency chain.
6+
7+
## Build / run
68

79
```bash
8-
# Build the solution
10+
# Build
911
dotnet build --configuration Release
1012

11-
# Run all tests (multi-TFM: net8.0 and net9.0)
13+
# Test (multi-TFM: net8.0 and net9.0)
1214
dotnet test --configuration Release --verbosity normal
1315

14-
# Run a single test by fully qualified name
16+
# Single test by FQN
1517
dotnet test --configuration Release --filter "FullyQualifiedName~com.IvanMurzak.ReflectorNet.Tests.ClassName.MethodName"
1618

17-
# Run tests matching a pattern
18-
dotnet test --configuration Release --filter "FullyQualifiedName~SchemaTests"
19-
2019
# Pack for NuGet
2120
dotnet pack ReflectorNet/ReflectorNet.csproj --configuration Release --output ./packages
2221
```
2322

24-
## Project Layout
25-
26-
- **ReflectorNet/** - Main library (NuGet: `com.IvanMurzak.ReflectorNet`)
27-
- **ReflectorNet.Tests/** - xUnit test suite
28-
- **ReflectorNet.Tests.OuterAssembly/** - Separate assembly used by tests for cross-assembly reflection scenarios
29-
- **ConsoleApp/** - Console app for manual testing
30-
31-
## Target Frameworks & Language
32-
33-
- **Library**: `netstandard2.1`, `net8.0`, `net9.0` — LangVersion `10.0`
34-
- **Tests**: `net8.0`, `net9.0` — LangVersion `11.0`
35-
- Nullable enabled, ImplicitUsings disabled throughout
36-
- Root namespace: `com.IvanMurzak.ReflectorNet`
37-
38-
## Architecture
39-
40-
ReflectorNet is a reflection toolkit for AI-driven .NET scenarios — fuzzy method discovery, type-preserving serialization, and dynamic invocation.
41-
42-
### Reflector (partial class, split across 10 files)
43-
44-
`Reflector` is the main entry point in `src/Reflector/`. Each concern is a separate partial file:
45-
46-
| File | Responsibility |
47-
|------|---------------|
48-
| `Reflector.cs` | Constructor, reference resolution |
49-
| `Reflector.Serialize.cs` | Object → `SerializedMember` |
50-
| `Reflector.Deserialize.cs` | `SerializedMember` → object |
51-
| `Reflector.Modify.cs` | In-place object updates |
52-
| `Reflector.FindMethod.cs` | Fuzzy method discovery (match levels 1-6) |
53-
| `Reflector.CallMethod.cs` | Dynamic method invocation |
54-
| `Reflector.Json.cs` | JSON serialization integration |
55-
| `Reflector.Registry.cs` | Converter registry (nested `Registry` class) |
56-
| `Reflector.DefaultValue.cs` | Default value resolution |
57-
| `Reflector.Equals.cs` | Deep equality comparison |
58-
| `Reflector.Error.cs` | Hierarchical error formatting |
59-
60-
### Converter System (Chain of Responsibility)
61-
62-
Located in `src/Converter/`. The `Registry` selects the best converter by querying each for `SerializationPriority(Type)` — highest score wins.
63-
64-
**Reflection converters** (`src/Converter/Reflection/`):
65-
- `BaseReflectionConverter<T>` — abstract base (partial: `.Serialize`, `.Deserialize`, `.Modify`, `.DefaultValue`)
66-
- `PrimitiveReflectionConverter` — built-in types (int, string, DateTime, etc.)
67-
- `GenericReflectionConverter<T>` — custom classes/structs (fallback)
68-
- `ArrayReflectionConverter` — arrays and collections (partial: `.Deserialize`)
69-
- `TypeReflectionConverter`, `AssemblyReflectionConverter` — System.Type, Assembly
70-
- `LazyGenericReflectionConverter` — runtime type resolution for optional dependencies
71-
- `IgnoreFieldsAndPropertiesReflectionConverter` — selective member exclusion
72-
73-
**JSON converters** (`src/Converter/Json/`): System.Text.Json converters for many .NET types. `IJsonSchemaConverter` interface enables custom JSON Schema generation.
74-
75-
### Key Models (`src/Model/`)
76-
77-
- `SerializedMember` — type-preserving intermediate representation (partial: `.Static`)
78-
- `MethodRef` — method reference for fuzzy discovery
79-
- `MethodData` — method metadata and parameters
80-
- `SerializationContext` / `DeserializationContext` — state during (de)serialization
81-
82-
### Thread Safety
83-
84-
Registry uses `ConcurrentBag`/`ConcurrentDictionary` with a cache-replacement invalidation pattern (replace entire dictionary reference rather than clearing) for thread-safe converter and blacklist cache management.
85-
86-
## CI/CD
87-
88-
- **PR workflow** (`pull_request.yml`): build + test on ubuntu with .NET 8.0 + 9.0, publishes trx test results
89-
- **Release workflow** (`release.yml`): triggered on push to main — reads version from `ReflectorNet.csproj` `<Version>`, creates GitHub release tag, publishes NuGet package. Version bump = new release.
90-
91-
## Versioning
23+
## Find detail in
9224

93-
Version is defined in `ReflectorNet/ReflectorNet.csproj` `<Version>` element. Bumping it and merging to main triggers a NuGet publish.
25+
- `docs/claude/architecture.md` — Reflector partial-class structure, converter chain, project layout, target frameworks
26+
- `docs/claude/models.md``SerializedMember`, `MethodRef`, context objects
27+
- `docs/claude/threading.md` — Registry thread safety pattern
28+
- `docs/claude/release.md` — CI/CD workflows and versioning

docs/claude/architecture.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Architecture
2+
3+
ReflectorNet is a reflection toolkit for AI-driven .NET scenarios — fuzzy method discovery, type-preserving serialization, and dynamic invocation.
4+
5+
## Project Layout
6+
7+
- **ReflectorNet/** - Main library (NuGet: `com.IvanMurzak.ReflectorNet`)
8+
- **ReflectorNet.Tests/** - xUnit test suite
9+
- **ReflectorNet.Tests.OuterAssembly/** - Separate assembly used by tests for cross-assembly reflection scenarios
10+
- **ConsoleApp/** - Console app for manual testing
11+
12+
## Target Frameworks & Language
13+
14+
- **Library**: `netstandard2.1`, `net8.0`, `net9.0` — LangVersion `10.0`
15+
- **Tests**: `net8.0`, `net9.0` — LangVersion `11.0`
16+
- Nullable enabled, ImplicitUsings disabled throughout
17+
- Root namespace: `com.IvanMurzak.ReflectorNet`
18+
19+
## Reflector (partial class, split across 10 files)
20+
21+
`Reflector` is the main entry point in `src/Reflector/`. Each concern is a separate partial file:
22+
23+
| File | Responsibility |
24+
|------|---------------|
25+
| `Reflector.cs` | Constructor, reference resolution |
26+
| `Reflector.Serialize.cs` | Object → `SerializedMember` |
27+
| `Reflector.Deserialize.cs` | `SerializedMember` → object |
28+
| `Reflector.Modify.cs` | In-place object updates |
29+
| `Reflector.FindMethod.cs` | Fuzzy method discovery (match levels 1-6) |
30+
| `Reflector.CallMethod.cs` | Dynamic method invocation |
31+
| `Reflector.Json.cs` | JSON serialization integration |
32+
| `Reflector.Registry.cs` | Converter registry (nested `Registry` class) |
33+
| `Reflector.DefaultValue.cs` | Default value resolution |
34+
| `Reflector.Equals.cs` | Deep equality comparison |
35+
| `Reflector.Error.cs` | Hierarchical error formatting |
36+
37+
## Converter System (Chain of Responsibility)
38+
39+
Located in `src/Converter/`. The `Registry` selects the best converter by querying each for `SerializationPriority(Type)` — highest score wins.
40+
41+
**Reflection converters** (`src/Converter/Reflection/`):
42+
- `BaseReflectionConverter<T>` — abstract base (partial: `.Serialize`, `.Deserialize`, `.Modify`, `.DefaultValue`)
43+
- `PrimitiveReflectionConverter` — built-in types (int, string, DateTime, etc.)
44+
- `GenericReflectionConverter<T>` — custom classes/structs (fallback)
45+
- `ArrayReflectionConverter` — arrays and collections (partial: `.Deserialize`)
46+
- `TypeReflectionConverter`, `AssemblyReflectionConverter` — System.Type, Assembly
47+
- `LazyGenericReflectionConverter` — runtime type resolution for optional dependencies
48+
- `IgnoreFieldsAndPropertiesReflectionConverter` — selective member exclusion
49+
50+
**JSON converters** (`src/Converter/Json/`): System.Text.Json converters for many .NET types. `IJsonSchemaConverter` interface enables custom JSON Schema generation.

docs/claude/models.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Key Models
2+
3+
Located in `src/Model/`.
4+
5+
- `SerializedMember` — type-preserving intermediate representation (partial: `.Static`)
6+
- `MethodRef` — method reference for fuzzy discovery
7+
- `MethodData` — method metadata and parameters
8+
- `SerializationContext` / `DeserializationContext` — state during (de)serialization

docs/claude/release.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CI/CD
2+
3+
- **PR workflow** (`pull_request.yml`): build + test on ubuntu with .NET 8.0 + 9.0, publishes trx test results
4+
- **Release workflow** (`release.yml`): triggered on push to main — reads version from `ReflectorNet.csproj` `<Version>`, creates GitHub release tag, publishes NuGet package. Version bump = new release.
5+
6+
## Versioning
7+
8+
Version is defined in `ReflectorNet/ReflectorNet.csproj` `<Version>` element. Bumping it and merging to main triggers a NuGet publish.

docs/claude/threading.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Thread Safety
2+
3+
Registry uses `ConcurrentBag`/`ConcurrentDictionary` with a cache-replacement invalidation pattern (replace entire dictionary reference rather than clearing) for thread-safe converter and blacklist cache management.

0 commit comments

Comments
 (0)