Skip to content

feat(act): generic actor type + descriptive generic rename#421

Merged
Rotorsoft merged 1 commit intomasterfrom
feat/generic-actor-descriptive-generics
Feb 21, 2026
Merged

feat(act): generic actor type + descriptive generic rename#421
Rotorsoft merged 1 commit intomasterfrom
feat/generic-actor-descriptive-generics

Conversation

@Rotorsoft
Copy link
Owner

Summary

  • Generic Actor — Add TActor extends Actor = Actor generic at the orchestrator level with .withActor<TActor>(), enabling type-safe richer actors (role, tenantId, etc.) throughout the write path (Target, Invariant, Dispatcher, Act.do())
  • Descriptive generics — Rename all single-letter generic parameters (S, E, A, K, N, M) to TPrefix convention (TState, TEvents, TActions, TKey, TName, TStateMap) across all type files, builders, and runtime modules
  • Loose schemas — Add .loose() to ActorSchema and TargetSchema so extra actor fields survive Zod 4 validation at runtime

Test plan

  • New actor-generic.spec.ts — verifies .withActor<MyActor>() requires richer actor, extra fields preserved in metadata, default behavior unchanged, typed Dispatcher in reactions
  • All 245 existing tests pass unchanged
  • pnpm build — all packages compile
  • pnpm typecheck — strict mode clean
  • Existing type-check.ts compile-time diagnostics still pass

🤖 Generated with Claude Code

…ention

Introduce TActor generic at the act() builder level via .withActor<TActor>(),
enabling type-safe richer actors (role, tenantId, etc.) throughout the write
path (Target, Invariant, Dispatcher, Act.do()). Add .loose() to ActorSchema
and TargetSchema so extra actor fields survive Zod validation at runtime.

Rename all single-letter generic parameters (S, E, A, K, N, M) to descriptive
TPrefix convention (TState, TEvents, TActions, TKey, TName, TStateMap) across
all type files, builders, and runtime modules for improved readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Rotorsoft Rotorsoft merged commit 60e27df into master Feb 21, 2026
6 checks passed
@github-actions
Copy link

🎉 This PR is included in version @rotorsoft/act-v0.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant