[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78C4KW2D90P5WQJ3M6EKDY4":3,"skill-same:01M78C4KW2D90P5WQJ3M6EKDY4":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M78C4KW2D90P5WQJ3M6EKDY4","cratis-orleans-jobs",null,"Build recoverable work with Cratis.Orleans jobs and job-step grains, stage barriers, bounded startup and cleanup, storage scopes and state machines. Use for service or kernel job authors, job recovery, SQL schema setup, or grain lifecycle transitions. Framework guidance; do not use for operating live Chronicle jobs or for application command validation.","Cratis\u002FPrologue","Cratis","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16456213?v=4","01M6BXRH290K4C8RS4PTKK3HXQ","01M78C1YXTSPZGP4G1K2ZM6J1N",0,"MIT","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-orleans-jobs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cratis-orleans-jobs\ndescription: Build recoverable work with Cratis.Orleans jobs and job-step grains, stage barriers, bounded startup and cleanup, storage scopes and state machines. Use for service or kernel job authors, job recovery, SQL schema setup, or grain lifecycle transitions. Framework guidance; do not use for operating live Chronicle jobs or for application command validation.\nlicense: MIT\n---\n\u003C!-- cratis-ai-managed: skills\u002Fcratis-orleans-jobs\u002FSKILL.md -->\n\n\u003C!-- Copyright (c) Cratis. All rights reserved. -->\n\u003C!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->\n\n# Recoverable Orleans jobs\n\nFor services and kernel contributors using Orleans. This is library-consumer guidance, not the application vertical-slice architecture. For live Chronicle operations use **cratis-chronicle-cli-operations** instead. Co-hosting conventions are in [orleans.md](..\u002F..\u002Frules\u002Forleans.md).\n\n## Verified product sources\n\nAll Orleans claims below come from `Cratis\u002FOrleans` source.\n\n| Packages | Sources |\n| --- | --- |\n| `Cratis.Orleans`, `Cratis.Orleans.Storage` | `Source\u002FOrleans\u002FJobs\u002F{Job.cs,Job.Steps.cs,Job.Stages.cs,JobStep.cs,IJobsManager.cs,JobsOptions.cs}`; `Source\u002FOrleans.Storage\u002FJobs\u002F*` |\n| `Cratis.Orleans.Storage.MongoDB`, `Cratis.Orleans.Storage.Sql` | `Source\u002FOrleans.Storage.MongoDB\u002F{MongoDBJobsStorageOptions.cs,DatabaseNames.cs}`; `Source\u002FOrleans.Storage.Sql\u002F{SqlJobsStorage.cs,SqlJobsStorageOptions.cs,Jobs\u002FMigrations\u002Fv1_0_0.cs}` |\n| `Cratis.Orleans.Chronicle` | `Source\u002FOrleans.Chronicle\u002FStateMachines\u002FEventSourcedStateMachine.cs`; [state-machine reference](references\u002Fstate-machines.md) |\n\nThe API snippets cite their exact files and lines below. Product docs `Documentation\u002Fconcepts\u002F{jobs,storage-scopes,state-machines,event-sourced-state-machines}.md` supply the task vocabulary; source resolves contradictions.\n\n## 1. Choose a job, not a detached task\n\nA job plans recoverable work; each step is a grain and does the work. Use it for work that must outlive a request. It is **at-least-once**, not exactly-once: a step interrupted before a durable checkpoint can perform the same work again. Protect external effects with receiver-owned idempotency\u002Fdeduplication; a checkpoint does not atomically commit an external write (`JobStep.cs`, `JobsOptions.cs`).\n\n- Job: derive `Job\u003CTRequest, TJobState>`; the request is a class implementing `IJobRequest`, the state derives `JobState` (`Job.cs`). Implement `PrepareSteps(TRequest)` returning `Task\u003CIImmutableList\u003CJobStepDetails>>` (`Job.Steps.cs`).\n- Step: derive `JobStep\u003CTRequest, TResult, TState>`; state derives `JobStepState`. Its constructor receives `[PersistentState(nameof(JobStepState), WellKnownGrainStorageProviders.JobSteps)] IPersistentState\u003CTState>`, `IJobStepThrottle`, and `ILogger\u003CJobStep\u003CTRequest, TResult, TState>>` (`JobStep.cs`).\n- Implement `PrepareStep(TRequest)` → `Task\u003CResult\u003CPrepareJobStepError>>`; `InitializeState(TRequest)` → `ValueTask`, called after preparation succeeds; and `PerformStep(TState, CancellationToken)` → `Task\u003CCatch\u003CJobStepResult>>` (`JobStep.cs`). `TResult` is the step's result type; the work method returns the framework's `JobStepResult` envelope, not `TResult` directly.\n- Give the concrete job and step unique `[GrainType(\"product-specific-name\")]` names. Use serializable request\u002Fstate\u002Fresult types. Do not reuse a class-derived grain name across assemblies (`Jobs\u002FJobsManager.cs`, `Documentation\u002Fhow-to\u002Fhost-the-silo.md`, and `orleans.md`).\n\n`PerformStep` runs **outside the activation context** with a state snapshot obtained through the grain reference. Mutating that snapshot does not persist it; do not access\u002Fwrite grain `State` directly from background work (`JobStep.cs`). Keep progress\u002Fstate coordination on grain calls. Requires Cratis.Orleans 1.16.2 for framework-owned stop reporting; there, do not report cancellation again from a `PerformWork` override (`Documentation\u002Fconcepts\u002Fjobs.md`).\n\n## 2. Plan dependencies as stages\n\nDefault steps all use `JobStepStage.First`. Prefer independent fan-out. Use stages only when correctness requires earlier work to finish (`Job.Stages.cs`).\n\nPlanning excerpt inside an existing `Job\u003CRecoveryRequest, RecoveryState>`. It assumes `RecoveryRequest : IJobRequest`, `RecoveryState : JobState`, and the two existing grain interfaces `IRepairIndex` and `IRebuildCatalog`, each deriving a typed `IJobStep\u003C,,>`:\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nprotected override Task\u003CIImmutableList\u003CJobStepDetails>> PrepareSteps(RecoveryRequest request) =>\n    Task.FromResult\u003CIImmutableList\u003CJobStepDetails>>(\n    [\n        CreateStep\u003CIRepairIndex>(request, stage: 0),\n        CreateStep\u003CIRebuildCatalog>(request, stage: 10)\n    ]);\n```\n\nImport `System.Collections.Immutable` and `Cratis.Orleans.Jobs` in that job file. `CreateStep\u003CTStep>` takes the **grain interface**, not the implementation (`Job.Steps.cs`). Its stage overload accepts `JobStepStage`, with implicit integer conversion (`Source\u002FOrleans.Storage\u002FJobs\u002FStages\u002FJobStepStage.cs`).\n\nEvery step in a stage reaches an outcome before later stages start; steps within a stage run in parallel. All steps are prepared up front, so later-stage preparation cannot read the effects of earlier-stage execution. Read such dependencies in `PerformStep` (`Job.Stages.cs`).\n\nA failed stage stops the pipeline by default: later steps become `Unreachable`, and the job completes with failures. A best-effort stage may override `GetFailureBehaviorFor(JobStepStage)` to return `JobStageFailureBehavior.ContinueWithNextStage` (`Job.Stages.cs`, namespace `Cratis.Orleans.Jobs.Stages`). Do not silently continue when a later stage relies on the failed output.\n\n## 3. Start and resume through the scoped manager\n\n`IGrainFactory.GetJobsManager(scope, namespace)` resolves the manager (`JobsManagerExtensions.cs`). `IJobsManager.Start\u003CTJob,TRequest>(request)` returns `Result\u003CJobId, StartJobError>`; inspect its error before telling a caller that a job started (`IJobsManager.cs`). Start success is not completed work; observe the job's status\u002Foutcomes.\n\n`IJobsManager.Resume(JobId)` returns **`Task\u003Cbool>`**. False means nothing took the job; do not wait for a completion callback as though resumption succeeded. True can mean resumed, already running, or finalized as completed (`IJobsManager.cs`). `Rehydrate()` completes after loading\u002Fpreparing interrupted jobs, **before** its bounded background drain has resumed them all.\n\n`StartStepsInBackground` defaults to false. Overriding it to true makes Start return once the job is durable, moving step preparation\u002Fstart to the grain's next turn. Later startup errors belong to the job, not the Start response (`Job.cs`).\n\n## 4. Know what storage retains\n\nSuccessful jobs clear themselves by default; override `KeepAfterCompleted` to retain job state. Jobs completed with failures default to `KeepAfterCompletedWithFailures = true`, but retention cleanup still applies (`Job.cs`, `JobsOptions.cs`).\n\n**Keeping a job does not keep successful step state.** The step provider deletes successful\u002Fremoving state, moves failed state to failed-step storage, and saves stopped\u002Fscheduled\u002Frunning\u002Funreachable state (`JobStepGrainStorageProvider.cs`). SQL keeps failed step rows with a failure status rather than a separate collection (`Source\u002FOrleans.Storage.Sql\u002FJobs\u002FJobStepStorage.cs`, `MoveToFailed`). Copy results the job must retain through `OnStepCompletedOrStopped(JobStepId, JobStepResult)` into job state (`Job.Steps.cs`); do not read deleted successful step state later.\n\nDeliver external callbacks to a method on the **job's grain interface**, update job state there and persist it with `WriteState()`. Preserve the returned `Catch` failure; do not acknowledge input whose write failed (`Job.State.cs`, `WriteState`; `Documentation\u002Fconcepts\u002Fjobs.md`). Step state is not a callback inbox: a concurrent callback can race the final write, and successful completion deletes it. A running step's snapshot will not see later job\u002Fstep writes automatically.\n\n## 5. Register storage and budget concurrency\n\n`IJobsStorage.GetFor(scope, namespace)` returns `JobsStorage`. Scope and namespace are opaque engine coordinates carried in grain keys; the host\u002Fprovider owns their mapping (`Source\u002FOrleans.Storage\u002FJobs\u002FIJobsStorage.cs`, `Job.cs`). They are storage boundaries, not authorization checks.\n\nChoose one storage registration alongside `AddCratisOrleans`:\n\n| Registration | Package \u002F namespace | Use |\n| --- | --- | --- |\n| `AddCratisOrleansMongoDBJobsStorage` | `.Storage.MongoDB` \u002F `Cratis.Orleans.Setup` | Durable MongoDB; database-name resolver can override the default `{scope}+jobs[+{namespace}]` |\n| `AddCratisOrleansSqlJobsStorage` | `.Storage.Sql` \u002F `Cratis.Orleans.Setup` | Durable EF Core; `OptionsResolver(scope, namespace)` selects typed `DbContextOptions\u003CJobsDbContext>` |\n| `AddCratisOrleansInMemoryJobsStorage` | `.Storage` \u002F `Cratis.Orleans.Storage` | Specs\u002Fdevelopment only; process restart loses state |\n\nEvidence: each package's `*JobsStorageServiceCollectionExtensions.cs`; MongoDB `DatabaseNames.cs` and `MongoDBJobsStorageOptions.cs`; SQL `SqlJobsStorageOptions.cs`; in-memory `InMemory\u002FInMemoryJobsStorage.cs`.\n\n### SQL schema creation\n\nThe product's SQL setup docs say to create the schema yourself. **the provider applies migrations automatically**: `SqlJobsStorage.GetFor` calls `EnsureSchema`, which calls `dbContext.Database.Migrate()` before constructing storage (`Source\u002FOrleans.Storage.Sql\u002FSqlJobsStorage.cs`). The migration is `Jobs\u002FMigrations\u002Fv1_0_0.cs`; do not substitute `EnsureCreated` or hand-create those tables. The connection needs permissions to apply the migration, and scope-to-database mapping must be deliberate. Storage is cached per scope\u002Fnamespace; `IJobsStorage.Reset()` clears the cache and the next resolution migrates again (`SqlJobsStorage.cs`). This resolves the documentation conflict from source, not from a release-note inference.\n\nConfigure `JobsOptions` through the host's options registration. Its properties are **init-only**: supply a constructed instance via the options mechanism rather than assigning them in a `Configure(options => options.Property = …)` callback (`JobsOptions.cs`).\n\n| Option | Default | Purpose |\n| --- | --- | --- |\n| `MaxParallelSteps` | `max(1, ProcessorCount - 1)` when unset | Actual execution throttle |\n| `MaxConcurrentStepStarts` | `16` | Startup\u002Fresume calls per job, not the execution limit |\n| `MaxConcurrentRehydration` | `8` | Jobs resumed concurrently by a manager |\n| `MaxConcurrentCleanup` | `4` | Dead-job deletions |\n| `StepCheckpointBatchInterval` | `100` | Batches between durable progress checkpoints |\n| `StepCheckpointFlushInterval` | `5 seconds` | Timed checkpoint flush; nonpositive disables it |\n| `DeadJobThreshold`, `CleanupCadence` | `1 hour` each | Preparation-with-no-steps scavenging |\n| `TerminalJobRetention` | `7 days` | Terminal history retention; `Timeout.InfiniteTimeSpan` retains indefinitely |\n| `MaxTerminalJobsPerCleanup` | `100` | Bounded oldest-first cleanup page |\n\nSource: `JobsOptions.cs`. The three concurrency options for starts\u002Frehydration\u002Fcleanup treat values below one as one. Retention does not delete preparing\u002Frunning\u002Fstopped\u002Fremoving jobs. Larger checkpoint intervals mean more post-crash redelivery, not higher delivery guarantees.\n\n## State machines and verification\n\nUse [state-machines.md](references\u002Fstate-machines.md) for `StateMachine\u003CTStoredState>` and `EventSourcedStateMachine\u003CTModel>`: jobs are recoverable work, state machines are lifecycle behavior. Neither makes external effects exactly-once.\n\nVerify a new job with specs for planning, idempotent redelivery, stop\u002Fresume (including false), failed barriers\u002FUnreachable, retention and persistence failures. Exercise the selected durable provider for restart recovery and SQL migration permissions. A build alone cannot establish crash recovery. Do not operate a live store merely to validate a code example.\n","\u003C!-- cratis-ai-managed: skills\u002Fcratis-orleans-jobs\u002FSKILL.md -->\n\n\u003C!-- Copyright (c) Cratis. All rights reserved. -->\n\u003C!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->\n\n# Recoverable Orleans jobs\n\nFor services and kernel contributors using Orleans. This is library-consumer guidance, not the application vertical-slice architecture. For live Chronicle operations use **cratis-chronicle-cli-operations** instead. Co-hosting conventions are in [orleans.md](..\u002F..\u002Frules\u002Forleans.md).\n\n## Verified product sources\n\nAll Orleans claims below come from `Cratis\u002FOrleans` source.\n\n| Packages | Sources |\n| --- | --- |\n| `Cratis.Orleans`, `Cratis.Orleans.Storage` | `Source\u002FOrleans\u002FJobs\u002F{Job.cs,Job.Steps.cs,Job.Stages.cs,JobStep.cs,IJobsManager.cs,JobsOptions.cs}`; `Source\u002FOrleans.Storage\u002FJobs\u002F*` |\n| `Cratis.Orleans.Storage.MongoDB`, `Cratis.Orleans.Storage.Sql` | `Source\u002FOrleans.Storage.MongoDB\u002F{MongoDBJobsStorageOptions.cs,DatabaseNames.cs}`; `Source\u002FOrleans.Storage.Sql\u002F{SqlJobsStorage.cs,SqlJobsStorageOptions.cs,Jobs\u002FMigrations\u002Fv1_0_0.cs}` |\n| `Cratis.Orleans.Chronicle` | `Source\u002FOrleans.Chronicle\u002FStateMachines\u002FEventSourcedStateMachine.cs`; [state-machine reference](references\u002Fstate-machines.md) |\n\nThe API snippets cite their exact files and lines below. Product docs `Documentation\u002Fconcepts\u002F{jobs,storage-scopes,state-machines,event-sourced-state-machines}.md` supply the task vocabulary; source resolves contradictions.\n\n## 1. Choose a job, not a detached task\n\nA job plans recoverable work; each step is a grain and does the work. Use it for work that must outlive a request. It is **at-least-once**, not exactly-once: a step interrupted before a durable checkpoint can perform the same work again. Protect external effects with receiver-owned idempotency\u002Fdeduplication; a checkpoint does not atomically commit an external write (`JobStep.cs`, `JobsOptions.cs`).\n\n- Job: derive `Job\u003CTRequest, TJobState>`; the request is a class implementing `IJobRequest`, the state derives `JobState` (`Job.cs`). Implement `PrepareSteps(TRequest)` returning `Task\u003CIImmutableList\u003CJobStepDetails>>` (`Job.Steps.cs`).\n- Step: derive `JobStep\u003CTRequest, TResult, TState>`; state derives `JobStepState`. Its constructor receives `[PersistentState(nameof(JobStepState), WellKnownGrainStorageProviders.JobSteps)] IPersistentState\u003CTState>`, `IJobStepThrottle`, and `ILogger\u003CJobStep\u003CTRequest, TResult, TState>>` (`JobStep.cs`).\n- Implement `PrepareStep(TRequest)` → `Task\u003CResult\u003CPrepareJobStepError>>`; `InitializeState(TRequest)` → `ValueTask`, called after preparation succeeds; and `PerformStep(TState, CancellationToken)` → `Task\u003CCatch\u003CJobStepResult>>` (`JobStep.cs`). `TResult` is the step's result type; the work method returns the framework's `JobStepResult` envelope, not `TResult` directly.\n- Give the concrete job and step unique `[GrainType(\"product-specific-name\")]` names. Use serializable request\u002Fstate\u002Fresult types. Do not reuse a class-derived grain name across assemblies (`Jobs\u002FJobsManager.cs`, `Documentation\u002Fhow-to\u002Fhost-the-silo.md`, and `orleans.md`).\n\n`PerformStep` runs **outside the activation context** with a state snapshot obtained through the grain reference. Mutating that snapshot does not persist it; do not access\u002Fwrite grain `State` directly from background work (`JobStep.cs`). Keep progress\u002Fstate coordination on grain calls. Requires Cratis.Orleans 1.16.2 for framework-owned stop reporting; there, do not report cancellation again from a `PerformWork` override (`Documentation\u002Fconcepts\u002Fjobs.md`).\n\n## 2. Plan dependencies as stages\n\nDefault steps all use `JobStepStage.First`. Prefer independent fan-out. Use stages only when correctness requires earlier work to finish (`Job.Stages.cs`).\n\nPlanning excerpt inside an existing `Job\u003CRecoveryRequest, RecoveryState>`. It assumes `RecoveryRequest : IJobRequest`, `RecoveryState : JobState`, and the two existing grain interfaces `IRepairIndex` and `IRebuildCatalog`, each deriving a typed `IJobStep\u003C,,>`:\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nprotected override Task\u003CIImmutableList\u003CJobStepDetails>> PrepareSteps(RecoveryRequest request) =>\n    Task.FromResult\u003CIImmutableList\u003CJobStepDetails>>(\n    [\n        CreateStep\u003CIRepairIndex>(request, stage: 0),\n        CreateStep\u003CIRebuildCatalog>(request, stage: 10)\n    ]);\n```\n\nImport `System.Collections.Immutable` and `Cratis.Orleans.Jobs` in that job file. `CreateStep\u003CTStep>` takes the **grain interface**, not the implementation (`Job.Steps.cs`). Its stage overload accepts `JobStepStage`, with implicit integer conversion (`Source\u002FOrleans.Storage\u002FJobs\u002FStages\u002FJobStepStage.cs`).\n\nEvery step in a stage reaches an outcome before later stages start; steps within a stage run in parallel. All steps are prepared up front, so later-stage preparation cannot read the effects of earlier-stage execution. Read such dependencies in `PerformStep` (`Job.Stages.cs`).\n\nA failed stage stops the pipeline by default: later steps become `Unreachable`, and the job completes with failures. A best-effort stage may override `GetFailureBehaviorFor(JobStepStage)` to return `JobStageFailureBehavior.ContinueWithNextStage` (`Job.Stages.cs`, namespace `Cratis.Orleans.Jobs.Stages`). Do not silently continue when a later stage relies on the failed output.\n\n## 3. Start and resume through the scoped manager\n\n`IGrainFactory.GetJobsManager(scope, namespace)` resolves the manager (`JobsManagerExtensions.cs`). `IJobsManager.Start\u003CTJob,TRequest>(request)` returns `Result\u003CJobId, StartJobError>`; inspect its error before telling a caller that a job started (`IJobsManager.cs`). Start success is not completed work; observe the job's status\u002Foutcomes.\n\n`IJobsManager.Resume(JobId)` returns **`Task\u003Cbool>`**. False means nothing took the job; do not wait for a completion callback as though resumption succeeded. True can mean resumed, already running, or finalized as completed (`IJobsManager.cs`). `Rehydrate()` completes after loading\u002Fpreparing interrupted jobs, **before** its bounded background drain has resumed them all.\n\n`StartStepsInBackground` defaults to false. Overriding it to true makes Start return once the job is durable, moving step preparation\u002Fstart to the grain's next turn. Later startup errors belong to the job, not the Start response (`Job.cs`).\n\n## 4. Know what storage retains\n\nSuccessful jobs clear themselves by default; override `KeepAfterCompleted` to retain job state. Jobs completed with failures default to `KeepAfterCompletedWithFailures = true`, but retention cleanup still applies (`Job.cs`, `JobsOptions.cs`).\n\n**Keeping a job does not keep successful step state.** The step provider deletes successful\u002Fremoving state, moves failed state to failed-step storage, and saves stopped\u002Fscheduled\u002Frunning\u002Funreachable state (`JobStepGrainStorageProvider.cs`). SQL keeps failed step rows with a failure status rather than a separate collection (`Source\u002FOrleans.Storage.Sql\u002FJobs\u002FJobStepStorage.cs`, `MoveToFailed`). Copy results the job must retain through `OnStepCompletedOrStopped(JobStepId, JobStepResult)` into job state (`Job.Steps.cs`); do not read deleted successful step state later.\n\nDeliver external callbacks to a method on the **job's grain interface**, update job state there and persist it with `WriteState()`. Preserve the returned `Catch` failure; do not acknowledge input whose write failed (`Job.State.cs`, `WriteState`; `Documentation\u002Fconcepts\u002Fjobs.md`). Step state is not a callback inbox: a concurrent callback can race the final write, and successful completion deletes it. A running step's snapshot will not see later job\u002Fstep writes automatically.\n\n## 5. Register storage and budget concurrency\n\n`IJobsStorage.GetFor(scope, namespace)` returns `JobsStorage`. Scope and namespace are opaque engine coordinates carried in grain keys; the host\u002Fprovider owns their mapping (`Source\u002FOrleans.Storage\u002FJobs\u002FIJobsStorage.cs`, `Job.cs`). They are storage boundaries, not authorization checks.\n\nChoose one storage registration alongside `AddCratisOrleans`:\n\n| Registration | Package \u002F namespace | Use |\n| --- | --- | --- |\n| `AddCratisOrleansMongoDBJobsStorage` | `.Storage.MongoDB` \u002F `Cratis.Orleans.Setup` | Durable MongoDB; database-name resolver can override the default `{scope}+jobs[+{namespace}]` |\n| `AddCratisOrleansSqlJobsStorage` | `.Storage.Sql` \u002F `Cratis.Orleans.Setup` | Durable EF Core; `OptionsResolver(scope, namespace)` selects typed `DbContextOptions\u003CJobsDbContext>` |\n| `AddCratisOrleansInMemoryJobsStorage` | `.Storage` \u002F `Cratis.Orleans.Storage` | Specs\u002Fdevelopment only; process restart loses state |\n\nEvidence: each package's `*JobsStorageServiceCollectionExtensions.cs`; MongoDB `DatabaseNames.cs` and `MongoDBJobsStorageOptions.cs`; SQL `SqlJobsStorageOptions.cs`; in-memory `InMemory\u002FInMemoryJobsStorage.cs`.\n\n### SQL schema creation\n\nThe product's SQL setup docs say to create the schema yourself. **the provider applies migrations automatically**: `SqlJobsStorage.GetFor` calls `EnsureSchema`, which calls `dbContext.Database.Migrate()` before constructing storage (`Source\u002FOrleans.Storage.Sql\u002FSqlJobsStorage.cs`). The migration is `Jobs\u002FMigrations\u002Fv1_0_0.cs`; do not substitute `EnsureCreated` or hand-create those tables. The connection needs permissions to apply the migration, and scope-to-database mapping must be deliberate. Storage is cached per scope\u002Fnamespace; `IJobsStorage.Reset()` clears the cache and the next resolution migrates again (`SqlJobsStorage.cs`). This resolves the documentation conflict from source, not from a release-note inference.\n\nConfigure `JobsOptions` through the host's options registration. Its properties are **init-only**: supply a constructed instance via the options mechanism rather than assigning them in a `Configure(options => options.Property = …)` callback (`JobsOptions.cs`).\n\n| Option | Default | Purpose |\n| --- | --- | --- |\n| `MaxParallelSteps` | `max(1, ProcessorCount - 1)` when unset | Actual execution throttle |\n| `MaxConcurrentStepStarts` | `16` | Startup\u002Fresume calls per job, not the execution limit |\n| `MaxConcurrentRehydration` | `8` | Jobs resumed concurrently by a manager |\n| `MaxConcurrentCleanup` | `4` | Dead-job deletions |\n| `StepCheckpointBatchInterval` | `100` | Batches between durable progress checkpoints |\n| `StepCheckpointFlushInterval` | `5 seconds` | Timed checkpoint flush; nonpositive disables it |\n| `DeadJobThreshold`, `CleanupCadence` | `1 hour` each | Preparation-with-no-steps scavenging |\n| `TerminalJobRetention` | `7 days` | Terminal history retention; `Timeout.InfiniteTimeSpan` retains indefinitely |\n| `MaxTerminalJobsPerCleanup` | `100` | Bounded oldest-first cleanup page |\n\nSource: `JobsOptions.cs`. The three concurrency options for starts\u002Frehydration\u002Fcleanup treat values below one as one. Retention does not delete preparing\u002Frunning\u002Fstopped\u002Fremoving jobs. Larger checkpoint intervals mean more post-crash redelivery, not higher delivery guarantees.\n\n## State machines and verification\n\nUse [state-machines.md](references\u002Fstate-machines.md) for `StateMachine\u003CTStoredState>` and `EventSourcedStateMachine\u003CTModel>`: jobs are recoverable work, state machines are lifecycle behavior. Neither makes external effects exactly-once.\n\nVerify a new job with specs for planning, idempotent redelivery, stop\u002Fresume (including false), failed barriers\u002FUnreachable, retention and persistence failures. Exercise the selected durable provider for restart recovery and SQL migration permissions. A build alone cannot establish crash recovery. Do not operate a live store merely to validate a code example.\n",{"name":5,"license":14,"description":7},"main","feed400071bf3f9f4410a956d73413daa6e1b334",".cratis\u002Fai\u002Fskills\u002Fcratis-orleans-jobs","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue","https:\u002F\u002Fwww.cratis.io\u002Fprologue\u002F","https:\u002F\u002Fgithub.com\u002FCratis","https:\u002F\u002Fwww.cratis.io","Open-source (MIT) event sourcing and CQRS for .NET and beyond: Chronicle, Arc, Components and Screenplay.","2026-11-14 06:37:10",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Cratis\u002FPrologue --skill cratis-orleans-jobs",{"tool":38,"command":39},"bunx","bunx skills add Cratis\u002FPrologue --skill cratis-orleans-jobs",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Cratis\u002FPrologue --skill cratis-orleans-jobs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-orleans-jobs\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fstate-machines.md","REFERENCE","参考文档",5726,"https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-orleans-jobs\u002Freferences\u002Fstate-machines.md",[53,61,69,77,85,93],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M78CCRM9594FCYFMCY5W137G","vectorization","Designs, implements, optimizes, and reviews SIMD code in .NET: vectorizing scalar loops with TensorPrimitives, Vector64, Vector128, Vector256, Vector512, or hardware intrinsics, and reviewing existing SIMD code, including the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. Use when a .NET loop or SIMD routine is being written or reviewed. Not for performance work unrelated to SIMD.","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fvectorization\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fvectorization\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M78CCJKGDNSDNCMA92PV8GCR","target-authoring","Canonical patterns for writing custom MSBuild targets: DependsOnTargets versus BeforeTargets and AfterTargets, the Build-to-CoreBuild three-level pattern, and the XxxDependsOn chain-extension pattern. Use when diagnosing or fixing custom-target anti-patterns: Directory.Build.targets redefining SDK targets, targets that replace CompileDependsOn instead of extending it, Outputs versus Returns misuse that returns stale results, missing Inputs\u002FOutputs causing needless rebuilds, or missing FileWrites registration. Not for incremental build tuning or general anti-pattern review (use the msbuild skill), or non-MSBuild build systems.","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Ftarget-authoring\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Ftarget-authoring\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M78CCCWS16JZA36AGB5YVMAN","run-tests","Chooses and runs the repository-compatible .NET test command: classic, VSTest, bridged MTP, or native MTP syntax for MSTest, xUnit, NUnit, and TUnit. Use before running .NET tests or answering with a test command or flags: run the tests, one test, class, category, trait or target framework, combined filters, --filter-query, --no-build, --diag, TRX, coverage collection, crash or hang dumps, filter errors, or unrecognized options. Not for platform identification alone (use platform-detection), writing or debugging test code, interpreting a coverage report (use coverage-analysis), CI investigation, migration, or a persistent hot-reload loop.","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Frun-tests\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Frun-tests\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M78CC6VC08Y3WTN4T784DYDY","profiling","Uses the free official .NET diagnostics CLI tools for profiling and runtime investigation in a repository: CPU, GC pressure, allocation growth, exception storms, lock contention, and slow code. Use when a .NET application needs performance or runtime profiling. Not for replacing realistic performance or load tests with ad-hoc tracing, production heap collection without a pause-risk plan, crash dumps (use dump-collect), or benchmark design (use microbenchmarking).","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fprofiling\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fprofiling\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M78CC14WNAP1Y77ZMM4VD29A","platform-detection","Identifies a .NET project's test platform, framework, command mode, and SDK-style versus classic project system, resolving global.json, project, packages.config, Directory.Build.props, and Directory.Packages.props precedence for MSTest, xUnit, NUnit, and TUnit. Use when asking \"which test platform or framework?\", \"VSTest or MTP?\", or \"what runner does this project use?\", including bridge settings, UseVSTest opt-outs, and conflicting VSTest\u002FMTP configuration. Not for running or filtering tests, commands, flags, TRX, dumps, or test-command errors (use run-tests), or for hot-reload or migration requests.","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fplatform-detection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fplatform-detection\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M78CBVQKQZ6C9VZAD48GB8AC","orleans","Designs Microsoft Orleans systems from each primitive's purpose and failure model: grains, digital twins, state versus databases, transactions, messaging, streams, timers, reminders, Durable Jobs, stateless workers, grain services, startup, and hosting. Use when a task needs an Orleans design decision: inspect version and topology, choose the primitive, implement, and validate. Not for other actor stacks, batch processing, relational-only CRUD, or advice without an Orleans decision.","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Forleans\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FPrologue\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Forleans\u002FSKILL.md",[],[]]