Git State

Since C19 is a distributed system, there might be a situation where a value is being set to the state concurrently from different sources. A State must resolve conflicts and decide which value to take if the values are conflicting.

Imagine a case where two C19 agents hold a different version of a value. One has been updated while the other has not yet. Now imagine a third agent exchanging data with those two agents. It will get the value from both of them and will have to decide which value to commit.

The Default state implementation resolve conflicts by using a simple timestamp. The timestamp is set when a value is first created at the source.

Git has its own way of resolving conflicts and it might be a good candidate for a C19 state.

State

The State can set and get values by using git commit operations and conflicts can be automatically resolved. If a conflict cannot be automatically resolved there's an option to prefer "theirs" or "ours" (See here for Git documentation of the pull command)

Connection

The Connection layer would have to support a Git protocol.

Agent

The Agent can probably be any agent without specific need for a Git knowledge. The Default agent implementation offers a way to get and set values to the state and it doesn't need to know anything about the fact that the keys are stored as Git repositories.

A Git specific agent can be implemented to allow Git specific commands to be sent from an application or to allow commit of files and not only keys and values.