Repository navigation
feat(client): workflow repository, first slice (#974) - #1039
Merged
Merged
Conversation
gplanchat
added a commit
that referenced
this pull request
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This is the first slice of #974, taken from
openspec/changes/workflow-repository/. It adds the entry point an application uses to reach the executions of one workflow class, without the operations on a running execution yet.Public names, all in
src/Durable:Gplanchat\Durable\WorkflowRepository(abstract,@template T of object):create(?ExecutionId $id = null): WorkflowStubcontacts no backend and generates an id when none is given;get(ExecutionId $id): WorkflowStubcallsWorkflowRunCatalogInterface::findRun().Attribute\AsWorkflowRepository(workflow)on a repository subclass, andAttribute\RepositoryFor(workflow)on a constructor parameter (a plain attribute, no resolver yet).Stub\WorkflowStub: carries theExecutionIdand exposesexecutionId().Workflow\ReservedStubMethods::assertFreeFor($workflowClass): refuses a signal, query or update method namedstart,execute,result,cancel,terminateorexecutionId, in any case.Exception\WorkflowClassNotFound(workflowClass,previousis the\ReflectionException):get()andReservedStubMethodsraise it for a workflow class that cannot be loaded.ExceptionInterface, with a stable message and the context in typed properties:WorkflowExecutionNotFound(executionId),WorkflowTypeMismatch(executionId,expectedType,actualType),WorkflowRepositoryNotDeclared,ReservedStubMethodName(workflowClass,method).Tasks of
tasks.mdcompleted: 1.4 and 1.5. Task 1.2 is partly done (WorkflowRepository,#[AsWorkflowRepository],create()andget()for the in-memory run catalogue); the "done when" line "get()fails at once for an unknown execution" holds for the catalogue.Decisions
WorkflowRepositorytakes the run catalogue only and isfinal, so a subclass cannot override it. The optionalWorkflowDefinitionLoaderparameter is gone: the loader holds no state andget()creates one where it needs it.UnknownWorkflow(whatTemporalWorkflowRunCatalogreturns when the type is missing),get()throwsWorkflowTypeMismatchon every backend. A test pins it with a catalogue double that reportsUnknownWorkflow.#[AsWorkflowRepository]is read on the class itself and is not inherited (the OpenSpec spec does not say otherwise): a subclass of a declared repository raisesWorkflowRepositoryNotDeclared. A test pins it.get()means unknown to the catalogue. The in-memory catalogue is empty in a process that did not run the workflow, and the DBAL, Illuminate and Magento catalogues depend on the projection being fed; the conformance test of task 1.1 must exercise every backend.Checked
--threads=1). php-cs-fixer dry-run, file by file: nothing to fix.get()is exercised on the in-memory catalogue only; the DBAL, Illuminate and Temporal catalogues are not covered by a repository test yet.Not in this pull request
WorkflowClientPortand its conformance test case (1.1), and the stub'sstart(),execute(), signal, query, update,result(),cancel()andterminate()(1.3). The constructor takes the run catalogue only and is final; the port arrives later as a collaborator and leaves this constructor as it is.create()does not takeWorkflowStartOptionsyet. The stub has nowhere to keep them untilstart()exists, and adding an optional parameter later is not a breaking change.#[RepositoryFor]resolvers and the call toReservedStubMethodsat boot (4.x), journal changes (1.6, 1.7), Temporal and documentation.Refs #974