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
4 changes: 3 additions & 1 deletion .memory/alignment_checking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ 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#` / `Rb#` / `Go#` = 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.

**Ruby:** ⏳ IN PROGRESS (2026-03-16) — Ruby columns added to all alignment tracking files. Ruby reference files not yet created.

## Files

Each file in this directory tracks alignment for a corresponding reference file:
Expand Down
72 changes: 46 additions & 26 deletions .memory/alignment_checking/advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,68 @@

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

## Style Compliance

| Language | Status | Notes |
|----------|--------|-------|
| Python | ✓ reference | 7 sections |
| TypeScript | ✓ aligned | 4 sections (removed duplicates) |
| Ruby | — | Not started |
| Go | ✓ aligned | 4 sections — Schedules, Async Completion, Worker Tuning, Sessions |

## Status

**Go-specific notes:**
- Schedules: `client.ScheduleClient` — same concept as Python/TS
- Async Activity Completion: `activity.GetInfo(ctx).TaskToken` + `client.CompleteActivity` / `client.CompleteActivityByID`
- Worker Tuning: `worker.Options` — `MaxConcurrentActivityExecutionSize`, `MaxConcurrentWorkflowTaskExecutionSize`, `MaxConcurrentActivityTaskPollers`
- 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; Ruby/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`); Ruby uses `initialize` naturally; Go N/A
- Sinks: TS-specific feature
- Sessions: Go-specific (not in Python/TS)
- Workflow Failure Exception Types: Python has `workflow_failure_exception_types`; Ruby has similar `workflow_failure_exception_type` class method — should include; Go: Python-specific
- Sessions: Go-specific (not in Python/TS/Ruby)
- Interceptors: Decided not to include for any language (all SDKs have them, but too advanced for current scope)

**Ruby notes:**
- Schedules: `Temporalio::Client::ScheduleHandle` — same API pattern as other SDKs
- Async Activity Completion: `Temporalio::Client::AsyncActivityHandle` for completing activities from external processes
- Worker Tuning: `max_concurrent_workflow_tasks`, `max_concurrent_activities`, resource-based auto-tuning
- Workflow Failure Exception Types: `workflow_failure_exception_type` on workflow class or `workflow_failure_exception_types` on worker
- Activity Concurrency and Executors: Ruby-specific — `Temporalio::Worker::ActivityExecutor::ThreadPool`, fiber-based execution, `max_concurrent_activities`
- Rails Integration: Ruby-specific — ActiveRecord concerns, lazy/eager loading, Zeitwerk compatibility

**Go notes:**
- Schedules: `client.ScheduleClient` — same concept as Python/TS
- Async Activity Completion: `activity.GetInfo(ctx).TaskToken` + `client.CompleteActivity` / `client.CompleteActivityByID`
- Worker Tuning: `worker.Options` — `MaxConcurrentActivityExecutionSize`, `MaxConcurrentWorkflowTaskExecutionSize`, `MaxConcurrentActivityTaskPollers`
- Sessions: Go-specific feature — `workflow.CreateSession(ctx, options)` pins activities to a specific worker. Useful for file processing where activities need local state.

**Sections needing review (empty cells):**
- Ruby column: all TODO — Ruby reference files not yet created

**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 Completion, Worker Tuning, Sessions)
- Ruby: ~6 sections planned (Schedules, Async Activity Completion, Worker Tuning, Failure Exception Types, Activity Concurrency/Executors, Rails Integration)
- Removed duplicates from TS (Continue-as-New, Workflow Updates, CancellationScope Patterns, Nexus Operations, Activity Cancellation, Best Practices — all covered elsewhere)
52 changes: 34 additions & 18 deletions .memory/alignment_checking/data-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,43 @@

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

## Style Compliance

| Language | Status | Notes |
|----------|--------|-------|
| Python | ✓ reference | — |
| TypeScript | ✓ aligned | — |
| Ruby | — | Not started |
| Go | ✓ aligned | JSON default, protobuf native, converter.CompositeDataConverter |

## Status

**Ruby notes:**
- Default converter: nil, bytes, Protobuf, then JSON (using Ruby's `JSON` module with `create_additions: true`)
- Symbol keys become string keys on deserialization
- JSON Additions supported but not cross-language compatible
- ActiveModel: needs `ActiveModelJSONSupport` mixin for proper serialization
- Converter Hints: unique to Ruby — `workflow_arg_hint MyClass`, `workflow_result_hint MyClass` — needed because Ruby lacks type hints
- Search Attributes: `Temporalio::SearchAttributes::Key.new('name', type)`, `Temporalio::Workflow.upsert_search_attributes`
- Deterministic APIs: `Temporalio::Workflow.random` (SecureRandom replacement), `Temporalio::Workflow.now` (Time.now replacement), `Temporalio::Workflow.uuid` (UUID generation)

**Go-specific notes:**
- Default Data Converter: Go uses `converter.NewCompositeDataConverter()` with JSON as default — chain: NilPayloadConverter, ByteSlicePayloadConverter, ProtoPayloadConverter, ProtoJSONPayloadConverter, JSONPayloadConverter
- Custom Data Converter: implement `converter.DataConverter` interface
Expand All @@ -39,10 +51,14 @@

**Intentionally missing (`—`):**
- Core column: data handling is implementation-specific
- Pydantic Integration: Python-specific
- Deterministic APIs for Values: Python-specific; Go covers in determinism.md Safe Builtin Alternatives
- Pydantic Integration: Python-specific (TS uses plain JSON/types)
- ActiveModel Integration: Ruby-specific (equivalent of Pydantic)
- Composition of Payload Converters: TS/Go-specific section
- Converter Hints: Ruby-specific (`workflow_arg_hint`, `workflow_result_hint` — needed because Ruby lacks type annotations)
- Protobuf Support: TS/Go-specific section (Ruby/Python handle protobufs via default converter)
- Deterministic APIs for Values: Python has `workflow.uuid4()`, `workflow.random()`; Ruby has `Temporalio::Workflow.random/now/uuid`; Go covers in determinism.md
- Large Payloads: Moved to core/patterns.md and core/gotchas.md

**Order alignment:** ✅ ALIGNED — Go sections follow same order as Python/TypeScript
**Order alignment:** ✅ ALIGNED — Ruby follows Python order with Ruby-specific additions (ActiveModel, Converter Hints)

**Style alignment:** ✅ Complete (Python, TypeScript)
**Style alignment:** ✅ Complete (Python, TypeScript, Go). Ruby: ~10 sections planned.
52 changes: 34 additions & 18 deletions .memory/alignment_checking/determinism-protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,50 @@

## 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# | Ruby | Rb# | Go | Go# |
|---------|------|--------|-----|------------|-----|------|-----|-----|-----|
| Overview | — | ✓ | 1 | ✓ | 1 | TODO | 1 | ✓ | 1 |
| How the Sandbox Works | — | ✓ | 2 | — | — | — | — | — | — |
| How Illegal Call Tracing Works | — | — | — | — | — | TODO | 2 | — | — |
| Import Blocking | — | — | — | ✓ | 2 | — | — | — | — |
| Forbidden Operations | — | ✓ | 3 | — | — | TODO | 3 | — | — |
| Function Replacement | — | — | — | ✓ | 3 | — | — | — | — |
| Durable Fiber Scheduler | — | — | — | — | — | TODO | 4 | — | — |
| workflowcheck Static Analysis | — | — | — | — | — | — | — | ✓ | 2 |
| Determinism Rules | — | — | — | — | — | — | — | ✓ | 3 |
| Pass-Through Pattern | — | ✓ | 4 | — | — | — | — | — | — |
| Importing Activities | — | ✓ | 5 | — | — | — | — | — | — |
| Disabling the Sandbox | — | ✓ | 6 | — | — | — | — | — | — |
| Disabling Illegal Call Tracing | — | — | — | — | — | TODO | 5 | — | — |
| Customizing Invalid Module Members | — | ✓ | 7 | — | — | — | — | — | — |
| Customizing Illegal Calls | — | — | — | — | — | TODO | 6 | — | — |
| Import Notification Policy | — | ✓ | 8 | — | — | — | — | — | — |
| Disable Lazy sys.modules Passthrough | — | ✓ | 9 | — | — | — | — | — | — |
| File Organization | — | ✓ | 10 | — | — | — | — | — | — |
| Common Issues | — | ✓ | 11 | — | — | TODO | 7 | — | — |
| Best Practices | — | ✓ | 12 | — | — | TODO | 8 | ✓ | 4 |

## Style Compliance

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

## Status

**Ruby notes:**
- Ruby's approach is fundamentally different from Python (sandbox) and TS (V8): uses TracePoint for illegal call tracing + custom Fiber::Scheduler for durable fibers
- "How Illegal Call Tracing Works": TracePoint catches illegal calls on workflow thread, configurable via `illegal_workflow_calls` worker param
- "Durable Fiber Scheduler": Custom Fiber::Scheduler makes fibers deterministic; `Kernel.sleep`, `Mutex` etc. are disabled by default
- "Disabling Illegal Call Tracing": `Temporalio::Workflow::Unsafe.illegal_call_tracing_disabled` block
- "Customizing Illegal Calls": `illegal_workflow_calls` parameter on worker, `Temporalio::Worker.default_illegal_workflow_calls`
- `durable_scheduler_disabled` (implies `illegal_call_tracing_disabled`), `io_enabled` for IO wait
- Python's Import/Module sections don't apply (Ruby doesn't have module-level sandbox)
- Ruby estimated ~8 sections (moderate — more than TS's 3, less than Python's 12)

**Go-specific notes:**
- Go has NO runtime sandbox (unlike Python's import-restricting sandbox or TS's V8 isolate)
- Determinism enforcement is purely by developer convention + optional static analysis
Expand All @@ -51,4 +66,5 @@
**Style alignment:** ⚠️ Very different structures (intentional, different protection mechanisms)
- Python: Comprehensive (12 sections) — complex sandbox with many customization options
- TypeScript: Minimal (3 sections) — V8 sandbox is mostly automatic
- Ruby: Moderate (~8 sections) — TracePoint + Fiber Scheduler with customization options
- Go: Minimal (4 sections) — no sandbox, convention-based with static analysis tool
Loading