diff --git a/.memory/alignment_checking/README.md b/.memory/alignment_checking/README.md index 716d627..ac2556d 100644 --- a/.memory/alignment_checking/README.md +++ b/.memory/alignment_checking/README.md @@ -22,7 +22,7 @@ Python is the reference style (code-first, minimal prose). All languages should - `—` = missing, intentional (language doesn't need this) - `TODO` = missing, should add - `DEL` = present, should remove or merge -- `Py#` / `TS#` / `Go#` = section order in file (should monotonically increase if order is aligned) +- `Py#` / `TS#` / `DN#` / `Go#` = section order in file (should monotonically increase if order is aligned) ## Implementation Status @@ -30,6 +30,8 @@ Python is the reference style (code-first, minimal prose). All languages should **Go:** ✅ COMPLETE (2026-03-17) — All Go reference files created and aligned. +**.NET:** ✅ COMPLETE (2026-04-01) — All sections verified present and style-aligned with Python reference. + ## Files Each file in this directory tracks alignment for a corresponding reference file: diff --git a/.memory/alignment_checking/advanced-features.md b/.memory/alignment_checking/advanced-features.md index 532976f..2c758a9 100644 --- a/.memory/alignment_checking/advanced-features.md +++ b/.memory/alignment_checking/advanced-features.md @@ -2,22 +2,24 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | -|---------|------|--------|-----|------------|-----|-----| -| Schedules | — | ✓ | 1 | ✓ | 1 | | -| Async Activity Completion | — | ✓ | 2 | ✓ | 2 | | -| Sandbox Customization | — | ✓ | 3 | — | — | | -| Gevent Compatibility Warning | — | ✓ | 4 | — | — | | -| Worker Tuning | — | ✓ | 5 | ✓ | 3 | | -| Workflow Init Decorator | — | ✓ | 6 | — | — | | -| Workflow Failure Exception Types | — | ✓ | 7 | — | — | | -| Continue-as-New | — | — | — | — | — | | -| Workflow Updates | — | — | — | — | — | | -| Nexus Operations | — | — | — | — | — | | -| Activity Cancellation and Heartbeating | — | — | — | — | — | | -| Sinks | — | — | — | ✓ | 4 | | -| CancellationScope Patterns | — | — | — | — | — | | -| Best Practices | — | — | — | — | — | | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Schedules | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Async Activity Completion | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Sandbox Customization | — | ✓ | 3 | — | — | — | — | — | — | +| Gevent Compatibility Warning | — | ✓ | 4 | — | — | — | — | — | — | +| Worker Tuning | — | ✓ | 5 | ✓ | 3 | ✓ | 3 | ✓ | 3 | +| Workflow Init Decorator | — | ✓ | 6 | — | — | ✓ | 4 | — | — | +| Workflow Failure Exception Types | — | ✓ | 7 | — | — | ✓ | 5 | — | — | +| Dependency Injection | — | — | — | — | — | ✓ | 6 | — | — | +| Sessions | — | — | — | — | — | — | — | ✓ | 4 | +| Continue-as-New | — | — | — | — | — | — | — | — | — | +| Workflow Updates | — | — | — | — | — | — | — | — | — | +| Nexus Operations | — | — | — | — | — | — | — | — | — | +| Activity Cancellation and Heartbeating | — | — | — | — | — | — | — | — | — | +| Sinks | — | — | — | ✓ | 4 | — | — | — | — | +| CancellationScope Patterns | — | — | — | — | — | — | — | — | — | +| Best Practices | — | — | — | — | — | — | — | — | — | ## Style Compliance @@ -25,6 +27,7 @@ |----------|--------|-------| | Python | ✓ reference | 7 sections | | TypeScript | ✓ aligned | 4 sections (removed duplicates) | +| .NET | ✓ aligned | 6 sections — Schedules, Async Completion, Worker Tuning, Workflow Init, Failure Exception Types, DI | | Go | ✓ aligned | 4 sections — Schedules, Async Completion, Worker Tuning, Sessions | ## Status @@ -36,14 +39,24 @@ - Sessions: Go-specific feature — `workflow.CreateSession(ctx, options)` pins activities to a specific worker. Useful for file processing where activities need local state. **Intentionally missing (`—`):** - Core column: advanced features are implementation-specific -- Sandbox Customization: Python-specific; Go has no sandbox +- Sandbox Customization: Python-specific; .NET/Go have no sandbox - Gevent Compatibility Warning: Python-specific -- Workflow Init Decorator: Python-specific -- Workflow Failure Exception Types: Python-specific +- Workflow Init Decorator: Python-specific (@workflow.init) +- Workflow Failure Exception Types: Python and .NET (see .NET notes) - Sinks: TS-specific feature -- Sessions: Go-specific (not in Python/TS) +- Sessions: Go-specific (not in Python/TS/.NET) - Interceptors: Decided not to include for any language (all SDKs have them, but too advanced for current scope) +**.NET alignment notes:** +- Workflow Failure Exception Types: ✓ for .NET — only `ApplicationFailureException` fails a workflow; other exceptions retry the workflow task. +- Dependency Injection: NEW .NET-specific section — `Temporalio.Extensions.Hosting` package, `AddTemporalClient()`, generic host worker setup, activity DI. +- .NET gets 6 sections (Schedules, Async Activity Completion, Worker Tuning, Workflow Init, Workflow Failure Exception Types, Dependency Injection) + **Order alignment:** N/A — Files have different structures by design -**Style alignment:** ✅ Complete (Python, TypeScript) +**Style alignment:** ✅ Complete (Python, TypeScript, Go) +- Python: 7 sections (Schedules, Async Activity Completion, Sandbox Customization, Gevent Warning, Worker Tuning, Workflow Init, Failure Exception Types) +- TypeScript: 4 sections (Schedules, Async Activity Completion, Worker Tuning, Sinks) +- Go: 4 sections (Schedules, Async Activity Completion, Worker Tuning, Sessions) +- .NET: 6 sections (Schedules, Async Activity Completion, Worker Tuning, Workflow Init, Workflow Failure Exception Types, Dependency Injection) +- Removed duplicates from TS (Continue-as-New, Workflow Updates, CancellationScope Patterns, Nexus Operations, Activity Cancellation, Best Practices — all covered elsewhere) diff --git a/.memory/alignment_checking/data-handling.md b/.memory/alignment_checking/data-handling.md index 441e825..ce380d8 100644 --- a/.memory/alignment_checking/data-handling.md +++ b/.memory/alignment_checking/data-handling.md @@ -2,20 +2,20 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Default Data Converter | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Pydantic Integration | — | ✓ | 3 | — | — | — | — | -| Custom Data Converter | — | ✓ | 4 | ✓ | 3 | ✓ | 3 | -| Composition of Payload Converters | — | — | — | ✓ | 4 | ✓ | 4 | -| Protobuf Support | — | — | — | ✓ | 5 | ✓ | 5 | -| Payload Encryption | — | ✓ | 5 | ✓ | 6 | ✓ | 6 | -| Search Attributes | — | ✓ | 6 | ✓ | 7 | ✓ | 7 | -| Workflow Memo | — | ✓ | 7 | ✓ | 8 | ✓ | 8 | -| Large Payloads | — | — | — | — | — | — | — | -| Deterministic APIs for Values | — | ✓ | 8 | — | — | — | — | -| Best Practices | — | ✓ | 9 | ✓ | 9 | ✓ | 9 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Default Data Converter | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Pydantic Integration | — | ✓ | 3 | — | — | — | — | — | — | +| Custom Data Converter | — | ✓ | 4 | ✓ | 3 | ✓ | 3 | ✓ | 3 | +| Composition of Payload Converters | — | — | — | ✓ | 4 | — | — | ✓ | 4 | +| Protobuf Support | — | — | — | ✓ | 5 | ✓ | 4 | ✓ | 5 | +| Payload Encryption | — | ✓ | 5 | ✓ | 6 | ✓ | 5 | ✓ | 6 | +| Search Attributes | — | ✓ | 6 | ✓ | 7 | ✓ | 6 | ✓ | 7 | +| Workflow Memo | — | ✓ | 7 | ✓ | 8 | ✓ | 7 | ✓ | 8 | +| Large Payloads | — | — | — | — | — | — | — | — | — | +| Deterministic APIs for Values | — | ✓ | 8 | — | — | ✓ | 8 | — | — | +| Best Practices | — | ✓ | 9 | ✓ | 9 | ✓ | 9 | ✓ | 9 | ## Style Compliance @@ -23,6 +23,7 @@ |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | — | +| .NET | ✓ aligned | System.Text.Json, DefaultPayloadConverter, IPayloadCodec, SearchAttributeKey/Update | | Go | ✓ aligned | JSON default, protobuf native, converter.CompositeDataConverter | ## Status diff --git a/.memory/alignment_checking/determinism-protection.md b/.memory/alignment_checking/determinism-protection.md index c0ef0f0..c51eb48 100644 --- a/.memory/alignment_checking/determinism-protection.md +++ b/.memory/alignment_checking/determinism-protection.md @@ -2,24 +2,26 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| How the Sandbox Works | — | ✓ | 2 | — | — | — | — | -| Import Blocking | — | — | — | ✓ | 2 | — | — | -| Forbidden Operations | — | ✓ | 3 | — | — | — | — | -| Function Replacement | — | — | — | ✓ | 3 | — | — | -| workflowcheck Static Analysis | — | — | — | — | — | ✓ | 2 | -| Determinism Rules | — | — | — | — | — | ✓ | 3 | -| Pass-Through Pattern | — | ✓ | 4 | — | — | — | — | -| Importing Activities | — | ✓ | 5 | — | — | — | — | -| Disabling the Sandbox | — | ✓ | 6 | — | — | — | — | -| Customizing Invalid Module Members | — | ✓ | 7 | — | — | — | — | -| Import Notification Policy | — | ✓ | 8 | — | — | — | — | -| Disable Lazy sys.modules Passthrough | — | ✓ | 9 | — | — | — | — | -| File Organization | — | ✓ | 10 | — | — | — | — | -| Common Issues | — | ✓ | 11 | — | — | — | — | -| Best Practices | — | ✓ | 12 | — | — | ✓ | 4 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| How the Sandbox Works | — | ✓ | 2 | — | — | — | — | — | — | +| Import Blocking | — | — | — | ✓ | 2 | — | — | — | — | +| Forbidden Operations | — | ✓ | 3 | — | — | — | — | — | — | +| Function Replacement | — | — | — | ✓ | 3 | — | — | — | — | +| Runtime Task Detection | — | — | — | — | — | ✓ | 2 | — | — | +| .NET Task Determinism Rules | — | — | — | — | — | ✓ | 3 | — | — | +| workflowcheck Static Analysis | — | — | — | — | — | — | — | ✓ | 2 | +| Determinism Rules | — | — | — | — | — | — | — | ✓ | 3 | +| Pass-Through Pattern | — | ✓ | 4 | — | — | — | — | — | — | +| Importing Activities | — | ✓ | 5 | — | — | — | — | — | — | +| Disabling the Sandbox | — | ✓ | 6 | — | — | — | — | — | — | +| Customizing Invalid Module Members | — | ✓ | 7 | — | — | — | — | — | — | +| Import Notification Policy | — | ✓ | 8 | — | — | — | — | — | — | +| Disable Lazy sys.modules Passthrough | — | ✓ | 9 | — | — | — | — | — | — | +| File Organization | — | ✓ | 10 | — | — | — | — | — | — | +| Common Issues | — | ✓ | 11 | — | — | — | — | — | — | +| Best Practices | — | ✓ | 12 | — | — | ✓ | 4 | ✓ | 4 | ## Style Compliance @@ -27,6 +29,7 @@ |----------|--------|-------| | Python | ✓ reference | Comprehensive (12 sections) | | TypeScript | ✓ aligned | Minimal (3 sections) — V8 is automatic | +| .NET | ✓ aligned | Minimal (4 sections) — no sandbox, runtime EventListener + Task rules | | Go | ✓ aligned | Minimal (4 sections) — no runtime sandbox, convention + static analysis | ## Status diff --git a/.memory/alignment_checking/determinism.md b/.memory/alignment_checking/determinism.md index e70299a..685bb63 100644 --- a/.memory/alignment_checking/determinism.md +++ b/.memory/alignment_checking/determinism.md @@ -2,19 +2,19 @@ ## Section Inventory -| Section | Core | Core# | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|-------|--------|-----|------------|-----|-----|-----| -| Overview | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Why Determinism Matters | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Sources of Non-Determinism | ✓ | 3 | — | — | — | — | — | — | -| Central Concept: Activities | ✓ | 4 | — | — | — | — | — | — | -| SDK Protection / Sandbox | ✓ | 5 | ✓ | 6 | ✓ | 3 | — | — | -| Forbidden Operations | — | — | ✓ | 3 | ✓ | 4 | ✓ | 3 | -| Safe Builtin Alternatives | — | — | ✓ | 4 | — | — | ✓ | 4 | -| Detecting Non-Determinism | ✓ | 6 | — | — | — | — | — | — | -| Recovery from Non-Determinism | ✓ | 7 | — | — | — | — | — | — | -| Testing Replay Compatibility | — | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | -| Best Practices | ✓ | 8 | ✓ | 7 | ✓ | 6 | ✓ | 6 | +| Section | Core | Core# | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|-------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Why Determinism Matters | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Sources of Non-Determinism | ✓ | 3 | — | — | — | — | — | — | — | — | +| Central Concept: Activities | ✓ | 4 | — | — | — | — | — | — | — | — | +| SDK Protection / Sandbox | ✓ | 5 | ✓ | 6 | ✓ | 3 | — | — | — | — | +| Forbidden Operations | — | — | ✓ | 3 | ✓ | 4 | ✓ | 3 | ✓ | 3 | +| Safe Builtin Alternatives | — | — | ✓ | 4 | — | — | ✓ | 4 | ✓ | 4 | +| Detecting Non-Determinism | ✓ | 6 | — | — | — | — | — | — | — | — | +| Recovery from Non-Determinism | ✓ | 7 | — | — | — | — | — | — | — | — | +| Testing Replay Compatibility | — | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | ✓ | 5 | +| Best Practices | ✓ | 8 | ✓ | 7 | ✓ | 6 | ✓ | 6 | ✓ | 6 | ## Style Compliance @@ -23,6 +23,7 @@ | Core | ✓ reference | Deep conceptual content | | Python | ✓ aligned | Practical focus | | TypeScript | ✓ aligned | Practical focus, V8 sandbox | +| .NET | ✓ aligned | No sandbox, custom TaskScheduler + EventListener, Workflow.* safe alternatives table | | Go | ✓ aligned | Practical focus, no sandbox, workflowcheck tool, workflow.* replacements | ## Status diff --git a/.memory/alignment_checking/error-handling.md b/.memory/alignment_checking/error-handling.md index 6b4a8f2..c39698d 100644 --- a/.memory/alignment_checking/error-handling.md +++ b/.memory/alignment_checking/error-handling.md @@ -2,19 +2,19 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Application Errors/Failures | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Non-Retryable Errors | — | ✓ | 3 | — | — | ✓ | 3 | -| Activity Errors | — | — | — | ✓ | 3 | — | — | -| Handling Activity Errors in Workflows | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | -| Retry Configuration | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | -| Timeout Configuration | — | ✓ | 6 | ✓ | 6 | ✓ | 6 | -| Workflow Failure | — | ✓ | 7 | ✓ | 7 | ✓ | 7 | -| Cancellation Handling in Activities | — | — | — | — | — | — | — | -| Idempotency Patterns | — | — | — | — | — | — | — | -| Best Practices | — | ✓ | 8 | ✓ | 9 | ✓ | 8 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Application Errors/Failures | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Non-Retryable Errors | — | ✓ | 3 | — | — | ✓ | 3 | ✓ | 3 | +| Activity Errors | — | — | — | ✓ | 3 | — | — | — | — | +| Handling Activity Errors in Workflows | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | ✓ | 4 | +| Retry Configuration | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | ✓ | 5 | +| Timeout Configuration | — | ✓ | 6 | ✓ | 6 | ✓ | 6 | ✓ | 6 | +| Workflow Failure | — | ✓ | 7 | ✓ | 7 | ✓ | 7 | ✓ | 7 | +| Cancellation Handling in Activities | — | — | — | — | — | — | — | — | — | +| Idempotency Patterns | — | — | — | — | — | — | — | — | — | +| Best Practices | — | ✓ | 8 | ✓ | 9 | ✓ | 8 | ✓ | 8 | ## Style Compliance @@ -22,6 +22,7 @@ |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | Uses `log`, has retry defaults note | +| .NET | ✓ aligned | ApplicationFailureException, ActivityFailureException, nonRetryable param | | Go | ✓ aligned | Go-style error handling (errors.As, error returns, no exceptions) | ## Status diff --git a/.memory/alignment_checking/gotchas.md b/.memory/alignment_checking/gotchas.md index e83465f..842465c 100644 --- a/.memory/alignment_checking/gotchas.md +++ b/.memory/alignment_checking/gotchas.md @@ -2,26 +2,28 @@ ## Section Inventory -| Section | Core | Core# | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|-------|--------|-----|------------|-----|-----|-----| -| Idempotency / Non-Idempotent Activities | ✓ | 1 | — | — | — | — | — | — | -| Replay Safety / Side Effects & Non-Determinism | ✓ | 2 | — | — | — | — | — | — | -| Multiple Workers with Different Code | ✓ | 3 | — | — | — | — | — | — | -| Retry Policies / Failing Activities Too Quickly | ✓ | 4 | — | — | — | — | — | — | -| Query Handlers / Query Handler Mistakes | ✓ | 5 | — | — | — | — | — | — | -| File Organization | ✓ | 6 | ✓ | 1 | — | — | — | — | -| Activity Imports | — | — | — | — | ✓ | 1 | — | — | -| Bundling Issues | — | — | — | — | ✓ | 2 | — | — | -| Async vs Sync Activities | — | — | ✓ | 2 | — | — | — | — | -| Goroutines and Concurrency | — | — | — | — | — | — | ✓ | 1 | -| Non-Deterministic Operations | — | — | — | — | — | — | ✓ | 2 | -| Error Handling | ✓ | 8 | — | — | — | — | — | — | -| Wrong Retry Classification | ✓ | 8 | ✓ | 3 | ✓ | 3 | ✓ | 3 | -| Heartbeating | — | — | ✓ | 5 | ✓ | 5 | ✓ | 4 | -| Cancellation | ✓ | 10 | ✓ | 4 | ✓ | 4 | ✓ | 5 | -| Testing | ✓ | 7 | ✓ | 6 | ✓ | 6 | ✓ | 6 | -| Timers and Sleep | — | — | ✓ | 7 | ✓ | 7 | ✓ | 7 | -| Payload Size Limits | ✓ | 9 | — | — | — | — | — | — | +| Section | Core | Core# | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|-------|--------|-----|------------|-----|------|-----|----|-----| +| Idempotency / Non-Idempotent Activities | ✓ | 1 | — | — | — | — | — | — | — | — | +| Replay Safety / Side Effects & Non-Determinism | ✓ | 2 | — | — | — | — | — | — | — | — | +| Multiple Workers with Different Code | ✓ | 3 | — | — | — | — | — | — | — | — | +| Retry Policies / Failing Activities Too Quickly | ✓ | 4 | — | — | — | — | — | — | — | — | +| Query Handlers / Query Handler Mistakes | ✓ | 5 | — | — | — | — | — | — | — | — | +| File Organization | ✓ | 6 | ✓ | 1 | — | — | — | — | — | — | +| Activity Imports | — | — | — | — | ✓ | 1 | — | — | — | — | +| Bundling Issues | — | — | — | — | ✓ | 2 | — | — | — | — | +| Async vs Sync Activities | — | — | ✓ | 2 | — | — | — | — | — | — | +| .NET Task Determinism | — | — | — | — | — | — | ✓ | 1 | — | — | +| Goroutines and Concurrency | — | — | — | — | — | — | — | — | ✓ | 1 | +| Non-Deterministic Operations | — | — | — | — | — | — | — | — | ✓ | 2 | +| Error Handling | ✓ | 8 | — | — | — | — | — | — | — | — | +| Wrong Retry Classification | ✓ | 8 | ✓ | 3 | ✓ | 3 | ✓ | 2 | ✓ | 3 | +| Heartbeating | — | — | ✓ | 5 | ✓ | 5 | ✓ | 3 | ✓ | 4 | +| Cancellation | ✓ | 10 | ✓ | 4 | ✓ | 4 | ✓ | 4 | ✓ | 5 | +| Testing | ✓ | 7 | ✓ | 6 | ✓ | 6 | ✓ | 5 | ✓ | 6 | +| Timers and Sleep | — | — | ✓ | 7 | ✓ | 7 | ✓ | 6 | ✓ | 7 | +| Payload Size Limits | ✓ | 9 | — | — | — | — | — | — | — | — | +| Dictionary Iteration Order | — | — | — | — | — | — | ✓ | 7 | — | — | ## Style Compliance @@ -30,6 +32,7 @@ | Core | ✓ reference | Conceptual gotchas | | Python | ✓ aligned | Language-specific gotchas | | TypeScript | ✓ aligned | Language-specific gotchas | +| .NET | ✓ aligned | Task determinism, Dictionary iteration order, BAD/GOOD code pattern examples | | Go | ✓ aligned | Language-specific gotchas — goroutines, channels, selectors, map range | ## Status diff --git a/.memory/alignment_checking/language.md b/.memory/alignment_checking/language.md index 2ab9ecc..59496bc 100644 --- a/.memory/alignment_checking/language.md +++ b/.memory/alignment_checking/language.md @@ -4,18 +4,19 @@ Tracks alignment for `python.md`, `typescript.md`, `go.md`, etc. ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| How Temporal Works: History Replay | — | — | — | — | — | — | — | -| Understanding Replay | — | — | — | ✓ | 2 | — | — | -| Quick Start / Quick Demo | — | ✓ | 2 | ✓ | 3 | ✓ | 2 | -| Key Concepts | — | ✓ | 3 | ✓ | 4 | ✓ | 3 | -| File Organization Best Practice | — | ✓ | 4 | ✓ | 5 | ✓ | 4 | -| Determinism Rules | — | — | — | ✓ | 6 | — | — | -| Common Pitfalls | — | ✓ | 5 | ✓ | 7 | ✓ | 5 | -| Writing Tests | — | ✓ | 6 | ✓ | 8 | ✓ | 6 | -| Additional Resources | — | ✓ | 7 | ✓ | 9 | ✓ | 7 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| How Temporal Works: History Replay | — | — | — | — | — | — | — | — | — | +| Understanding Replay | — | — | — | ✓ | 2 | ✓ | 2 | — | — | +| Quick Start / Quick Demo | — | ✓ | 2 | ✓ | 3 | ✓ | 3 | ✓ | 2 | +| Key Concepts | — | ✓ | 3 | ✓ | 4 | ✓ | 4 | ✓ | 3 | +| File Organization Best Practice | — | ✓ | 4 | ✓ | 5 | ✓ | 5 | ✓ | 4 | +| Workflow .editorconfig | — | — | — | — | — | ✓ | 6 | — | — | +| Determinism Rules | — | — | — | ✓ | 6 | ✓ | 7 | — | — | +| Common Pitfalls | — | ✓ | 5 | ✓ | 7 | ✓ | 8 | ✓ | 5 | +| Writing Tests | — | ✓ | 6 | ✓ | 8 | ✓ | 9 | ✓ | 6 | +| Additional Resources | — | ✓ | 7 | ✓ | 9 | ✓ | 10 | ✓ | 7 | ## Style Compliance @@ -23,6 +24,7 @@ Tracks alignment for `python.md`, `typescript.md`, `go.md`, etc. |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | Has Understanding Replay, Determinism Rules | +| .NET | ✓ aligned | Has Understanding Replay + Determinism Rules (like TS); NuGet setup, attribute-based API | | Go | ✓ aligned | Function-based (no decorators), workflowcheck, struct activities | ## Status diff --git a/.memory/alignment_checking/observability.md b/.memory/alignment_checking/observability.md index 3d56a89..8fd4179 100644 --- a/.memory/alignment_checking/observability.md +++ b/.memory/alignment_checking/observability.md @@ -2,16 +2,16 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Logging / Replay-Aware Logging | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Customizing the Logger | — | ✓ | 2 | ✓ | 3 | ✓ | 3 | -| OpenTelemetry Integration | — | — | — | — | — | — | — | -| Metrics | — | ✓ | 3 | ✓ | 4 | ✓ | 4 | -| Search Attributes (Visibility) | — | ✓ | 4 | — | — | ✓ | 5 | -| Debugging with Event History | — | — | — | — | — | — | — | -| Best Practices | — | ✓ | 5 | ✓ | 5 | ✓ | 6 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Logging / Replay-Aware Logging | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Customizing the Logger | — | ✓ | 2 | ✓ | 3 | ✓ | 3 | ✓ | 3 | +| OpenTelemetry Integration | — | — | — | — | — | — | — | — | — | +| Metrics | — | ✓ | 3 | ✓ | 4 | ✓ | 4 | ✓ | 4 | +| Search Attributes (Visibility) | — | ✓ | 4 | ✓ | 5 | ✓ | 5 | ✓ | 5 | +| Debugging with Event History | — | — | — | — | — | — | — | — | — | +| Best Practices | — | ✓ | 5 | ✓ | 6 | ✓ | 6 | ✓ | 6 | ## Style Compliance @@ -19,6 +19,7 @@ |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | Removed verbose sections | +| .NET | ✓ aligned | Workflow.Logger, ActivityExecutionContext.Current.Logger, ILoggerFactory, OpenTelemetry metrics | | Go | ✓ aligned | workflow.GetLogger, slog integration, Tally/Prometheus metrics | ## Status diff --git a/.memory/alignment_checking/patterns.md b/.memory/alignment_checking/patterns.md index 9485753..04600fe 100644 --- a/.memory/alignment_checking/patterns.md +++ b/.memory/alignment_checking/patterns.md @@ -2,35 +2,37 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Signals | ✓ | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Dynamic Signal Handlers | — | ✓ | 2 | ✓ | 2 | — | — | -| Queries | ✓ | ✓ | 3 | ✓ | 3 | ✓ | 2 | -| Dynamic Query Handlers | — | ✓ | 4 | ✓ | 4 | — | — | -| Updates | ✓ | ✓ | 5 | ✓ | 5 | ✓ | 3 | -| Child Workflows | ✓ | ✓ | 6 | ✓ | 6 | ✓ | 4 | -| Child Workflow Options | — | — | — | ✓ | 7 | ✓ | 4s | -| Handles to External Workflows | — | ✓ | 7 | ✓ | 8 | ✓ | 5 | -| Parallel Execution | ✓ | ✓ | 8 | ✓ | 9 | ✓ | 6 | -| Deterministic Asyncio Alternatives | — | ✓ | 9 | — | — | — | — | -| Selector Pattern | — | — | — | — | — | ✓ | 7 | -| Continue-as-New | ✓ | ✓ | 10 | ✓ | 10 | ✓ | 8 | -| Cancellation Handling (asyncio) | — | ✓ | 12 | — | — | — | — | -| Cancellation Scopes | — | — | — | ✓ | 12 | — | — | -| Cancellation Handling | — | — | — | — | — | ✓ | 9 | -| Saga Pattern | ✓ | ✓ | 11 | ✓ | 11 | ✓ | 10 | -| Triggers | — | — | — | ✓ | 13 | — | — | -| Wait Condition with Timeout | — | ✓ | 13 | ✓ | 14 | ✓ | 11 | -| Waiting for All Handlers to Finish | — | ✓ | 14 | ✓ | 15 | ✓ | 12 | -| Activity Heartbeat Details | ✓ | ✓ | 15 | ✓ | 16 | ✓ | 13 | -| Timers | ✓ | ✓ | 16 | ✓ | 17 | ✓ | 14 | -| Large Data Handling | ✓ | — | — | — | — | — | — | -| Local Activities | ✓ | ✓ | 17 | ✓ | 18 | ✓ | 15 | -| Entity Workflow Pattern | ✓ | — | — | — | — | — | — | -| Polling Patterns | ✓ | — | — | — | — | — | — | -| Idempotency Patterns | ✓ | — | — | — | — | — | — | -| Using Pydantic Models | — | ✓ | 18 | — | — | — | — | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Signals | ✓ | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Dynamic Signal Handlers | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | — | — | +| Queries | ✓ | ✓ | 3 | ✓ | 3 | ✓ | 3 | ✓ | 2 | +| Dynamic Query Handlers | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | — | — | +| Updates | ✓ | ✓ | 5 | ✓ | 5 | ✓ | 5 | ✓ | 3 | +| Child Workflows | ✓ | ✓ | 6 | ✓ | 6 | ✓ | 6 | ✓ | 4 | +| Child Workflow Options | — | — | — | ✓ | 7 | — | — | ✓ | 4s | +| Handles to External Workflows | — | ✓ | 7 | ✓ | 8 | ✓ | 7 | ✓ | 5 | +| Parallel Execution | ✓ | ✓ | 8 | ✓ | 9 | ✓ | 8 | ✓ | 6 | +| Deterministic Asyncio Alternatives | — | ✓ | 9 | — | — | — | — | — | — | +| Deterministic Task Alternatives | — | — | — | — | — | ✓ | 9 | — | — | +| Selector Pattern | — | — | — | — | — | — | — | ✓ | 7 | +| Continue-as-New | ✓ | ✓ | 10 | ✓ | 10 | ✓ | 10 | ✓ | 8 | +| Cancellation Handling (asyncio) | — | ✓ | 12 | — | — | — | — | — | — | +| Cancellation Scopes | — | — | — | ✓ | 12 | — | — | — | — | +| Cancellation Handling (CancellationToken) | — | — | — | — | — | ✓ | 12 | — | — | +| Cancellation Handling | — | — | — | — | — | — | — | ✓ | 9 | +| Saga Pattern | ✓ | ✓ | 11 | ✓ | 11 | ✓ | 11 | ✓ | 10 | +| Triggers | — | — | — | ✓ | 13 | — | — | — | — | +| Wait Condition with Timeout | — | ✓ | 13 | ✓ | 14 | ✓ | 13 | ✓ | 11 | +| Waiting for All Handlers to Finish | — | ✓ | 14 | ✓ | 15 | ✓ | 14 | ✓ | 12 | +| Activity Heartbeat Details | ✓ | ✓ | 15 | ✓ | 16 | ✓ | 15 | ✓ | 13 | +| Timers | ✓ | ✓ | 16 | ✓ | 17 | ✓ | 16 | ✓ | 14 | +| Large Data Handling | ✓ | — | — | — | — | — | — | — | — | +| Local Activities | ✓ | ✓ | 17 | ✓ | 18 | ✓ | 17 | ✓ | 15 | +| Entity Workflow Pattern | ✓ | — | — | — | — | — | — | — | — | +| Polling Patterns | ✓ | — | — | — | — | — | — | — | — | +| Idempotency Patterns | ✓ | — | — | — | — | — | — | — | — | +| Using Pydantic Models | — | ✓ | 18 | — | — | — | — | — | — | ## Style Compliance @@ -38,6 +40,7 @@ |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | Uses `log`, CancellationScope idiom | +| .NET | ✓ aligned | Attribute-based handlers, CancellationToken, Workflow.WhenAllAsync/WhenAnyAsync, lambda activity invocations | | Go | ✓ aligned | Channel-based signals, SetQueryHandler, SetUpdateHandler, Selector, compensation slice saga | ## Status @@ -65,6 +68,14 @@ - Continue-as-New: Go returns `workflow.NewContinueAsNewError` (error-based, not function call) - Cancellation Scopes / Triggers / Deterministic Asyncio: Not applicable to Go → marked `—` +**.NET-specific notes:** +- Signals/Queries/Updates use `[WorkflowSignal]`, `[WorkflowQuery]`, `[WorkflowUpdate]` attributes +- Dynamic handlers use `(Dynamic = true)` attribute param with `IRawValue[]` args +- Cancellation uses standard `CancellationToken` + `TemporalException.IsCanceledException(e)` pattern with detached token for cleanup +- Deterministic Task Alternatives: .NET-specific section covering `Workflow.WhenAllAsync`, `WhenAnyAsync`, `RunTaskAsync`, `DelayAsync`, `Mutex`, `Semaphore` +- Parallel Execution uses `Workflow.WhenAllAsync` (not `Task.WhenAll`) +- Saga uses `List>` for compensations (idiomatic C#) + **Decided to keep as Core-only:** - Large Data Handling: Core conceptual explanation sufficient (language-agnostic pattern) - Polling Patterns: Core conceptual explanation sufficient @@ -81,7 +92,7 @@ **Order alignment:** ✓ Aligned — TS# and Go# monotonically increase -**Style alignment:** ✅ All issues fixed (Python, TypeScript, Go) +**Style alignment:** ✅ All issues fixed (Python, TypeScript, Go, .NET) - ✅ **Queries:** TS now has "Important: must NOT modify state" note - ✅ **Updates:** All languages now have "validators must NOT mutate state or block" note - ✅ **Saga Pattern:** TS now has idempotency note, comments about saving compensation BEFORE activity diff --git a/.memory/alignment_checking/testing.md b/.memory/alignment_checking/testing.md index 500f07a..8f62a8e 100644 --- a/.memory/alignment_checking/testing.md +++ b/.memory/alignment_checking/testing.md @@ -2,17 +2,17 @@ ## Section Inventory -| Section | Core | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|--------|-----|------------|-----|-----|-----| -| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Test Environment Setup | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Time Skipping | — | — | — | — | — | — | — | -| Activity Mocking | — | ✓ | 3 | ✓ | 3 | ✓ | 3 | -| Testing Signals and Queries | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | -| Testing Failure Cases | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | -| Replay Testing | — | ✓ | 6 | ✓ | 6 | ✓ | 6 | -| Activity Testing | — | ✓ | 7 | ✓ | 7 | ✓ | 7 | -| Best Practices | — | ✓ | 8 | ✓ | 8 | ✓ | 8 | +| Section | Core | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Test Environment Setup | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Time Skipping | — | — | — | — | — | — | — | — | — | +| Activity Mocking | — | ✓ | 3 | ✓ | 3 | ✓ | 3 | ✓ | 3 | +| Testing Signals and Queries | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | ✓ | 4 | +| Testing Failure Cases | — | ✓ | 5 | ✓ | 5 | ✓ | 5 | ✓ | 5 | +| Replay Testing | — | ✓ | 6 | ✓ | 6 | ✓ | 6 | ✓ | 6 | +| Activity Testing | — | ✓ | 7 | ✓ | 7 | ✓ | 7 | ✓ | 7 | +| Best Practices | — | ✓ | 8 | ✓ | 8 | ✓ | 8 | ✓ | 8 | ## Style Compliance @@ -20,6 +20,7 @@ |----------|--------|-------| | Python | ✓ reference | — | | TypeScript | ✓ aligned | Added failure/activity testing | +| .NET | ✓ aligned | WorkflowEnvironment, xUnit, [Activity("name")] mocking, ActivityEnvironment, WorkflowReplayer | | Go | ✓ aligned | testsuite package, testify, mock activities, TestWorkflowEnvironment | ## Status diff --git a/.memory/alignment_checking/versioning.md b/.memory/alignment_checking/versioning.md index 3df1f60..5680d84 100644 --- a/.memory/alignment_checking/versioning.md +++ b/.memory/alignment_checking/versioning.md @@ -2,17 +2,17 @@ ## Section Inventory -| Section | Core | Core# | Python | Py# | TypeScript | TS# | Go | Go# | -|---------|------|-------|--------|-----|------------|-----|-----|-----| -| Overview | ✓ | 1 | — | — | — | — | — | — | -| Why Versioning is Needed | ✓ | 2 | — | — | — | — | — | — | -| Patching API / GetVersion API | ✓ | 3 | ✓ | 1 | ✓ | 1 | ✓ | 1 | -| Workflow Type Versioning | ✓ | 4 | ✓ | 2 | ✓ | 2 | ✓ | 2 | -| Worker Versioning | ✓ | 5 | ✓ | 3 | ✓ | 3 | ✓ | 3 | -| Choosing a Strategy | ✓ | 6 | — | — | — | — | — | — | -| Best Practices | ✓ | 7 | ✓ | 4 | ✓ | 4 | ✓ | 4 | -| Finding Workflows by Version | ✓ | 8 | — | — | — | — | — | — | -| Common Mistakes | ✓ | 9 | — | — | — | — | — | — | +| Section | Core | Core# | Python | Py# | TypeScript | TS# | .NET | DN# | Go | Go# | +|---------|------|-------|--------|-----|------------|-----|------|-----|----|-----| +| Overview | ✓ | 1 | — | — | — | — | — | — | — | — | +| Why Versioning is Needed | ✓ | 2 | — | — | — | — | — | — | — | — | +| Patching API / GetVersion API | ✓ | 3 | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 | +| Workflow Type Versioning | ✓ | 4 | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 | +| Worker Versioning | ✓ | 5 | ✓ | 3 | ✓ | 3 | ✓ | 3 | ✓ | 3 | +| Choosing a Strategy | ✓ | 6 | — | — | — | — | — | — | — | — | +| Best Practices | ✓ | 7 | ✓ | 4 | ✓ | 4 | ✓ | 4 | ✓ | 4 | +| Finding Workflows by Version | ✓ | 8 | — | — | — | — | — | — | — | — | +| Common Mistakes | ✓ | 9 | — | — | — | — | — | — | — | — | ## Style Compliance @@ -21,6 +21,7 @@ | Core | ✓ reference | Conceptual content | | Python | ✓ aligned | Code only, refs core | | TypeScript | ✓ aligned | Code only, refs core | +| .NET | ✓ aligned | Workflow.Patched/DeprecatePatch, [Workflow("name")] type versioning, DeploymentOptions + VersioningBehavior attribute | | Go | ✓ aligned | Uses `workflow.GetVersion` (not patching); code only, refs core | ## Status diff --git a/.memory/correctness_checking/README.md b/.memory/correctness_checking/README.md index 98f0cac..4d90bf9 100644 --- a/.memory/correctness_checking/README.md +++ b/.memory/correctness_checking/README.md @@ -9,27 +9,27 @@ Track verification of factual statements and code examples in reference files fo Each file in this directory tracks correctness for a corresponding reference file. Within each file, sections are organized by language (e.g., `## TypeScript`, `## Python`). -**Supported languages:** TypeScript, Python, Go +**Supported languages:** TypeScript, Python, .NET, Go **Adding a new language:** Add a new `## {Language}` section to each relevant file with a Tracking table and Detailed Notes. ## Summary -| File | TypeScript | Python | Go | -|------|------------|--------|-----| -| patterns.md | ✅ | partial | ✅ | -| testing.md | ✅ | partial | ✅ | -| language.md | ✅ | partial | ✅ | -| versioning.md | ✅ | partial | ✅ | -| advanced-features.md | ✅ | partial | ✅ | -| data-handling.md | ✅ | partial | ✅ | -| determinism-protection.md | ✅ | partial | ✅ | -| determinism.md | ✅ | partial | ✅ | -| error-handling.md | ✅ | partial | ✅ | -| gotchas.md | ✅ | partial | ✅ | -| observability.md | ✅ | partial | ✅ | -| ai-patterns.md | — | partial | — | -| sync-vs-async.md | — | ✅ | — | +| File | TypeScript | Python | .NET | Go | +|------|------------|--------|------|-----| +| patterns.md | ✅ | partial | ✅ | ✅ | +| testing.md | ✅ | partial | ✅ | ✅ | +| language.md | ✅ | partial | ✅ | ✅ | +| versioning.md | ✅ | partial | ✅ | ✅ | +| advanced-features.md | ✅ | partial | ✅ | ✅ | +| data-handling.md | ✅ | partial | ✅ | ✅ | +| determinism-protection.md | ✅ | partial | ✅ | ✅ | +| determinism.md | ✅ | partial | ✅ | ✅ | +| error-handling.md | ✅ | partial | ✅ | ✅ | +| gotchas.md | ✅ | partial | ✅ | ✅ | +| observability.md | ✅ | partial | ✅ | ✅ | +| ai-patterns.md | — | partial | — | — | +| sync-vs-async.md | — | ✅ | — | — | **Legend:** ✅ = all sections verified, partial = some sections need fixes, unchecked = not yet verified, — = N/A diff --git a/.memory/correctness_checking/advanced-features.md b/.memory/correctness_checking/advanced-features.md index 952ac22..1961c88 100644 --- a/.memory/correctness_checking/advanced-features.md +++ b/.memory/correctness_checking/advanced-features.md @@ -185,3 +185,32 @@ Correctness verification for `references/{language}/advanced-features.md`. --- + +## .NET + +**File:** `references/dotnet/advanced-features.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Schedules | FIXED | Changed `action:`/`spec:` to PascalCase `Action:`/`Spec:` | temporal-docs API | +| 2 | Async Activity Completion | all good | Added heartbeat guidance during alignment | temporal-docs API | +| 3 | Worker Tuning | all good | | temporal-docs API | +| 4 | Workflow Init Attribute | all good | New section added during alignment | temporal-docs, SDK README | +| 5 | Workflow Failure Exception Types | all good | | SDK README | +| 6 | Dependency Injection | all good | `AddScopedActivities()` and `AddSingletonActivities()` confirmed | temporal-docs API | + +### Detailed Notes + +#### 1. Schedules +**Status:** FIXED +**Issue:** Constructor used lowercase named params `action:`, `spec:`. C# records use PascalCase: `Action:`, `Spec:`. +**Source:** `Schedule(ScheduleAction Action, ScheduleSpec Spec)` confirmed at dotnet.temporal.io API docs. + +#### 2. Async Activity Completion +**Status:** all good +**Verified:** `CompleteAsyncException` is correct class name in `Temporalio.Activities` namespace. `GetAsyncActivityHandle(taskToken)` returns handle with `CompleteAsync`, `FailAsync`, `HeartbeatAsync` methods. + +--- + diff --git a/.memory/correctness_checking/data-handling.md b/.memory/correctness_checking/data-handling.md index 5b5b5ac..8d822fd 100644 --- a/.memory/correctness_checking/data-handling.md +++ b/.memory/correctness_checking/data-handling.md @@ -330,3 +330,31 @@ Correctness verification for `references/{language}/data-handling.md`. --- + +## .NET + +**File:** `references/dotnet/data-handling.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | temporal-docs | +| 2 | Default Data Converter | all good | | SDK README | +| 3 | Custom Data Converter | all good | | SDK README | +| 4 | Protobuf Support | all good | | SDK README | +| 5 | Payload Encryption | all good | | SDK README | +| 6 | Search Attributes | FIXED | Changed to `key.ValueSet(value)` style | temporal-docs API | +| 7 | Workflow Memo | all good | | temporal-docs | +| 8 | Deterministic APIs for Values | all good | | temporal-docs API | +| 9 | Best Practices | all good | | — | + +### Detailed Notes + +#### 6. Search Attributes +**Status:** FIXED +**Issue:** Was using static `SearchAttributeUpdate.ValueSet(key, value)`. Changed to preferred `key.ValueSet(value)` instance method style per official docs. Both are valid APIs but docs prefer the instance method. +**Source:** temporal-docs API, dotnet.temporal.io + +--- + diff --git a/.memory/correctness_checking/determinism-protection.md b/.memory/correctness_checking/determinism-protection.md index a16068b..809b49d 100644 --- a/.memory/correctness_checking/determinism-protection.md +++ b/.memory/correctness_checking/determinism-protection.md @@ -232,3 +232,25 @@ Correctness verification for `references/{language}/determinism-protection.md`. --- + +## .NET + +**File:** `references/dotnet/determinism-protection.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | SDK README | +| 2 | Runtime Task Detection | all good | `InvalidWorkflowOperationException` confirmed | SDK README | +| 3 | .NET Task Determinism Rules | all good | All rules match SDK README | SDK README | +| 4 | Best Practices | all good | | — | + +### Detailed Notes + +#### 2. Runtime Task Detection +**Status:** all good +**Verified:** `InvalidWorkflowOperationException` exact class name confirmed. `DisableWorkflowTracingEventListener` property confirmed. EventListener mechanism description matches SDK README. + +--- + diff --git a/.memory/correctness_checking/determinism.md b/.memory/correctness_checking/determinism.md index 4d948d3..05c6499 100644 --- a/.memory/correctness_checking/determinism.md +++ b/.memory/correctness_checking/determinism.md @@ -232,3 +232,27 @@ Correctness verification for `references/{language}/determinism.md`. --- + +## .NET + +**File:** `references/dotnet/determinism.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | — | +| 2 | Why Determinism Matters | all good | | — | +| 3 | Forbidden Operations | all good | | SDK README | +| 4 | Safe Builtin Alternatives | all good | All entries verified | temporal-docs API | +| 5 | Testing Replay Compatibility | all good | | — | +| 6 | Best Practices | all good | | — | + +### Detailed Notes + +#### 4. Safe Builtin Alternatives +**Status:** all good +**Verified:** `Workflow.UtcNow`, `Workflow.Random`, `Workflow.NewGuid()`, `Workflow.DelayAsync`, `Workflow.RunTaskAsync`, `Workflow.WhenAllAsync`, `Workflow.WhenAnyAsync`, `Temporalio.Workflows.Mutex`, `Temporalio.Workflows.Semaphore` — all confirmed from SDK README and API docs. + +--- + diff --git a/.memory/correctness_checking/error-handling.md b/.memory/correctness_checking/error-handling.md index 121330d..bf7c5ee 100644 --- a/.memory/correctness_checking/error-handling.md +++ b/.memory/correctness_checking/error-handling.md @@ -269,3 +269,29 @@ Correctness verification for `references/{language}/error-handling.md`. --- + +## .NET + +**File:** `references/dotnet/error-handling.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | — | +| 2 | Application Failures | all good | `errorType:` param confirmed | temporal-docs API | +| 3 | Non-Retryable Errors | all good | `nonRetryable:` param confirmed | temporal-docs API | +| 4 | Handling Activity Errors | all good | `ActivityFailureException` confirmed | temporal-docs API | +| 5 | Retry Configuration | all good | `MaximumInterval`/`MaximumAttempts`/`NonRetryableErrorTypes` confirmed | temporal-docs, SDK samples | +| 6 | Timeout Configuration | all good | | temporal-docs | +| 7 | Workflow Failure | all good | Only `ApplicationFailureException` fails workflow — confirmed | SDK README | +| 8 | Best Practices | all good | | — | + +### Detailed Notes + +#### 2-3. Application Failures / Non-Retryable +**Status:** all good +**Verified:** `ApplicationFailureException(message, errorType:, nonRetryable:)` constructor — lowercase param names confirmed from API docs. Namespace `Temporalio.Exceptions` confirmed. + +--- + diff --git a/.memory/correctness_checking/gotchas.md b/.memory/correctness_checking/gotchas.md index 548c3e6..4e611de 100644 --- a/.memory/correctness_checking/gotchas.md +++ b/.memory/correctness_checking/gotchas.md @@ -371,3 +371,28 @@ _ = encodedVal.Get(&val) --- + +## .NET + +**File:** `references/dotnet/gotchas.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | .NET Task Determinism | all good | | SDK README | +| 2 | Wrong Retry Classification | all good | | — | +| 3 | Heartbeating | all good | `ActivityExecutionContext.Current.Heartbeat()` confirmed | temporal-docs API | +| 4 | Cancellation | all good | `CancellationToken.None` for cleanup confirmed | temporal-docs | +| 5 | Testing | all good | | — | +| 6 | Timers and Sleep | all good | | SDK README | +| 7 | Dictionary Iteration Order | all good | | SDK README | + +### Detailed Notes + +#### 1. .NET Task Determinism +**Status:** all good +**Verified:** All BAD/GOOD examples match SDK README `.NET Task Determinism` section exactly. `Workflow.RunTaskAsync`, `Workflow.DelayAsync`, `Workflow.WhenAllAsync`/`WhenAnyAsync`, `Temporalio.Workflows.Mutex`/`Semaphore` confirmed. + +--- + diff --git a/.memory/correctness_checking/language.md b/.memory/correctness_checking/language.md index 7707133..1fe157e 100644 --- a/.memory/correctness_checking/language.md +++ b/.memory/correctness_checking/language.md @@ -295,3 +295,31 @@ Correctness verification for `references/{language}/{language}.md` (e.g., typesc --- + +## .NET + +**File:** `references/dotnet/dotnet.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | — | +| 2 | Understanding Replay | all good | | — | +| 3 | Quick Start | all good | `AddAllActivities`/`AddWorkflow()` verified | SDK samples | +| 4 | Key Concepts | all good | Added `[WorkflowInit]` guidance | temporal-docs | +| 5 | File Organization | all good | Updated to `.workflow.cs` convention | SDK README | +| 6 | Workflow .editorconfig | all good | Copied from SDK README | SDK README | +| 7 | Determinism Rules | all good | | — | +| 8 | Common Pitfalls | all good | | — | +| 9 | Writing Tests | all good | | — | +| 10 | Additional Resources | all good | | — | + +### Detailed Notes + +#### 6. Workflow .editorconfig +**Status:** all good +**Verified:** Copied directly from SDK README. Rules match exactly: CA1024, CA1822, CA2007, CA2008, CA5394, CS1998, VSTHRD103, VSTHRD105. Scoped to `[*.workflow.cs]`. + +--- + diff --git a/.memory/correctness_checking/observability.md b/.memory/correctness_checking/observability.md index 2c7e4e0..1e7b24b 100644 --- a/.memory/correctness_checking/observability.md +++ b/.memory/correctness_checking/observability.md @@ -253,3 +253,28 @@ Correctness verification for `references/{language}/observability.md`. --- + +## .NET + +**File:** `references/dotnet/observability.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | — | +| 2 | Logging | all good | `Workflow.Logger` as `ILogger` confirmed | temporal-docs, SDK README | +| 3 | Customizing Logger | all good | `LoggerFactory` on client options confirmed | temporal-docs | +| 4 | Metrics | FIXED | Replaced fabricated `AddTemporalClientInstrumentation()` with correct `TemporalRuntime` Prometheus approach | temporal-docs | +| 5 | Search Attributes | all good | Cross-reference to data-handling.md | — | +| 6 | Best Practices | all good | | — | + +### Detailed Notes + +#### 4. Metrics +**Status:** FIXED +**Issue:** Original code used `Sdk.CreateMeterProviderBuilder().AddTemporalClientInstrumentation()` which does NOT exist in the SDK. The .NET SDK uses `TemporalRuntime` with `Prometheus` endpoint for metrics, or `Temporalio.Extensions.DiagnosticSource` for .NET Meter integration. +**Source:** temporal-docs, SDK README, dotnet.temporal.io API docs + +--- + diff --git a/.memory/correctness_checking/patterns.md b/.memory/correctness_checking/patterns.md index 1500eba..5c25b24 100644 --- a/.memory/correctness_checking/patterns.md +++ b/.memory/correctness_checking/patterns.md @@ -710,3 +710,39 @@ import { proxyLocalActivities } from '@temporalio/workflow'; --- + +## .NET + +**File:** `references/dotnet/patterns.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Signals | all good | | temporal-docs API | +| 2 | Dynamic Signal Handlers | all good | | temporal-docs API | +| 3 | Queries | all good | | temporal-docs API | +| 4 | Dynamic Query Handlers | all good | | temporal-docs API | +| 5 | Updates | all good | Added validator constraints note during alignment | temporal-docs | +| 6 | Child Workflows | all good | | temporal-docs API | +| 7 | Handles to External Workflows | all good | | temporal-docs API | +| 8 | Parallel Execution | all good | | temporal-docs API | +| 9 | Deterministic Task Alternatives | all good | | SDK README, release notes | +| 10 | Continue-as-New | all good | | temporal-docs API | +| 11 | Saga Pattern | all good | | temporal-docs | +| 12 | Cancellation Handling | FIXED | Updated to `TemporalException.IsCanceledException` + detached CancellationTokenSource | SDK README, temporal-docs | +| 13 | Wait Condition with Timeout | all good | | temporal-docs API | +| 14 | Waiting for All Handlers to Finish | all good | | temporal-docs API | +| 15 | Activity Heartbeat Details | all good | | temporal-docs API | +| 16 | Timers | all good | | temporal-docs API | +| 17 | Local Activities | all good | | temporal-docs API | + +### Detailed Notes + +#### 12. Cancellation Handling +**Status:** FIXED +**Issue:** Was using `catch (OperationCanceledException) when (Workflow.CancellationToken.IsCancellationRequested)`. Official pattern uses `catch (Exception e) when (TemporalException.IsCanceledException(e))` with a detached `CancellationTokenSource` for cleanup activities. +**Source:** SDK README, temporal-docs + +--- + diff --git a/.memory/correctness_checking/testing.md b/.memory/correctness_checking/testing.md index 5ccb05f..5beb05b 100644 --- a/.memory/correctness_checking/testing.md +++ b/.memory/correctness_checking/testing.md @@ -286,3 +286,29 @@ Correctness verification for `references/{language}/testing.md`. --- + +## .NET + +**File:** `references/dotnet/testing.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Overview | all good | | temporal-docs | +| 2 | Test Environment Setup | all good | | SDK README, temporal-docs | +| 3 | Activity Mocking | all good | | SDK README | +| 4 | Testing Signals and Queries | all good | | temporal-docs | +| 5 | Testing Failure Cases | all good | | temporal-docs | +| 6 | Replay Testing | all good | `WorkflowReplayer`/`WorkflowReplayerOptions` confirmed | temporal-docs API | +| 7 | Activity Testing | all good | | temporal-docs API | +| 8 | Best Practices | all good | | — | + +### Detailed Notes + +#### 6. Replay Testing +**Status:** all good +**Verified:** `WorkflowReplayer` class in `Temporalio.Worker` namespace. Constructor takes `WorkflowReplayerOptions`. `ReplayWorkflowAsync(WorkflowHistory.FromJson(...))` matches SDK README exactly. + +--- + diff --git a/.memory/correctness_checking/versioning.md b/.memory/correctness_checking/versioning.md index 4885ddd..62172b3 100644 --- a/.memory/correctness_checking/versioning.md +++ b/.memory/correctness_checking/versioning.md @@ -341,3 +341,25 @@ Correctness verification for `references/{language}/versioning.md`. --- + +## .NET + +**File:** `references/dotnet/versioning.md` (relative to skill root) + +### Tracking + +| # | Section | Status | Fix Applied | Sources | +|---|---------|--------|-------------|---------| +| 1 | Patching API | all good | | temporal-docs | +| 2 | Workflow Type Versioning | all good | | temporal-docs | +| 3 | Worker Versioning | all good | `WorkerDeploymentOptions`/`UseWorkerVersioning` confirmed | temporal-docs API | +| 4 | Best Practices | all good | | — | + +### Detailed Notes + +#### 3. Worker Versioning +**Status:** all good +**Verified:** `WorkerDeploymentOptions(DeploymentName:, BuildId:)` and `UseWorkerVersioning = true` confirmed in API docs. `VersioningBehavior.Pinned`/`AutoUpgrade` attribute syntax confirmed. + +--- +