Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .memory/alignment_checking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,25 @@ Python is the reference style (code-first, minimal prose). All languages should
- `⚠️ needs work` = has style issues to address
- `—` = not started

**Supported languages:** Python (reference), TypeScript, Go (not started), PHP (all reference files created)

## Section Inventory Legend

- `✓` = present
- ` ` (empty) = missing, unknown if intentional (needs review)
- `—` = 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#` / `Go#` / `PHP#` = section order in file (should monotonically increase if order is aligned)

## Implementation Status

**Python/TypeScript:** ✅ COMPLETE (2026-02-25) — All TODO/DEL/BUG items implemented.

**Go:** ✅ COMPLETE (2026-03-17) — All Go reference files created and aligned.

**PHP:** ✅ CONTENT COMPLETE (2026-03-16) — All 11 PHP reference files created. PHP columns present in all tracking files. Correctness verification pending.

## Files

Each file in this directory tracks alignment for a corresponding reference file:
Expand Down
50 changes: 30 additions & 20 deletions .memory/alignment_checking/advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

## 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# | Go | PHP | PHP# |
|---------|------|--------|-----|------------|-----|----|-----|------|
| Schedules | — | ✓ | 1 | ✓ | 1 | | ✓ | 1 |
| Async Activity Completion | — | ✓ | 2 | ✓ | 2 | | ✓ | 2 |
| Sandbox Customization | — | ✓ | 3 | — | — | | — | — |
| Gevent Compatibility Warning | — | ✓ | 4 | — | — | | — | — |
| Worker Tuning | — | ✓ | 5 | ✓ | 3 | | ✓ | 3 |
| Workflow Init Decorator | — | ✓ | 6 | — | — | | — | — |
| Workflow Failure Exception Types | — | ✓ | 7 | — | — | | — | — |
| RoadRunner Configuration | — | — | — | — | — | | ✓ | 4 |
| Continue-as-New | — | — | — | — | — | | | |
| Workflow Updates | — | — | — | — | — | | | |
| Nexus Operations | — | — | — | — | — | | | |
| Activity Cancellation and Heartbeating | — | — | — | — | — | | | |
| Sinks | — | — | — | ✓ | 4 | | — | — |
| CancellationScope Patterns | — | — | — | — | — | | | |
| Best Practices | — | — | — | — | — | | | |

## Style Compliance

Expand All @@ -26,6 +27,7 @@
| Python | ✓ reference | 7 sections |
| TypeScript | ✓ aligned | 4 sections (removed duplicates) |
| Go | ✓ aligned | 4 sections — Schedules, Async Completion, Worker Tuning, Sessions |
| PHP | ✓ aligned | 4 sections (Schedules, Async Activity Completion, Worker Tuning, RoadRunner Configuration) |

## Status

Expand All @@ -36,14 +38,22 @@
- 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; PHP/Go have no sandbox
- Gevent Compatibility Warning: Python-specific
- Workflow Init Decorator: Python-specific
- Workflow Init Decorator: Python-specific (@workflow.init); PHP has #[WorkflowInit] but not an "advanced" feature
- Workflow Failure Exception Types: Python-specific
- Sinks: TS-specific feature
- Sessions: Go-specific (not in Python/TS)
- Sessions: Go-specific (not in Python/TS/PHP)
- Interceptors: Decided not to include for any language (all SDKs have them, but too advanced for current scope)

**PHP-specific additions:**
- RoadRunner Configuration: PHP-specific (no equivalent in Python/TS/Go)

**Order alignment:** N/A — Files have different structures by design

**Style alignment:** ✅ Complete (Python, TypeScript)
**Style alignment:** ✅ Complete (Python, TypeScript, Go, PHP)
- 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)
- PHP: 4 sections (Schedules, Async Activity Completion, Worker Tuning, RoadRunner Configuration)
- Removed duplicates from TS (Continue-as-New, Workflow Updates, CancellationScope Patterns, Nexus Operations, Activity Cancellation, Best Practices — all covered elsewhere)
29 changes: 15 additions & 14 deletions .memory/alignment_checking/data-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@

## 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# | PHP | PHP# | Go | Go# |
|---------|------|--------|-----|------------|-----|-----|------|----|-----|
| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 |
| Default Data Converter | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 |
| Pydantic Integration | — | ✓ | 3 | — | — | — | — | — | — |
| Custom Data Conversion | — | ✓ | 4 | ✓ | 3 | ✓ | 3 | ✓ | 3 |
| Composition of Payload Converters | — | — | — | ✓ | 4 | — | — | ✓ | 4 |
| Protobuf Support | — | — | — | ✓ | 5 | — | — | ✓ | 5 |
| Payload Encryption | — | ✓ | 5 | ✓ | 6 | ✓ | 4 | ✓ | 6 |
| Search Attributes | — | ✓ | 6 | ✓ | 7 | ✓ | 5 | ✓ | 7 |
| Workflow Memo | — | ✓ | 7 | ✓ | 8 | ✓ | 6 | ✓ | 8 |
| Large Payloads | — | — | — | — | — | — | — | — | — |
| Deterministic APIs for Values | — | ✓ | 8 | — | — | — | — | — | — |
| Best Practices | — | ✓ | 9 | ✓ | 9 | ✓ | 7 | ✓ | 9 |

## Style Compliance

| Language | Status | Notes |
|----------|--------|-------|
| Python | ✓ reference | — |
| TypeScript | ✓ aligned | — |
| PHP | ✓ aligned | Matches Python structure; uses #[ReturnType] instead of Pydantic |
| Go | ✓ aligned | JSON default, protobuf native, converter.CompositeDataConverter |

## Status
Expand Down
37 changes: 19 additions & 18 deletions .memory/alignment_checking/determinism-protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@

## 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# | PHP | PHP# | Go | Go# |
|---------|------|--------|-----|------------|-----|-----|------|----|-----|
| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 |
| How the Sandbox Works | — | ✓ | 2 | — | — | — | — | — | — |
| Import Blocking | — | — | — | ✓ | 2 | — | — | — | — |
| Forbidden Operations | — | ✓ | 3 | — | — | ✓ | 2 | — | — |
| 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 | — | — | ✓ | 3 | — | — |
| Best Practices | — | ✓ | 12 | — | — | ✓ | 4 | ✓ | 4 |

## Style Compliance

| Language | Status | Notes |
|----------|--------|-------|
| Python | ✓ reference | Comprehensive (12 sections) |
| TypeScript | ✓ aligned | Minimal (3 sections) — V8 is automatic |
| PHP | ✓ aligned | Minimal (4 sections) — no sandbox |
| Go | ✓ aligned | Minimal (4 sections) — no runtime sandbox, convention + static analysis |

## Status
Expand Down
27 changes: 14 additions & 13 deletions .memory/alignment_checking/determinism.md
Original file line number Diff line number Diff line change
Expand Up @@ -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# | PHP | PHP# | 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 | ✓ | 3 | — | — |
| Forbidden Operations | — | — | ✓ | 3 | ✓ | 4 | ✓ | 4 | ✓ | 3 |
| Safe Builtin Alternatives | — | — | ✓ | 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

Expand All @@ -23,6 +23,7 @@
| Core | ✓ reference | Deep conceptual content |
| Python | ✓ aligned | Practical focus |
| TypeScript | ✓ aligned | Practical focus, V8 sandbox |
| PHP | ✓ aligned | Practical focus, no sandbox (runtime checks only) |
| Go | ✓ aligned | Practical focus, no sandbox, workflowcheck tool, workflow.* replacements |

## Status
Expand Down
27 changes: 14 additions & 13 deletions .memory/alignment_checking/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

## 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# | PHP | PHP# | Go | Go# |
|---------|------|--------|-----|------------|-----|-----|------|----|-----|
| Overview | — | ✓ | 1 | ✓ | 1 | ✓ | 1 | ✓ | 1 |
| Application Errors | — | ✓ | 2 | ✓ | 2 | ✓ | 2 | ✓ | 2 |
| Non-Retryable Errors | — | ✓ | 3 | — | — | ✓ | 3 | ✓ | 3 |
| Activity Errors | — | — | — | ✓ | 3 | — | — | — | — |
| Handling Activity Errors | — | ✓ | 4 | ✓ | 4 | ✓ | 4 | ✓ | 4 |
| Retry Policy 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

| Language | Status | Notes |
|----------|--------|-------|
| Python | ✓ reference | — |
| TypeScript | ✓ aligned | Uses `log`, has retry defaults note |
| PHP | ✓ aligned | Matches Python section structure and code-first style |
| Go | ✓ aligned | Go-style error handling (errors.As, error returns, no exceptions) |

## Status
Expand Down
41 changes: 21 additions & 20 deletions .memory/alignment_checking/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

## 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# | PHP | PHP# | 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 | ✓ | 1 | ✓ | 3 |
| Heartbeating | — | — | ✓ | 5 | ✓ | 5 | ✓ | 3 | ✓ | 4 |
| Cancellation | ✓ | 10 | ✓ | 4 | ✓ | 4 | ✓ | 2 | ✓ | 5 |
| Testing | ✓ | 7 | ✓ | 6 | ✓ | 6 | ✓ | 4 | ✓ | 6 |
| Timers and Sleep | — | — | ✓ | 7 | ✓ | 7 | ✓ | 5 | ✓ | 7 |
| Payload Size Limits | ✓ | 9 | — | — | — | — | | | — | — |

## Style Compliance

Expand All @@ -30,6 +30,7 @@
| Core | ✓ reference | Conceptual gotchas |
| Python | ✓ aligned | Language-specific gotchas |
| TypeScript | ✓ aligned | Language-specific gotchas |
| PHP | ✓ aligned | 5 sections (Wrong Retry Classification, Cancellation, Heartbeating, Testing, Timers and Sleep) |
| Go | ✓ aligned | Language-specific gotchas — goroutines, channels, selectors, map range |

## Status
Expand Down
Loading