Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
07ef769
Add comprehensive GitHub Copilot instructions and blueprint generator
Dec 4, 2025
317dbb2
feat: Add feature specification and task breakdown for generator reli…
Dec 4, 2025
1ec1a5d
feat: Add diagnostics for ActorSrcGen, implement coverage workflow, a…
Dec 5, 2025
cdf6e3b
US1
Dec 5, 2025
0ba465b
feat: Enhance generator reliability with cancellation support and thr…
Dec 5, 2025
1d17193
feat: Add comprehensive integration tests for cancellation and thread…
Dec 5, 2025
25d74db
feat: Enhance TypeHelpers and add extensive unit tests for ActorVisit…
Dec 5, 2025
96e1787
Add comprehensive integration and unit tests for ActorSrcGen
Dec 5, 2025
e39c886
feat: Enhance documentation with testing guidelines, diagnostics refe…
Dec 5, 2025
9d8efc0
bump version number
aabs Dec 5, 2025
2ffba05
fix: Update coverage report format and paths in CI workflow
Dec 5, 2025
17e4daf
fix: Correct coverage report paths in CI workflow
Dec 5, 2025
7252dd7
fix: Update coverage testing commands and report generation paths in …
Dec 5, 2025
fc409d8
fix: Update .dockerignore and .gitignore to exclude test and coverage…
Dec 5, 2025
26c6599
fix: Refactor coverage testing command for improved readability and m…
Dec 5, 2025
1887436
fix: Simplify coverage testing setup and adjust report generation paths
Dec 5, 2025
75fed34
wip
Dec 5, 2025
b529324
fix: Enhance coverage testing command by refining parameters for resu…
Dec 5, 2025
4efb0e0
fix: Update coverage testing command to specify project file and corr…
Dec 5, 2025
9d016d3
wip
Dec 5, 2025
832f058
wip
Dec 5, 2025
a009908
fix: Add continue-on-error for coverage report generation step
Dec 5, 2025
f1ac1a2
Merge branch 'master' into 001-generator-reliability-hardening
aabs Dec 5, 2025
7f743a6
Increment Version
aabs Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
**/node_modules
**/npm-debug.log
**/obj
**/TestResults
**/coverage*
**/coverage-report
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
# ConstFieldDocumentationHeader: The field must have a documentation header.
dotnet_diagnostic.ConstFieldDocumentationHeader.severity = none
dotnet_diagnostic.RS1035.severity = none

[ActorSrcGen/**.cs]
dotnet_code_quality_unused_parameters = all
dotnet_diagnostic.CA1501.severity = warning
137 changes: 137 additions & 0 deletions .github/agents/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# ActorSrcGen Development Guidelines

Auto-generated from all feature plans. Last updated: 2025-12-05

## Active Technologies

- **C# 12.0** (.NET 8 for tests, .NET Standard 2.0 for generator)
- **Roslyn SDK 4.6.0** (Microsoft.CodeAnalysis.CSharp)
- **xUnit** test framework with **Verify** snapshot testing
- **Coverlet** for code coverage with **ReportGenerator**
- **ImmutableCollections** (System.Collections.Immutable)
- **TPL Dataflow** (Gridsum.DataflowEx 2.0.0)

## Project Structure

```text
ActorSrcGen/ # Source generator project (.NET Standard 2.0)
├── Generators/ # IIncrementalGenerator implementation
├── Model/ # Domain models (⚠️ refactoring to records)
├── Helpers/ # Roslyn extensions
├── Diagnostics/ # ✨ NEW: Centralized DiagnosticDescriptors
└── Templates/ # T4 templates

ActorSrcGen.Abstractions/ # Public API attributes
tests/ActorSrcGen.Tests/ # Test suite (✨ expanding for 85% coverage)
├── GeneratorTests.cs # ✨ NEW: Pipeline tests
├── ActorVisitorTests.cs # ✨ NEW: Visitor logic
├── DiagnosticTests.cs # ✨ NEW: Diagnostic reporting
├── DeterminismTests.cs # ✨ NEW: Byte-for-byte stability
├── CancellationTests.cs # ✨ NEW: Cancellation handling
├── ThreadSafetyTests.cs # ✨ NEW: Parallel execution
└── SnapshotTests/ # ✨ NEW: Generated code snapshots
```

## Commands

```powershell
# Build
dotnet build

# Run tests
dotnet test

# Coverage (target: 85% overall, 100% critical paths)
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
reportgenerator -reports:tests/**/coverage.opencover.xml -targetdir:coverage-report

# Run specific test categories
dotnet test --filter "Category=Unit"
dotnet test --filter "Category=Critical"

# Verify coverage thresholds (Constitution Principle II)
dotnet test /p:Threshold=85 /p:ThresholdType=line
```

## Code Style & Constitutional Principles

### TDD (Principle I - NON-NEGOTIABLE)
- Write tests FIRST (Red-Green-Refactor)
- No implementation without failing test
- Commit test + implementation together

### Coverage (Principle II)
- **Overall minimum: 85%**
- **Critical paths: 100%** (Generator.cs, ActorVisitor.cs, ActorGenerator.cs)
- Use Coverlet + ReportGenerator for validation

### Immutability (Principle III)
```csharp
// ❌ OLD: Mutable class
public class ActorNode {
public List<int> NextBlocks { get; set; } = new();
}

// ✅ NEW: Immutable record
public sealed record ActorNode(
string Name,
ImmutableArray<int> NextBlocks,
...
);
```

### Diagnostics (Principle IV)
```csharp
// ❌ OLD: Inline creation
var descriptor = new DiagnosticDescriptor("ASG0002", ...);

// ✅ NEW: Centralized
using static ActorSrcGen.Diagnostics.Diagnostics;
var diagnostic = Diagnostic.Create(MissingInputTypes, location, actorName);
```

### Complexity (Principle V)
- **Target: CC ≤ 5**
- **Maximum: CC ≤ 8** (must justify exceptions)
- Extract helper methods to reduce complexity

### Testability (Principle VI)
```csharp
// ❌ OLD: Void with side effects
public void VisitActor(INamedTypeSymbol symbol) {
_actorStack.Add(...); // Mutates state
}

// ✅ NEW: Pure function returning result
public VisitorResult VisitActor(SyntaxAndSymbol symbol) {
return new VisitorResult(actors, diagnostics);
}
```

## Recent Changes

### 001-generator-reliability-hardening (Active)
**Goal**: Harden generator for reliability and testability

**Key Refactorings**:
1. Convert domain models to records (ActorNode, BlockNode, SyntaxAndSymbol)
2. Refactor ActorVisitor to return VisitorResult (pure function)
3. Centralize DiagnosticDescriptors in static Diagnostics class
4. Add deterministic sorting (OrderBy FQN)
5. Add CancellationToken support
6. Expand test suite from 1 test to 50+ tests

**Diagnostic IDs**:
- ASG0001: Actor must have at least one Step method
- ASG0002: Actor has no entry points ([FirstStep], [Receiver], or [Ingest])
- ASG0003: Ingest method must be static and return Task or IAsyncEnumerable<T>

**Success Criteria**:
- ≥85% code coverage overall
- 100% coverage for Generator, ActorVisitor, ActorGenerator
- <100ms cancellation response time
- Byte-for-byte deterministic output
- Zero concurrency failures in parallel tests

<!-- MANUAL ADDITIONS START -->
<!-- MANUAL ADDITIONS END -->
Loading