Instruction Composition Framework#4759
Conversation
✅ Deploy Preview for finos-cdm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @chrisisla @tomhealey-icma @llynhiavu, this is ready for review when you are able |
chrisisla
left a comment
There was a problem hiding this comment.
Some comments and questions to get the ball rolling 🙂
| compositionStep CompositionStep (1..*) <"Ordered sequence of CompositionSteps that drive the instruction composition process (atomic actions, calculations, validations)."> | ||
| compositionState CompositionState (0..1) <"Shared state accumulated across executed steps, capturing intermediate and final outputs of the instruction composition process."> | ||
| instructionCompositionType InstructionCompositionTypeEnum (1..1) <"Type of Instruction Composition being orchestrated (e.g. ResetInstruction)."> | ||
| instructionCompositionIdentifier string (1..1) <"Unique identifier of this InstructionComposition instance."> |
There was a problem hiding this comment.
Could this just be identifier?
| instructionCompositionType InstructionCompositionTypeEnum (1..1) <"Type of Instruction Composition being orchestrated (e.g. ResetInstruction)."> | ||
| instructionCompositionIdentifier string (1..1) <"Unique identifier of this InstructionComposition instance."> | ||
| tradeId TradeIdentifier (0..1) <"Identifier of the underlying trade to which this InstructionComposition relates."> | ||
| instructionCompositionOutput InstructionCompositionOutput (0..1) <"Outputs of each Instruction Composition process. The recording of this information will be done in a single step at the end of the process for each Instruction Composition."> |
There was a problem hiding this comment.
And this just output?
We're under InstructionComposition so we probably don't need to prefix these items with instructionComposition?
There was a problem hiding this comment.
I think that it is not allowed to set "output" as the name of an element. Should we leave it as it is then? @chrisisla
There was a problem hiding this comment.
Ah yes of course... shame but okay, lets leave as it is
|
|
||
| import cdm.event.common.* | ||
|
|
||
| type InstructionComposition: <"Represents a instruction composition orchestration, holding data, shared history, and an ordered sequence of InstructionCompositionSteps."> |
There was a problem hiding this comment.
"...an instruction..."
Should it also read "CompositionSteps" and not "InstructionCompositionSteps"?
| [rootType] | ||
| compositionStep CompositionStep (1..*) <"Ordered sequence of CompositionSteps that drive the instruction composition process (atomic actions, calculations, validations)."> | ||
| compositionState CompositionState (0..1) <"Shared state accumulated across executed steps, capturing intermediate and final outputs of the instruction composition process."> | ||
| instructionCompositionType InstructionCompositionTypeEnum (1..1) <"Type of Instruction Composition being orchestrated (e.g. ResetInstruction)."> |
There was a problem hiding this comment.
Maybe rename this to compositionType to match the other elements e.g. compositionStep? Happy either way with this one, it's quite good to keep the full name on this enum... hmmm.
There was a problem hiding this comment.
In this case, I think that makes sense to keep it as it is because the type is liked to the "Instruction Composition"
| type InstructionCompositionOutput: <"Records the relevant output of each Instruction Composition. Will be updated while executing the relevant steps of the Instruction Composition so at the end of the process the output should be completed and ready to use in other parts of the system."> | ||
| resetInstruction ResetInstruction (0..1) <"Defines the reset value or fixing value produced in cashflow calculations, during the life-cycle of a financial instrument. The reset process defined in Create_Reset function joins product definition details with observations to compute the reset value."> | ||
|
|
||
| choice CompositionState: <"A container that holds the cumulative state of a Instruction Composition. It selects the specific history/state schema (e.g., ResetInstructionState) based on the lifecycle process being executed."> No newline at end of file |
There was a problem hiding this comment.
"... an Instruction..."
So under here we'll have new xxxState types for each event that can be handled using the InstructionComposition? So for now it will just be ResetInstructionState but in the future we could have TransferInstructionState for example?
| timestamp zonedDateTime (0..1) <"Date and time of the execution of the Instruction Composition step after being executed."> | ||
| compositionStepInstruction CompositionStepInstruction (1..1) <"Set of instructions defining the steps of each Instruction Composition process."> | ||
|
|
||
| type CompositionStepInstruction: <"Set of instructions defining the steps of each Instruction Composition process."> |
There was a problem hiding this comment.
I still struggling with this naming 😅 For me, this is a single instruction step as the name is singular and the contents of the type are all cardinality 1..1 and thus can only appear once.
But the descriptions all imply multiple instances of something "Set of instructions" and "List of all... compositionSteps..."
I would have expected CompositionStepInstructions to be a list of CompositionStepInstruction items, but it looks to be the other way around?
There was a problem hiding this comment.
The logic behind is:
- Each
InstructionCompositionwill have 1 or moreCompositionSteps(to build the Reset we will follow an 8-step process) - Each
CompositionStepis defined by an identifier, a timestamp and an (1) Instruction (CompositionStepInstruction) - The
CompositionStepInstructionis defined by theInstructionCompoisitionType(we can have the same instruction for different Instruction Composition types) and the selection of one of the list ofCompositionStepInstruction**s**(where we actually hold the info for the executing the step) - This
CompositionStepInstruction**s**is the list of all the instruction steps
Does it make sense? @chrisisla
There was a problem hiding this comment.
Okay so CompositionStepInstructions will end up holding a list of the different instruction steps, which again I'm guessing will start to be added in the next PR?
What you have described above I think will be good to add to the documentation. I did think that maybe we could add an abbreviated version to the comments in the model but that may not be necessary.
chrisisla
left a comment
There was a problem hiding this comment.
I think this covers the initial framework and is pretty straightforward. The only things outstanding really are whether to change instructionCompositionIdentifier to just identifier (which it may not be worth doing as the other items are prefixed with the type/scope so why not keep them all this way for consistency), and then we need to make sure the use of InstructionComposition and it's associated types in this PR are well documented for the release notes and the documentation site 🙂
Happy to approve now and potentially revisit once the second PR is contributed, which will add some meat to the bones of the framework.
Instruction Composition Framework
Background
The CDM Smart Contract Taskforce is introducing the Instruction Composition Model within the Common Domain Model (CDM). While the CDM has traditionally been declarative, defining what a lifecycle event is, it has not always defined how that event is operationally executed. This gap often forces institutions to implement their own procedural logic externally, increasing reconciliation risks and inconsistent interpretations. This release bridges that gap by establishing a modular, stateful, and deterministic framework to execute the sequential steps and intermediate computations of contractual workflows directly within the model. For further information, see issue #4165.
What is being released?
This release introduces the core architectural types, enums, and structural foundations for the Instruction Composition Framework within the new cdm.event.instructionComposition namespace.
Types
Changes that can be found in the cdm.event.instructionComposition namespace:
InstructionComposition: The root orchestrator representing a specific business process (e.g., an Interest Rate Reset). It maintains the ordered sequence of steps, tracks unique identifiers, links back to the underlying Trade, and hosts the final outputCompositionStep: Represents a single, atomic, and deterministic operational step within the workflow, capturing exactly when and how it was executedCompositionStepInstruction&CompositionStepInstructions: Reusable containers that define the specific instructions and logic passed into each stepCompositionState: A persistent, cumulative state choice object that aggregates intermediate outputs across steps. This ensures complete traceability, auditability, and deterministic replay capabilitiesInstructionCompositionOutput: Holds the definitive outcome of the completed process (e.g., the canonical CDM ResetInstruction) once all sequential steps have successfully executedEnumerations
Changes that can be found in the cdm.event.instructionComposition namespace:
InstructionCompositionTypeEnum: Establishes the types of orchestrations supported. This release seeds the ResetInstruction type, which maps out the blueprint for the 8-step Interest Rate Reset processVerification and Testing
As these represent foundational, new architectural data structures and namespaces, there are zero backward compatibility impacts on existing model logic or legacy lifecycle event processes.
Validation has focused on:
Review Directions
Navigate to the following paths to inspect the new models: